diff options
author | feildmaster <admin@feildmaster.com> | 2012-12-23 17:06:26 -0600 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2012-12-23 17:06:26 -0600 |
commit | 8292b73f3098be405d181522361f056932ff84be (patch) | |
tree | 6fca895b8b25d313de27772c7bf02c567f1fa5bf /src/main | |
parent | edd90ccf16318ae3fd38eb7d02efd7f9424addae (diff) | |
download | craftbukkit-8292b73f3098be405d181522361f056932ff84be.tar craftbukkit-8292b73f3098be405d181522361f056932ff84be.tar.gz craftbukkit-8292b73f3098be405d181522361f056932ff84be.tar.lz craftbukkit-8292b73f3098be405d181522361f056932ff84be.tar.xz craftbukkit-8292b73f3098be405d181522361f056932ff84be.zip |
Fix fireworks being short lived. Fixes BUKKIT-3291
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java index 1a576007..863078f8 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java @@ -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 } |