Mirror von
https://github.com/ViaVersion/ViaBackwards.git
synchronisiert 2024-12-25 15:50:12 +01:00
Null check entity type in LegacyEntityRewriter#getObjectTrackerHandler (#935)
Dieser Commit ist enthalten in:
Ursprung
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);
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren