mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 12:27:59 +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();
|
||||
}
|
||||
|
||||
// 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 New Issue
Block a user