Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-26 00:00:41 +01:00
Fix fireworks (Closes #917)
Dieser Commit ist enthalten in:
Ursprung
485ba1b8a7
Commit
5ceb4145ac
@ -116,7 +116,9 @@ public class FireworkEntity extends Entity {
|
||||
|
||||
fireworksBuilder.putList("Explosions", NbtType.COMPOUND, explosions);
|
||||
|
||||
metadata.put(EntityData.DISPLAY_ITEM, NbtMap.builder().put("Fireworks", fireworksBuilder.build()));
|
||||
NbtMapBuilder builder = NbtMap.builder();
|
||||
builder.put("Fireworks", fireworksBuilder.build());
|
||||
metadata.put(EntityData.DISPLAY_ITEM, builder.build());
|
||||
} else if (entityMetadata.getId() == 8 && !entityMetadata.getValue().equals(OptionalInt.empty()) && ((OptionalInt) entityMetadata.getValue()).getAsInt() == session.getPlayerEntity().getEntityId()) {
|
||||
//Checks if the firework has an entity ID (used when a player is gliding) and checks to make sure the player that is gliding is the one getting sent the packet or else every player near the gliding player will boost too.
|
||||
PlayerEntity entity = session.getPlayerEntity();
|
||||
|
@ -98,8 +98,11 @@ public class FireworkTranslator extends NbtItemStackTranslator {
|
||||
|
||||
@Override
|
||||
public void translateToJava(CompoundTag itemTag, ItemEntry itemEntry) {
|
||||
if (!itemTag.contains("Fireworks")) {
|
||||
return;
|
||||
}
|
||||
CompoundTag fireworks = itemTag.get("Fireworks");
|
||||
if (fireworks.get("Flight") != null) {
|
||||
if (fireworks.contains("Flight")) {
|
||||
fireworks.put(new ByteTag("Flight", MathUtils.convertByte(fireworks.get("Flight").getValue())));
|
||||
}
|
||||
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren