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
|
2021-06-17 14:50:16 +02:00
|
|
|
index 6ca8e76d1569f3f631275fea187e7110f09fc69e..7d8f29335d4c5188527cad66be39cedb34c26f50 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
|
2021-06-17 14:50:16 +02:00
|
|
|
@@ -528,6 +528,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
|
2021-06-14 10:37:14 +02:00
|
|
|
index 01d425d359f2d6d87b6c01b435a9cfcfe11caa20..4707a651dc80086efa852bcfba38a534e7f1f3d0 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
|
|
|
|
@@ -64,6 +64,13 @@ public class CraftInventoryDoubleChest extends CraftInventory implements DoubleC
|
|
|
|
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);
|