3
0

Limit TNT detonations per world per tick

This commit is contained in:
Sergey Shatunov
2016-01-05 14:20:01 +07:00
parent 0aad7977fc
commit 0011dd0d9a
4 changed files with 47 additions and 17 deletions

View File

@ -16,7 +16,15 @@
public EntityTNTPrimed(World p_i1729_1_)
{
@@ -68,12 +72,14 @@
@@ -50,6 +54,7 @@
public void onUpdate()
{
+ if (worldObj.spigotConfig.currentPrimedTnt++ > worldObj.spigotConfig.maxTntTicksPerTick) { return; } // Spigot
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
@@ -68,12 +73,14 @@
if (this.fuse-- <= 0)
{
@ -33,7 +41,7 @@
}
else
{
@@ -83,8 +89,19 @@
@@ -83,8 +90,19 @@
private void explode()
{
@ -55,7 +63,7 @@
}
protected void writeEntityToNBT(NBTTagCompound p_70014_1_)
@@ -107,4 +124,11 @@
@@ -107,4 +125,11 @@
{
return this.tntPlacedBy;
}