mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-04 06:34:42 +02:00
Entity#getEntitySpawnReason compatibility for spigot (#4305)
chore: Entity#getEntitySpawnReason compatibility for spigot
This commit is contained in:

committed by
GitHub

parent
966c878a72
commit
448577774a
@ -779,8 +779,11 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
||||
Iterator<Entity> iterator = entities.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
Entity entity = iterator.next();
|
||||
final String spawnReason = entity.getEntitySpawnReason().name();
|
||||
if ("CUSTOM".equals(spawnReason)) {
|
||||
if (PaperLib.isPaper() && "CUSTOM".equals(entity.getEntitySpawnReason().name())) {
|
||||
continue;
|
||||
}
|
||||
// Fallback for Spigot not having Entity#getEntitySpawnReason
|
||||
if (entity.getMetadata("ps_custom_spawned").stream().anyMatch(MetadataValue::asBoolean)) {
|
||||
continue;
|
||||
}
|
||||
switch (entity.getType().toString()) {
|
||||
|
Reference in New Issue
Block a user