3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-12-26 00:00:33 +01:00

Null check entity type in LegacyEntityRewriter#getObjectTrackerHandler (#935)

Dieser Commit ist enthalten in:
EnZaXD 2024-12-16 01:23:05 +01:00 committet von GitHub
Ursprung e0430c0f45
Commit f0def507fd
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: B5690EEEBB952194
3 geänderte Dateien mit 10 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -140,6 +140,7 @@ public abstract class EntityRewriter<C extends ClientboundPacketType, T extends
if (entityType == null) { if (entityType == null) {
return null; return null;
} }
tracker(wrapper.user()).addEntity(wrapper.get(Types.VAR_INT, 0), entityType); tracker(wrapper.user()).addEntity(wrapper.get(Types.VAR_INT, 0), entityType);
int mappedTypeId = newEntityId(entityType.getId()); int mappedTypeId = newEntityId(entityType.getId());

Datei anzeigen

@ -124,7 +124,14 @@ public abstract class LegacyEntityRewriter<C extends ClientboundPacketType, T ex
} }
protected PacketHandler getObjectTrackerHandler() { 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) { protected PacketHandler getTrackerAndDataHandler(Type<List<EntityData>> dataType, EntityType entityType) {

Datei anzeigen

@ -138,6 +138,7 @@ public class EntityPacketRewriter1_13 extends LegacyEntityRewriter<ClientboundPa
if (entityType == null) { if (entityType == null) {
return; return;
} }
tracker(wrapper.user()).addEntity(wrapper.get(Types.VAR_INT, 0), entityType); tracker(wrapper.user()).addEntity(wrapper.get(Types.VAR_INT, 0), entityType);
int oldId = EntityIdMappings1_12_2.getOldId(type); int oldId = EntityIdMappings1_12_2.getOldId(type);