Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 12:30:06 +01:00
SPIGOT-3428: Recover from invalid firework data
Dieser Commit ist enthalten in:
Ursprung
3819f8dbec
Commit
9a82fa7785
@ -103,7 +103,15 @@ class CraftMetaFirework extends CraftMetaItem implements FireworkMeta {
|
|||||||
.trail(explosion.getBoolean(EXPLOSION_TRAIL.NBT))
|
.trail(explosion.getBoolean(EXPLOSION_TRAIL.NBT))
|
||||||
.with(getEffectType(0xff & explosion.getByte(EXPLOSION_TYPE.NBT)));
|
.with(getEffectType(0xff & explosion.getByte(EXPLOSION_TYPE.NBT)));
|
||||||
|
|
||||||
for (int color : explosion.getIntArray(EXPLOSION_COLORS.NBT)) {
|
int[] colors = explosion.getIntArray(EXPLOSION_COLORS.NBT);
|
||||||
|
// People using buggy command generators specify a list rather than an int here, so recover with dummy data.
|
||||||
|
// Wrong: Colors: [1234]
|
||||||
|
// Right: Colors: [I;1234]
|
||||||
|
if (colors.length == 0) {
|
||||||
|
effect.withColor(Color.WHITE);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int color : colors) {
|
||||||
effect.withColor(Color.fromRGB(color));
|
effect.withColor(Color.fromRGB(color));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren