mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 05:47:45 +01:00
Inventory getHolder method without block snapshot
This commit is contained in:
parent
4c32788db0
commit
1b1ab34ecd
@ -531,6 +531,13 @@ public class CraftInventory implements Inventory {
|
|||||||
return this.inventory.getOwner();
|
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
|
@Override
|
||||||
public int getMaxStackSize() {
|
public int getMaxStackSize() {
|
||||||
return this.inventory.getMaxStackSize();
|
return this.inventory.getMaxStackSize();
|
||||||
|
@ -63,6 +63,13 @@ public class CraftInventoryDoubleChest extends CraftInventory implements DoubleC
|
|||||||
return new DoubleChest(this);
|
return new DoubleChest(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Paper start - getHolder without snapshot
|
||||||
|
@Override
|
||||||
|
public DoubleChest getHolder(boolean useSnapshot) {
|
||||||
|
return getHolder();
|
||||||
|
}
|
||||||
|
// Paper end
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Location getLocation() {
|
public Location getLocation() {
|
||||||
return this.getLeftSide().getLocation().add(this.getRightSide().getLocation()).multiply(0.5);
|
return this.getLeftSide().getLocation().add(this.getRightSide().getLocation()).multiply(0.5);
|
||||||
|
Loading…
Reference in New Issue
Block a user