mirror of
https://github.com/ViaVersion/ViaBackwards.git
synced 2025-01-04 19:08:43 +01:00
Null check entity type in LegacyEntityRewriter#getObjectTrackerHandler (#935)
This commit is contained in:
parent
e0430c0f45
commit
f0def507fd
@ -140,6 +140,7 @@ public abstract class EntityRewriter<C extends ClientboundPacketType, T extends
|
||||
if (entityType == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
tracker(wrapper.user()).addEntity(wrapper.get(Types.VAR_INT, 0), entityType);
|
||||
|
||||
int mappedTypeId = newEntityId(entityType.getId());
|
||||
|
@ -124,7 +124,14 @@ public abstract class LegacyEntityRewriter<C extends ClientboundPacketType, T ex
|
||||
}
|
||||
|
||||
protected PacketHandler getObjectTrackerHandler() {
|
||||
return wrapper -> addTrackedEntity(wrapper, wrapper.get(Types.VAR_INT, 0), objectTypeFromId(wrapper.get(Types.BYTE, 0)));
|
||||
return wrapper -> {
|
||||
EntityType type = objectTypeFromId(wrapper.get(Types.BYTE, 0));
|
||||
if (type == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
addTrackedEntity(wrapper, wrapper.get(Types.VAR_INT, 0), type);
|
||||
};
|
||||
}
|
||||
|
||||
protected PacketHandler getTrackerAndDataHandler(Type<List<EntityData>> dataType, EntityType entityType) {
|
||||
|
@ -138,6 +138,7 @@ public class EntityPacketRewriter1_13 extends LegacyEntityRewriter<ClientboundPa
|
||||
if (entityType == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
tracker(wrapper.user()).addEntity(wrapper.get(Types.VAR_INT, 0), entityType);
|
||||
|
||||
int oldId = EntityIdMappings1_12_2.getOldId(type);
|
||||
|
Loading…
Reference in New Issue
Block a user