SPIGOT-2798: Fix ShulkerBox BlockStateMeta

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2016-11-19 15:59:04 +11:00
parent 3e21482d20
commit 1159a15bf0

View file

@ -211,8 +211,30 @@ public class CraftMetaBlockState extends CraftMetaItem implements BlockStateMeta
@Override
public BlockState getBlockState() {
if (blockEntityTag != null && material == Material.SHIELD) {
blockEntityTag.setString("id", "Banner"); // Hack
if (blockEntityTag != null) {
switch (material) {
case SHIELD:
blockEntityTag.setString("id", "banner");
break;
case WHITE_SHULKER_BOX:
case ORANGE_SHULKER_BOX:
case MAGENTA_SHULKER_BOX:
case LIGHT_BLUE_SHULKER_BOX:
case YELLOW_SHULKER_BOX:
case LIME_SHULKER_BOX:
case PINK_SHULKER_BOX:
case GRAY_SHULKER_BOX:
case SILVER_SHULKER_BOX:
case CYAN_SHULKER_BOX:
case PURPLE_SHULKER_BOX:
case BLUE_SHULKER_BOX:
case BROWN_SHULKER_BOX:
case GREEN_SHULKER_BOX:
case RED_SHULKER_BOX:
case BLACK_SHULKER_BOX:
blockEntityTag.setString("id", "shulker_box");
break;
}
}
TileEntity te = (blockEntityTag == null) ? null : TileEntity.a(null, blockEntityTag);