Paper/patches/server/0775-Fix-cancelled-powdered-snow-bucket-placement.patch
Nassim Jahnke 4af62f6d1d
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:
2d009e64 Update SnakeYAML javadoc link
b4fd213c Switch Player#updateInventory deprecation for internal API annotation

CraftBukkit Changes:
f3b2b2210 SPIGOT-7376: Exception with getBlockData when hasBlockData is false
725545630 SPIGOT-7375: Fix crash breeding certain entities
b9873b0d4 Update Brigadier version with fix
68b320562 SPIGOT-7266: Found typo in CraftBukkit package
98b4d2ff8 SPIGOT-7372, SPIGOT-7373: Signs can't be edited, issues with SignChangeEvent
5f7bd4d78 SPIGOT-7371: Sign does not open edit text on placement
b4cf99d24 SPIGOT-7371: Fix editing signs with API
a2b6c2744 PR-1200: Implement open sign by side
a345bb940 SPIGOT-7368: Downgrade SpecialSource version

Spigot Changes:
723951c3 Rebuild patches
b655c57d Drop old collision API deprecated since 1.9.4
55b0fed4 Rebuild patches
2023-06-08 15:25:35 +02:00

44 lines
3.0 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Fri, 8 Oct 2021 13:12:58 -0700
Subject: [PATCH] Fix cancelled powdered snow bucket placement
Cancelling the placement of powdered snow from the powdered
snow bucket didn't revert grass that became snowy because of the
placement.
diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java
index e581dc10f3c805f7f8b6e4c842092609e7e1a0f8..b0204af850ee182773ad458208cccd946ad148d5 100644
--- a/src/main/java/net/minecraft/world/item/BlockItem.java
+++ b/src/main/java/net/minecraft/world/item/BlockItem.java
@@ -117,6 +117,7 @@ public class BlockItem extends Item {
blockstate.update(true, false);
if (this instanceof SolidBucketItem) {
+ ((ServerPlayer) entityhuman).connection.send(new net.minecraft.network.protocol.game.ClientboundBlockUpdatePacket(world, blockposition.below())); // Paper - update block below
((ServerPlayer) entityhuman).getBukkitEntity().updateInventory(); // SPIGOT-4541
}
return InteractionResult.FAIL;
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index 9e7357c65c36da9cad2f4492dacfc60af2a1af70..6b9924652ef3cb3b26042155b05df3458b2a25ab 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -352,7 +352,7 @@ public final class ItemStack {
int oldCount = this.getCount();
ServerLevel world = (ServerLevel) itemactioncontext.getLevel();
- if (!(this.getItem() instanceof BucketItem || this.getItem() instanceof SolidBucketItem)) { // if not bucket
+ if (!(this.getItem() instanceof BucketItem/* || this.getItem() instanceof SolidBucketItem*/)) { // if not bucket // Paper - capture block states for snow buckets
world.captureBlockStates = true;
// special case bonemeal
if (this.getItem() == Items.BONE_MEAL) {
@@ -407,7 +407,7 @@ public final class ItemStack {
world.capturedBlockStates.clear();
if (blocks.size() > 1) {
placeEvent = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockMultiPlaceEvent(world, entityhuman, enumhand, blocks, blockposition.getX(), blockposition.getY(), blockposition.getZ());
- } else if (blocks.size() == 1) {
+ } else if (blocks.size() == 1 && item != Items.POWDER_SNOW_BUCKET) { // Paper - don't call event twice for snow buckets
placeEvent = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPlaceEvent(world, entityhuman, enumhand, blocks.get(0), blockposition.getX(), blockposition.getY(), blockposition.getZ());
}