3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-15 11:00:06 +01:00
Paper/Spigot-Server-Patches/0023-Center-TNT-grid-sample-points.patch

36 Zeilen
1.7 KiB
Diff

2014-11-29 20:23:36 +01:00
From fdcaa4e3ccf4baac17b16f9d7121f3794afc15a0 Mon Sep 17 00:00:00 2001
From: Jedediah Smith <jedediah@silencegreys.com>
2014-11-28 02:17:45 +01:00
Date: Fri, 28 Nov 2014 02:36:18 -0600
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
2014-11-29 20:23:36 +01:00
index df976aa..6528b89 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
2014-11-29 20:23:36 +01:00
@@ -1861,6 +1861,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 - 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;
2014-11-29 20:23:36 +01:00
@@ -1872,7 +1878,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;
2014-11-28 02:17:45 +01: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
++i;
}
--
1.9.1