Merge branch 'master' of github.com:MassiveCraft/mcore

This commit is contained in:
Olof Larsson 2013-09-06 11:35:28 +02:00
commit ae575ac674
3 changed files with 11 additions and 4 deletions

View File

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