3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-07-30 17:18:10 +02:00

Add air bubble UI support (#569)

This commit translates entity metadata ID 1 into the AIR entity metadata.
Dieser Commit ist enthalten in:
Camotoy 2020-05-15 16:29:54 -04:00 committet von GitHub
Ursprung 1b260c16d7
Commit b4ecb88d49

Datei anzeigen

@ -98,7 +98,7 @@ public class Entity {
metadata.put(EntityData.SCALE, 1f);
metadata.put(EntityData.COLOR, 0);
metadata.put(EntityData.MAX_AIR, (short) 400);
metadata.put(EntityData.MAX_AIR, (short) 300);
metadata.put(EntityData.AIR, (short) 0);
metadata.put(EntityData.LEAD_HOLDER_EID, -1L);
metadata.put(EntityData.BOUNDING_BOX_HEIGHT, entityType.getHeight());
@ -242,6 +242,13 @@ public class Entity {
}
}
break;
case 1: // Air/bubbles
if ((int) entityMetadata.getValue() == 300) {
metadata.put(EntityData.AIR, (short) 0); // Otherwise the bubble counter remains in the UI
} else {
metadata.put(EntityData.AIR, (short) (int) entityMetadata.getValue());
}
break;
case 2: // custom name
TextMessage name = (TextMessage) entityMetadata.getValue();
if (name != null)