2022-02-12 14:56:27 +01:00
|
|
|
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
|
2022-12-07 22:35:34 +01:00
|
|
|
index e581dc10f3c805f7f8b6e4c842092609e7e1a0f8..b0204af850ee182773ad458208cccd946ad148d5 100644
|
2022-02-12 14:56:27 +01:00
|
|
|
--- a/src/main/java/net/minecraft/world/item/BlockItem.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/item/BlockItem.java
|
2022-12-07 22:35:34 +01:00
|
|
|
@@ -117,6 +117,7 @@ public class BlockItem extends Item {
|
2022-02-12 14:56:27 +01:00
|
|
|
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
|
2023-08-06 02:21:59 +02:00
|
|
|
index afbf619feb35751046131e7b22791e789d16427f..f62585f3112886c927f1f65f982b9db9194457e9 100644
|
2022-02-12 14:56:27 +01:00
|
|
|
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
2023-08-06 02:21:59 +02:00
|
|
|
@@ -353,7 +353,7 @@ public final class ItemStack {
|
2022-02-12 14:56:27 +01:00
|
|
|
int oldCount = this.getCount();
|
2023-07-04 10:22:56 +02:00
|
|
|
ServerLevel world = (ServerLevel) context.getLevel();
|
2022-02-12 14:56:27 +01:00
|
|
|
|
2023-08-06 02:21:59 +02:00
|
|
|
- if (!(item instanceof BucketItem || item instanceof SolidBucketItem)) { // if not bucket
|
|
|
|
+ if (!(item instanceof BucketItem/* || item instanceof SolidBucketItem*/)) { // if not bucket // Paper - capture block states for snow buckets
|
2022-02-12 14:56:27 +01:00
|
|
|
world.captureBlockStates = true;
|
|
|
|
// special case bonemeal
|
2023-08-06 02:21:59 +02:00
|
|
|
if (item == Items.BONE_MEAL) {
|
|
|
|
@@ -412,7 +412,7 @@ public final class ItemStack {
|
2022-02-12 14:56:27 +01:00
|
|
|
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());
|
|
|
|
}
|
|
|
|
|