From ecfc4f451c28c4ce2f4111d9ade533139d193dd7 Mon Sep 17 00:00:00 2001 From: fullwall Date: Sun, 22 Jul 2018 14:27:08 +0800 Subject: [PATCH] Preliminary 1.13 update --- main/pom.xml | 2 +- .../main/java/net/citizensnpcs/util/Util.java | 3 +- v1_13_R1/pom.xml | 2 +- .../nms/v1_13_R1/entity/BatController.java | 4 +- .../nms/v1_13_R1/entity/BlazeController.java | 4 +- .../v1_13_R1/entity/CaveSpiderController.java | 4 +- .../v1_13_R1/entity/ChickenController.java | 4 +- .../nms/v1_13_R1/entity/CodController.java | 4 +- .../nms/v1_13_R1/entity/CowController.java | 4 +- .../v1_13_R1/entity/CreeperController.java | 4 +- .../v1_13_R1/entity/DolphinController.java | 5 +- .../v1_13_R1/entity/DrownedController.java | 4 +- .../entity/EnderDragonController.java | 4 +- .../v1_13_R1/entity/EndermanController.java | 4 +- .../v1_13_R1/entity/EndermiteController.java | 4 +- .../nms/v1_13_R1/entity/EvokerController.java | 4 +- .../nms/v1_13_R1/entity/GhastController.java | 4 +- .../nms/v1_13_R1/entity/GiantController.java | 4 +- .../v1_13_R1/entity/GuardianController.java | 4 +- .../entity/GuardianElderController.java | 4 +- .../nms/v1_13_R1/entity/HorseController.java | 4 +- .../entity/HorseDonkeyController.java | 4 +- .../v1_13_R1/entity/HorseMuleController.java | 4 +- .../entity/HorseSkeletonController.java | 4 +- .../entity/HorseZombieController.java | 4 +- .../v1_13_R1/entity/IllusionerController.java | 4 +- .../v1_13_R1/entity/IronGolemController.java | 4 +- .../nms/v1_13_R1/entity/LlamaController.java | 4 +- .../v1_13_R1/entity/MagmaCubeController.java | 4 +- .../entity/MushroomCowController.java | 4 +- .../nms/v1_13_R1/entity/OcelotController.java | 8 +- .../nms/v1_13_R1/entity/ParrotController.java | 4 +- .../v1_13_R1/entity/PhantomController.java | 36 ++++-- .../nms/v1_13_R1/entity/PigController.java | 8 +- .../v1_13_R1/entity/PigZombieController.java | 4 +- .../v1_13_R1/entity/PolarBearController.java | 4 +- .../v1_13_R1/entity/PufferFishController.java | 4 +- .../nms/v1_13_R1/entity/RabbitController.java | 4 +- .../nms/v1_13_R1/entity/SalmonController.java | 4 +- .../nms/v1_13_R1/entity/SheepController.java | 4 +- .../v1_13_R1/entity/ShulkerController.java | 4 +- .../v1_13_R1/entity/SilverfishController.java | 4 +- .../v1_13_R1/entity/SkeletonController.java | 4 +- .../entity/SkeletonStrayController.java | 4 +- .../entity/SkeletonWitherController.java | 4 +- .../nms/v1_13_R1/entity/SlimeController.java | 4 +- .../v1_13_R1/entity/SnowmanController.java | 4 +- .../nms/v1_13_R1/entity/SpiderController.java | 4 +- .../nms/v1_13_R1/entity/SquidController.java | 4 +- .../entity/TropicalFishController.java | 4 +- .../nms/v1_13_R1/entity/TurtleController.java | 4 +- .../nms/v1_13_R1/entity/VexController.java | 4 +- .../v1_13_R1/entity/VillagerController.java | 4 +- .../v1_13_R1/entity/VindicatorController.java | 4 +- .../nms/v1_13_R1/entity/WitchController.java | 4 +- .../nms/v1_13_R1/entity/WitherController.java | 4 +- .../nms/v1_13_R1/entity/WolfController.java | 4 +- .../nms/v1_13_R1/entity/ZombieController.java | 4 +- .../v1_13_R1/entity/ZombieHuskController.java | 4 +- .../entity/ZombieVillagerController.java | 4 +- .../nms/v1_13_R1/util/NMSImpl.java | 28 ++--- .../v1_13_R1/util/PlayerControllerLook.java | 2 +- .../nms/v1_13_R1/util/PlayerNavigation.java | 104 +++++++++--------- 63 files changed, 219 insertions(+), 191 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index 6cb6cb606..05187ed54 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -12,7 +12,7 @@ UTF-8 - 1.13-pre7-R0.1-SNAPSHOT + 1.13-R0.1-SNAPSHOT 2.0.23-SNAPSHOT 1.5.4 1.4.12 diff --git a/main/src/main/java/net/citizensnpcs/util/Util.java b/main/src/main/java/net/citizensnpcs/util/Util.java index 71d5b147b..3e875666d 100644 --- a/main/src/main/java/net/citizensnpcs/util/Util.java +++ b/main/src/main/java/net/citizensnpcs/util/Util.java @@ -92,7 +92,8 @@ public class Util { } public static boolean isAlwaysFlyable(EntityType type) { - if (type.name().toLowerCase().contains("vex") || type.name().toLowerCase().contains("parrot")) + if (type.name().toLowerCase().equals("vex") || type.name().toLowerCase().equals("parrot") + || type.name().toLowerCase().equals("phantom")) // 1.8.8 compatibility return true; switch (type) { diff --git a/v1_13_R1/pom.xml b/v1_13_R1/pom.xml index a6a557ed1..de91d92fb 100644 --- a/v1_13_R1/pom.xml +++ b/v1_13_R1/pom.xml @@ -11,7 +11,7 @@ UTF-8 - 1.13-pre7-R0.1-SNAPSHOT + 1.13-R0.1-SNAPSHOT diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/BatController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/BatController.java index 7c89bb8c1..3bdec7538 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/BatController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/BatController.java @@ -61,8 +61,8 @@ public class BatController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/BlazeController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/BlazeController.java index c8dfa5451..d37d54ade 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/BlazeController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/BlazeController.java @@ -60,8 +60,8 @@ public class BlazeController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/CaveSpiderController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/CaveSpiderController.java index b2ba133e1..a11db0869 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/CaveSpiderController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/CaveSpiderController.java @@ -78,8 +78,8 @@ public class CaveSpiderController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/ChickenController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/ChickenController.java index 84554d480..d30df5f57 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/ChickenController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/ChickenController.java @@ -106,8 +106,8 @@ public class ChickenController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/CodController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/CodController.java index e8cefbbce..4796be51b 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/CodController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/CodController.java @@ -94,8 +94,8 @@ public class CodController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/CowController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/CowController.java index ebeeb298e..07b095c61 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/CowController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/CowController.java @@ -90,8 +90,8 @@ public class CowController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/CreeperController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/CreeperController.java index 6c605a8c6..1f8d2c6d3 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/CreeperController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/CreeperController.java @@ -80,8 +80,8 @@ public class CreeperController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/DolphinController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/DolphinController.java index ab653c63c..ff9afb384 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/DolphinController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/DolphinController.java @@ -58,6 +58,7 @@ public class DolphinController extends MobEntityController { this.npc = (CitizensNPC) npc; if (npc != null) { NMSImpl.clearGoals(goalSelector, targetSelector); + this.setNoAI(true); } } @@ -94,8 +95,8 @@ public class DolphinController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/DrownedController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/DrownedController.java index 3e89360ed..33a707626 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/DrownedController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/DrownedController.java @@ -94,8 +94,8 @@ public class DrownedController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/EnderDragonController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/EnderDragonController.java index 76c2094dd..0a1ffcbc5 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/EnderDragonController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/EnderDragonController.java @@ -60,8 +60,8 @@ public class EnderDragonController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/EndermanController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/EndermanController.java index 2d16f950f..447b83e4b 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/EndermanController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/EndermanController.java @@ -78,8 +78,8 @@ public class EndermanController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/EndermiteController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/EndermiteController.java index e660873eb..6e9aa1980 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/EndermiteController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/EndermiteController.java @@ -78,8 +78,8 @@ public class EndermiteController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/EvokerController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/EvokerController.java index 15e28169f..50a4bfa6a 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/EvokerController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/EvokerController.java @@ -64,8 +64,8 @@ public class EvokerController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/GhastController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/GhastController.java index aa2a20e09..dac1f4cbc 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/GhastController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/GhastController.java @@ -51,8 +51,8 @@ public class GhastController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/GiantController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/GiantController.java index 833ef4b4b..f8b378060 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/GiantController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/GiantController.java @@ -64,8 +64,8 @@ public class GiantController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/GuardianController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/GuardianController.java index 1d8baa669..f5012a1dc 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/GuardianController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/GuardianController.java @@ -64,8 +64,8 @@ public class GuardianController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/GuardianElderController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/GuardianElderController.java index b94ab3e7c..eff520926 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/GuardianElderController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/GuardianElderController.java @@ -64,8 +64,8 @@ public class GuardianElderController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/HorseController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/HorseController.java index 1a58ecff7..6aadabcd7 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/HorseController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/HorseController.java @@ -85,8 +85,8 @@ public class HorseController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/HorseDonkeyController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/HorseDonkeyController.java index ac4f25eae..06e5ce0fb 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/HorseDonkeyController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/HorseDonkeyController.java @@ -85,8 +85,8 @@ public class HorseDonkeyController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/HorseMuleController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/HorseMuleController.java index f30c02e83..d29ef6966 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/HorseMuleController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/HorseMuleController.java @@ -85,8 +85,8 @@ public class HorseMuleController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/HorseSkeletonController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/HorseSkeletonController.java index 7875a2a0a..c876737d7 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/HorseSkeletonController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/HorseSkeletonController.java @@ -86,8 +86,8 @@ public class HorseSkeletonController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/HorseZombieController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/HorseZombieController.java index 16345ba21..f0cc82d86 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/HorseZombieController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/HorseZombieController.java @@ -86,8 +86,8 @@ public class HorseZombieController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/IllusionerController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/IllusionerController.java index e0d2bee56..704227e65 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/IllusionerController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/IllusionerController.java @@ -64,8 +64,8 @@ public class IllusionerController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/IronGolemController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/IronGolemController.java index 85b76f298..32b9da995 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/IronGolemController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/IronGolemController.java @@ -64,8 +64,8 @@ public class IronGolemController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/LlamaController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/LlamaController.java index c3481a262..796889af3 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/LlamaController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/LlamaController.java @@ -85,8 +85,8 @@ public class LlamaController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/MagmaCubeController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/MagmaCubeController.java index 0dd838906..8a12793f0 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/MagmaCubeController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/MagmaCubeController.java @@ -76,8 +76,8 @@ public class MagmaCubeController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/MushroomCowController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/MushroomCowController.java index 1797a3a90..805c6a65b 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/MushroomCowController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/MushroomCowController.java @@ -76,8 +76,8 @@ public class MushroomCowController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/OcelotController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/OcelotController.java index c0904e343..76e97314f 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/OcelotController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/OcelotController.java @@ -92,8 +92,8 @@ public class OcelotController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override @@ -112,9 +112,9 @@ public class OcelotController extends MobEntityController { } @Override - protected void dz() { + protected void dA() { if (npc == null) { - super.dz(); + super.dA(); } } diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/ParrotController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/ParrotController.java index 902307b87..f4bebae2a 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/ParrotController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/ParrotController.java @@ -57,8 +57,8 @@ public class ParrotController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/PhantomController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/PhantomController.java index 4788ae926..b5a39a567 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/PhantomController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/PhantomController.java @@ -15,8 +15,11 @@ import net.citizensnpcs.npc.CitizensNPC; import net.citizensnpcs.npc.ai.NPCHolder; import net.citizensnpcs.util.Util; import net.minecraft.server.v1_13_R1.BlockPosition; +import net.minecraft.server.v1_13_R1.ControllerLook; +import net.minecraft.server.v1_13_R1.ControllerMove; import net.minecraft.server.v1_13_R1.DamageSource; import net.minecraft.server.v1_13_R1.EntityPhantom; +import net.minecraft.server.v1_13_R1.EnumDifficulty; import net.minecraft.server.v1_13_R1.IBlockData; import net.minecraft.server.v1_13_R1.NBTTagCompound; import net.minecraft.server.v1_13_R1.SoundEffect; @@ -45,6 +48,9 @@ public class PhantomController extends MobEntityController { if (npc != null) { NMSImpl.clearGoals(goalSelector, targetSelector); setNoAI(true); + this.moveController = new ControllerMove(this); + this.lookController = new ControllerLook(this); + // TODO: phantom pitch reversed } } @@ -81,8 +87,8 @@ public class PhantomController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override @@ -101,9 +107,9 @@ public class PhantomController extends MobEntityController { } @Override - public boolean dq() { + public boolean dr() { if (npc == null || !npc.isProtected()) - return super.dq(); + return super.dr(); return false; } @@ -176,14 +182,28 @@ public class PhantomController extends MobEntityController { @Override public void k() { - if (npc == null) { - super.k(); - } else { - NMSImpl.updateAI(this); + super.k(); + if (npc != null) { + if (npc.isProtected()) { + this.setOnFire(0); + } npc.update(); } } + @Override + public void tick() { + // avoid suicide + boolean resetDifficulty = this.world.getDifficulty() == EnumDifficulty.PEACEFUL; + if (npc != null && resetDifficulty) { + this.world.getWorldData().setDifficulty(EnumDifficulty.NORMAL); + } + super.tick(); + if (npc != null && resetDifficulty) { + this.world.getWorldData().setDifficulty(EnumDifficulty.PEACEFUL); + } + } + @Override public boolean z_() { if (npc == null || !npc.isFlyable()) { diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/PigController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/PigController.java index 1eb9ab732..a98942f30 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/PigController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/PigController.java @@ -93,8 +93,8 @@ public class PigController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override @@ -113,9 +113,9 @@ public class PigController extends MobEntityController { } @Override - public boolean dh() { + public boolean di() { // block carrot-on-a-stick behaviour - return npc == null ? super.dh() : false; + return npc == null ? super.di() : false; } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/PigZombieController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/PigZombieController.java index 229dc262c..4f469be40 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/PigZombieController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/PigZombieController.java @@ -65,8 +65,8 @@ public class PigZombieController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/PolarBearController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/PolarBearController.java index 81eedafc6..bb5de3344 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/PolarBearController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/PolarBearController.java @@ -57,8 +57,8 @@ public class PolarBearController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/PufferFishController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/PufferFishController.java index c0ca3a1e8..1fe94a93c 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/PufferFishController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/PufferFishController.java @@ -80,8 +80,8 @@ public class PufferFishController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/RabbitController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/RabbitController.java index d1350028c..d73a4fdcc 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/RabbitController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/RabbitController.java @@ -94,8 +94,8 @@ public class RabbitController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SalmonController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SalmonController.java index 016df2cef..21b4afd55 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SalmonController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SalmonController.java @@ -80,8 +80,8 @@ public class SalmonController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SheepController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SheepController.java index ee8039567..db98819dd 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SheepController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SheepController.java @@ -75,8 +75,8 @@ public class SheepController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/ShulkerController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/ShulkerController.java index 426ef746b..36915eb49 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/ShulkerController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/ShulkerController.java @@ -81,8 +81,8 @@ public class ShulkerController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SilverfishController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SilverfishController.java index 30d6dc07e..baa459dd9 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SilverfishController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SilverfishController.java @@ -54,8 +54,8 @@ public class SilverfishController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SkeletonController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SkeletonController.java index ec76e7c2b..2e4c233b1 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SkeletonController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SkeletonController.java @@ -64,8 +64,8 @@ public class SkeletonController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SkeletonStrayController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SkeletonStrayController.java index f0b41ab23..c2ae637a6 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SkeletonStrayController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SkeletonStrayController.java @@ -64,8 +64,8 @@ public class SkeletonStrayController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SkeletonWitherController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SkeletonWitherController.java index 1c122c3fa..bf34a834b 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SkeletonWitherController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SkeletonWitherController.java @@ -64,8 +64,8 @@ public class SkeletonWitherController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SlimeController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SlimeController.java index 109a880fb..5b4b1b885 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SlimeController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SlimeController.java @@ -76,8 +76,8 @@ public class SlimeController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SnowmanController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SnowmanController.java index 9bfe89b30..59602537a 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SnowmanController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SnowmanController.java @@ -80,8 +80,8 @@ public class SnowmanController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SpiderController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SpiderController.java index 31fea00eb..5177d4b95 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SpiderController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SpiderController.java @@ -64,8 +64,8 @@ public class SpiderController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SquidController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SquidController.java index 036d01ca1..c8e7c34e6 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SquidController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/SquidController.java @@ -64,8 +64,8 @@ public class SquidController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/TropicalFishController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/TropicalFishController.java index ba4228804..af929684d 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/TropicalFishController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/TropicalFishController.java @@ -80,8 +80,8 @@ public class TropicalFishController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/TurtleController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/TurtleController.java index fb06595f4..ceb42159d 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/TurtleController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/TurtleController.java @@ -80,8 +80,8 @@ public class TurtleController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/VexController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/VexController.java index c513e4c01..80f9e7297 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/VexController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/VexController.java @@ -47,8 +47,8 @@ public class VexController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/VillagerController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/VillagerController.java index 0102418cb..4dcd329b8 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/VillagerController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/VillagerController.java @@ -112,8 +112,8 @@ public class VillagerController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/VindicatorController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/VindicatorController.java index 4ac0fc5d8..287dfa5ee 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/VindicatorController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/VindicatorController.java @@ -75,8 +75,8 @@ public class VindicatorController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/WitchController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/WitchController.java index 15fd3bf3f..5fe7ad251 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/WitchController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/WitchController.java @@ -64,8 +64,8 @@ public class WitchController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/WitherController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/WitherController.java index c5c3018fd..89f1d1e04 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/WitherController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/WitherController.java @@ -46,8 +46,8 @@ public class WitherController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/WolfController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/WolfController.java index c191b0aa6..f5f186570 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/WolfController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/WolfController.java @@ -77,8 +77,8 @@ public class WolfController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/ZombieController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/ZombieController.java index cfd811dc1..25bcc0276 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/ZombieController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/ZombieController.java @@ -64,8 +64,8 @@ public class ZombieController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/ZombieHuskController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/ZombieHuskController.java index 909c4097e..e812eaedd 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/ZombieHuskController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/ZombieHuskController.java @@ -64,8 +64,8 @@ public class ZombieHuskController extends MobEntityController { } @Override - protected SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + protected SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/ZombieVillagerController.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/ZombieVillagerController.java index 3908323ca..0c52e8075 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/ZombieVillagerController.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/entity/ZombieVillagerController.java @@ -64,8 +64,8 @@ public class ZombieVillagerController extends MobEntityController { } @Override - public SoundEffect cr() { - return NMSImpl.getSoundEffect(npc, super.cr(), NPC.DEATH_SOUND_METADATA); + public SoundEffect cs() { + return NMSImpl.getSoundEffect(npc, super.cs(), NPC.DEATH_SOUND_METADATA); } @Override diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/util/NMSImpl.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/util/NMSImpl.java index 2f11ee8a4..48f4d70aa 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/util/NMSImpl.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/util/NMSImpl.java @@ -486,10 +486,10 @@ public class NMSImpl implements NMSBridge { @Override public void stop() { - if (navigation.n() != null) { + if (navigation.m() != null) { for (Player player : Bukkit.getOnlinePlayers()) { - for (int i = 0; i < navigation.n().d(); i++) { - PathPoint pp = navigation.n().a(i); + for (int i = 0; i < navigation.m().d(); i++) { + PathPoint pp = navigation.m().a(i); org.bukkit.block.Block block = new Vector(pp.a, pp.b, pp.c).toLocation(player.getWorld()) .getBlock(); player.sendBlockChange(block.getLocation(), block.getType(), block.getData()); @@ -520,8 +520,8 @@ public class NMSImpl implements NMSBridge { } if (params.debug() && !NMSImpl.isNavigationFinished(navigation)) { for (Player player : Bukkit.getOnlinePlayers()) { - for (int i = 0; i < navigation.n().d(); i++) { - PathPoint pp = navigation.n().a(i); + for (int i = 0; i < navigation.m().d(); i++) { + PathPoint pp = navigation.m().a(i); player.sendBlockChange(new Vector(pp.a, pp.b, pp.c).toLocation(player.getWorld()), Material.SUNFLOWER, (byte) 0); } @@ -1165,9 +1165,9 @@ public class NMSImpl implements NMSBridge { @Override public Iterator iterator() { - final int npoints = navigation.n() == null ? 0 : navigation.n().d(); + final int npoints = navigation.m() == null ? 0 : navigation.m().d(); return new Iterator() { - PathPoint curr = npoints > 0 ? navigation.n().a(0) : null; + PathPoint curr = npoints > 0 ? navigation.m().a(0) : null; int i = 0; @Override @@ -1178,7 +1178,7 @@ public class NMSImpl implements NMSBridge { @Override public Vector next() { PathPoint old = curr; - curr = i + 1 < npoints ? navigation.n().a(++i) : null; + curr = i + 1 < npoints ? navigation.m().a(++i) : null; return new Vector(old.a, old.b, old.c); } @@ -1204,7 +1204,7 @@ public class NMSImpl implements NMSBridge { } public static void flyingMoveLogic(EntityLiving entity, float f, float f1, float f2) { - if ((entity.cO()) || (entity.bT())) { + if ((entity.cP()) || (entity.bT())) { double d0 = 0.08D; if ((entity.motY <= 0.0D) && (entity.hasEffect(MobEffects.SLOW_FALLING))) { d0 = 0.01D; @@ -1225,7 +1225,7 @@ public class NMSImpl implements NMSBridge { } if (f3 > 0.0F) { f5 += (0.54600006F - f5) * f3 / 3.0F; - f4 += (entity.cJ() - f4) * f3 / 3.0F; + f4 += (entity.cK() - f4) * f3 / 3.0F; } if (entity.hasEffect(MobEffects.DOLPHINS_GRACE)) { f5 = 0.96F; @@ -1262,7 +1262,7 @@ public class NMSImpl implements NMSBridge { && (entity.c(entity.motX, entity.motY + 0.6000000238418579D - entity.locY + d2, entity.motZ))) { entity.motY = 0.30000001192092896D; } - } else if (entity.db()) { + } else if (entity.dc()) { if (entity.motY > -0.5D) { entity.fallDistance = 1.0F; } @@ -1323,7 +1323,7 @@ public class NMSImpl implements NMSBridge { } f4 = 0.16277137F / (f9 * f9 * f9); if (entity.onGround) { - f3 = entity.cJ() * f4; + f3 = entity.cK() * f4; } else { f3 = entity.aU; } @@ -1476,7 +1476,7 @@ public class NMSImpl implements NMSBridge { } public static boolean isNavigationFinished(NavigationAbstract navigation) { - return navigation.q(); + return navigation.p(); } @SuppressWarnings("deprecation") @@ -1549,7 +1549,7 @@ public class NMSImpl implements NMSBridge { } public static void stopNavigation(NavigationAbstract navigation) { - navigation.r(); + navigation.q(); } public static void updateAI(EntityLiving entity) { diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/util/PlayerControllerLook.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/util/PlayerControllerLook.java index 95deea452..7b4a2a4fb 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/util/PlayerControllerLook.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/util/PlayerControllerLook.java @@ -45,7 +45,7 @@ public class PlayerControllerLook { // this.a.aP = a(this.a.aS, this.a.aQ, 10.0F); } float f3 = MathHelper.g(this.a.aS - this.a.aQ); - if (!this.a.getNavigation().q()) { + if (!this.a.getNavigation().p()) { if (f3 < -75.0F) { this.a.aS = (this.a.aQ - 75.0F); } diff --git a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/util/PlayerNavigation.java b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/util/PlayerNavigation.java index 604776edc..91a991245 100644 --- a/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/util/PlayerNavigation.java +++ b/v1_13_R1/src/main/java/net/citizensnpcs/nms/v1_13_R1/util/PlayerNavigation.java @@ -156,7 +156,7 @@ public class PlayerNavigation extends NavigationAbstract { protected void a(Vec3D paramVec3D) { if (this.e - this.f > 100) { if (paramVec3D.distanceSquared(this.g) < 2.25D) { - r(); + q(); } this.f = this.e; this.g = paramVec3D; @@ -168,13 +168,13 @@ public class PlayerNavigation extends NavigationAbstract { } else { this.h = localVec3D; double d1 = paramVec3D.f(this.h); - this.k = (this.a.cJ() > 0.0F ? d1 / this.a.cJ() * 1000.0D : 0.0D); + this.k = (this.a.cK() > 0.0F ? d1 / this.a.cK() * 1000.0D : 0.0D); } if ((this.k > 0.0D) && (this.i > this.k * 3.0D)) { this.h = Vec3D.a; this.i = 0L; this.k = 0.0D; - r(); + q(); } this.j = SystemUtils.b(); } @@ -242,7 +242,7 @@ public class PlayerNavigation extends NavigationAbstract { @Override protected boolean b() { - return (this.a.onGround) || (s()) || (this.a.isPassenger()); + return (this.a.onGround) || (r()) || (this.a.isPassenger()); } @Override @@ -267,9 +267,9 @@ public class PlayerNavigation extends NavigationAbstract { && (this.b.getType(localBlockPosition).getMaterial().isBuildable())) { localBlockPosition = localBlockPosition.up(); } - return superb(localBlockPosition); + return super.b(localBlockPosition); } - return superb(paramBlockPosition); + return super.b(paramBlockPosition); } public void b(boolean paramBoolean) { @@ -297,20 +297,20 @@ public class PlayerNavigation extends NavigationAbstract { } public void c(boolean paramBoolean) { - this.o.c(paramBoolean); + this.pp = paramBoolean; } @Override public void d() { this.e += 1; if (this.m) { - m(); + l(); } - if (q()) { + if (p()) { return; } if (b()) { - p(); + o(); } else if ((this.c != null) && (this.c.e() < this.c.d())) { Vec3D localVec3D = c(); Vec3D localObject = this.c.a(this.a, this.c.e()); @@ -320,8 +320,8 @@ public class PlayerNavigation extends NavigationAbstract { this.c.c(this.c.e() + 1); } } - o(); - if (q()) { + n(); + if (p()) { return; } Vec3D localVec3D = this.c.a(this.a); @@ -333,30 +333,14 @@ public class PlayerNavigation extends NavigationAbstract { localVec3D.z, this.d); } + @Override public void d(boolean paramBoolean) { - this.pp = paramBoolean; + this.o.c(paramBoolean); } @Override protected void E_() { - if (this.c == null) { - return; - } - for (int i1 = 0; i1 < this.c.d(); i1++) { - PathPoint localPathPoint = this.c.a(i1); - Object localObject = i1 + 1 < this.c.d() ? this.c.a(i1 + 1) : null; - - IBlockData localIBlockData = this.b - .getType(new BlockPosition(localPathPoint.a, localPathPoint.b, localPathPoint.c)); - Block localBlock = localIBlockData.getBlock(); - if (localBlock == Blocks.CAULDRON) { - this.c.a(i1, localPathPoint.a(localPathPoint.a, localPathPoint.b + 1, localPathPoint.c)); - if ((localObject != null) && (localPathPoint.b >= ((PathPoint) localObject).b)) { - this.c.a(i1 + 1, ((PathPoint) localObject).a(((PathPoint) localObject).a, localPathPoint.b + 1, - ((PathPoint) localObject).c)); - } - } - } + superE_(); if (this.pp) { if (this.b.e(new BlockPosition(MathHelper.floor(this.a.locX), (int) (this.a.getBoundingBox().b + 0.5D), MathHelper.floor(this.a.locZ)))) { @@ -376,27 +360,23 @@ public class PlayerNavigation extends NavigationAbstract { return this.o.c(); } - public boolean h() { - return this.o.e(); - } - @Override - public BlockPosition j() { + public BlockPosition i() { return this.q; } @Override - public float k() { + public float j() { return (float) this.p.getValue(); } @Override - public boolean l() { + public boolean k() { return this.m; } @Override - public void m() { + public void l() { if (this.b.getTime() - this.n > 20L) { if (this.q != null) { this.c = null; @@ -410,16 +390,16 @@ public class PlayerNavigation extends NavigationAbstract { } @Override - public PathEntity n() { + public PathEntity m() { return this.c; } @Override - protected void o() { + protected void n() { } @Override - protected void p() { + protected void o() { Vec3D localVec3D1 = c(); int i1 = this.c.d(); @@ -449,20 +429,25 @@ public class PlayerNavigation extends NavigationAbstract { } @Override - public boolean q() { + public boolean p() { return (this.c == null) || (this.c.b()); } @Override - public void r() { + public void q() { this.c = null; } @Override - protected boolean s() { + protected boolean r() { return (this.a.aq()) || (this.a.ax()); } + @Override + public PathfinderAbstract s() { + return this.o; + } + public void setRange(float pathfindingRange) { this.p.setValue(pathfindingRange); } @@ -476,7 +461,7 @@ public class PlayerNavigation extends NavigationAbstract { } this.q = paramBlockPosition; - float f1 = k(); + float f1 = j(); this.b.methodProfiler.a("pathfind"); BlockPosition localBlockPosition = new BlockPosition(this.a); int i1 = (int) (f1 + 8.0F); @@ -488,13 +473,34 @@ public class PlayerNavigation extends NavigationAbstract { return localPathEntity; } + protected void superE_() { + if (this.c == null) { + return; + } + for (int i1 = 0; i1 < this.c.d(); i1++) { + PathPoint localPathPoint = this.c.a(i1); + Object localObject = i1 + 1 < this.c.d() ? this.c.a(i1 + 1) : null; + + IBlockData localIBlockData = this.b + .getType(new BlockPosition(localPathPoint.a, localPathPoint.b, localPathPoint.c)); + Block localBlock = localIBlockData.getBlock(); + if (localBlock == Blocks.CAULDRON) { + this.c.a(i1, localPathPoint.a(localPathPoint.a, localPathPoint.b + 1, localPathPoint.c)); + if ((localObject != null) && (localPathPoint.b >= ((PathPoint) localObject).b)) { + this.c.a(i1 + 1, ((PathPoint) localObject).a(((PathPoint) localObject).a, localPathPoint.b + 1, + ((PathPoint) localObject).c)); + } + } + } + } + @Override - public PathfinderAbstract t() { - return this.o; + public boolean t() { + return this.o.e(); } private int u() { - if ((!this.a.isInWater()) || (!h())) { + if ((!this.a.isInWater()) || (!t())) { return (int) (this.a.getBoundingBox().b + 0.5D); } int i = (int) this.a.getBoundingBox().b;