mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-24 03:25:15 +01:00
Fixed chest.getInventory for double chests, thanks to Acrobot. This fixes BUKKIT-901
This commit is contained in:
parent
8016bf2dd0
commit
88149dc439
@ -1,6 +1,7 @@
|
|||||||
package org.bukkit.craftbukkit.block;
|
package org.bukkit.craftbukkit.block;
|
||||||
|
|
||||||
import net.minecraft.server.TileEntityChest;
|
import net.minecraft.server.TileEntityChest;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
@ -23,7 +24,10 @@ public class CraftChest extends CraftBlockState implements Chest {
|
|||||||
|
|
||||||
public Inventory getInventory() {
|
public Inventory getInventory() {
|
||||||
// The logic here is basically identical to the logic in BlockChest.interact
|
// The logic here is basically identical to the logic in BlockChest.interact
|
||||||
int x = getLocation().getBlockX(), y = getLocation().getBlockY(), z = getLocation().hashCode();
|
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