mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2024-11-07 03:00:29 +01:00
1.10- support for natural spawning disable
This commit is contained in:
parent
d4a9e5ab84
commit
70374c7a7c
@ -674,8 +674,13 @@ public class Entity implements Listener {
|
|||||||
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) {
|
if (event.getSpawnReason() == SpawnReason.JOCKEY || event.getSpawnReason() == SpawnReason.MOUNT) {
|
||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(skyblock, () -> {
|
Bukkit.getScheduler().scheduleSyncDelayedTask(skyblock, () -> {
|
||||||
|
if (NMSUtil.getVersionNumber() > 10) { // getPassengers() was added in 1.11
|
||||||
for (org.bukkit.entity.Entity passenger : livingEntity.getPassengers())
|
for (org.bukkit.entity.Entity passenger : livingEntity.getPassengers())
|
||||||
passenger.remove();
|
passenger.remove();
|
||||||
|
} else {
|
||||||
|
if (livingEntity.getPassenger() != null)
|
||||||
|
livingEntity.getPassenger().remove();
|
||||||
|
}
|
||||||
livingEntity.remove();
|
livingEntity.remove();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user