Handle fake entities (negative ID)

This commit is contained in:
filoghost 2020-04-11 21:55:52 +02:00
parent b589749c24
commit 269a4bec72
1 changed files with 4 additions and 0 deletions

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);