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:
@@ -21,7 +21,15 @@
|
||||
|
||||
public PrimedTnt(EntityType<? extends PrimedTnt> type, Level world) {
|
||||
super(type, world);
|
||||
@@ -107,10 +114,13 @@
|
||||
@@ -94,6 +101,7 @@
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
+ if (this.level().spigotConfig.maxTntTicksPerTick > 0 && ++this.level().spigotConfig.currentPrimedTnt > this.level().spigotConfig.maxTntTicksPerTick) { return; } // Spigot
|
||||
this.handlePortal();
|
||||
this.applyGravity();
|
||||
this.move(MoverType.SELF, this.getDeltaMovement());
|
||||
@@ -107,10 +115,13 @@
|
||||
|
||||
this.setFuse(i);
|
||||
if (i <= 0) {
|
||||
@@ -36,7 +44,7 @@
|
||||
} else {
|
||||
this.updateInWaterStateAndDoFluidPushing();
|
||||
if (this.level().isClientSide) {
|
||||
@@ -121,7 +131,13 @@
|
||||
@@ -121,7 +132,13 @@
|
||||
}
|
||||
|
||||
private void explode() {
|
||||
|
||||
Reference in New Issue
Block a user