Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-11-03 14:50:19 +01:00
Add air bubble UI support (#569)
This commit translates entity metadata ID 1 into the AIR entity metadata.
Dieser Commit ist enthalten in:
Ursprung
1b260c16d7
Commit
b4ecb88d49
@ -98,7 +98,7 @@ public class Entity {
|
|||||||
|
|
||||||
metadata.put(EntityData.SCALE, 1f);
|
metadata.put(EntityData.SCALE, 1f);
|
||||||
metadata.put(EntityData.COLOR, 0);
|
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.AIR, (short) 0);
|
||||||
metadata.put(EntityData.LEAD_HOLDER_EID, -1L);
|
metadata.put(EntityData.LEAD_HOLDER_EID, -1L);
|
||||||
metadata.put(EntityData.BOUNDING_BOX_HEIGHT, entityType.getHeight());
|
metadata.put(EntityData.BOUNDING_BOX_HEIGHT, entityType.getHeight());
|
||||||
@ -242,6 +242,13 @@ public class Entity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
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
|
case 2: // custom name
|
||||||
TextMessage name = (TextMessage) entityMetadata.getValue();
|
TextMessage name = (TextMessage) entityMetadata.getValue();
|
||||||
if (name != null)
|
if (name != null)
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren