3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-19 14:30:17 +01:00

Hide out-of-range entity metadata IDs

The vanilla Java client gracefully ignores these.
Dieser Commit ist enthalten in:
Camotoy 2021-12-13 13:25:51 -05:00
Ursprung 117ebdd9c1
Commit 25921e1d67
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 7EEFB66FE798081F

Datei anzeigen

@ -51,8 +51,9 @@ public class JavaSetEntityDataTranslator extends PacketTranslator<ClientboundSet
EntityDefinition<?> definition = entity.getDefinition(); EntityDefinition<?> definition = entity.getDefinition();
for (EntityMetadata<?, ?> metadata : packet.getMetadata()) { for (EntityMetadata<?, ?> metadata : packet.getMetadata()) {
if (metadata.getId() >= definition.translators().size()) { 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()) { 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()); session.getGeyser().getLogger().debug(metadata.toString());
} }
continue; continue;