Paper/Spigot-Server-Patches/0025-Configurable-nerf-for-TNT-cannons.patch
Zach Brown 4aef5602d5 Update from upstream SpigotMC
Remove defensive copy in EAR SpigotMC/Spigot@f1ba1f6c07
Make "moved wrongly limit" configurable SpigotMC/Spigot@f7ab380e16
Fix null Tile Entity Worlds (we already had this) SpigotMC/Spigot@b271cdbfa0
Fix slow tab complete for some commands SpigotMC/Spigot@f3b7952c73
Only suggest ops to deop and remove whitelist add case entirely SpigotMC/Spigot@0e1fcfbe70
Allow tab complete for /whitelist add SpigotMC/Spigot@27f8aa22bd
2014-07-22 15:25:09 -05:00

50 lines
1.9 KiB
Diff

From 7157550a84f45bb3e4d87f417585e46699aacf2a Mon Sep 17 00:00:00 2001
From: Zach Brown <Zbob750@live.com>
Date: Wed, 9 Jul 2014 17:38:48 -0500
Subject: [PATCH] Configurable nerf for TNT cannons
diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
index 8ca4300..3be3d98 100644
--- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java
+++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
@@ -1,6 +1,7 @@
package net.minecraft.server;
import org.bukkit.event.entity.ExplosionPrimeEvent; // CraftBukkit
+import org.github.paperspigot.PaperSpigotWorldConfig;
public class EntityTNTPrimed extends Entity {
@@ -56,6 +57,12 @@ public class EntityTNTPrimed extends Entity {
this.motY *= -0.5D;
}
+ // PaperSpigot start - Configurable nerf for TNT cannons
+ if (this.locY > PaperSpigotWorldConfig.tntHeightNerf && PaperSpigotWorldConfig.tntHeightNerf != 0) {
+ this.die();
+ }
+ // PaperSpigot end
+
if (this.fuseTicks-- <= 0) {
// CraftBukkit start - Need to reverse the order of the explosion and the entity death so we have a location for the event
if (!this.world.isStatic) {
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
index 39bbd62..0d388af 100644
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
@@ -169,4 +169,10 @@ public class PaperSpigotWorldConfig
keepSpawnInMemory = getBoolean( "keep-spawn-loaded", true );
log( "Keep spawn chunk loaded: " + keepSpawnInMemory );
}
+
+ public static double tntHeightNerf;
+ private void tntHeightNerf()
+ {
+ tntHeightNerf = getDouble( "tnt-entity-height-nerf", 0 );
+ }
}
--
1.9.1