@@ -30,6 +30,8 @@ public class InventoryMoveItemEvent extends Event implements Cancellable {
private final Inventory destinationInventory;
private ItemStack itemStack;
private final boolean didSourceInitiate;
+ public boolean calledGetItem; // Paper
+ public boolean calledSetItem; // Paper
public InventoryMoveItemEvent(final Inventory sourceInventory, final ItemStack itemStack, final Inventory destinationInventory, final boolean didSourceInitiate) {
Validate.notNull(itemStack, "ItemStack cannot be null");
@@ -55,7 +57,8 @@ public class InventoryMoveItemEvent extends Event implements Cancellable {
* @return ItemStack
*/
public ItemStack getItem() {
- return itemStack.clone();
+ calledGetItem = true; // Paper - record this method was used for auto detection of mode
+ return itemStack; // Paper - Removed clone, handled better in Server
}
/**
@@ -67,6 +70,7 @@ public class InventoryMoveItemEvent extends Event implements Cancellable {
*/
public void setItem(ItemStack itemStack) {
Validate.notNull(itemStack, "ItemStack cannot be null. Cancel the event if you want nothing to be transferred.");
+ calledSetItem = true; // Paper - record this method was used for auto detection of mode