mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 07:20:24 +01:00
Fix breakNaturally for fluid-logged blocks (#7134)
This commit is contained in:
parent
4bf1124114
commit
a6dba1dac6
1 changed files with 29 additions and 0 deletions
|
@ -0,0 +1,29 @@
|
|||
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
||||
@@ -0,0 +0,0 @@ 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
|
||||
@@ -0,0 +0,0 @@ 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
|
Loading…
Reference in a new issue