Setting for disabling the physics limiter

This commit is contained in:
Jesse Boyd 2016-09-26 14:05:58 +10:00
parent 9e6c90430d
commit 50504a0fe5
2 changed files with 14 additions and 10 deletions

View File

@ -13,6 +13,7 @@ import org.bukkit.event.entity.ItemSpawnEvent;
public class ChunkListener implements Listener { public class ChunkListener implements Listener {
public ChunkListener() { public ChunkListener() {
if (Settings.TICK_LIMITER.ENABLED) {
Bukkit.getPluginManager().registerEvents(ChunkListener.this, Fawe.<FaweBukkit>imp().getPlugin()); Bukkit.getPluginManager().registerEvents(ChunkListener.this, Fawe.<FaweBukkit>imp().getPlugin());
TaskManager.IMP.repeat(new Runnable() { TaskManager.IMP.repeat(new Runnable() {
@Override @Override
@ -24,6 +25,7 @@ public class ChunkListener implements Listener {
} }
}, 1); }, 1);
} }
}
private int physicsLimit = Integer.MAX_VALUE; private int physicsLimit = Integer.MAX_VALUE;
private int itemLimit = Integer.MAX_VALUE; private int itemLimit = Integer.MAX_VALUE;

View File

@ -230,6 +230,8 @@ public class Settings extends Config {
@Comment("Generic tick limiter (not necessarily WorldEdit related, but still useful)") @Comment("Generic tick limiter (not necessarily WorldEdit related, but still useful)")
public static class TICK_LIMITER { public static class TICK_LIMITER {
@Comment("Enable the limiter")
public static boolean ENABLED = true;
@Comment("Max physics per tick") @Comment("Max physics per tick")
public static int PHYSICS = 500000; public static int PHYSICS = 500000;
@Comment("Max item spawns per tick") @Comment("Max item spawns per tick")