From 94ba82430263ebb42632f51bc266c5a0297c10b7 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 5 Mar 2016 15:52:44 +1100 Subject: [PATCH] SPIGOT-1758: Apply correct ItemMeta to new CommandBlock types --- .../org/bukkit/craftbukkit/inventory/CraftItemFactory.java | 2 ++ .../org/bukkit/craftbukkit/inventory/CraftItemStack.java | 2 ++ .../bukkit/craftbukkit/inventory/CraftMetaBlockState.java | 6 ++++++ 3 files changed, 10 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java index 0c685e4461..3bc313cbd4 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java @@ -103,6 +103,8 @@ public final class CraftItemFactory implements ItemFactory { case BREWING_STAND_ITEM: case ENCHANTMENT_TABLE: case COMMAND: + case COMMAND_REPEATING: + case COMMAND_CHAIN: case BEACON: case DAYLIGHT_DETECTOR: case DAYLIGHT_DETECTOR_INVERTED: diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java index b120a7ed28..8b6fd4ff50 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java @@ -365,6 +365,8 @@ public final class CraftItemStack extends ItemStack { case BREWING_STAND_ITEM: case ENCHANTMENT_TABLE: case COMMAND: + case COMMAND_REPEATING: + case COMMAND_CHAIN: case BEACON: case DAYLIGHT_DETECTOR: case DAYLIGHT_DETECTOR_INVERTED: diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBlockState.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBlockState.java index 4f1415b7ac..b57b6e9dff 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBlockState.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBlockState.java @@ -166,6 +166,8 @@ public class CraftMetaBlockState extends CraftMetaItem implements BlockStateMeta case BREWING_STAND_ITEM: case ENCHANTMENT_TABLE: case COMMAND: + case COMMAND_REPEATING: + case COMMAND_CHAIN: case BEACON: case DAYLIGHT_DETECTOR: case DAYLIGHT_DETECTOR_INVERTED: @@ -248,6 +250,8 @@ public class CraftMetaBlockState extends CraftMetaItem implements BlockStateMeta } return new CraftSkull(material, (TileEntitySkull) te); case COMMAND: + case COMMAND_REPEATING: + case COMMAND_CHAIN: if (te == null) { te = new TileEntityCommand(); } @@ -316,6 +320,8 @@ public class CraftMetaBlockState extends CraftMetaItem implements BlockStateMeta valid = te instanceof TileEntitySkull; break; case COMMAND: + case COMMAND_REPEATING: + case COMMAND_CHAIN: valid = te instanceof TileEntityCommand; break; case BEACON: