Add extra SpawnReasons to spawn listener

This commit is contained in:
dordsor21 2020-04-30 17:00:35 +01:00
parent 135c6f2c15
commit 17698065a0

View File

@ -2024,8 +2024,6 @@ public class PlayerEvents extends PlotListener implements Listener {
return; return;
} }
CreatureSpawnEvent.SpawnReason reason = event.getSpawnReason(); CreatureSpawnEvent.SpawnReason reason = event.getSpawnReason();
//TODO needs an overhaul for the increased number of spawn reasons added to this event.
//I can't believe they waited so damn long to expand this API set.
switch (reason) { switch (reason) {
case DISPENSE_EGG: case DISPENSE_EGG:
case EGG: case EGG:
@ -2038,6 +2036,16 @@ public class PlayerEvents extends PlotListener implements Listener {
break; break;
case REINFORCEMENTS: case REINFORCEMENTS:
case NATURAL: case NATURAL:
case MOUNT:
case PATROL:
case RAID:
case SHEARED:
case SHOULDER_ENTITY:
case SILVERFISH_BLOCK:
case TRAP:
case VILLAGE_DEFENSE:
case VILLAGE_INVASION:
case BEEHIVE:
case CHUNK_GEN: case CHUNK_GEN:
if (!area.isMobSpawning()) { if (!area.isMobSpawning()) {
event.setCancelled(true); event.setCancelled(true);