Inventory getHolder method without block snapshot
This commit is contained in:
@@ -531,6 +531,13 @@ public class CraftInventory implements Inventory {
|
||||
return this.inventory.getOwner();
|
||||
}
|
||||
|
||||
// Paper start - getHolder without snapshot
|
||||
@Override
|
||||
public InventoryHolder getHolder(boolean useSnapshot) {
|
||||
return inventory instanceof net.minecraft.world.level.block.entity.BlockEntity ? ((net.minecraft.world.level.block.entity.BlockEntity) inventory).getOwner(useSnapshot) : getHolder();
|
||||
}
|
||||
// Paper end
|
||||
|
||||
@Override
|
||||
public int getMaxStackSize() {
|
||||
return this.inventory.getMaxStackSize();
|
||||
|
||||
@@ -63,6 +63,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() {
|
||||
return this.getLeftSide().getLocation().add(this.getRightSide().getLocation()).multiply(0.5);
|
||||
|
||||
Reference in New Issue
Block a user