mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-02-19 22:03:12 +01:00
Revert to old socket, fix NPE
This commit is contained in:
parent
f2e9a7dc3f
commit
ddb1a88bd0
@ -24,6 +24,8 @@ public class CitizensHumanNPC extends CitizensNPC {
|
|||||||
@Override
|
@Override
|
||||||
public void update() {
|
public void update() {
|
||||||
super.update();
|
super.update();
|
||||||
|
if (mcEntity == null)
|
||||||
|
return;
|
||||||
if (mcEntity.noDamageTicks > 0)
|
if (mcEntity.noDamageTicks > 0)
|
||||||
mcEntity.noDamageTicks--;
|
mcEntity.noDamageTicks--;
|
||||||
if (mcEntity.attackTicks > 0)
|
if (mcEntity.attackTicks > 0)
|
||||||
|
@ -1,27 +1,20 @@
|
|||||||
package net.citizensnpcs.resource.lib;
|
package net.citizensnpcs.resource.lib;
|
||||||
|
|
||||||
|
import java.io.ByteArrayInputStream;
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
|
|
||||||
public class NPCSocket extends Socket {
|
public class NPCSocket extends Socket {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public InputStream getInputStream() {
|
public InputStream getInputStream() {
|
||||||
return new InputStream() {
|
return new ByteArrayInputStream(new byte[10]);
|
||||||
@Override
|
|
||||||
public int read() {
|
|
||||||
return 0; // NOP
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public OutputStream getOutputStream() {
|
public OutputStream getOutputStream() {
|
||||||
return new OutputStream() {
|
return new ByteArrayOutputStream();
|
||||||
@Override
|
|
||||||
public void write(int b) {
|
|
||||||
// NOP
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user