geforkt von Mirrors/Paper
51 Zeilen
2.5 KiB
Diff
51 Zeilen
2.5 KiB
Diff
|
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
|
||
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||
|
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
|
||
|
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
|
||
|
@@ -0,0 +0,0 @@ import net.minecraft.world.inventory.PlayerEnderChestContainer;
|
||
|
import net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity;
|
||
|
import net.minecraft.world.level.block.entity.BarrelBlockEntity;
|
||
|
import net.minecraft.world.level.block.entity.BlastFurnaceBlockEntity;
|
||
|
+import net.minecraft.world.level.block.entity.BlockEntity;
|
||
|
import net.minecraft.world.level.block.entity.BrewingStandBlockEntity;
|
||
|
import net.minecraft.world.level.block.entity.DispenserBlockEntity;
|
||
|
import net.minecraft.world.level.block.entity.DropperBlockEntity;
|
||
|
@@ -0,0 +0,0 @@ public class CraftInventory implements Inventory {
|
||
|
return inventory.getOwner();
|
||
|
}
|
||
|
|
||
|
+ // Paper start - getHolder without snapshot
|
||
|
+ @Override
|
||
|
+ public InventoryHolder getHolder(boolean useSnapshot) {
|
||
|
+ return inventory instanceof BlockEntity ? ((BlockEntity) inventory).getOwner(useSnapshot) : getHolder();
|
||
|
+ }
|
||
|
+ // Paper end
|
||
|
+
|
||
|
@Override
|
||
|
public int getMaxStackSize() {
|
||
|
return inventory.getMaxStackSize();
|
||
|
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryDoubleChest.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryDoubleChest.java
|
||
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||
|
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryDoubleChest.java
|
||
|
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryDoubleChest.java
|
||
|
@@ -0,0 +0,0 @@ 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() {
|
||
|
return getLeftSide().getLocation().add(getRightSide().getLocation()).multiply(0.5);
|