Replace LegacyEntityRewriter#getObjectTypeFromId with existing method (#723)

This commit is contained in:
EnZaXD 2024-04-22 23:30:15 +02:00 committed by GitHub
parent 0cd46fdac9
commit 948c615622
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 7 additions and 11 deletions

View File

@ -132,7 +132,7 @@ public abstract class LegacyEntityRewriter<C extends ClientboundPacketType, T ex
}
protected PacketHandler getObjectTrackerHandler() {
return wrapper -> addTrackedEntity(wrapper, wrapper.get(Type.VAR_INT, 0), getObjectTypeFromId(wrapper.get(Type.BYTE, 0)));
return wrapper -> addTrackedEntity(wrapper, wrapper.get(Type.VAR_INT, 0), objectTypeFromId(wrapper.get(Type.BYTE, 0)));
}
protected PacketHandler getTrackerAndMetaHandler(Type<List<Metadata>> metaType, EntityType entityType) {
@ -161,10 +161,6 @@ public abstract class LegacyEntityRewriter<C extends ClientboundPacketType, T ex
};
}
protected EntityType getObjectTypeFromId(int typeId) {
return typeFromId(typeId);
}
@Deprecated
protected void addTrackedEntity(PacketWrapper wrapper, int entityId, EntityType type) throws Exception {
tracker(wrapper.user()).addEntity(entityId, type);

View File

@ -380,7 +380,7 @@ public class EntityPackets1_11 extends LegacyEntityRewriter<ClientboundPackets1_
}
@Override
protected EntityType getObjectTypeFromId(int typeId) {
public EntityType objectTypeFromId(int typeId) {
return EntityTypes1_11.getTypeFromId(typeId, true);
}
}

View File

@ -290,7 +290,7 @@ public class EntityPackets1_12 extends LegacyEntityRewriter<ClientboundPackets1_
}
@Override
protected EntityType getObjectTypeFromId(final int typeId) {
public EntityType objectTypeFromId(int typeId) {
return EntityTypes1_12.getTypeFromId(typeId, true);
}
}

View File

@ -121,7 +121,7 @@ public class EntityPackets1_11_1 extends LegacyEntityRewriter<ClientboundPackets
}
@Override
protected EntityType getObjectTypeFromId(final int typeId) {
public EntityType objectTypeFromId(int typeId) {
return EntityTypes1_11.getTypeFromId(typeId, true);
}
}

View File

@ -362,7 +362,7 @@ public class EntityPackets1_13 extends LegacyEntityRewriter<ClientboundPackets1_
}
@Override
protected EntityType getObjectTypeFromId(final int typeId) {
public EntityType objectTypeFromId(int typeId) {
return EntityTypes1_13.getTypeFromId(typeId, true);
}

View File

@ -168,7 +168,7 @@ public class EntityPackets1_13_1 extends LegacyEntityRewriter<ClientboundPackets
}
@Override
protected EntityType getObjectTypeFromId(final int typeId) {
public EntityType objectTypeFromId(int typeId) {
return EntityTypes1_13.getTypeFromId(typeId, true);
}
}

View File

@ -165,7 +165,7 @@ public class EntityPackets1_10 extends LegacyEntityRewriter<ClientboundPackets1_
}
@Override
protected EntityType getObjectTypeFromId(int typeId) {
public EntityType objectTypeFromId(int typeId) {
return EntityTypes1_10.getTypeFromId(typeId, true);
}
}