Return null in pre 1.14 entity types

This commit is contained in:
FlorianMichael 2024-07-04 20:29:51 +02:00
parent 1cc3bddc26
commit 984533b867
7 changed files with 2 additions and 6 deletions

View File

@ -38,7 +38,6 @@ public class EntityTypes1_10 {
} }
if (type == null) { if (type == null) {
Via.getPlatform().getLogger().severe("Could not find 1.10 type id " + typeId + " objectType=" + object); Via.getPlatform().getLogger().severe("Could not find 1.10 type id " + typeId + " objectType=" + object);
return EntityType.ENTITY; // Fall back to the basic ENTITY
} }
return type; return type;
} }

View File

@ -38,7 +38,6 @@ public class EntityTypes1_11 {
} }
if (type == null) { if (type == null) {
Via.getPlatform().getLogger().severe("Could not find 1.11 type id " + typeId + " objectType=" + object); Via.getPlatform().getLogger().severe("Could not find 1.11 type id " + typeId + " objectType=" + object);
return EntityType.ENTITY; // Fall back to the basic ENTITY
} }
return type; return type;
} }

View File

@ -38,7 +38,6 @@ public class EntityTypes1_12 {
} }
if (type == null) { if (type == null) {
Via.getPlatform().getLogger().severe("Could not find 1.12 type id " + typeId + " objectType=" + object); Via.getPlatform().getLogger().severe("Could not find 1.12 type id " + typeId + " objectType=" + object);
return EntityType.ENTITY; // Fall back to the basic ENTITY
} }
return type; return type;
} }

View File

@ -38,7 +38,6 @@ public class EntityTypes1_13 {
} }
if (type == null) { if (type == null) {
Via.getPlatform().getLogger().severe("Could not find 1.13 type id " + typeId + " objectType=" + object); Via.getPlatform().getLogger().severe("Could not find 1.13 type id " + typeId + " objectType=" + object);
return EntityType.ENTITY; // Fall back to the basic ENTITY
} }
return type; return type;
} }

View File

@ -38,7 +38,6 @@ public class EntityTypes1_8 {
} }
if (type == null) { if (type == null) {
Via.getPlatform().getLogger().severe("Could not find 1.8 type id " + typeId + " objectType=" + object); Via.getPlatform().getLogger().severe("Could not find 1.8 type id " + typeId + " objectType=" + object);
return EntityType.ENTITY; // Fall back to the basic ENTITY
} }
return type; return type;
} }

View File

@ -38,7 +38,6 @@ public class EntityTypes1_9 {
} }
if (type == null) { if (type == null) {
Via.getPlatform().getLogger().severe("Could not find 1.9 type id " + typeId + " objectType=" + object); Via.getPlatform().getLogger().severe("Could not find 1.9 type id " + typeId + " objectType=" + object);
return EntityType.ENTITY; // Fall back to the basic ENTITY
} }
return type; return type;
} }

View File

@ -82,6 +82,8 @@ public class EntityPacketRewriter1_14 extends EntityRewriter<ClientboundPackets1
int typeId = wrapper.get(Types.VAR_INT, 1); int typeId = wrapper.get(Types.VAR_INT, 1);
EntityTypes1_13.EntityType type1_13 = EntityTypes1_13.getTypeFromId(typeId, true); EntityTypes1_13.EntityType type1_13 = EntityTypes1_13.getTypeFromId(typeId, true);
if (type1_13 == null) return;
typeId = newEntityId(type1_13.getId()); typeId = newEntityId(type1_13.getId());
EntityType type1_14 = EntityTypes1_14.getTypeFromId(typeId); EntityType type1_14 = EntityTypes1_14.getTypeFromId(typeId);