Merge branch 'master' of github.com:MassiveCraft/mcore
This commit is contained in:
commit
ae575ac674
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user