Handle fake entities (negative ID)

This commit is contained in:
filoghost 2020-04-11 21:55:52 +02:00
parent b589749c24
commit 269a4bec72

View File

@ -177,6 +177,10 @@ public class ProtocolLibHookImpl implements ProtocolLibHook {
private Entity getEntity(PacketEvent packetEvent, EntityRelatedPacketWrapper packetWrapper) {
if (packetWrapper.getEntityID() < 0) {
return null;
}
if (!useGetEntityWorkaround) {
try {
return packetWrapper.getEntity(packetEvent);