mirror of
https://github.com/craftaro/EpicSpawners.git
synced 2025-01-08 11:37:51 +08:00
Fixes a bug where spawners wouldn't properly spawn
Carelessly introduced by a stupid person in 55a9d27970
This commit is contained in:
parent
6286f72391
commit
6fa7dc796f
@ -36,30 +36,30 @@ public class SpawnerSpawnTask extends BukkitRunnable {
|
||||
try {
|
||||
if (spawner.getWorld() == null
|
||||
|| plugin.getBlacklistHandler().isBlacklisted(spawner.getWorld())
|
||||
|| !spawner.getWorld().isChunkLoaded(spawner.getX() >> 4, spawner.getZ() >> 4)) return;
|
||||
|| !spawner.getWorld().isChunkLoaded(spawner.getX() >> 4, spawner.getZ() >> 4)) continue;
|
||||
|
||||
if (spawner.getLocation().getBlock().getType() != CompatibleMaterial.SPAWNER.getMaterial()
|
||||
|| !spawner.isValid()) {
|
||||
spawner.destroy(plugin);
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (spawner.getStackSize() == 0
|
||||
|| (spawner.getPlacedBy() == null && Settings.DISABLE_NATURAL_SPAWNERS.getBoolean())
|
||||
|| !spawner.checkConditions()) return;
|
||||
|| !spawner.checkConditions()) continue;
|
||||
|
||||
CreatureSpawner cSpawner = spawner.getCreatureSpawner();
|
||||
if (cSpawner == null) return;
|
||||
if (cSpawner == null) continue;
|
||||
int delay = spawner.getCreatureSpawner().getDelay();
|
||||
delay = delay - Settings.CUSTOM_SPAWNER_TICK_RATE.getInt();
|
||||
spawner.getCreatureSpawner().setDelay(delay);
|
||||
if (delay >= 0) return;
|
||||
if (delay >= 0) continue;
|
||||
|
||||
if (!spawner.spawn()) {
|
||||
spawner.updateDelay();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user