Add new switch conditions to entity listeners

This commit is contained in:
MattBDev 2019-08-23 15:57:57 -04:00
parent 267dea4693
commit a0d666ae14

View File

@ -118,6 +118,7 @@ import java.util.regex.Pattern;
case SPECTRAL_ARROW:
case SPLASH_POTION:
case THROWN_EXP_BOTTLE:
case TRIDENT:
// projectile
case FALLING_BLOCK:
case PRIMED_TNT:
@ -180,6 +181,7 @@ import java.util.regex.Pattern;
case VILLAGER:
case WOLF:
case ZOMBIE_HORSE:
case WANDERING_TRADER:
// animal
return EntityUtil
.checkEntity(plot, Flags.ENTITY_CAP, Flags.MOB_CAP, Flags.ANIMAL_CAP);
@ -2162,8 +2164,16 @@ import java.util.regex.Pattern;
}
break;
case REINFORCEMENTS:
case VILLAGE_DEFENSE:
case VILLAGE_INVASION:
case NATURAL:
case CHUNK_GEN:
case SILVERFISH_BLOCK:
case ENDER_PEARL:
case DROWNED:
case CURED:
case DEFAULT:
case LIGHTNING:
if (!area.MOB_SPAWNING) {
event.setCancelled(true);
return;
@ -2268,16 +2278,7 @@ import java.util.regex.Pattern;
Entity ignitingEntity = event.getIgnitingEntity();
Block block = event.getBlock();
BlockIgniteEvent.IgniteCause igniteCause = event.getCause();
Location location1;
if (block != null) {
location1 = BukkitUtil.getLocation(block.getLocation());
} else if (ignitingEntity != null) {
location1 = BukkitUtil.getLocation(ignitingEntity);
} else if (player != null) {
location1 = BukkitUtil.getLocation(player);
} else {
return;
}
Location location1 = BukkitUtil.getLocation(block.getLocation());
PlotArea area = location1.getPlotArea();
if (area == null) {
return;