diff options
Diffstat (limited to 'src/main/java/org/bukkit')
3 files changed, 22 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java index c576c8c3..f12a7202 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java @@ -109,6 +109,12 @@ public class CraftContainer extends Container { case BREWING: typeID = 5; break; + case BEACON: + typeID = 7; + break; + case ANVIL: + typeID = 8; + break; default: typeID = 0; break; diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java index c8f25b02..d60b1d82 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java @@ -4,12 +4,14 @@ import java.util.HashMap; import java.util.List; import java.util.ListIterator; +import net.minecraft.server.ContainerAnvilInventory; import net.minecraft.server.ContainerEnchantTableInventory; import net.minecraft.server.IInventory; import net.minecraft.server.InventoryCrafting; import net.minecraft.server.InventoryEnderChest; import net.minecraft.server.InventoryMerchant; import net.minecraft.server.PlayerInventory; +import net.minecraft.server.TileEntityBeacon; import net.minecraft.server.TileEntityBrewingStand; import net.minecraft.server.TileEntityDispenser; import net.minecraft.server.TileEntityFurnace; @@ -416,6 +418,10 @@ public class CraftInventory implements Inventory { return InventoryType.ENDER_CHEST; } else if (inventory instanceof InventoryMerchant) { return InventoryType.MERCHANT; + } else if (inventory instanceof TileEntityBeacon) { + return InventoryType.BEACON; + } else if (inventory instanceof ContainerAnvilInventory) { + return InventoryType.ANVIL; } else { return InventoryType.CHEST; } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryView.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryView.java index 55df2197..0e930914 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryView.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryView.java @@ -109,6 +109,16 @@ public class CraftInventoryView extends InventoryView { type = SlotType.CRAFTING; } break; + case BEACON: + type = SlotType.CRAFTING; + break; + case ANVIL: + if (slot == 2) { + type = SlotType.RESULT; + } else { + type = SlotType.CRAFTING; + } + break; default: // Nothing to do, it's a CONTAINER slot } |