diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java b/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java index 6f27e1b10..8aa3fb7c0 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java @@ -779,7 +779,8 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl Iterator iterator = entities.iterator(); while (iterator.hasNext()) { Entity entity = iterator.next(); - if (PaperLib.isPaper() && "CUSTOM".equals(entity.getEntitySpawnReason().name())) { + //noinspection ConstantValue - getEntitySpawnReason annotated as NotNull, but is not NotNull. lol. + if (PaperLib.isPaper() && entity.getEntitySpawnReason() != null && "CUSTOM".equals(entity.getEntitySpawnReason().name())) { continue; } // Fallback for Spigot not having Entity#getEntitySpawnReason diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntitySpawnListener.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntitySpawnListener.java index fc2f3a275..f1f05b653 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntitySpawnListener.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listener/EntitySpawnListener.java @@ -124,7 +124,8 @@ public class EntitySpawnListener implements Listener { return; } if (PaperLib.isPaper()) { - if (area.isSpawnCustom() && "CUSTOM".equals(entity.getEntitySpawnReason().name())) { + //noinspection ConstantValue - getEntitySpawnReason annotated as NotNull, but is not NotNull. lol. + if (area.isSpawnCustom() && entity.getEntitySpawnReason() != null && "CUSTOM".equals(entity.getEntitySpawnReason().name())) { return; } }