2015-02-22 06:43:08 +00:00
|
|
|
From 01e10685a9d781cec3a70951baa46b907202a29a Mon Sep 17 00:00:00 2001
|
2014-08-08 04:04:58 +00:00
|
|
|
From: Jedediah Smith <jedediah@silencegreys.com>
|
2014-11-28 01:17:45 +00:00
|
|
|
Date: Fri, 28 Nov 2014 02:36:18 -0600
|
2014-08-08 04:04:58 +00:00
|
|
|
Subject: [PATCH] Center TNT grid sample points
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
2015-02-22 06:43:08 +00:00
|
|
|
index ba37e02..22a8b59 100644
|
2014-08-08 04:04:58 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/World.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/World.java
|
2015-02-22 06:43:08 +00:00
|
|
|
@@ -1875,6 +1875,12 @@ public abstract class World implements IBlockAccess {
|
2014-08-08 04:04:58 +00:00
|
|
|
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 - Center TNT sample points for more accurate calculations
|
|
|
|
+ // Shift the sample points so they are centered on the BB
|
|
|
|
+ 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;
|
2015-02-22 06:43:08 +00:00
|
|
|
@@ -1886,7 +1892,7 @@ public abstract class World implements IBlockAccess {
|
2014-08-08 04:04:58 +00:00
|
|
|
double d4 = axisalignedbb.b + (axisalignedbb.e - axisalignedbb.b) * (double) f1;
|
|
|
|
double d5 = axisalignedbb.c + (axisalignedbb.f - axisalignedbb.c) * (double) f2;
|
|
|
|
|
2014-11-28 01:17:45 +00:00
|
|
|
- if (this.rayTrace(new Vec3D(d3, d4, d5), vec3d) == null) {
|
|
|
|
+ if (this.rayTrace(new Vec3D(xOffset, d4, zOffset + d5), vec3d) == null) { // PaperSpigot - Center TNT sample points
|
2014-08-08 04:04:58 +00:00
|
|
|
++i;
|
|
|
|
}
|
|
|
|
|
|
|
|
--
|
2015-01-29 21:26:20 +00:00
|
|
|
1.9.5.msysgit.0
|
2014-08-08 04:04:58 +00:00
|
|
|
|