Merge pull request #34 from riking/findbugs

More Findbugs reports <3
This commit is contained in:
Olof Larsson 2013-08-31 05:26:31 -07:00
commit db2a64504d
3 changed files with 11 additions and 4 deletions

View File

@ -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);

View File

@ -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);
}
}

View File

@ -148,4 +148,10 @@ public class TimeUnit implements Comparable<TimeUnit>
return this.millis == ((TimeUnit)other).millis;
}
@Override
public final int hashCode()
{
return (int)(this.millis^(this.millis>>>32));
}
}