Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-27 08:30:12 +01:00
Add null check for fireworks tag (Closes #636)
Dieser Commit ist enthalten in:
Ursprung
d918139c44
Commit
6dabc22d22
@ -36,10 +36,15 @@ public class FireworkTranslator extends NbtItemStackTranslator {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void translateToBedrock(CompoundTag itemTag, ItemEntry itemEntry) {
|
public void translateToBedrock(CompoundTag itemTag, ItemEntry itemEntry) {
|
||||||
CompoundTag fireworks = itemTag.get("Fireworks");
|
if (!itemTag.contains("Fireworks")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
CompoundTag fireworks = itemTag.get("Fireworks");
|
||||||
ListTag explosions = fireworks.get("Explosions");
|
ListTag explosions = fireworks.get("Explosions");
|
||||||
if (explosions != null) {
|
if (explosions == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
for (Tag effect : explosions.getValue()) {
|
for (Tag effect : explosions.getValue()) {
|
||||||
CompoundTag effectData = (CompoundTag) effect;
|
CompoundTag effectData = (CompoundTag) effect;
|
||||||
|
|
||||||
@ -85,7 +90,6 @@ public class FireworkTranslator extends NbtItemStackTranslator {
|
|||||||
explosions.add(newEffectData);
|
explosions.add(newEffectData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void translateToJava(CompoundTag itemTag, ItemEntry itemEntry) {
|
public void translateToJava(CompoundTag itemTag, ItemEntry itemEntry) {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren