From 4a451c0ae2e8c54e7f251ca44d32e769287a6c97 Mon Sep 17 00:00:00 2001 From: Govindass Date: Tue, 28 Jul 2020 11:33:14 +0300 Subject: [PATCH] remove old 1.9.2 --- .idea/workspace.xml | 41 +-------- src/me/TheBukor/SkStuff/SkStuff.java | 4 - src/me/TheBukor/SkStuff/util/NMS_v1_9_R1.java | 91 ------------------- 3 files changed, 3 insertions(+), 133 deletions(-) delete mode 100644 src/me/TheBukor/SkStuff/util/NMS_v1_9_R1.java diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 2099ef6..181c53e 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,44 +2,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/src/me/TheBukor/SkStuff/SkStuff.java b/src/me/TheBukor/SkStuff/SkStuff.java index 28ccad7..0624d7d 100644 --- a/src/me/TheBukor/SkStuff/SkStuff.java +++ b/src/me/TheBukor/SkStuff/SkStuff.java @@ -63,10 +63,6 @@ public class SkStuff extends JavaPlugin { nmsMethods = new NMS_v1_8_R3(); getLogger().info("It looks like you're running 1.8.8!"); break; - case "v1_9_R1.": - nmsMethods = new NMS_v1_9_R1(); - getLogger().info("It looks like you're running 1.9.2!"); - break; case "v1_9_R2.": nmsMethods = new NMS_v1_9_R2(); getLogger().info("It looks like you're running 1.9.4!"); diff --git a/src/me/TheBukor/SkStuff/util/NMS_v1_9_R1.java b/src/me/TheBukor/SkStuff/util/NMS_v1_9_R1.java deleted file mode 100644 index 0e3b5bb..0000000 --- a/src/me/TheBukor/SkStuff/util/NMS_v1_9_R1.java +++ /dev/null @@ -1,91 +0,0 @@ -package me.TheBukor.SkStuff.util; - -import net.minecraft.server.v1_9_R1.EntityInsentient; -import net.minecraft.server.v1_9_R1.PathfinderGoal; -import net.minecraft.server.v1_9_R1.PathfinderGoalSelector; -import org.bukkit.craftbukkit.v1_9_R1.entity.CraftEntity; -import org.bukkit.entity.Entity; - -import java.util.Iterator; -import java.util.LinkedHashSet; - -public class NMS_v1_9_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_9_R1.Entity nmsEntity = ((CraftEntity) entity).getHandle(); - return nmsEntity.noclip; - } - - @Override - public void setNoClip(Entity entity, boolean noclip) { - net.minecraft.server.v1_9_R1.Entity nmsEntity = ((CraftEntity) entity).getHandle(); - nmsEntity.noclip = noclip; - } - - @Override - public boolean getFireProof(Entity entity) { - net.minecraft.server.v1_9_R1.Entity nmsEntity = ((CraftEntity) entity).getHandle(); - return nmsEntity.isFireProof(); - } - - @Override - public void setFireProof(Entity entity, boolean fireProof) { - net.minecraft.server.v1_9_R1.Entity nmsEntity = ((CraftEntity) entity).getHandle(); - ReflectionUtils.setField("fireProof", nmsEntity.getClass(), nmsEntity, fireProof); - } - @Override - public float getEntityStepLength(Entity entity) { - net.minecraft.server.v1_9_R1.Entity nmsEntity = ((CraftEntity) entity).getHandle(); - return nmsEntity.P; - } - - @Override - public void setEntityStepLength(Entity entity, float length) { - net.minecraft.server.v1_9_R1.Entity nmsEntity = ((CraftEntity) entity).getHandle(); - nmsEntity.P = length; - } -} \ No newline at end of file