mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-21 20:56:45 +01:00
Suppress errors due to failed getEntitySpawnReason implementation (#4334)
fix: suppress errors due to failed getEntitySpawnReason implementation
This commit is contained in:
parent
0de6887526
commit
d9537ee9df
@ -779,7 +779,8 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
|||||||
Iterator<Entity> iterator = entities.iterator();
|
Iterator<Entity> iterator = entities.iterator();
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
Entity entity = iterator.next();
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
// Fallback for Spigot not having Entity#getEntitySpawnReason
|
// Fallback for Spigot not having Entity#getEntitySpawnReason
|
||||||
|
@ -124,7 +124,8 @@ public class EntitySpawnListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (PaperLib.isPaper()) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user