mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-28 05:25:20 +01:00
Made TNT blocking more aggressive. Also fixed explosion event.
This commit is contained in:
parent
bed6782a00
commit
162d53b66e
@ -76,7 +76,7 @@ public void registerEvents() {
|
||||
registerEvent("ENTITY_DAMAGE", Priority.High);
|
||||
registerEvent("ENTITY_COMBUST", Priority.High);
|
||||
registerEvent("ENTITY_EXPLODE", Priority.High);
|
||||
registerEvent("ENTITY_PRIME", Priority.High);
|
||||
registerEvent("EXPLOSION_PRIME", Priority.High);
|
||||
registerEvent("CREATURE_SPAWN", Priority.High);
|
||||
registerEvent("ENTITY_INTERACT", Priority.High);
|
||||
registerEvent("CREEPER_POWER", Priority.High);
|
||||
@ -464,6 +464,12 @@ public void onEntityExplode(EntityExplodeEvent event) {
|
||||
WorldConfiguration wcfg = cfg.get(world);
|
||||
Entity ent = event.getEntity();
|
||||
|
||||
if (cfg.activityHaltToggle) {
|
||||
ent.remove();
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ent instanceof LivingEntity) {
|
||||
if (wcfg.blockCreeperBlockDamage) {
|
||||
event.setCancelled(true);
|
||||
@ -485,12 +491,6 @@ public void onEntityExplode(EntityExplodeEvent event) {
|
||||
}
|
||||
}
|
||||
} else if (ent instanceof TNTPrimed) {
|
||||
if (cfg.activityHaltToggle) {
|
||||
ent.remove();
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (wcfg.blockTNT) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
@ -540,12 +540,21 @@ public void onExplosionPrime(ExplosionPrimeEvent event) {
|
||||
return;
|
||||
}
|
||||
|
||||
logger.info("PRIME");
|
||||
|
||||
ConfigurationManager cfg = plugin.getGlobalStateManager();
|
||||
Location l = event.getEntity().getLocation();
|
||||
World world = l.getWorld();
|
||||
WorldConfiguration wcfg = cfg.get(world);
|
||||
Entity ent = event.getEntity();
|
||||
|
||||
if (cfg.activityHaltToggle) {
|
||||
logger.info("WG Halt-Act: Blocking " + ent.getClass().getName());
|
||||
ent.remove();
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ent instanceof Fireball) {
|
||||
if (wcfg.blockFireballBlockDamage) {
|
||||
event.setCancelled(true);
|
||||
|
Loading…
Reference in New Issue
Block a user