PaperMC/patches/server/0818-Fix-fluid-logging-on-Block-breakNaturally.patch
Nassim Jahnke 1cfd363d32
Updated Upstream (Bukkit/CraftBukkit/Spigot)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
fc460d1b PR-735: Add Villager#zombify
c8c8331e PR-690: Add method to read ItemStack input
62845f2f SPIGOT-6829: Add per-player world border API

CraftBukkit Changes:
a459f4d4 PR-1033: Add Villager#zombify
d65d1430 PR-975: Add method to read ItemStack input
b5559f8c SPIGOT-6990: Fix setRepairCost(0) in Anvil
6c308e1b SPIGOT-6829: Add per-player world border API

Spigot Changes:
42b61526 SPIGOT-7000: Generation and /locate issues when using custom structure seeds
2022-04-16 10:29:50 +02:00

29 lines
1.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Tue, 21 Dec 2021 16:28:17 -0800
Subject: [PATCH] Fix fluid-logging on Block#breakNaturally
Leaves fluid if the block broken was fluid-logged which is what
happens if a player breaks a fluid-logged block
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
index 0b2e33fb16f832e0ddfe5e39a8a16caf98521098..68eaae018646c541c8553ded80c5cafdfc5ae63f 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
@@ -515,6 +515,7 @@ public class CraftBlock implements Block {
net.minecraft.world.level.block.state.BlockState iblockdata = this.getNMS();
net.minecraft.world.level.block.Block block = iblockdata.getBlock();
net.minecraft.world.item.ItemStack nmsItem = CraftItemStack.asNMSCopy(item);
+ net.minecraft.world.level.material.FluidState fluidState = this.world.getFluidState(this.position); // Paper
boolean result = false;
// Modelled off EntityHuman#hasBlock
@@ -525,7 +526,7 @@ public class CraftBlock implements Block {
}
// SPIGOT-6778: Directly call setBlock instead of setTypeAndData, so that the tile entiy is not removed and custom remove logic is run.
- return this.world.setBlock(position, Blocks.AIR.defaultBlockState(), 3) && result;
+ return this.world.setBlock(position, fluidState.createLegacyBlock(), 3) && result; // Paper - leave liquid if waterlogged
}
@Override