mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2025-02-11 09:11:21 +01:00
Fix spider jockeys spawning skeletons even if natural spawning disabled
This commit is contained in:
parent
662c248656
commit
d4a9e5ab84
@ -662,7 +662,7 @@ public class Entity implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.getSpawnReason() != SpawnReason.NATURAL)
|
if (!(event.getSpawnReason() == SpawnReason.NATURAL || event.getSpawnReason() == SpawnReason.JOCKEY || event.getSpawnReason() == SpawnReason.MOUNT))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
LivingEntity livingEntity = event.getEntity();
|
LivingEntity livingEntity = event.getEntity();
|
||||||
@ -672,8 +672,16 @@ public class Entity implements Listener {
|
|||||||
|
|
||||||
if (skyblock.getWorldManager().isIslandWorld(livingEntity.getWorld())) {
|
if (skyblock.getWorldManager().isIslandWorld(livingEntity.getWorld())) {
|
||||||
if (!skyblock.getIslandManager().hasSetting(livingEntity.getLocation(), IslandRole.Owner, "NaturalMobSpawning")) {
|
if (!skyblock.getIslandManager().hasSetting(livingEntity.getLocation(), IslandRole.Owner, "NaturalMobSpawning")) {
|
||||||
|
if (event.getSpawnReason() == SpawnReason.JOCKEY || event.getSpawnReason() == SpawnReason.MOUNT) {
|
||||||
|
Bukkit.getScheduler().scheduleSyncDelayedTask(skyblock, () -> {
|
||||||
|
for (org.bukkit.entity.Entity passenger : livingEntity.getPassengers())
|
||||||
|
passenger.remove();
|
||||||
|
livingEntity.remove();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
livingEntity.remove();
|
livingEntity.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user