Paper/Spigot-Server-Patches/0426-Optimize-call-to-getFluid-for-explosions.patch

23 Zeilen
1.1 KiB
Diff

2020-01-20 17:04:39 +01:00
From aeabd8ac2eedc092054b266c0cb9af1b7c530ea9 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/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java
2020-01-18 18:58:05 +01:00
index 8762a566d..3fd4c12b1 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());
--
2020-01-18 18:58:05 +01:00
2.25.0