mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-12-26 18:07:35 +01:00
e87f5f4f11
- 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
31 lines
1.1 KiB
Java
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;
|
|
}
|
|
}
|