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.
This commit is contained in:
Jake Potrebic 2021-10-08 13:12:58 -07:00
parent 83b4d889b7
commit 140e68625c

View File

@ -170,7 +170,7 @@
+ int oldCount = this.getCount();
+ ServerLevel world = (ServerLevel) context.getLevel();
+
+ if (!(item instanceof BucketItem || item instanceof SolidBucketItem)) { // if not bucket
+ if (!(item instanceof BucketItem/* || item instanceof SolidBucketItem*/)) { // if not bucket // Paper - Fix cancelled powdered snow bucket placement
+ world.captureBlockStates = true;
+ // special case bonemeal
+ if (item == Items.BONE_MEAL) {
@ -234,7 +234,7 @@
+ 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 - Fix cancelled powdered snow bucket placement
+ placeEvent = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPlaceEvent(world, entityhuman, enumhand, blocks.get(0), blockposition.getX(), blockposition.getY(), blockposition.getZ());
+ }
+