Set noclip for spectator NPCs

This commit is contained in:
fullwall 2017-06-09 20:27:44 +08:00
parent 4235e72cc1
commit c02fec9ca0
4 changed files with 4 additions and 0 deletions

View File

@ -297,6 +297,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
if (updateCounter + 1 > Setting.PACKET_UPDATE_DELAY.asInt()) { if (updateCounter + 1 > Setting.PACKET_UPDATE_DELAY.asInt()) {
updateEffects = true; updateEffects = true;
} }
this.noclip = isSpectator();
Bukkit.getServer().getPluginManager().unsubscribeFromPermission("bukkit.broadcast.user", bukkitEntity); Bukkit.getServer().getPluginManager().unsubscribeFromPermission("bukkit.broadcast.user", bukkitEntity);
livingEntityBaseTick(); livingEntityBaseTick();

View File

@ -147,6 +147,7 @@ public class WitherController extends MobEntityController {
protected void M() { protected void M() {
if (npc == null) { if (npc == null) {
super.M(); super.M();
return;
} }
npc.update(); npc.update();
} }

View File

@ -111,6 +111,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
super.A_(); super.A_();
if (npc == null) if (npc == null)
return; return;
this.noclip = isSpectator();
if (updateCounter + 1 > Setting.PACKET_UPDATE_DELAY.asInt()) { if (updateCounter + 1 > Setting.PACKET_UPDATE_DELAY.asInt()) {
updateEffects = true; updateEffects = true;
} }

View File

@ -120,6 +120,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
super.B_(); super.B_();
if (npc == null) if (npc == null)
return; return;
this.noclip = isSpectator();
if (updateCounter + 1 > Setting.PACKET_UPDATE_DELAY.asInt()) { if (updateCounter + 1 > Setting.PACKET_UPDATE_DELAY.asInt()) {
updateEffects = true; updateEffects = true;
} }