mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-25 10:27:55 +01:00
Minor optimization getting chest inventories
This commit is contained in:
parent
88149dc439
commit
ede443234e
@ -23,11 +23,10 @@ public class CraftChest extends CraftBlockState implements Chest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Inventory getInventory() {
|
public Inventory getInventory() {
|
||||||
|
int x = getX();
|
||||||
|
int y = getY();
|
||||||
|
int z = getZ();
|
||||||
// The logic here is basically identical to the logic in BlockChest.interact
|
// The logic here is basically identical to the logic in BlockChest.interact
|
||||||
Location loc = getLocation();
|
|
||||||
int x = loc.getBlockX();
|
|
||||||
int y = loc.getBlockY();
|
|
||||||
int z = loc.getBlockZ();
|
|
||||||
CraftInventory inventory = new CraftInventory(chest);
|
CraftInventory inventory = new CraftInventory(chest);
|
||||||
if (world.getBlockTypeIdAt(x - 1, y, z) == Material.CHEST.getId()) {
|
if (world.getBlockTypeIdAt(x - 1, y, z) == Material.CHEST.getId()) {
|
||||||
CraftInventory left = new CraftInventory((TileEntityChest)world.getHandle().getTileEntity(x - 1, y, z));
|
CraftInventory left = new CraftInventory((TileEntityChest)world.getHandle().getTileEntity(x - 1, y, z));
|
||||||
|
Loading…
Reference in New Issue
Block a user