diff --git a/.idea/$PRODUCT_WORKSPACE_FILE$ b/.idea/$PRODUCT_WORKSPACE_FILE$
new file mode 100644
index 0000000..3733e0d
--- /dev/null
+++ b/.idea/$PRODUCT_WORKSPACE_FILE$
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+ 1.8
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/artifacts/SkStuff_jar.xml b/.idea/artifacts/SkStuff_jar.xml
new file mode 100644
index 0000000..6eff031
--- /dev/null
+++ b/.idea/artifacts/SkStuff_jar.xml
@@ -0,0 +1,10 @@
+
+
+ $PROJECT_DIR$/out/artifacts/SkStuff_jar
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/dictionaries/Govindas.xml b/.idea/dictionaries/Govindas.xml
new file mode 100644
index 0000000..e0070ef
--- /dev/null
+++ b/.idea/dictionaries/Govindas.xml
@@ -0,0 +1,7 @@
+
+
+
+ elytra
+
+
+
\ No newline at end of file
diff --git a/.idea/discord.xml b/.idea/discord.xml
new file mode 100644
index 0000000..59b11d1
--- /dev/null
+++ b/.idea/discord.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..e208459
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..a1beb97
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml
new file mode 100644
index 0000000..e96534f
--- /dev/null
+++ b/.idea/uiDesigner.xml
@@ -0,0 +1,124 @@
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
new file mode 100644
index 0000000..e9f575c
--- /dev/null
+++ b/.idea/workspace.xml
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1573731941395
+
+
+ 1573731941395
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/META-INF/MANIFEST.MF b/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..59499bc
--- /dev/null
+++ b/META-INF/MANIFEST.MF
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+
diff --git a/README.md b/README.md
index 086e8f3..6150327 100644
--- a/README.md
+++ b/README.md
@@ -1,65 +1,13 @@
## Unofficial fork of [SkStuff](https://github.com/TheBukor/SkStuff)
-This fork adds 1.13 and 1.14 support, removes support for older than 1.13 versions, removes worldguard/worldedit, vanishnospacket and nbt stuff. This fork is focused on making pathfinder goals to work as they are unique to SkStuff. Note that I'm not very experienced Java developer yet, so it is possible that I have made some mistakes, but from my little testings things are working.
+As the owner is missing for a few weeks, this fork brings nbt support to 1.12. Only use it in case the official one still not supported.
-**Download it [here](https://github.com/Govindass/SkStuff/releases)**
+**Download it [here](https://github.com/Tuke-Nuke/SkStuff/releases)**
-**Little Pathfinder Goals Tutorial**
-Add pathfinder goals with:
-```
-add pathfind[er] goal [[with] priority %-integer%] to %livingentities%
-```
-
-List of Pathfinder Goals
-```
-(avoid|run away from) %entitytype%[, radius %number%[, speed %number%[, speed (if|when) (close|near) %number%]]]
-break door[s]
-breed[, [move[ment]] speed %number%] #Note 1
-eat grass
-(flee from the sun|seek shad(e|ow))[, [move[ment]] speed %number%]
-(float (in[side]|on) water|swim)
-follow (owner|tamer)[, speed %number%[, min[imum] distance %number%[, max[imum] distance %number%]]] #Note 2
-follow (adult|parent)[s][, [move[ment]] speed %number%] #Note 3
-(fight back|react to|target) (damager|attacker) [[of] type] %entitytype%[, call ([for] help|reinforcement) %boolean%]
-o(c|z)elot jump on blocks[, [move[ment]] speed %number%]
-leap at target[, [leap] height %number%]
-look at %entitytype%[, (radius|max[imum] distance) %number%]
-melee attack %entitytype%[, [move[ment]] speed %number%[, (memorize|do('nt| not) forget) target [for [a] long[er] time] %boolean%]] #Note 4
-move to[wards] target[, [move[ment]] speed %number%[, (radius|max[imum] distance) %number%]]
-target nearest [entity [of] type] %entitytype%[, check sight %boolean%] #Note 5
-o(c|z)elot attack #Note 6
-open door[s]
-(panic|flee)[, [move[ment]] speed %number%]
-look around randomly
-(walk around randomly|wander)[, [move[ment]] speed %number%[, min[imum] [of] %timespan% between mov(e[ment][s]|ing)]]
-sit #Note 2
-[creeper] (explode|inflate|swell)
-squid (swim around|wander)
-shoot fireball[s] #Note 7
-[silverfish] hide (in[side]|on) block[s]
-(call|summon|wake) [other] [hidden] silverfish[es]
-[enderman] pick[[ ]up] block[s]
-[enderman] place block[s]
-[enderman] attack player (staring|looking) at [their] eye[s]]
-ghast move to[wards] target
-ghast (idle move[ment]|wander|random fl(ight|y[ing]))
-(tempt to|follow players (holding|with)) %itemstack%[, [move[ment]] speed %number%[, scared of player movement %boolean%]]
-target [random] %entitytype% (if|when) (not |un)tamed #Note 2
-guardian attack [entities] #Note 6
-[z[ombie[ ]]pig[man]] attack [player[s]] (if|when) angry
-[z[ombie[ ]]pig[man]] (react to|fight back|target) (attacker|damager) (if|when) angry
-[rabbit] eat carrot crops
-[killer] rabbit [melee] attack
-slime [random] jump
-slime change (direction|facing) randomly
-slime (idle move[ment]|wander)
+In case of **bugs**:
+ * If it is a bug related to NBTs or Pathfind and it only happens in 1.12, you can report it here and I will try to help.
+ * Any other bugs, should be reported at official pages. Since it is a temporary fork.
-Notes:
-1 - Can only be applied to breedable animals.
-2 - Can only be applied to tameable animals (Wolves and Ocelots).
-3 - Only takes effect when the entity is a baby (age is less than 0).
-4 - The boolean argument specifies whether or not the entity should lose interest on its target if there's no suitable path. The speed parameter will ALWAYS be 1 for SPIDERS. The boolean will ALWAYS be TRUE for SPIDERS.
-5 - The boolean argument specifier whether or not the entity should have a direct line of sight of its target. Examples are spiders, by default they can see players through blocks. The boolean argument will ALWAYS be TRUE for SPIDERS.
-6 - If this goal is missing on the entity, it will not be able to attack.
-7 - Can only be applied on Ghasts or Blazes.
-```
+---
+
+[**Github**](https://github.com/TheBukor/SkStuff) - [**skUnity**](https://forums.skunity.com/resources/skstuff.131/)
diff --git a/SkStuff.iml b/SkStuff.iml
new file mode 100644
index 0000000..7443437
--- /dev/null
+++ b/SkStuff.iml
@@ -0,0 +1,200 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/bin/.gitignore b/bin/.gitignore
deleted file mode 100644
index 24cb195..0000000
--- a/bin/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/me/
-/org/
diff --git a/bin/META-INF/MANIFEST.MF b/bin/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..5bb3946
--- /dev/null
+++ b/bin/META-INF/MANIFEST.MF
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Main-Class: me.TheBukor.SkStuff.SkStuff
+
diff --git a/bin/META-INF/SkStuff.kotlin_module b/bin/META-INF/SkStuff.kotlin_module
new file mode 100644
index 0000000..2983af7
Binary files /dev/null and b/bin/META-INF/SkStuff.kotlin_module differ
diff --git a/bin/me/TheBukor/SkStuff/SkStuff$1.class b/bin/me/TheBukor/SkStuff/SkStuff$1.class
new file mode 100644
index 0000000..5f8d9ba
Binary files /dev/null and b/bin/me/TheBukor/SkStuff/SkStuff$1.class differ
diff --git a/bin/me/TheBukor/SkStuff/SkStuff.class b/bin/me/TheBukor/SkStuff/SkStuff.class
new file mode 100644
index 0000000..da09f10
Binary files /dev/null and b/bin/me/TheBukor/SkStuff/SkStuff.class differ
diff --git a/bin/me/TheBukor/SkStuff/effects/EffClearPathGoals.class b/bin/me/TheBukor/SkStuff/effects/EffClearPathGoals.class
new file mode 100644
index 0000000..3732af1
Binary files /dev/null and b/bin/me/TheBukor/SkStuff/effects/EffClearPathGoals.class differ
diff --git a/bin/me/TheBukor/SkStuff/effects/EffGZipFile.class b/bin/me/TheBukor/SkStuff/effects/EffGZipFile.class
new file mode 100644
index 0000000..3ae9f24
Binary files /dev/null and b/bin/me/TheBukor/SkStuff/effects/EffGZipFile.class differ
diff --git a/bin/me/TheBukor/SkStuff/effects/EffMakeJump.class b/bin/me/TheBukor/SkStuff/effects/EffMakeJump.class
new file mode 100644
index 0000000..9458e1a
Binary files /dev/null and b/bin/me/TheBukor/SkStuff/effects/EffMakeJump.class differ
diff --git a/bin/me/TheBukor/SkStuff/effects/EffRemovePathGoal.class b/bin/me/TheBukor/SkStuff/effects/EffRemovePathGoal.class
new file mode 100644
index 0000000..b6333f2
Binary files /dev/null and b/bin/me/TheBukor/SkStuff/effects/EffRemovePathGoal.class differ
diff --git a/bin/me/TheBukor/SkStuff/effects/EffResourceSound.class b/bin/me/TheBukor/SkStuff/effects/EffResourceSound.class
new file mode 100644
index 0000000..1f50ee5
Binary files /dev/null and b/bin/me/TheBukor/SkStuff/effects/EffResourceSound.class differ
diff --git a/bin/me/TheBukor/SkStuff/effects/EffSetPathGoal.class b/bin/me/TheBukor/SkStuff/effects/EffSetPathGoal.class
new file mode 100644
index 0000000..f2d9ac0
Binary files /dev/null and b/bin/me/TheBukor/SkStuff/effects/EffSetPathGoal.class differ
diff --git a/bin/me/TheBukor/SkStuff/effects/EffShowEntityEffect.class b/bin/me/TheBukor/SkStuff/effects/EffShowEntityEffect.class
new file mode 100644
index 0000000..a87d952
Binary files /dev/null and b/bin/me/TheBukor/SkStuff/effects/EffShowEntityEffect.class differ
diff --git a/bin/me/TheBukor/SkStuff/expressions/ExprClickedInventory.class b/bin/me/TheBukor/SkStuff/expressions/ExprClickedInventory.class
new file mode 100644
index 0000000..5b57bc3
Binary files /dev/null and b/bin/me/TheBukor/SkStuff/expressions/ExprClickedInventory.class differ
diff --git a/bin/me/TheBukor/SkStuff/expressions/ExprFireProof.class b/bin/me/TheBukor/SkStuff/expressions/ExprFireProof.class
new file mode 100644
index 0000000..49c7a37
Binary files /dev/null and b/bin/me/TheBukor/SkStuff/expressions/ExprFireProof.class differ
diff --git a/bin/me/TheBukor/SkStuff/expressions/ExprGlideState.class b/bin/me/TheBukor/SkStuff/expressions/ExprGlideState.class
new file mode 100644
index 0000000..bb449c1
Binary files /dev/null and b/bin/me/TheBukor/SkStuff/expressions/ExprGlideState.class differ
diff --git a/bin/me/TheBukor/SkStuff/expressions/ExprInventoryOwner.class b/bin/me/TheBukor/SkStuff/expressions/ExprInventoryOwner.class
new file mode 100644
index 0000000..997bf22
Binary files /dev/null and b/bin/me/TheBukor/SkStuff/expressions/ExprInventoryOwner.class differ
diff --git a/bin/me/TheBukor/SkStuff/expressions/ExprNoClip.class b/bin/me/TheBukor/SkStuff/expressions/ExprNoClip.class
new file mode 100644
index 0000000..da7a114
Binary files /dev/null and b/bin/me/TheBukor/SkStuff/expressions/ExprNoClip.class differ
diff --git a/bin/me/TheBukor/SkStuff/expressions/ExprNoGravityState.class b/bin/me/TheBukor/SkStuff/expressions/ExprNoGravityState.class
new file mode 100644
index 0000000..451dda6
Binary files /dev/null and b/bin/me/TheBukor/SkStuff/expressions/ExprNoGravityState.class differ
diff --git a/bin/me/TheBukor/SkStuff/expressions/ExprTimespanToNumber.class b/bin/me/TheBukor/SkStuff/expressions/ExprTimespanToNumber.class
new file mode 100644
index 0000000..954a2c2
Binary files /dev/null and b/bin/me/TheBukor/SkStuff/expressions/ExprTimespanToNumber.class differ
diff --git a/bin/me/TheBukor/SkStuff/expressions/ExprToLowerCase.class b/bin/me/TheBukor/SkStuff/expressions/ExprToLowerCase.class
new file mode 100644
index 0000000..e1614cd
Binary files /dev/null and b/bin/me/TheBukor/SkStuff/expressions/ExprToLowerCase.class differ
diff --git a/bin/me/TheBukor/SkStuff/expressions/ExprToUpperCase.class b/bin/me/TheBukor/SkStuff/expressions/ExprToUpperCase.class
new file mode 100644
index 0000000..5ab6494
Binary files /dev/null and b/bin/me/TheBukor/SkStuff/expressions/ExprToUpperCase.class differ
diff --git a/bin/me/TheBukor/SkStuff/expressions/ExprWordsToUpperCase.class b/bin/me/TheBukor/SkStuff/expressions/ExprWordsToUpperCase.class
new file mode 100644
index 0000000..1ec28bb
Binary files /dev/null and b/bin/me/TheBukor/SkStuff/expressions/ExprWordsToUpperCase.class differ
diff --git a/bin/me/TheBukor/SkStuff/pathfinders/PathfinderGoalFollow_v1_13_R2.class b/bin/me/TheBukor/SkStuff/pathfinders/PathfinderGoalFollow_v1_13_R2.class
new file mode 100644
index 0000000..ccd4976
Binary files /dev/null and b/bin/me/TheBukor/SkStuff/pathfinders/PathfinderGoalFollow_v1_13_R2.class differ
diff --git a/bin/me/TheBukor/SkStuff/pathfinders/PathfinderGoalFollow_v1_14_R1.class b/bin/me/TheBukor/SkStuff/pathfinders/PathfinderGoalFollow_v1_14_R1.class
new file mode 100644
index 0000000..dfb0de7
Binary files /dev/null and b/bin/me/TheBukor/SkStuff/pathfinders/PathfinderGoalFollow_v1_14_R1.class differ
diff --git a/bin/me/TheBukor/SkStuff/util/NMSInterface.class b/bin/me/TheBukor/SkStuff/util/NMSInterface.class
new file mode 100644
index 0000000..301cdab
Binary files /dev/null and b/bin/me/TheBukor/SkStuff/util/NMSInterface.class differ
diff --git a/bin/me/TheBukor/SkStuff/util/NMS_v1_13_R2.class b/bin/me/TheBukor/SkStuff/util/NMS_v1_13_R2.class
new file mode 100644
index 0000000..f0be4f4
Binary files /dev/null and b/bin/me/TheBukor/SkStuff/util/NMS_v1_13_R2.class differ
diff --git a/bin/me/TheBukor/SkStuff/util/NMS_v1_14_R1.class b/bin/me/TheBukor/SkStuff/util/NMS_v1_14_R1.class
new file mode 100644
index 0000000..3d3cdc0
Binary files /dev/null and b/bin/me/TheBukor/SkStuff/util/NMS_v1_14_R1.class differ
diff --git a/bin/me/TheBukor/SkStuff/util/NMS_v1_15_R1.class b/bin/me/TheBukor/SkStuff/util/NMS_v1_15_R1.class
new file mode 100644
index 0000000..ae81cd2
Binary files /dev/null and b/bin/me/TheBukor/SkStuff/util/NMS_v1_15_R1.class differ
diff --git a/bin/me/TheBukor/SkStuff/util/ReflectionUtils.class b/bin/me/TheBukor/SkStuff/util/ReflectionUtils.class
new file mode 100644
index 0000000..630a07a
Binary files /dev/null and b/bin/me/TheBukor/SkStuff/util/ReflectionUtils.class differ
diff --git a/bin/org/mcstats/Metrics$1.class b/bin/org/mcstats/Metrics$1.class
new file mode 100644
index 0000000..19c4b0b
Binary files /dev/null and b/bin/org/mcstats/Metrics$1.class differ
diff --git a/bin/org/mcstats/Metrics$Graph.class b/bin/org/mcstats/Metrics$Graph.class
new file mode 100644
index 0000000..03c1a16
Binary files /dev/null and b/bin/org/mcstats/Metrics$Graph.class differ
diff --git a/bin/org/mcstats/Metrics$Plotter.class b/bin/org/mcstats/Metrics$Plotter.class
new file mode 100644
index 0000000..8622ece
Binary files /dev/null and b/bin/org/mcstats/Metrics$Plotter.class differ
diff --git a/bin/org/mcstats/Metrics.class b/bin/org/mcstats/Metrics.class
new file mode 100644
index 0000000..3079690
Binary files /dev/null and b/bin/org/mcstats/Metrics.class differ
diff --git a/out/artifacts/SkStuff_jar/SkStuff.jar b/out/artifacts/SkStuff_jar/SkStuff.jar
new file mode 100644
index 0000000..2fbdb84
Binary files /dev/null and b/out/artifacts/SkStuff_jar/SkStuff.jar differ
diff --git a/plugin.yml b/plugin.yml
index 780a761..640a7ce 100644
--- a/plugin.yml
+++ b/plugin.yml
@@ -3,4 +3,4 @@ author: [TheBukor, Govindas]
description: A Skript addon which adds extra functionalities such as pathfinder goals.
version: 1.6.4.2-fork-1.13-1.14
main: me.TheBukor.SkStuff.SkStuff
-depend: [Skript]
+softdepend: [Skript]
\ No newline at end of file
diff --git a/src/me/TheBukor/SkStuff/SkStuff.java b/src/me/TheBukor/SkStuff/SkStuff.java
index a849ca0..0a717fd 100644
--- a/src/me/TheBukor/SkStuff/SkStuff.java
+++ b/src/me/TheBukor/SkStuff/SkStuff.java
@@ -1,48 +1,22 @@
package me.TheBukor.SkStuff;
-import java.io.IOException;
-
-import javax.annotation.Nullable;
-
-import me.TheBukor.SkStuff.util.*;
-import org.bukkit.Bukkit;
-import org.bukkit.Location;
-import org.bukkit.entity.Entity;
-import org.bukkit.event.entity.EntityToggleGlideEvent;
-import org.bukkit.inventory.Inventory;
-import org.bukkit.inventory.ItemStack;
-import org.bukkit.plugin.java.JavaPlugin;
-import org.mcstats.Metrics;
-
-
-
import ch.njol.skript.Skript;
import ch.njol.skript.lang.ExpressionType;
import ch.njol.skript.lang.util.SimpleEvent;
import ch.njol.skript.registrations.EventValues;
import ch.njol.skript.util.Getter;
-import me.TheBukor.SkStuff.effects.EffClearPathGoals;
-import me.TheBukor.SkStuff.effects.EffGZipFile;
-import me.TheBukor.SkStuff.effects.EffMakeJump;
-import me.TheBukor.SkStuff.effects.EffRemovePathGoal;
-import me.TheBukor.SkStuff.effects.EffResourceSound;
-import me.TheBukor.SkStuff.effects.EffSetPathGoal;
-import me.TheBukor.SkStuff.effects.EffShowEntityEffect;
-import me.TheBukor.SkStuff.expressions.ExprClickedInventory;
+import me.TheBukor.SkStuff.effects.*;
+import me.TheBukor.SkStuff.expressions.*;
+import me.TheBukor.SkStuff.util.*;
+import org.bukkit.Bukkit;
+import org.bukkit.entity.Entity;
+import org.bukkit.event.entity.EntityToggleGlideEvent;
+import org.bukkit.inventory.Inventory;
+import org.bukkit.plugin.java.JavaPlugin;
+import org.mcstats.Metrics;
-import me.TheBukor.SkStuff.expressions.ExprFireProof;
-import me.TheBukor.SkStuff.expressions.ExprGlideState;
-import me.TheBukor.SkStuff.expressions.ExprInventoryOwner;
-
-
-
-import me.TheBukor.SkStuff.expressions.ExprNoClip;
-import me.TheBukor.SkStuff.expressions.ExprNoGravityState;
-
-import me.TheBukor.SkStuff.expressions.ExprTimespanToNumber;
-import me.TheBukor.SkStuff.expressions.ExprToLowerCase;
-import me.TheBukor.SkStuff.expressions.ExprToUpperCase;
-import me.TheBukor.SkStuff.expressions.ExprWordsToUpperCase;
+import javax.annotation.Nullable;
+import java.io.IOException;
public class SkStuff extends JavaPlugin {
private int condAmount = 0;
@@ -126,14 +100,22 @@ public class SkStuff extends JavaPlugin {
private boolean setupNMSVersion() {
String version = ReflectionUtils.getVersion();
- if (version.equals("v1_13_R2.")) {
- nmsMethods = new NMS_v1_13_R2();
- getLogger().info("It looks like you're running 1.13.2!");
- } else if (version.equals("v1_14_R1.")) {
- nmsMethods = new NMS_v1_14_R1();
- getLogger().info("It looks like you're running 1.14.2!");
- } else {
- getLogger().warning("It looks like you're running an unsupported server version, some features will not be available :(");
+ switch (version) {
+ case "v1_13_R2.":
+ nmsMethods = new NMS_v1_13_R2();
+ getLogger().info("It looks like you're running 1.13.2!");
+ break;
+ case "v1_14_R1.":
+ nmsMethods = new NMS_v1_14_R1();
+ getLogger().info("It looks like you're running 1.14.2!");
+ break;
+ case "v1_15_R1.":
+ nmsMethods = new NMS_v1_15_R1();
+ getLogger().info("It looks like you're running 1.15.1!");
+ break;
+ default:
+ getLogger().warning("It looks like you're running an unsupported server version, some features will not be available :(");
+ break;
}
return nmsMethods != null;
}
diff --git a/src/me/TheBukor/SkStuff/util/NMSInterface.java b/src/me/TheBukor/SkStuff/util/NMSInterface.java
index 3ea94cf..7d1cd14 100644
--- a/src/me/TheBukor/SkStuff/util/NMSInterface.java
+++ b/src/me/TheBukor/SkStuff/util/NMSInterface.java
@@ -1,12 +1,6 @@
package me.TheBukor.SkStuff.util;
-import java.io.File;
-
-import net.minecraft.server.v1_13_R2.EntityTypes;
-import org.bukkit.Location;
-import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
-import org.bukkit.inventory.ItemStack;
public interface NMSInterface {
diff --git a/src/me/TheBukor/SkStuff/util/NMS_v1_15_R1.java b/src/me/TheBukor/SkStuff/util/NMS_v1_15_R1.java
new file mode 100644
index 0000000..a3d33a6
--- /dev/null
+++ b/src/me/TheBukor/SkStuff/util/NMS_v1_15_R1.java
@@ -0,0 +1,112 @@
+package me.TheBukor.SkStuff.util;
+
+
+import net.minecraft.server.v1_15_R1.EntityInsentient;
+import net.minecraft.server.v1_15_R1.EntityLiving;
+import net.minecraft.server.v1_15_R1.PathfinderGoal;
+import net.minecraft.server.v1_15_R1.PathfinderGoalSelector;
+import org.bukkit.craftbukkit.v1_15_R1.entity.CraftEntity;
+import org.bukkit.craftbukkit.v1_15_R1.entity.CraftLivingEntity;
+import org.bukkit.entity.Entity;
+
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+
+public class NMS_v1_15_R1 implements NMSInterface {
+
+
+
+ @Override
+ public void clearPathfinderGoals(Entity entity) {
+ EntityInsentient nmsEnt = (EntityInsentient) ((CraftEntity) entity).getHandle();
+ ((LinkedHashSet>) ReflectionUtils.getField("b", PathfinderGoalSelector.class, nmsEnt.goalSelector)).clear();
+ ((LinkedHashSet>) ReflectionUtils.getField("c", PathfinderGoalSelector.class, nmsEnt.goalSelector)).clear();
+ ((LinkedHashSet>) ReflectionUtils.getField("b", PathfinderGoalSelector.class, nmsEnt.targetSelector)).clear();
+ ((LinkedHashSet>) ReflectionUtils.getField("c", PathfinderGoalSelector.class, nmsEnt.targetSelector)).clear();
+ }
+
+ @Override
+ public void removePathfinderGoal(Object entity, Class> goalClass, boolean isTargetSelector) {
+ if (entity instanceof EntityInsentient) {
+ ((EntityInsentient) entity).setGoalTarget(null);
+ if (isTargetSelector) {
+ Iterator> goals = ((LinkedHashSet>) ReflectionUtils.getField("b", PathfinderGoalSelector.class, ((EntityInsentient) entity).targetSelector)).iterator();
+ while (goals.hasNext()) {
+ Object goal = goals.next();
+ if (ReflectionUtils.getField("a", goal.getClass(), goal).getClass() == goalClass) {
+ goals.remove();
+ }
+ }
+ } else {
+ Iterator> goals = ((LinkedHashSet>) ReflectionUtils.getField("b", PathfinderGoalSelector.class, ((EntityInsentient) entity).goalSelector)).iterator();
+ while (goals.hasNext()) {
+ Object goal = goals.next();
+ if (ReflectionUtils.getField("a", goal.getClass(), goal).getClass() == goalClass) {
+ goals.remove();
+ }
+ }
+ }
+ }
+ }
+
+ @Override
+ public void addPathfinderGoal(Object entity, int priority, Object goal, boolean isTargetSelector) {
+ if (entity instanceof EntityInsentient && goal instanceof PathfinderGoal) {
+ if (isTargetSelector)
+ ((EntityInsentient) entity).targetSelector.a(priority, (PathfinderGoal) goal);
+ else
+ ((EntityInsentient) entity).goalSelector.a(priority, (PathfinderGoal) goal);
+ }
+ }
+
+
+ @Override
+ public boolean getNoClip(Entity entity) {
+ net.minecraft.server.v1_15_R1.Entity nmsEntity = ((CraftEntity) entity).getHandle();
+ return nmsEntity.noclip;
+ }
+
+ @Override
+ public void setNoClip(Entity entity, boolean noclip) {
+ net.minecraft.server.v1_15_R1.Entity nmsEntity = ((CraftEntity) entity).getHandle();
+ nmsEntity.noclip = noclip;
+ }
+
+ @Override
+ public boolean getFireProof(Entity entity) {
+ net.minecraft.server.v1_15_R1.Entity nmsEntity = ((CraftEntity) entity).getHandle();
+ return nmsEntity.isFireProof();
+ }
+
+ @Override
+ public void setFireProof(Entity entity, boolean fireProof) {
+ net.minecraft.server.v1_15_R1.Entity nmsEntity = ((CraftEntity) entity).getHandle();
+ ReflectionUtils.setField("fireProof", nmsEntity.getClass(), nmsEntity, fireProof);
+ }
+
+
+
+
+
+
+ @Override
+ public boolean getElytraGlideState(Entity entity) {
+ EntityLiving nmsEntity = ((CraftLivingEntity) entity).getHandle();
+ return nmsEntity.getFlag(7);
+ }
+
+ public void setElytraGlideState(Entity entity, boolean glide) {
+ EntityLiving nmsEntity = ((CraftLivingEntity) entity).getHandle();
+ nmsEntity.setFlag(7, glide);
+ }
+
+ public boolean getNoGravity(Entity entity) {
+ net.minecraft.server.v1_15_R1.Entity nmsEntity = ((CraftEntity) entity).getHandle();
+ return nmsEntity.isNoGravity();
+ }
+
+ public void setNoGravity(Entity entity, boolean noGravity) {
+ net.minecraft.server.v1_15_R1.Entity nmsEntity = ((CraftEntity) entity).getHandle();
+ nmsEntity.setNoGravity(noGravity);
+ }
+}
\ No newline at end of file