From c02fec9ca0ad582d7bcc6830123a08df80a0c47a Mon Sep 17 00:00:00 2001 From: fullwall Date: Fri, 9 Jun 2017 20:27:44 +0800 Subject: [PATCH] Set noclip for spectator NPCs --- .../net/citizensnpcs/nms/v1_10_R1/entity/EntityHumanNPC.java | 1 + .../net/citizensnpcs/nms/v1_10_R1/entity/WitherController.java | 1 + .../net/citizensnpcs/nms/v1_11_R1/entity/EntityHumanNPC.java | 1 + .../net/citizensnpcs/nms/v1_12_R1/entity/EntityHumanNPC.java | 1 + 4 files changed, 4 insertions(+) diff --git a/v1_10_R1/src/main/java/net/citizensnpcs/nms/v1_10_R1/entity/EntityHumanNPC.java b/v1_10_R1/src/main/java/net/citizensnpcs/nms/v1_10_R1/entity/EntityHumanNPC.java index 6ff229dc0..48b1f0bfc 100644 --- a/v1_10_R1/src/main/java/net/citizensnpcs/nms/v1_10_R1/entity/EntityHumanNPC.java +++ b/v1_10_R1/src/main/java/net/citizensnpcs/nms/v1_10_R1/entity/EntityHumanNPC.java @@ -297,6 +297,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable if (updateCounter + 1 > Setting.PACKET_UPDATE_DELAY.asInt()) { updateEffects = true; } + this.noclip = isSpectator(); Bukkit.getServer().getPluginManager().unsubscribeFromPermission("bukkit.broadcast.user", bukkitEntity); livingEntityBaseTick(); diff --git a/v1_10_R1/src/main/java/net/citizensnpcs/nms/v1_10_R1/entity/WitherController.java b/v1_10_R1/src/main/java/net/citizensnpcs/nms/v1_10_R1/entity/WitherController.java index 9f9ecb1a3..595341b4a 100644 --- a/v1_10_R1/src/main/java/net/citizensnpcs/nms/v1_10_R1/entity/WitherController.java +++ b/v1_10_R1/src/main/java/net/citizensnpcs/nms/v1_10_R1/entity/WitherController.java @@ -147,6 +147,7 @@ public class WitherController extends MobEntityController { protected void M() { if (npc == null) { super.M(); + return; } npc.update(); } diff --git a/v1_11_R1/src/main/java/net/citizensnpcs/nms/v1_11_R1/entity/EntityHumanNPC.java b/v1_11_R1/src/main/java/net/citizensnpcs/nms/v1_11_R1/entity/EntityHumanNPC.java index add52d9fd..8adedc749 100644 --- a/v1_11_R1/src/main/java/net/citizensnpcs/nms/v1_11_R1/entity/EntityHumanNPC.java +++ b/v1_11_R1/src/main/java/net/citizensnpcs/nms/v1_11_R1/entity/EntityHumanNPC.java @@ -111,6 +111,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable super.A_(); if (npc == null) return; + this.noclip = isSpectator(); if (updateCounter + 1 > Setting.PACKET_UPDATE_DELAY.asInt()) { updateEffects = true; } diff --git a/v1_12_R1/src/main/java/net/citizensnpcs/nms/v1_12_R1/entity/EntityHumanNPC.java b/v1_12_R1/src/main/java/net/citizensnpcs/nms/v1_12_R1/entity/EntityHumanNPC.java index a44c1e12e..bdb9a8362 100644 --- a/v1_12_R1/src/main/java/net/citizensnpcs/nms/v1_12_R1/entity/EntityHumanNPC.java +++ b/v1_12_R1/src/main/java/net/citizensnpcs/nms/v1_12_R1/entity/EntityHumanNPC.java @@ -120,6 +120,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable super.B_(); if (npc == null) return; + this.noclip = isSpectator(); if (updateCounter + 1 > Setting.PACKET_UPDATE_DELAY.asInt()) { updateEffects = true; }