mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 18:27:41 +01:00
Fix fireworks being short lived. Fixes BUKKIT-3291
By: feildmaster <admin@feildmaster.com>
This commit is contained in:
parent
3e4f7af5c8
commit
28034e5c5c
@ -16,6 +16,7 @@ import java.util.Random;
|
||||
public class CraftFirework extends CraftEntity implements Firework {
|
||||
private static final int FIREWORK_ITEM_INDEX = 8;
|
||||
|
||||
private final Random random = new Random();
|
||||
private final CraftItemStack item;
|
||||
|
||||
public CraftFirework(CraftServer server, EntityFireworks entity) {
|
||||
@ -58,8 +59,7 @@ public class CraftFirework extends CraftEntity implements Firework {
|
||||
item.setItemMeta(meta);
|
||||
|
||||
// Copied from EntityFireworks constructor, update firework lifetime/power
|
||||
Random random = new Random();
|
||||
getHandle().b = 10 * meta.getPower() + random.nextInt(6) + random.nextInt(7);
|
||||
getHandle().b = 10 * (1 + meta.getPower()) + random.nextInt(6) + random.nextInt(7);
|
||||
|
||||
getHandle().getDataWatcher().h(FIREWORK_ITEM_INDEX); // Update
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user