From 5dc6bd450e00491b857994ba5d8da9ec8e8cbb8c Mon Sep 17 00:00:00 2001 From: Brody Beckwith Date: Tue, 14 Jan 2020 19:16:04 -0500 Subject: [PATCH] Optimize call to getFluid for explosions (#2859) Signed-off-by: BrodyBeckwith --- ...mize-call-to-getFluid-for-explosions.patch | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Spigot-Server-Patches/0424-Optimize-call-to-getFluid-for-explosions.patch diff --git a/Spigot-Server-Patches/0424-Optimize-call-to-getFluid-for-explosions.patch b/Spigot-Server-Patches/0424-Optimize-call-to-getFluid-for-explosions.patch new file mode 100644 index 000000000..47cb118a8 --- /dev/null +++ b/Spigot-Server-Patches/0424-Optimize-call-to-getFluid-for-explosions.patch @@ -0,0 +1,22 @@ +From f0b4cbaaa6aec911755c4211356befd1577d3a8a Mon Sep 17 00:00:00 2001 +From: BrodyBeckwith +Date: Tue, 14 Jan 2020 17:49:03 -0500 +Subject: [PATCH] Optimize call to getFluid for explosions + + +diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java +index 8762a566..3fd4c12b 100644 +--- a/src/main/java/net/minecraft/server/Explosion.java ++++ b/src/main/java/net/minecraft/server/Explosion.java +@@ -117,7 +117,7 @@ public class Explosion { + for (float f1 = 0.3F; f > 0.0F; f -= 0.22500001F) { + BlockPosition blockposition = new BlockPosition(d4, d5, d6); + IBlockData iblockdata = this.world.getType(blockposition); +- Fluid fluid = this.world.getFluid(blockposition); ++ Fluid fluid = iblockdata.getFluid(); // Paper + + if (!iblockdata.isAir() || !fluid.isEmpty()) { + float f2 = Math.max(iblockdata.getBlock().getDurability(), fluid.k()); +-- +2.20.1.windows.1 +