Hide out-of-range entity metadata IDs

The vanilla Java client gracefully ignores these.
This commit is contained in:
Camotoy 2021-12-13 13:25:51 -05:00
parent 117ebdd9c1
commit 25921e1d67
No known key found for this signature in database
GPG key ID: 7EEFB66FE798081F

View file

@ -51,8 +51,9 @@ public class JavaSetEntityDataTranslator extends PacketTranslator<ClientboundSet
EntityDefinition<?> definition = entity.getDefinition();
for (EntityMetadata<?, ?> metadata : packet.getMetadata()) {
if (metadata.getId() >= definition.translators().size()) {
session.getGeyser().getLogger().warning("Metadata ID " + metadata.getId() + " is out of bounds of known entity metadata size " + definition.translators().size() + " for entity type " + entity.getDefinition().entityType());
if (session.getGeyser().getConfig().isDebugMode()) {
// Minecraft client just ignores these
session.getGeyser().getLogger().warning("Metadata ID " + metadata.getId() + " is out of bounds of known entity metadata size " + definition.translators().size() + " for entity type " + entity.getDefinition().entityType());
session.getGeyser().getLogger().debug(metadata.toString());
}
continue;