PaperSpigot TNT Changes
Brought our multiple TNT change patches into a single patch and configuraiton section. You /will/ need to update your configs, sorry. Adds additional configuration and features as well.
This commit is contained in:
146
Spigot-Server-Patches/PaperSpigot-TNT-Changes.patch
Normal file
146
Spigot-Server-Patches/PaperSpigot-TNT-Changes.patch
Normal file
@@ -0,0 +1,146 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Zach Brown <1254957+zachbr@users.noreply.github.com>
|
||||
Date: Mon, 23 Feb 2015 15:54:17 -0600
|
||||
Subject: [PATCH] PaperSpigot TNT Changes
|
||||
|
||||
PaperSpigot communal TNT modification patch
|
||||
Original authors for individual changes are listed w/in PaperSpigotWorldConfig
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java
|
||||
@@ -0,0 +0,0 @@ public class EntityTNTPrimed extends Entity {
|
||||
this.lastY = d1;
|
||||
this.lastZ = d2;
|
||||
this.source = entityliving;
|
||||
+
|
||||
+ // PaperSpigot start - Fix TNT directional bias
|
||||
+ if (this.world.paperSpigotConfig.fixTNTDirectionBias) {
|
||||
+ this.motX = this.motZ = 0;
|
||||
+ }
|
||||
+ // PaperSpigot end
|
||||
}
|
||||
|
||||
protected void h() {}
|
||||
@@ -0,0 +0,0 @@ public class EntityTNTPrimed extends Entity {
|
||||
}
|
||||
// PaperSpigot end
|
||||
|
||||
+ // PaperSpigot start - Configurable TNT Height Limit
|
||||
+ if (this.world.paperSpigotConfig.tntHeightLimit != 0 && this.locY > this.world.paperSpigotConfig.tntHeightLimit) {
|
||||
+ this.die();
|
||||
+ }
|
||||
+ // PaperSpigot end
|
||||
+
|
||||
this.motX *= 0.9800000190734863D;
|
||||
this.motY *= 0.9800000190734863D;
|
||||
this.motZ *= 0.9800000190734863D;
|
||||
@@ -0,0 +0,0 @@ public class EntityTNTPrimed extends Entity {
|
||||
server.getPluginManager().callEvent(event);
|
||||
|
||||
if (!event.isCancelled()) {
|
||||
- this.world.createExplosion(this, this.locX, this.locY + (double) (this.length / 2.0F), this.locZ, event.getRadius(), event.getFire(), true);
|
||||
+ // PaperSpigot start - Configurable legacy TNT explosion height
|
||||
+ double locY = this.locY;
|
||||
+
|
||||
+ if (!this.world.paperSpigotConfig.legacyTNTExplosionHeight) {
|
||||
+ locY += this.length / 2.0F;
|
||||
+ }
|
||||
+
|
||||
+ this.world.createExplosion(this, this.locX, locY, this.locZ, event.getRadius(), event.getFire(), true);
|
||||
+ // PaperSpigot end
|
||||
}
|
||||
// CraftBukkit end
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class EntityTNTPrimed extends Entity {
|
||||
public float getHeadHeight() {
|
||||
return 0.0F;
|
||||
}
|
||||
+
|
||||
+ /**
|
||||
+ * PaperSpigot - Configurable TNT water movement
|
||||
+ */
|
||||
+ @Override
|
||||
+ public boolean aK() {
|
||||
+ return world.paperSpigotConfig.tntMovesInWater;
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
|
||||
double d1 = 1.0D / ((axisalignedbb.e - axisalignedbb.b) * 2.0D + 1.0D);
|
||||
double d2 = 1.0D / ((axisalignedbb.f - axisalignedbb.c) * 2.0D + 1.0D);
|
||||
|
||||
+ // PaperSpigot start - Fix TNT directional bias
|
||||
+ double xOffset = (1.0 - Math.floor(1.0 / d0) * d0) / 2.0;
|
||||
+ double zOffset = (1.0 - Math.floor(1.0 / d2) * d2) / 2.0;
|
||||
+ // PaperSpigot end
|
||||
+
|
||||
if (d0 >= 0.0D && d1 >= 0.0D && d2 >= 0.0D) {
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
|
||||
double d4 = axisalignedbb.b + (axisalignedbb.e - axisalignedbb.b) * (double) f1;
|
||||
double d5 = axisalignedbb.c + (axisalignedbb.f - axisalignedbb.c) * (double) f2;
|
||||
|
||||
- if (this.rayTrace(new Vec3D(d3, d4, d5), vec3d) == null) {
|
||||
+ // PaperSpigot start - Fix TNT directional bias
|
||||
+ Vec3D vec3d1;
|
||||
+ if (this.paperSpigotConfig.fixTNTDirectionBias) {
|
||||
+ vec3d1 = new Vec3D(xOffset, d4, zOffset + d5);
|
||||
+ } else {
|
||||
+ vec3d1 = new Vec3D(d3, d4, d5);
|
||||
+ }
|
||||
+
|
||||
+ if (this.rayTrace(vec3d1, vec3d) == null) {
|
||||
+ // PaperSpigot end
|
||||
++i;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
|
||||
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
|
||||
@@ -0,0 +0,0 @@ public class PaperSpigotWorldConfig
|
||||
{
|
||||
netherVoidTopDamage = getBoolean( "nether-ceiling-void-damage", false );
|
||||
}
|
||||
+
|
||||
+ public boolean fixTNTDirectionBias;
|
||||
+ public boolean tntMovesInWater;
|
||||
+ public boolean legacyTNTExplosionHeight;
|
||||
+ public int tntHeightLimit;
|
||||
+ private void tntChanges()
|
||||
+ {
|
||||
+ // Original Authors: Iceee <andrew@opticgaming.tv> and Jedediah Smith <jedediah@silencegreys.com>
|
||||
+ fixTNTDirectionBias = getBoolean( "tnt-gameplay.fix-directional-bias", false );
|
||||
+ // Original Author: Byteflux <byte@byteflux.net>
|
||||
+ tntMovesInWater = getBoolean( "tnt-gameplay.moves-in-water", true );
|
||||
+ // Original Author: Byteflux <byte@byteflux.net>
|
||||
+ legacyTNTExplosionHeight = getBoolean( "tnt-gameplay.legacy-explosion-height", false );
|
||||
+ // Original Author: Somebody \o/
|
||||
+ tntHeightLimit = getInt( "tnt-gameplay.tnt-entity-height-limit", 0 );
|
||||
+
|
||||
+ log( "Fix TNT directional bias: " + fixTNTDirectionBias );
|
||||
+ log( "TNT moves in water: " + tntMovesInWater );
|
||||
+ log( "Use legacy TNT explosion height " + legacyTNTExplosionHeight );
|
||||
+ if ( tntHeightLimit != 0 ) {
|
||||
+ log( "TNT height limit set at " + tntHeightLimit );
|
||||
+ } else {
|
||||
+ log( "TNT height limit disabled" );
|
||||
+ }
|
||||
+
|
||||
+ if (PaperSpigotConfig.version < 7) {
|
||||
+ System.err.println( "==========================================" );
|
||||
+ System.err.println( " Many TNT Related Settings Have Moved " );
|
||||
+ System.err.println( " Please check your config in paper.yml! " );
|
||||
+ System.err.println( "==========================================" );
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
--
|
||||
1.9.5.msysgit.0
|
||||
|
||||
Reference in New Issue
Block a user