From 5c711db6f19cec4d683040255080e747bc40a517 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Fri, 11 Jul 2014 03:56:02 -0500 Subject: [PATCH] Restore our earlier and simpler TNT direction bias fix --- .../0016-Fix-directional-TNT-bias.patch | 49 ++++++++----------- .../0024-Fix-Null-Tile-Entity-Worlds.patch | 6 +-- 2 files changed, 24 insertions(+), 31 deletions(-) diff --git a/CraftBukkit-Patches/0016-Fix-directional-TNT-bias.patch b/CraftBukkit-Patches/0016-Fix-directional-TNT-bias.patch index 5b15642ee7..9b1c30ea85 100644 --- a/CraftBukkit-Patches/0016-Fix-directional-TNT-bias.patch +++ b/CraftBukkit-Patches/0016-Fix-directional-TNT-bias.patch @@ -1,35 +1,28 @@ -From 0ea448246573309b06011437399cb3f3131a9ef2 Mon Sep 17 00:00:00 2001 -From: Jedediah Smith -Date: Mon, 10 Mar 2014 16:18:41 -0400 +From d1eae4fe305647704d12c5255409839d1293f260 Mon Sep 17 00:00:00 2001 +From: Zach Brown +Date: Fri, 11 Jul 2014 03:54:06 -0500 Subject: [PATCH] Fix directional TNT bias -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 9741e94..62b732d 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -1896,6 +1896,12 @@ 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 -+ // Shift the sample points so they are centered on the BB, to avoid 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; -@@ -1908,7 +1914,7 @@ 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.a(vec3d2.b(d3, d4, d5), vec3d) == null) { // CraftBukkit -+ if (this.a(vec3d2.b(xOffset + d3, d4, zOffset + d5), vec3d) == null) { // PaperSpigot // CraftBukkit - ++i; - } +diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java +index 13cbc79..c7646fb 100644 +--- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java ++++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java +@@ -19,11 +19,11 @@ public class EntityTNTPrimed extends Entity { + public EntityTNTPrimed(World world, double d0, double d1, double d2, EntityLiving entityliving) { + this(world); + this.setPosition(d0, d1, d2); +- float f = (float) (Math.random() * 3.1415927410125732D * 2.0D); ++ //float f = (float) (Math.random() * 3.1415927410125732D * 2.0D); // PaperSpigot - Fix directional TNT bias +- this.motX = (double) (-((float) Math.sin((double) f)) * 0.02F); ++ this.motX = 0; // PaperSpigot - Fix directional TNT bias //(double) (-((float) Math.sin((double) f)) * 0.02F); + this.motY = 0.20000000298023224D; +- this.motZ = (double) (-((float) Math.cos((double) f)) * 0.02F); ++ this.motZ = 0; // PaperSpigot - Fix directional TNT bias //(double) (-((float) Math.cos((double) f)) * 0.02F); + this.fuseTicks = 80; + this.lastX = d0; + this.lastY = d1; -- 1.9.1 diff --git a/CraftBukkit-Patches/0024-Fix-Null-Tile-Entity-Worlds.patch b/CraftBukkit-Patches/0024-Fix-Null-Tile-Entity-Worlds.patch index e7d637ec96..5635aaa024 100644 --- a/CraftBukkit-Patches/0024-Fix-Null-Tile-Entity-Worlds.patch +++ b/CraftBukkit-Patches/0024-Fix-Null-Tile-Entity-Worlds.patch @@ -1,14 +1,14 @@ -From 1f6ae06ada4f1d1e0b09d23ee917fd1d38df9ea1 Mon Sep 17 00:00:00 2001 +From eac2a0329174b6438545cb174e7a716ea046be0d Mon Sep 17 00:00:00 2001 From: "Evan A. Haskell" Date: Thu, 26 Jun 2014 18:37:29 -0400 Subject: [PATCH] Fix Null Tile Entity Worlds diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index f722db5..94b785e 100644 +index 9770cf0..57dd556 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -2021,6 +2021,7 @@ public abstract class World implements IBlockAccess { +@@ -2015,6 +2015,7 @@ public abstract class World implements IBlockAccess { } }