mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
Inventory getHolder method without block snapshot
This commit is contained in:
parent
4c32788db0
commit
1b1ab34ecd
2 changed files with 14 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue