Add some missing Tile Entities

By: Thinkofdeath <thinkofdeath@spigotmc.org>
This commit is contained in:
CraftBukkit/Spigot 2014-12-07 13:38:16 +00:00
parent 6ee362dcff
commit 19e7299b99
3 changed files with 43 additions and 22 deletions

View file

@ -83,18 +83,25 @@ public final class CraftItemFactory implements ItemFactory {
return meta instanceof CraftMetaEnchantedBook ? meta : new CraftMetaEnchantedBook(meta);
case BANNER:
return meta instanceof CraftMetaBanner ? meta : new CraftMetaBanner(meta);
case COMMAND:
case FURNACE:
case CHEST:
case TRAPPED_CHEST:
case FURNACE:
case HOPPER:
case MOB_SPAWNER:
case SIGN:
case BREWING_STAND_ITEM:
case JUKEBOX:
case FLOWER_POT_ITEM:
case DISPENSER:
case DROPPER:
case SIGN:
case MOB_SPAWNER:
case NOTE_BLOCK:
case PISTON_BASE:
case BREWING_STAND_ITEM:
case ENCHANTMENT_TABLE:
case COMMAND:
case BEACON:
case DAYLIGHT_DETECTOR:
case DAYLIGHT_DETECTOR_INVERTED:
case HOPPER:
case REDSTONE_COMPARATOR:
case FLOWER_POT_ITEM:
if (meta instanceof CraftMetaTileEntity) {
CraftMetaTileEntity te = (CraftMetaTileEntity) meta;
if (te.material != material) {

View file

@ -347,18 +347,25 @@ public final class CraftItemStack extends ItemStack {
return new CraftMetaEnchantedBook(item.getTag());
case BANNER:
return new CraftMetaBanner(item.getTag());
case COMMAND:
case FURNACE:
case CHEST:
case TRAPPED_CHEST:
case FURNACE:
case HOPPER:
case MOB_SPAWNER:
case SIGN:
case BREWING_STAND_ITEM:
case JUKEBOX:
case FLOWER_POT_ITEM:
case DISPENSER:
case DROPPER:
case SIGN:
case MOB_SPAWNER:
case NOTE_BLOCK:
case PISTON_BASE:
case BREWING_STAND_ITEM:
case ENCHANTMENT_TABLE:
case COMMAND:
case BEACON:
case DAYLIGHT_DETECTOR:
case DAYLIGHT_DETECTOR_INVERTED:
case HOPPER:
case REDSTONE_COMPARATOR:
case FLOWER_POT_ITEM:
return new CraftMetaTileEntity(item.getTag(), CraftMagicNumbers.getMaterial(item.getItem()));
default:
return new CraftMetaItem(item.getTag());

View file

@ -98,18 +98,25 @@ public class CraftMetaTileEntity extends CraftMetaItem {
@Override
boolean applicableTo(Material type) {
switch(type){
case COMMAND:
case FURNACE:
case CHEST:
case TRAPPED_CHEST:
case FURNACE:
case HOPPER:
case MOB_SPAWNER:
case SIGN:
case BREWING_STAND_ITEM:
case JUKEBOX:
case FLOWER_POT_ITEM:
case DISPENSER:
case DROPPER:
case SIGN:
case MOB_SPAWNER:
case NOTE_BLOCK:
case PISTON_BASE:
case BREWING_STAND_ITEM:
case ENCHANTMENT_TABLE:
case COMMAND:
case BEACON:
case DAYLIGHT_DETECTOR:
case DAYLIGHT_DETECTOR_INVERTED:
case HOPPER:
case REDSTONE_COMPARATOR:
case FLOWER_POT_ITEM:
return true;
}
return false;