mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-26 04:35:50 +01:00
Revert to old socket, fix NPE
This commit is contained in:
parent
1626b13d69
commit
1e3d3e5754
@ -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)
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user