diff --git a/src/net/citizensnpcs/npc/entity/CitizensHumanNPC.java b/src/net/citizensnpcs/npc/entity/CitizensHumanNPC.java index cc068ae26..be3785d2b 100644 --- a/src/net/citizensnpcs/npc/entity/CitizensHumanNPC.java +++ b/src/net/citizensnpcs/npc/entity/CitizensHumanNPC.java @@ -24,6 +24,8 @@ public class CitizensHumanNPC extends CitizensNPC { @Override public void update() { super.update(); + if (mcEntity == null) + return; if (mcEntity.noDamageTicks > 0) mcEntity.noDamageTicks--; if (mcEntity.attackTicks > 0) diff --git a/src/net/citizensnpcs/resource/lib/NPCSocket.java b/src/net/citizensnpcs/resource/lib/NPCSocket.java index 9e01123aa..c110337ba 100644 --- a/src/net/citizensnpcs/resource/lib/NPCSocket.java +++ b/src/net/citizensnpcs/resource/lib/NPCSocket.java @@ -1,27 +1,20 @@ package net.citizensnpcs.resource.lib; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; import java.io.InputStream; import java.io.OutputStream; import java.net.Socket; public class NPCSocket extends Socket { + @Override public InputStream getInputStream() { - return new InputStream() { - @Override - public int read() { - return 0; // NOP - } - }; + return new ByteArrayInputStream(new byte[10]); } @Override public OutputStream getOutputStream() { - return new OutputStream() { - @Override - public void write(int b) { - // NOP - } - }; + return new ByteArrayOutputStream(); } } \ No newline at end of file