3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-24 07:10:10 +01:00

Fixed chest.getInventory for double chests, thanks to Acrobot. This fixes BUKKIT-901

Dieser Commit ist enthalten in:
Nathan Adams 2012-03-02 20:02:45 +00:00
Ursprung 8016bf2dd0
Commit 88149dc439

Datei anzeigen

@ -1,6 +1,7 @@
package org.bukkit.craftbukkit.block;
import net.minecraft.server.TileEntityChest;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
@ -23,7 +24,10 @@ public class CraftChest extends CraftBlockState implements Chest {
public Inventory getInventory() {
// 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);
if (world.getBlockTypeIdAt(x - 1, y, z) == Material.CHEST.getId()) {
CraftInventory left = new CraftInventory((TileEntityChest)world.getHandle().getTileEntity(x - 1, y, z));