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_DAMAGE", Priority.High);
|
||||||
registerEvent("ENTITY_COMBUST", Priority.High);
|
registerEvent("ENTITY_COMBUST", Priority.High);
|
||||||
registerEvent("ENTITY_EXPLODE", Priority.High);
|
registerEvent("ENTITY_EXPLODE", Priority.High);
|
||||||
registerEvent("ENTITY_PRIME", Priority.High);
|
registerEvent("EXPLOSION_PRIME", Priority.High);
|
||||||
registerEvent("CREATURE_SPAWN", Priority.High);
|
registerEvent("CREATURE_SPAWN", Priority.High);
|
||||||
registerEvent("ENTITY_INTERACT", Priority.High);
|
registerEvent("ENTITY_INTERACT", Priority.High);
|
||||||
registerEvent("CREEPER_POWER", Priority.High);
|
registerEvent("CREEPER_POWER", Priority.High);
|
||||||
@ -464,6 +464,12 @@ public void onEntityExplode(EntityExplodeEvent event) {
|
|||||||
WorldConfiguration wcfg = cfg.get(world);
|
WorldConfiguration wcfg = cfg.get(world);
|
||||||
Entity ent = event.getEntity();
|
Entity ent = event.getEntity();
|
||||||
|
|
||||||
|
if (cfg.activityHaltToggle) {
|
||||||
|
ent.remove();
|
||||||
|
event.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (ent instanceof LivingEntity) {
|
if (ent instanceof LivingEntity) {
|
||||||
if (wcfg.blockCreeperBlockDamage) {
|
if (wcfg.blockCreeperBlockDamage) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
@ -485,12 +491,6 @@ public void onEntityExplode(EntityExplodeEvent event) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (ent instanceof TNTPrimed) {
|
} else if (ent instanceof TNTPrimed) {
|
||||||
if (cfg.activityHaltToggle) {
|
|
||||||
ent.remove();
|
|
||||||
event.setCancelled(true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (wcfg.blockTNT) {
|
if (wcfg.blockTNT) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
@ -540,12 +540,21 @@ public void onExplosionPrime(ExplosionPrimeEvent event) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logger.info("PRIME");
|
||||||
|
|
||||||
ConfigurationManager cfg = plugin.getGlobalStateManager();
|
ConfigurationManager cfg = plugin.getGlobalStateManager();
|
||||||
Location l = event.getEntity().getLocation();
|
Location l = event.getEntity().getLocation();
|
||||||
World world = l.getWorld();
|
World world = l.getWorld();
|
||||||
WorldConfiguration wcfg = cfg.get(world);
|
WorldConfiguration wcfg = cfg.get(world);
|
||||||
Entity ent = event.getEntity();
|
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 (ent instanceof Fireball) {
|
||||||
if (wcfg.blockFireballBlockDamage) {
|
if (wcfg.blockFireballBlockDamage) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
Loading…
Reference in New Issue
Block a user