From b97d581af2ff66d180cb5ea9e3cf27735cb1aafd Mon Sep 17 00:00:00 2001 From: ShaneBeee Date: Wed, 11 Dec 2019 21:40:10 -0800 Subject: [PATCH] SPIGOT-5443: BEE_NEST BlockState - Add missing BEE_NEST block state - Add a missing break in CraftMetaBlockState --- src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java | 1 + .../org/bukkit/craftbukkit/inventory/CraftItemFactory.java | 3 ++- .../java/org/bukkit/craftbukkit/inventory/CraftItemStack.java | 1 + .../org/bukkit/craftbukkit/inventory/CraftMetaBlockState.java | 4 ++++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java index 2267ff2284..c0f557568d 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java @@ -458,6 +458,7 @@ public class CraftBlock implements Block { case SMOKER: return new CraftSmoker(this); case BEEHIVE: + case BEE_NEST: return new CraftBeehive(this); default: TileEntity tileEntity = world.getTileEntity(position); diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java index c9b59fd8d7..01ab19434a 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java @@ -260,7 +260,8 @@ public final class CraftItemFactory implements ItemFactory { case LECTERN: case SMOKER: case BEEHIVE: - return new CraftMetaBlockState(meta, material); + case BEE_NEST: + return new CraftMetaBlockState(meta, material); case TROPICAL_FISH_BUCKET: return meta instanceof CraftMetaTropicalFishBucket ? meta : new CraftMetaTropicalFishBucket(meta); case CROSSBOW: diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java index 2b280e02e7..e181df6f4d 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java @@ -511,6 +511,7 @@ public final class CraftItemStack extends ItemStack { case LECTERN: case SMOKER: case BEEHIVE: + case BEE_NEST: return new CraftMetaBlockState(item.getTag(), CraftMagicNumbers.getMaterial(item.getItem())); case TROPICAL_FISH_BUCKET: return new CraftMetaTropicalFishBucket(item.getTag()); diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBlockState.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBlockState.java index b2b373cf8a..9ef1f0d5e4 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBlockState.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBlockState.java @@ -241,6 +241,7 @@ public class CraftMetaBlockState extends CraftMetaItem implements BlockStateMeta case LECTERN: case SMOKER: case BEEHIVE: + case BEE_NEST: return true; } return false; @@ -503,6 +504,7 @@ public class CraftMetaBlockState extends CraftMetaItem implements BlockStateMeta te = new TileEntitySmoker(); } return new CraftSmoker(material, (TileEntitySmoker) te); + case BEE_NEST: case BEEHIVE: if (te == null){ te = new TileEntityBeehive(); @@ -674,7 +676,9 @@ public class CraftMetaBlockState extends CraftMetaItem implements BlockStateMeta valid = blockState instanceof CraftSmoker; break; case BEEHIVE: + case BEE_NEST: valid = blockState instanceof CraftBeehive; + break; default: valid = false; break;