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/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
2024-10-23 22:52:43 +02:00
|
|
|
index 8c9ae9ac38def29ae4cd8944395e566e434d46d0..9289faebce6b1546af71aeadc6569d2595b486e0 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
|
2024-10-23 22:52:43 +02:00
|
|
|
@@ -425,7 +425,7 @@ public final class ItemStack implements DataComponentHolder {
|
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
|
2024-01-18 22:00:40 +01:00
|
|
|
+ if (!(item instanceof BucketItem/* || item instanceof SolidBucketItem*/)) { // if not bucket // Paper - Fix cancelled powdered snow bucket placement
|
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) {
|
2024-10-23 22:52:43 +02:00
|
|
|
@@ -488,7 +488,7 @@ public final class ItemStack implements DataComponentHolder {
|
|
|
|
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) {
|
2024-01-18 22:00:40 +01:00
|
|
|
+ } else if (blocks.size() == 1 && item != Items.POWDER_SNOW_BUCKET) { // Paper - Fix cancelled powdered snow bucket placement
|
2024-10-23 22:52:43 +02:00
|
|
|
placeEvent = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPlaceEvent(world, entityhuman, enumhand, blocks.get(0), blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
|
|
|
}
|
2022-02-12 14:56:27 +01:00
|
|
|
|