diff --git a/src/com/massivecraft/mcore/InternalListener.java b/src/com/massivecraft/mcore/InternalListener.java index c15a00b6..f28ac6b2 100644 --- a/src/com/massivecraft/mcore/InternalListener.java +++ b/src/com/massivecraft/mcore/InternalListener.java @@ -154,7 +154,7 @@ public class InternalListener implements Listener if (cause != DamageCause.BLOCK_EXPLOSION) return; // ... and that explosion is a fake ... - if (SmokeUtil.fakeExplosion == false) return; + if (!SmokeUtil.fakeExplosion.booleanValue()) return; // ... then cancel the event and the damage. event.setCancelled(true); diff --git a/src/com/massivecraft/mcore/util/SmokeUtil.java b/src/com/massivecraft/mcore/util/SmokeUtil.java index b8a6886e..370519c0 100644 --- a/src/com/massivecraft/mcore/util/SmokeUtil.java +++ b/src/com/massivecraft/mcore/util/SmokeUtil.java @@ -3,6 +3,7 @@ package com.massivecraft.mcore.util; import java.util.Collection; import java.util.Random; +import org.apache.commons.lang.mutable.MutableBoolean; import org.bukkit.Effect; import org.bukkit.Location; @@ -89,14 +90,14 @@ public class SmokeUtil fakeExplosion(location, 4F); } - public static Boolean fakeExplosion = false; + public static MutableBoolean fakeExplosion = new MutableBoolean(false); public static void fakeExplosion(Location location, float power) { synchronized (fakeExplosion) { - fakeExplosion = true; + fakeExplosion.setValue(true); location.getWorld().createExplosion(location.getX(), location.getY(), location.getZ(), power, false, false); - fakeExplosion = false; + fakeExplosion.setValue(false); } } diff --git a/src/com/massivecraft/mcore/util/TimeUnit.java b/src/com/massivecraft/mcore/util/TimeUnit.java index b008654f..9411b9c6 100644 --- a/src/com/massivecraft/mcore/util/TimeUnit.java +++ b/src/com/massivecraft/mcore/util/TimeUnit.java @@ -148,4 +148,10 @@ public class TimeUnit implements Comparable return this.millis == ((TimeUnit)other).millis; } + @Override + public final int hashCode() + { + return (int)(this.millis^(this.millis>>>32)); + } + }