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

Fix Shulker color and open state (#1113)

Dieser Commit ist enthalten in:
rtm516 2020-08-10 15:31:08 +01:00 committet von GitHub
Ursprung 3ef7e30230
Commit 439027d510
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -53,14 +53,21 @@ public class ShulkerEntity extends GolemEntity {
metadata.put(EntityData.SHULKER_ATTACH_POS, Vector3i.from(position.getX(), position.getY(), position.getZ())); metadata.put(EntityData.SHULKER_ATTACH_POS, Vector3i.from(position.getX(), position.getY(), position.getZ()));
} }
} }
//TODO Outdated metadata flag SHULKER_PEAK_HEIGHT
// if (entityMetadata.getId() == 17) { if (entityMetadata.getId() == 17) {
// int height = (byte) entityMetadata.getValue(); int height = (byte) entityMetadata.getValue();
// metadata.put(EntityData.SHULKER_PEAK_HEIGHT, height); metadata.put(EntityData.SHULKER_PEEK_ID, height);
// } }
if (entityMetadata.getId() == 18) { if (entityMetadata.getId() == 18) {
int color = Math.abs((byte) entityMetadata.getValue() - 15); byte color = (byte) entityMetadata.getValue();
metadata.put(EntityData.VARIANT, color); if (color == 16) {
// 16 is default on both editions
metadata.put(EntityData.VARIANT, 16);
} else {
// Every other shulker color is offset 15 in bedrock edition
metadata.put(EntityData.VARIANT, Math.abs(color - 15));
}
} }
super.updateBedrockMetadata(entityMetadata, session); super.updateBedrockMetadata(entityMetadata, session);
} }