geforkt von Mirrors/Paper
2873869bb1
Signs no longer have a specific isEdiable state, the entire API in this regard needs updating/deprecation. The boolean field is completely gone, replaced by a uuid (which will need a new setEditingPlayer(UUID) method on the Sign interface), and the current upstream implementation of setEdiable simply flips the is_waxed state. This patch is hence not needed as it neither allows editing (which will be redone in a later patch) nor is required to copy the is_waxed boolean flag as it lives in the signs compound tag and is covered by applyTo.
43 Zeilen
2.2 KiB
Diff
43 Zeilen
2.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
|
Date: Thu, 20 May 2021 22:16:37 -0700
|
|
Subject: [PATCH] Fix PlayerBucketEmptyEvent result itemstack
|
|
|
|
Fixes SPIGOT-2560: https://hub.spigotmc.org/jira/projects/SPIGOT/issues/SPIGOT-2560
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/item/BucketItem.java b/src/main/java/net/minecraft/world/item/BucketItem.java
|
|
index 5510098be25ce06bc5f92eab2f83dc1086c4838f..578c3db52dda4c169b5ea615a4ce4a79f15a4cad 100644
|
|
--- a/src/main/java/net/minecraft/world/item/BucketItem.java
|
|
+++ b/src/main/java/net/minecraft/world/item/BucketItem.java
|
|
@@ -39,6 +39,8 @@ import org.bukkit.event.player.PlayerBucketFillEvent;
|
|
|
|
public class BucketItem extends Item implements DispensibleContainerItem {
|
|
|
|
+ private static @Nullable ItemStack itemLeftInHandAfterPlayerBucketEmptyEvent = null; // Paper
|
|
+
|
|
public final Fluid content;
|
|
|
|
public BucketItem(Fluid fluid, Item.Properties settings) {
|
|
@@ -120,6 +122,13 @@ public class BucketItem extends Item implements DispensibleContainerItem {
|
|
}
|
|
|
|
public static ItemStack getEmptySuccessItem(ItemStack stack, Player player) {
|
|
+ // Paper start
|
|
+ if (itemLeftInHandAfterPlayerBucketEmptyEvent != null) {
|
|
+ ItemStack itemInHand = itemLeftInHandAfterPlayerBucketEmptyEvent;
|
|
+ itemLeftInHandAfterPlayerBucketEmptyEvent = null;
|
|
+ return itemInHand;
|
|
+ }
|
|
+ // Paper end
|
|
return !player.getAbilities().instabuild ? new ItemStack(Items.BUCKET) : stack;
|
|
}
|
|
|
|
@@ -150,6 +159,7 @@ public class BucketItem extends Item implements DispensibleContainerItem {
|
|
((ServerPlayer) entityhuman).getBukkitEntity().updateInventory(); // SPIGOT-4541
|
|
return false;
|
|
}
|
|
+ itemLeftInHandAfterPlayerBucketEmptyEvent = event.getItemStack() != null ? event.getItemStack().equals(CraftItemStack.asNewCraftStack(net.minecraft.world.item.Items.BUCKET)) ? null : CraftItemStack.asNMSCopy(event.getItemStack()) : ItemStack.EMPTY; // Paper - fix empty event result itemstack
|
|
}
|
|
// CraftBukkit end
|
|
if (!flag1) {
|