Fix 2.6.4 Skript support & fix compilation

This commit is contained in:
Govindas 2023-03-08 17:33:41 +02:00
parent a69f531562
commit f08c74cfb9
128 changed files with 232 additions and 118 deletions

0
LICENSE Normal file → Executable file
View File

0
README.md Normal file → Executable file
View File

14
biosphere2.iml Normal file
View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4">
<component name="FacetManager">
<facet type="minecraft" name="Minecraft">
<configuration>
<autoDetectTypes>
<platformType>SPIGOT</platformType>
<platformType>PAPER</platformType>
<platformType>BUKKIT</platformType>
</autoDetectTypes>
</configuration>
</facet>
</component>
</module>

48
pom.xml Normal file → Executable file
View File

@ -6,58 +6,50 @@
<groupId>io.github.bi0qaw</groupId> <groupId>io.github.bi0qaw</groupId>
<artifactId>biosphere2</artifactId> <artifactId>biosphere2</artifactId>
<version>1.0.2</version> <version>1.0.3</version>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<configuration> <configuration>
<source>1.6</source> <source>1.8</source>
<target>1.6</target> <target>1.8</target>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<repositories> <repositories>
<repository>
<id>bensku-repo</id>
<url>https://raw.githubusercontent.com/bensku/mvn-repo/master</url>
</repository>
<repository> <repository>
<id>spigot-repo</id> <id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url> <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/spigotmc/spigot-api/</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
</snapshots>
</repository> </repository>
<repository> <repository>
<id>sk89q-repo</id> <id>jitpack.io</id>
<url>http://maven.sk89q.com/repo</url> <url>https://jitpack.io</url>
</repository> </repository>
<repository> <repository>
<id>destroystokyo-repo</id> <id>mvnrepository</id>
<url>https://mvnrepository.com</url>
</repository>
<repository>
<id>PaperMC</id>
<url>https://repo.destroystokyo.com/repository/maven-public/</url> <url>https://repo.destroystokyo.com/repository/maven-public/</url>
</repository> </repository>
<repository> <repository>
<id>vault-repo</id> <id>sk89q</id>
<url>http://nexus.hc.to/content/repositories/pub_releases</url> <url>http://maven.sk89q.com/repo</url>
</repository>
<repository>
<id>jitpack-repo</id>
<url>https://jitpack.io</url>
</repository> </repository>
</repositories> </repositories>
<dependencies> <dependencies>
<!--Skript--> <!--Skript-->
<dependency> <dependency>
<groupId>ch.njol</groupId> <groupId>com.github.SkriptLang</groupId>
<artifactId>skript</artifactId> <artifactId>Skript</artifactId>
<version>2.2-dev32</version> <version>2.6.1</version>
<scope>compile</scope> <scope>provided</scope>
</dependency> </dependency>
<!--Spigot API--> <!--Spigot API-->
<dependency> <dependency>
@ -66,6 +58,12 @@
<version>1.12.2-R0.1-SNAPSHOT</version> <version>1.12.2-R0.1-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>RELEASE</version>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>
</project> </project>

0
scripts/biosphere-test.sk Normal file → Executable file
View File

0
scripts/gallery.sk Normal file → Executable file
View File

17
src/main/java/io/github/bi0qaw/biosphere/Biosphere.java Normal file → Executable file
View File

@ -1,22 +1,19 @@
package io.github.bi0qaw.biosphere; package io.github.bi0qaw.biosphere;
import io.github.bi0qaw.biosphere.expression.*;
import ch.njol.skript.Skript; import ch.njol.skript.Skript;
import ch.njol.skript.SkriptAddon;
import ch.njol.skript.lang.ExpressionType; import ch.njol.skript.lang.ExpressionType;
import io.github.bi0qaw.biosphere.expression.*;
import io.github.bi0qaw.biosphere.type.FrameType;
import io.github.bi0qaw.biosphere.util.Frame;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import io.github.bi0qaw.biosphere.type.FrameType;
import io.github.bi0qaw.biosphere.util.Frame;
public class Biosphere extends JavaPlugin { public class Biosphere extends JavaPlugin {
private static Biosphere plugin;
public void onEnable(){ public void onEnable(){
SkriptAddon addon = Skript.registerAddon(this);
plugin = this;
Skript.registerAddon(this);
new FrameType(); new FrameType();
@ -74,8 +71,4 @@ public class Biosphere extends JavaPlugin {
Skript.registerExpression(ExprVectorSphere.class, Vector.class, ExpressionType.SIMPLE, "[vector ]sphere with radius %number%(,| and) density %number%"); Skript.registerExpression(ExprVectorSphere.class, Vector.class, ExpressionType.SIMPLE, "[vector ]sphere with radius %number%(,| and) density %number%");
Skript.registerExpression(ExprVectorSphereRand.class, Vector.class, ExpressionType.SIMPLE, "[vector ]random sphere with radius %number%(,| and) density %number%"); Skript.registerExpression(ExprVectorSphereRand.class, Vector.class, ExpressionType.SIMPLE, "[vector ]random sphere with radius %number%(,| and) density %number%");
} }
public static Biosphere getPlugin() {
return plugin;
}
} }

View File

@ -4,7 +4,7 @@ import ch.njol.skript.doc.Description;
import ch.njol.skript.doc.Examples; import ch.njol.skript.doc.Examples;
import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Name;
import org.bukkit.event.Event; import org.bukkit.event.Event;
import javax.annotation.Nullable; import org.jetbrains.annotations.Nullable;
import ch.njol.skript.lang.Expression; import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.lang.SkriptParser.ParseResult;

View File

@ -8,7 +8,7 @@ import io.github.bi0qaw.biosphere.util.VectorLib;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.event.Event; import org.bukkit.event.Event;
import javax.annotation.Nullable; import org.jetbrains.annotations.Nullable;
import ch.njol.skript.lang.Expression; import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.lang.SkriptParser.ParseResult;

View File

@ -8,7 +8,7 @@ import io.github.bi0qaw.biosphere.util.VectorLib;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.event.Event; import org.bukkit.event.Event;
import javax.annotation.Nullable; import org.jetbrains.annotations.Nullable;
import ch.njol.skript.lang.Expression; import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.lang.SkriptParser.ParseResult;

View File

@ -3,18 +3,15 @@ package io.github.bi0qaw.biosphere.expression;
import ch.njol.skript.doc.Description; import ch.njol.skript.doc.Description;
import ch.njol.skript.doc.Examples; import ch.njol.skript.doc.Examples;
import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Name;
import io.github.bi0qaw.biosphere.util.LocationLib;
import io.github.bi0qaw.biosphere.util.VectorLib;
import org.bukkit.Location;
import org.bukkit.event.Event;
import javax.annotation.Nullable;
import ch.njol.skript.lang.Expression; import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.lang.SkriptParser.ParseResult;
import ch.njol.skript.lang.util.SimpleExpression; import ch.njol.skript.lang.util.SimpleExpression;
import ch.njol.util.Kleenean; import ch.njol.util.Kleenean;
import org.bukkit.util.Vector; import io.github.bi0qaw.biosphere.util.LocationLib;
import org.bukkit.Location;
import org.bukkit.event.Event;
import org.jetbrains.annotations.Nullable;
@Name("Location Cube Outline") @Name("Location Cube Outline")
@Description("Creates a list of locations in the shape of a cube, including the corners and vertices of the cube. The density value controls the amount of points. A higher number increases the amount of points. A density of 1 corresponds to 1 point per block.") @Description("Creates a list of locations in the shape of a cube, including the corners and vertices of the cube. The density value controls the amount of points. A higher number increases the amount of points. A density of 1 corresponds to 1 point per block.")

View File

@ -7,7 +7,7 @@ import io.github.bi0qaw.biosphere.util.LocationLib;
import io.github.bi0qaw.biosphere.util.VectorMath; import io.github.bi0qaw.biosphere.util.VectorMath;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.event.Event; import org.bukkit.event.Event;
import javax.annotation.Nullable; import org.jetbrains.annotations.Nullable;
import ch.njol.skript.lang.Expression; import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.lang.SkriptParser.ParseResult;

View File

@ -7,7 +7,7 @@ import io.github.bi0qaw.biosphere.util.LocationLib;
import io.github.bi0qaw.biosphere.util.VectorLib; import io.github.bi0qaw.biosphere.util.VectorLib;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.event.Event; import org.bukkit.event.Event;
import javax.annotation.Nullable; import org.jetbrains.annotations.Nullable;
import ch.njol.skript.lang.Expression; import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.lang.SkriptParser.ParseResult;

View File

@ -3,21 +3,14 @@ package io.github.bi0qaw.biosphere.expression;
import ch.njol.skript.doc.Description; import ch.njol.skript.doc.Description;
import ch.njol.skript.doc.Examples; import ch.njol.skript.doc.Examples;
import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Name;
import io.github.bi0qaw.biosphere.util.LocationLib;
import io.github.bi0qaw.biosphere.util.VectorLib;
import org.bukkit.Location;
import org.bukkit.event.Event;
import javax.annotation.Nullable;
import ch.njol.skript.lang.Expression; import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.lang.SkriptParser.ParseResult;
import ch.njol.skript.lang.util.SimpleExpression; import ch.njol.skript.lang.util.SimpleExpression;
import ch.njol.util.Kleenean; import ch.njol.util.Kleenean;
import org.bukkit.util.Vector; import io.github.bi0qaw.biosphere.util.LocationLib;
import org.bukkit.Location;
import java.util.ArrayList; import org.bukkit.event.Event;
import java.util.Arrays; import org.jetbrains.annotations.Nullable;
@Name("Location Line") @Name("Location Line")
@Description("Creates a list of locations in the shape of a line. The density value controls the amount of points. A higher number increases the amount of points. A density of 1 corresponds to 1 point per block.") @Description("Creates a list of locations in the shape of a line. The density value controls the amount of points. A higher number increases the amount of points. A density of 1 corresponds to 1 point per block.")

View File

@ -9,8 +9,7 @@ import io.github.bi0qaw.biosphere.util.VectorMath;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.event.Event; import org.bukkit.event.Event;
import javax.annotation.Nullable; import org.jetbrains.annotations.Nullable;
import ch.njol.skript.lang.Expression; import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.lang.SkriptParser.ParseResult;
import ch.njol.skript.lang.util.SimpleExpression; import ch.njol.skript.lang.util.SimpleExpression;

View File

@ -3,17 +3,15 @@ package io.github.bi0qaw.biosphere.expression;
import ch.njol.skript.doc.Description; import ch.njol.skript.doc.Description;
import ch.njol.skript.doc.Examples; import ch.njol.skript.doc.Examples;
import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Name;
import io.github.bi0qaw.biosphere.util.LocationLib;
import io.github.bi0qaw.biosphere.util.TrigLib;
import org.bukkit.Location;
import org.bukkit.event.Event;
import javax.annotation.Nullable;
import ch.njol.skript.lang.Expression; import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.lang.SkriptParser.ParseResult;
import ch.njol.skript.lang.util.SimpleExpression; import ch.njol.skript.lang.util.SimpleExpression;
import ch.njol.util.Kleenean; import ch.njol.util.Kleenean;
import io.github.bi0qaw.biosphere.util.LocationLib;
import org.bukkit.Location;
import org.bukkit.event.Event;
import org.jetbrains.annotations.Nullable;
@Name("Location Link All") @Name("Location Link All")
@Description("Creates a list of locations linking multiple locations with lines. The density value controls the amount of points. A higher number increases the amount of points. A density of 1 corresponds to 1 point per block.") @Description("Creates a list of locations linking multiple locations with lines. The density value controls the amount of points. A higher number increases the amount of points. A density of 1 corresponds to 1 point per block.")

View File

@ -8,7 +8,7 @@ import io.github.bi0qaw.biosphere.util.TrigLib;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.event.Event; import org.bukkit.event.Event;
import javax.annotation.Nullable; import org.jetbrains.annotations.Nullable;
import ch.njol.skript.lang.Expression; import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.lang.SkriptParser.ParseResult;

View File

@ -6,7 +6,7 @@ import ch.njol.skript.doc.Name;
import io.github.bi0qaw.biosphere.util.LocationLib; import io.github.bi0qaw.biosphere.util.LocationLib;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.event.Event; import org.bukkit.event.Event;
import javax.annotation.Nullable; import org.jetbrains.annotations.Nullable;
import ch.njol.skript.lang.Expression; import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.lang.SkriptParser.ParseResult;

View File

@ -8,7 +8,7 @@ import io.github.bi0qaw.biosphere.util.TrigLib;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.event.Event; import org.bukkit.event.Event;
import javax.annotation.Nullable; import org.jetbrains.annotations.Nullable;
import ch.njol.skript.lang.Expression; import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.lang.SkriptParser.ParseResult;

View File

@ -8,7 +8,7 @@ import io.github.bi0qaw.biosphere.util.TrigLib;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.event.Event; import org.bukkit.event.Event;
import javax.annotation.Nullable; import org.jetbrains.annotations.Nullable;
import ch.njol.skript.lang.Expression; import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.lang.SkriptParser.ParseResult;

View File

@ -8,7 +8,7 @@ import io.github.bi0qaw.biosphere.util.TrigLib;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.event.Event; import org.bukkit.event.Event;
import javax.annotation.Nullable; import org.jetbrains.annotations.Nullable;
import ch.njol.skript.lang.Expression; import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.lang.SkriptParser.ParseResult;

View File

@ -7,7 +7,7 @@ import io.github.bi0qaw.biosphere.util.LocationLib;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.event.Event; import org.bukkit.event.Event;
import javax.annotation.Nullable; import org.jetbrains.annotations.Nullable;
import ch.njol.skript.lang.Expression; import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser; import ch.njol.skript.lang.SkriptParser;

View File

@ -7,7 +7,7 @@ import io.github.bi0qaw.biosphere.util.LocationLib;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.event.Event; import org.bukkit.event.Event;
import javax.annotation.Nullable; import org.jetbrains.annotations.Nullable;
import ch.njol.skript.lang.Expression; import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser; import ch.njol.skript.lang.SkriptParser;

View File

@ -8,7 +8,7 @@ import io.github.bi0qaw.biosphere.util.TrigLib;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.event.Event; import org.bukkit.event.Event;
import javax.annotation.Nullable; import org.jetbrains.annotations.Nullable;
import ch.njol.skript.lang.Expression; import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.lang.SkriptParser.ParseResult;

View File

@ -8,7 +8,7 @@ import io.github.bi0qaw.biosphere.util.TrigLib;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.event.Event; import org.bukkit.event.Event;
import javax.annotation.Nullable; import org.jetbrains.annotations.Nullable;
import ch.njol.skript.lang.Expression; import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.lang.SkriptParser.ParseResult;

View File

@ -9,7 +9,7 @@ import io.github.bi0qaw.biosphere.util.VectorMath;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.event.Event; import org.bukkit.event.Event;
import javax.annotation.Nullable; import org.jetbrains.annotations.Nullable;
import ch.njol.skript.lang.Expression; import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.lang.SkriptParser.ParseResult;

View File

@ -8,7 +8,7 @@ import io.github.bi0qaw.biosphere.util.TrigLib;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.event.Event; import org.bukkit.event.Event;
import javax.annotation.Nullable; import org.jetbrains.annotations.Nullable;
import ch.njol.skript.lang.Expression; import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.lang.SkriptParser.ParseResult;

View File

@ -4,7 +4,7 @@ import ch.njol.skript.doc.Description;
import ch.njol.skript.doc.Examples; import ch.njol.skript.doc.Examples;
import ch.njol.skript.doc.Name; import ch.njol.skript.doc.Name;
import org.bukkit.event.Event; import org.bukkit.event.Event;
import javax.annotation.Nullable; import org.jetbrains.annotations.Nullable;
import ch.njol.skript.lang.Expression; import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser.ParseResult; import ch.njol.skript.lang.SkriptParser.ParseResult;

View File

View File

@ -11,7 +11,7 @@ import org.bukkit.event.Event;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import io.github.bi0qaw.biosphere.util.VectorLib; import io.github.bi0qaw.biosphere.util.VectorLib;
import javax.annotation.Nullable; import org.jetbrains.annotations.Nullable;
@Name("Vector Circle") @Name("Vector Circle")
@Description("Creates a list of vectors in the shape of a circle") @Description("Creates a list of vectors in the shape of a circle")

View File

@ -11,7 +11,7 @@ import org.bukkit.event.Event;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import io.github.bi0qaw.biosphere.util.VectorLib; import io.github.bi0qaw.biosphere.util.VectorLib;
import javax.annotation.Nullable; import org.jetbrains.annotations.Nullable;
@Name("Vector Cube") @Name("Vector Cube")
@Description("Creates a list of vectors in the shape of a cube (only the corners!). To get a list of locations including the cube edges use cube outline.") @Description("Creates a list of vectors in the shape of a cube (only the corners!). To get a list of locations including the cube edges use cube outline.")

View File

@ -11,7 +11,7 @@ import org.bukkit.event.Event;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import io.github.bi0qaw.biosphere.util.VectorLib; import io.github.bi0qaw.biosphere.util.VectorLib;
import javax.annotation.Nullable; import org.jetbrains.annotations.Nullable;
@Name("Vector Cube Outline") @Name("Vector Cube Outline")
@Description("Creates a list of vectors in the shape of a polygon including corners and edges. The density value controls the amount of points. A higher number increases the amount of points. A density of 1 corresponds to 1 point per block.") @Description("Creates a list of vectors in the shape of a polygon including corners and edges. The density value controls the amount of points. A higher number increases the amount of points. A density of 1 corresponds to 1 point per block.")

View File

@ -11,7 +11,7 @@ import org.bukkit.event.Event;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import io.github.bi0qaw.biosphere.util.VectorLib; import io.github.bi0qaw.biosphere.util.VectorLib;
import javax.annotation.Nullable; import org.jetbrains.annotations.Nullable;
@Name("Vector Helix") @Name("Vector Helix")
@Description("Creates a list of vectors in the shape of a helix. The step parameter determines how many blocks the helix will go upwards in one rotation. The density value controls the amount of points. A higher number increases the amount of points. A density of 1 corresponds to 1 point per block.") @Description("Creates a list of vectors in the shape of a helix. The step parameter determines how many blocks the helix will go upwards in one rotation. The density value controls the amount of points. A higher number increases the amount of points. A density of 1 corresponds to 1 point per block.")

View File

@ -11,7 +11,7 @@ import org.bukkit.event.Event;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import io.github.bi0qaw.biosphere.util.VectorLib; import io.github.bi0qaw.biosphere.util.VectorLib;
import javax.annotation.Nullable; import org.jetbrains.annotations.Nullable;
@Name("Vector Line") @Name("Vector Line")
@Description("Creates a list of vectors in the shape of a line. The density value controls the amount of points. A higher number increases the amount of points. A density of 1 corresponds to 1 point per block.") @Description("Creates a list of vectors in the shape of a line. The density value controls the amount of points. A higher number increases the amount of points. A density of 1 corresponds to 1 point per block.")

View File

@ -11,7 +11,7 @@ import org.bukkit.event.Event;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import io.github.bi0qaw.biosphere.util.VectorLib; import io.github.bi0qaw.biosphere.util.VectorLib;
import javax.annotation.Nullable; import org.jetbrains.annotations.Nullable;
@Name("Vector Link All") @Name("Vector Link All")
@Description("Creates a list of vectors linking multiple vectors with lines. The density value controls the amount of points. A higher number increases the amount of points. A density of 1 corresponds to 1 point per block.") @Description("Creates a list of vectors linking multiple vectors with lines. The density value controls the amount of points. A higher number increases the amount of points. A density of 1 corresponds to 1 point per block.")

View File

@ -7,11 +7,11 @@ import ch.njol.skript.lang.Expression;
import ch.njol.skript.lang.SkriptParser; import ch.njol.skript.lang.SkriptParser;
import ch.njol.skript.lang.util.SimpleExpression; import ch.njol.skript.lang.util.SimpleExpression;
import ch.njol.util.Kleenean; import ch.njol.util.Kleenean;
import io.github.bi0qaw.biosphere.util.VectorLib;
import org.bukkit.event.Event; import org.bukkit.event.Event;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import io.github.bi0qaw.biosphere.util.VectorLib;
import javax.annotation.Nullable; import org.jetbrains.annotations.Nullable;
@Name("Vector Midpoint") @Name("Vector Midpoint")
@Description("Gives the midpoint between vectors.") @Description("Gives the midpoint between vectors.")

View File

@ -11,7 +11,7 @@ import org.bukkit.event.Event;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import io.github.bi0qaw.biosphere.util.VectorLib; import io.github.bi0qaw.biosphere.util.VectorLib;
import javax.annotation.Nullable; import org.jetbrains.annotations.Nullable;
@Name("Vector Offset") @Name("Vector Offset")
@Description("Offset vectors by other vectors.") @Description("Offset vectors by other vectors.")

View File

@ -11,7 +11,7 @@ import org.bukkit.event.Event;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import io.github.bi0qaw.biosphere.util.VectorLib; import io.github.bi0qaw.biosphere.util.VectorLib;
import javax.annotation.Nullable; import org.jetbrains.annotations.Nullable;
@Name("Vector Polygon") @Name("Vector Polygon")
@Description("Creates a list of vectors in the shape of a polygon (only the corners!). If you want a polygon with edges use polygon outline.") @Description("Creates a list of vectors in the shape of a polygon (only the corners!). If you want a polygon with edges use polygon outline.")

View File

@ -11,7 +11,7 @@ import org.bukkit.event.Event;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import io.github.bi0qaw.biosphere.util.VectorLib; import io.github.bi0qaw.biosphere.util.VectorLib;
import javax.annotation.Nullable; import org.jetbrains.annotations.Nullable;
@Name("Vector Polygon Outline") @Name("Vector Polygon Outline")
@Description("Creates a list of vectors in the shape of a polygon including corners and edges. The density value controls the amount of points. A higher number increases the amount of points. A density of 1 corresponds to 1 point per block.") @Description("Creates a list of vectors in the shape of a polygon including corners and edges. The density value controls the amount of points. A higher number increases the amount of points. A density of 1 corresponds to 1 point per block.")

View File

@ -11,7 +11,7 @@ import org.bukkit.event.Event;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import io.github.bi0qaw.biosphere.util.VectorLib; import io.github.bi0qaw.biosphere.util.VectorLib;
import javax.annotation.Nullable; import org.jetbrains.annotations.Nullable;
@Name("Vector Reflection") @Name("Vector Reflection")
@Description("Mirrors vectors in another vector. The direction parameter applies an additional scaling for each axis.") @Description("Mirrors vectors in another vector. The direction parameter applies an additional scaling for each axis.")

View File

@ -12,7 +12,7 @@ import org.bukkit.event.Event;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import io.github.bi0qaw.biosphere.util.VectorLib; import io.github.bi0qaw.biosphere.util.VectorLib;
import javax.annotation.Nullable; import org.jetbrains.annotations.Nullable;
@Name("Vector Rotate") @Name("Vector Rotate")
@Description("Rotates vectors around a rotation center and a rotation axis by an angle.") @Description("Rotates vectors around a rotation center and a rotation axis by an angle.")

View File

@ -11,7 +11,7 @@ import org.bukkit.event.Event;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import io.github.bi0qaw.biosphere.util.VectorLib; import io.github.bi0qaw.biosphere.util.VectorLib;
import javax.annotation.Nullable; import org.jetbrains.annotations.Nullable;
@Name("Vector Rotate XYZ") @Name("Vector Rotate XYZ")
@Description("Rotates vectors around a rotation center and rotation axis by an angle.") @Description("Rotates vectors around a rotation center and rotation axis by an angle.")

View File

@ -11,7 +11,7 @@ import org.bukkit.event.Event;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import io.github.bi0qaw.biosphere.util.VectorLib; import io.github.bi0qaw.biosphere.util.VectorLib;
import javax.annotation.Nullable; import org.jetbrains.annotations.Nullable;
@Name("Vector Scale") @Name("Vector Scale")
@Description("Scales vectors by a scaling factor and an optional direction. The direction parameter adds an additional scaling along the x-, y- and z-axis.") @Description("Scales vectors by a scaling factor and an optional direction. The direction parameter adds an additional scaling along the x-, y- and z-axis.")

View File

@ -11,7 +11,7 @@ import org.bukkit.event.Event;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import io.github.bi0qaw.biosphere.util.VectorLib; import io.github.bi0qaw.biosphere.util.VectorLib;
import javax.annotation.Nullable; import org.jetbrains.annotations.Nullable;
@Name("Vector Sphere") @Name("Vector Sphere")
@Description("Creates a list of vectors in the shape of a sphere. The density value controls the amount of points. A higher number increases the amount of points. A density of 1 corresponds to 1 point per block.") @Description("Creates a list of vectors in the shape of a sphere. The density value controls the amount of points. A higher number increases the amount of points. A density of 1 corresponds to 1 point per block.")

View File

@ -11,7 +11,7 @@ import org.bukkit.event.Event;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import io.github.bi0qaw.biosphere.util.VectorLib; import io.github.bi0qaw.biosphere.util.VectorLib;
import javax.annotation.Nullable; import org.jetbrains.annotations.Nullable;
@Name("Vector Random Sphere") @Name("Vector Random Sphere")
@Description("Creates a list of vectors in the shape of a sphere. The locations are randomly distributed on the sphere surface.") @Description("Creates a list of vectors in the shape of a sphere. The locations are randomly distributed on the sphere surface.")

View File

@ -11,7 +11,6 @@ import ch.njol.yggdrasil.Fields;
import io.github.bi0qaw.biosphere.util.Frame; import io.github.bi0qaw.biosphere.util.Frame;
import io.github.bi0qaw.biosphere.util.VectorMath; import io.github.bi0qaw.biosphere.util.VectorMath;
import java.io.NotSerializableException;
import java.io.StreamCorruptedException; import java.io.StreamCorruptedException;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
@ -20,15 +19,15 @@ public class FrameType {
public FrameType(){} public FrameType(){}
static { static {
Classes.registerClass(new ClassInfo<Frame>(Frame.class, "frame") Classes.registerClass(new ClassInfo<>(Frame.class, "frame")
.user("frames?") .user("frames?")
.name("Frame") .name("Frame")
.description("Reference frame that can be used to get vectors relative to some direction.") .description("Reference frame that can be used to get vectors relative to some direction.")
.usage(new String[]{"frame of %entity%", "frame with yaw %number% and pitch %number%"}) .usage("frame of %entity%", "frame with yaw %number% and pitch %number%")
.examples(new String[]{"set {_frame} to frame of player", "set {_circle::*} to circle with radius 1 and density 5", .examples("set {_frame} to frame of player", "set {_circle::*} to circle with radius 1 and density 5",
"show happy villager at player's head offset by {_circle::*} in frame of player", "show happy villager at player's head offset by {_circle::*} in frame of player",
"#shows a particle circle around the player's head with the yaw and pitch of the player"}) "#shows a particle circle around the player's head with the yaw and pitch of the player")
.defaultExpression(new EventValueExpression<Frame>(Frame.class)) .defaultExpression(new EventValueExpression<>(Frame.class))
.parser(new Parser<Frame>() { .parser(new Parser<Frame>() {
private final Pattern parsePattern = Pattern.compile("frame:(-?\\d+(\\.\\d+)?),(-?\\d+(\\.\\d+)?)" private final Pattern parsePattern = Pattern.compile("frame:(-?\\d+(\\.\\d+)?),(-?\\d+(\\.\\d+)?)"
@ -63,12 +62,6 @@ public class FrameType {
float pitch = VectorMath.skriptPitch(f.getPitch()); float pitch = VectorMath.skriptPitch(f.getPitch());
return "frame:" + Skript.toString(yaw) + "," + Skript.toString(pitch); return "frame:" + Skript.toString(yaw) + "," + Skript.toString(pitch);
} }
@Override
public String getVariableNamePattern() {
return "frame:(-?\\d+(\\.\\d+)?),(-?\\d+(\\.\\d+)?)";
}
@Override @Override
public String getDebugMessage(Frame f) { public String getDebugMessage(Frame f) {
float yaw = VectorMath.skriptYaw(f.getYaw()); float yaw = VectorMath.skriptYaw(f.getYaw());
@ -78,7 +71,7 @@ public class FrameType {
}) })
.serializer(new Serializer<Frame>() { .serializer(new Serializer<Frame>() {
@Override @Override
public Fields serialize(Frame f) throws NotSerializableException { public Fields serialize(Frame f) {
final Fields fields = new Fields(); final Fields fields = new Fields();
float yaw = VectorMath.skriptYaw(f.getYaw()); float yaw = VectorMath.skriptYaw(f.getYaw());
float pitch = VectorMath.skriptPitch(f.getPitch()); float pitch = VectorMath.skriptPitch(f.getPitch());
@ -88,12 +81,12 @@ public class FrameType {
} }
@Override @Override
public void deserialize(Frame f, Fields fields) throws StreamCorruptedException, NotSerializableException { public void deserialize(Frame f, Fields fields) {
assert false; assert false;
} }
@Override @Override
protected Frame deserialize(Fields f) throws StreamCorruptedException, NotSerializableException { protected Frame deserialize(Fields f) throws StreamCorruptedException {
float yaw = VectorMath.fromSkriptYaw(f.getPrimitive("yaw", float.class)); float yaw = VectorMath.fromSkriptYaw(f.getPrimitive("yaw", float.class));
float pitch = VectorMath.fromSkriptPitch(f.getPrimitive("pitch", float.class)); float pitch = VectorMath.fromSkriptPitch(f.getPrimitive("pitch", float.class));
return new Frame().setFromYawPitch(yaw, pitch); return new Frame().setFromYawPitch(yaw, pitch);

View File

View File

@ -55,7 +55,6 @@ public class LocationLib {
} }
public static Location[] getLineCoordinate(Location[] locations, Location end, double position) { public static Location[] getLineCoordinate(Location[] locations, Location end, double position) {
Location[] coordinates = new Location[locations.length];
Vector delta; Vector delta;
int i = 0; int i = 0;
for (Location l: locations) { for (Location l: locations) {

View File

View File

6
src/main/resources/plugin.yml Normal file → Executable file
View File

@ -1,4 +1,6 @@
name: Biosphere2 name: Biosphere2
main: io.github.bi0qaw.biosphere.Biosphere main: io.github.bi0qaw.biosphere.Biosphere
author: bi0qaw author: bi0qaw, Govindas
version: 1.0.2 version: 1.0.3
api-version: 1.13
depend: [Skript]

BIN
target/biosphere2-1.0.3.jar Normal file

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More