Limit TNT Detonations per tick

This gives a per-world control on how much TNT will be processed per-tick,
preventing a massive TNT detonation from lagging out the server.

By: Aikar <aikar@aikar.co>
This commit is contained in:
CraftBukkit/Spigot
2014-08-20 18:12:32 -04:00
parent c34736a0d2
commit d7f3ba3df3
3 changed files with 28 additions and 8 deletions

View File

@@ -356,4 +356,15 @@ public class SpigotWorldConfig
this.sprintMultiplier = (float) this.getDouble( "hunger.sprint-multiplier", 0.1 );
this.otherMultiplier = (float) this.getDouble( "hunger.other-multiplier", 0.0 );
}
public int currentPrimedTnt = 0;
public int maxTntTicksPerTick;
private void maxTntPerTick() {
if ( SpigotConfig.version < 7 )
{
this.set( "max-tnt-per-tick", 100 );
}
this.maxTntTicksPerTick = this.getInt( "max-tnt-per-tick", 100 );
this.log( "Max TNT Explosions: " + this.maxTntTicksPerTick );
}
}