mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-30 06:24:06 +01:00
ef0e5a642d
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: 9ae3f10f SPIGOT-3842: Add Player#fireworkBoost() and expand Firework API 48c0c547 PR-786: Add methods to get sounds from entities CraftBukkit Changes: 5cc9c022a SPIGOT-7152: Handle hand item changing during air interact event 4ffa1acf6 SPIGOT-7154: Players get kicked when interacting with a conversation 4daa21123 SPIGOT-3842: Add Player#fireworkBoost() and expand Firework API e5d6a9bbf PR-1100: Add methods to get sounds from entities b7e9f1c8b SPIGOT-7146: Reduce use of Material switch in ItemMeta Spigot Changes: 4c157bb4 Rebuild patches
30 lines
1.6 KiB
Diff
30 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 2881bcb570dc86a7602309e1f540ecd1c7f00284..0030ac394d44acddcd2fc716277ae2b509a378af 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
|