mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-04 14:44:43 +02:00
Do not remove entitys with CUSTOM spawn-reason on CreatureSpawnEvent. (#4297)
Do not remove entitys with CUSTOM spawn-reason.
This commit is contained in:
@ -779,6 +779,10 @@ 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)) {
|
||||
continue;
|
||||
}
|
||||
switch (entity.getType().toString()) {
|
||||
case "EGG":
|
||||
case "FISHING_HOOK":
|
||||
@ -867,8 +871,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl
|
||||
if (livingEntity.isLeashed() && !Settings.Enabled_Components.KILL_OWNED_ROAD_MOBS) {
|
||||
continue;
|
||||
}
|
||||
List<MetadataValue> keep = entity.getMetadata("keep");
|
||||
if (!keep.isEmpty()) {
|
||||
if (entity.hasMetadata("keep")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user