commit
db2a64504d
@ -154,7 +154,7 @@ public class InternalListener implements Listener
|
|||||||
if (cause != DamageCause.BLOCK_EXPLOSION) return;
|
if (cause != DamageCause.BLOCK_EXPLOSION) return;
|
||||||
|
|
||||||
// ... and that explosion is a fake ...
|
// ... and that explosion is a fake ...
|
||||||
if (SmokeUtil.fakeExplosion == false) return;
|
if (!SmokeUtil.fakeExplosion.booleanValue()) return;
|
||||||
|
|
||||||
// ... then cancel the event and the damage.
|
// ... then cancel the event and the damage.
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
@ -3,6 +3,7 @@ package com.massivecraft.mcore.util;
|
|||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import org.apache.commons.lang.mutable.MutableBoolean;
|
||||||
import org.bukkit.Effect;
|
import org.bukkit.Effect;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
|
|
||||||
@ -89,14 +90,14 @@ public class SmokeUtil
|
|||||||
fakeExplosion(location, 4F);
|
fakeExplosion(location, 4F);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Boolean fakeExplosion = false;
|
public static MutableBoolean fakeExplosion = new MutableBoolean(false);
|
||||||
public static void fakeExplosion(Location location, float power)
|
public static void fakeExplosion(Location location, float power)
|
||||||
{
|
{
|
||||||
synchronized (fakeExplosion)
|
synchronized (fakeExplosion)
|
||||||
{
|
{
|
||||||
fakeExplosion = true;
|
fakeExplosion.setValue(true);
|
||||||
location.getWorld().createExplosion(location.getX(), location.getY(), location.getZ(), power, false, false);
|
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;
|
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