From 2eb4908754439905f370f2700e7fd6f1acfb9045 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 --- .../net/minecraft/world/level/ServerExplosion.java.patch | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/paper-server/patches/sources/net/minecraft/world/level/ServerExplosion.java.patch b/paper-server/patches/sources/net/minecraft/world/level/ServerExplosion.java.patch index f008185fe1..cc2588d14c 100644 --- a/paper-server/patches/sources/net/minecraft/world/level/ServerExplosion.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/level/ServerExplosion.java.patch @@ -53,6 +53,15 @@ } private ExplosionDamageCalculator makeDamageCalculator(@Nullable Entity entity) { +@@ -135,7 +150,7 @@ + for (float f1 = 0.3F; f > 0.0F; f -= 0.22500001F) { + BlockPos blockposition = BlockPos.containing(d4, d5, d6); + BlockState iblockdata = this.level.getBlockState(blockposition); +- FluidState fluid = this.level.getFluidState(blockposition); ++ FluidState fluid = iblockdata.getFluidState(); // Paper - Perf: Optimize call to getFluid for explosions + + if (!this.level.isInWorldBounds(blockposition)) { + break; @@ -171,7 +186,7 @@ int l = Mth.floor(this.center.y + (double) f + 1.0D); int i1 = Mth.floor(this.center.z - (double) f - 1.0D);