Fixed: Исправлен эвент взрыва от взрывов иннера
This commit is contained in:
@@ -187,14 +187,10 @@ public class BlockSourceMethods {
|
||||
|
||||
public static void explode(Level level, float x, float y, float z, float power, boolean fire) {
|
||||
final Block block = level.getBlock((int) x, (int) y, (int) z);
|
||||
final BlockExplosionPrimeEvent event = new BlockExplosionPrimeEvent(block, power, 0d);
|
||||
final BlockExplosionPrimeEvent event = new BlockExplosionPrimeEvent(block, power, fire ? .4 : 0d);
|
||||
event.setIncendiary(fire);
|
||||
|
||||
synchronized (EventListener.DEALING_LOCK) {
|
||||
EventListener.dealingEvent = event;
|
||||
Server.getInstance().getPluginManager().callEvent(event);
|
||||
EventListener.dealingEvent = null;
|
||||
}
|
||||
Server.getInstance().getPluginManager().callEvent(event);
|
||||
|
||||
if (event.isCancelled()) {
|
||||
return;
|
||||
|
||||
@@ -104,6 +104,11 @@ public class Updatable {
|
||||
private Context currentContext = null;
|
||||
|
||||
private void executeUpdateWithContext(Context ctx, ScriptableObject obj) {
|
||||
if(shouldBeRemoved(obj)){
|
||||
postedRemovedUpdatables.add(obj);
|
||||
return;
|
||||
}
|
||||
|
||||
Object _update = obj.get("update", obj);
|
||||
try {
|
||||
Function update = (Function) _update;
|
||||
@@ -125,10 +130,6 @@ public class Updatable {
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (shouldBeRemoved(obj)) {
|
||||
postedRemovedUpdatables.add(obj);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean executeUpdate(ScriptableObject obj) {
|
||||
@@ -141,7 +142,9 @@ public class Updatable {
|
||||
TickExecutor.getInstance().execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
executeUpdateWithContext(Compiler.assureContextForCurrentThread(), obj);
|
||||
synchronized (obj) {
|
||||
executeUpdateWithContext(Compiler.assureContextForCurrentThread(), obj);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user