ChestShop-3/com/Acrobot/ChestShop/BukkitFixes/bInventoryFix.java
Acrobot e87f5f4f11 - Added a warning if spawn-radius isn't set to 0
- Deleted a few outdated plugins from built-in Register
- System.out -> System.err for errors
- Blocked buying if you're holding a sign in your hand (allows, for example, for sign editors to work)
- Updated Heroes package
- Fixed WG integration (no longer throws errors, but uses ugly workaround)
- Fixed a small bug in Register plugin loading message
- Removed version checking for OddItem, WorldGuard and LWC
2012-03-06 19:41:14 +01:00

31 lines
1.1 KiB
Java

package com.Acrobot.ChestShop.BukkitFixes;
import com.Acrobot.ChestShop.Chests.MinecraftChest;
import net.minecraft.server.TileEntityChest;
import org.bukkit.block.Chest;
import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.craftbukkit.inventory.CraftInventory;
import org.bukkit.craftbukkit.inventory.CraftInventoryDoubleChest;
import org.bukkit.inventory.Inventory;
/**
* Temporary class until this is fixed in Bukkit RB
* @author Acrobot
*/
public class bInventoryFix {
public static Inventory getInventory(Chest chest) {
MinecraftChest mchest = new MinecraftChest(chest);
TileEntityChest teChest = (TileEntityChest) ((CraftWorld) chest.getWorld()).getTileEntityAt(chest.getX(), chest.getY(), chest.getZ());
CraftInventory ci = new CraftInventory(teChest);
if (mchest.getNeighbor() != null) {
Chest nb = mchest.getNeighbor();
TileEntityChest neighbor = (TileEntityChest) ((CraftWorld) chest.getWorld()).getTileEntityAt(nb.getX(), nb.getY(), nb.getZ());
return new CraftInventoryDoubleChest(ci, new CraftInventory(neighbor));
}
return ci;
}
}