mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-24 03:25:15 +01:00
Properly update fireworks. Fixes BUKKIT-3289
This commit is contained in:
parent
ced0646351
commit
edd90ccf16
@ -25,7 +25,7 @@ public class CraftFirework extends CraftEntity implements Firework {
|
|||||||
|
|
||||||
if (item == null) {
|
if (item == null) {
|
||||||
item = new ItemStack(Item.FIREWORKS);
|
item = new ItemStack(Item.FIREWORKS);
|
||||||
getHandle().getDataWatcher().watch(FIREWORK_ITEM_INDEX, item);
|
getHandle().getDataWatcher().a(FIREWORK_ITEM_INDEX, item); // register
|
||||||
}
|
}
|
||||||
|
|
||||||
this.item = CraftItemStack.asCraftMirror(item);
|
this.item = CraftItemStack.asCraftMirror(item);
|
||||||
@ -60,5 +60,7 @@ public class CraftFirework extends CraftEntity implements Firework {
|
|||||||
// Copied from EntityFireworks constructor, update firework lifetime/power
|
// Copied from EntityFireworks constructor, update firework lifetime/power
|
||||||
Random random = new Random();
|
Random random = new Random();
|
||||||
getHandle().b = 10 * meta.getPower() + random.nextInt(6) + random.nextInt(7);
|
getHandle().b = 10 * meta.getPower() + random.nextInt(6) + random.nextInt(7);
|
||||||
|
|
||||||
|
getHandle().getDataWatcher().h(FIREWORK_ITEM_INDEX); // Update
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user