From fa8b18f3d5c2099f95cdd584bcf3926118484484 Mon Sep 17 00:00:00 2001 From: MattBDev <4009945+MattBDev@users.noreply.github.com> Date: Fri, 23 Aug 2019 15:57:57 -0400 Subject: [PATCH] Add new switch conditions to entity spawning --- .../bukkit/listeners/PlayerEvents.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java index 3ecc572db..291d4ecca 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/listeners/PlayerEvents.java @@ -2162,8 +2162,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 +2276,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;