Paper/patches/server-unmapped/0396-Optimize-call-to-getFluid-for-explosions.patch
2021-06-11 14:02:28 +02:00

20 lines
1.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: BrodyBeckwith <brody@beckwith.dev>
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/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
index 618cf4e0d71b4b04085807314e79a02785f8a498..a9ecc2b4da587ca3d3c99f8c8af38092a02fb572 100644
--- a/src/main/java/net/minecraft/world/level/Explosion.java
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -153,7 +153,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
Optional<Float> optional = this.l.a(this, this.world, blockposition, iblockdata, fluid);
if (optional.isPresent()) {