From 7d963508ee55d12ad09ba73facf999d103ae7373 Mon Sep 17 00:00:00 2001 From: Kane York Date: Wed, 29 May 2013 13:58:32 -0400 Subject: [PATCH] Make holiday fireworks have more randomness fidelity This moves the multiplication to before the cast to integer. Without this, there would only be 3 clumps of fireworks each 1 second apart. With this change, the 10 fireworks won't bunch together. --- src/main/java/com/gmail/nossr50/util/HolidayManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/util/HolidayManager.java b/src/main/java/com/gmail/nossr50/util/HolidayManager.java index 61eda995f..e788005a7 100644 --- a/src/main/java/com/gmail/nossr50/util/HolidayManager.java +++ b/src/main/java/com/gmail/nossr50/util/HolidayManager.java @@ -96,13 +96,13 @@ public final class HolidayManager { sender.sendMessage(ChatColor.BLUE + "nossr50's work and all the devs, here's a firework show!"); final int firework_amount = 10; for (int i = 0; i < firework_amount; i++) { - int delay = (int) (Math.random() * 3) + 4; + int delay = (int) (Math.random() * 3 * 20) + 4; mcMMO.p.getServer().getScheduler().runTaskLater(mcMMO.p, new Runnable() { @Override public void run() { spawnFireworks((Player) sender); } - }, 20 * delay); + }, delay); } hasCelebrated.add(sender.getName()); }