2021-06-11 14:02:28 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Phoenix616 <mail@moep.tv>
|
|
|
|
Date: Wed, 10 Jun 2020 23:55:15 +0100
|
|
|
|
Subject: [PATCH] Inventory getHolder method without block snapshot
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
|
2023-06-13 01:51:45 +02:00
|
|
|
index 7bdb2e52d36feb9e0ce517ae95f5edb28ddc67d6..01b38b5a515c7dd0f0c79141c270d618bf3c56eb 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
|
2023-03-24 21:38:40 +01:00
|
|
|
@@ -540,6 +540,13 @@ public class CraftInventory implements Inventory {
|
2021-06-14 10:37:14 +02:00
|
|
|
return this.inventory.getOwner();
|
2021-06-11 14:02:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
+ // Paper start - getHolder without snapshot
|
|
|
|
+ @Override
|
|
|
|
+ public InventoryHolder getHolder(boolean useSnapshot) {
|
2021-06-14 10:37:14 +02:00
|
|
|
+ return inventory instanceof net.minecraft.world.level.block.entity.BlockEntity ? ((net.minecraft.world.level.block.entity.BlockEntity) inventory).getOwner(useSnapshot) : getHolder();
|
2021-06-11 14:02:28 +02:00
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
+
|
|
|
|
@Override
|
|
|
|
public int getMaxStackSize() {
|
2021-06-14 10:37:14 +02:00
|
|
|
return this.inventory.getMaxStackSize();
|
2021-06-11 14:02:28 +02:00
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryDoubleChest.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryDoubleChest.java
|
2023-06-13 01:51:45 +02:00
|
|
|
index d5defc82aec2279463e14029e213cfb8c3a40ce1..83712cc8da9751b6d4cc1f34a1cc0798bf848ae1 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryDoubleChest.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryDoubleChest.java
|
2023-06-13 01:51:45 +02:00
|
|
|
@@ -63,6 +63,13 @@ public class CraftInventoryDoubleChest extends CraftInventory implements DoubleC
|
2021-06-11 14:02:28 +02:00
|
|
|
return new DoubleChest(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
+ // Paper start - getHolder without snapshot
|
|
|
|
+ @Override
|
|
|
|
+ public DoubleChest getHolder(boolean useSnapshot) {
|
|
|
|
+ return getHolder();
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
+
|
|
|
|
@Override
|
|
|
|
public Location getLocation() {
|
2021-06-14 10:37:14 +02:00
|
|
|
return this.getLeftSide().getLocation().add(this.getRightSide().getLocation()).multiply(0.5);
|