Commits
Parker Hawke authored and md_5 committed b7e9f1c8b9f
1 1 | package org.bukkit.craftbukkit.inventory; |
2 2 | |
3 3 | import com.google.common.collect.ImmutableMap.Builder; |
4 4 | import java.util.Map; |
5 5 | import net.minecraft.nbt.NBTBase; |
6 6 | import net.minecraft.nbt.NBTTagCompound; |
7 7 | import org.bukkit.Material; |
8 8 | import org.bukkit.configuration.serialization.DelegateDeserialization; |
9 - | import org.bukkit.craftbukkit.inventory.CraftMetaItem.ItemMetaKey; |
10 9 | |
11 10 | CraftMetaItem.SerializableMeta.class) | (
12 11 | public class CraftMetaArmorStand extends CraftMetaItem { |
13 12 | |
14 13 | static final ItemMetaKey ENTITY_TAG = new ItemMetaKey("EntityTag", "entity-tag"); |
15 14 | NBTTagCompound entityTag; |
16 15 | |
17 16 | CraftMetaArmorStand(CraftMetaItem meta) { |
18 17 | super(meta); |
19 18 | |
57 56 | void applyToItem(NBTTagCompound tag) { |
58 57 | super.applyToItem(tag); |
59 58 | |
60 59 | if (entityTag != null) { |
61 60 | tag.put(ENTITY_TAG.NBT, entityTag); |
62 61 | } |
63 62 | } |
64 63 | |
65 64 | |
66 65 | boolean applicableTo(Material type) { |
67 - | switch (type) { |
68 - | case ARMOR_STAND: |
69 - | return true; |
70 - | default: |
71 - | return false; |
72 - | } |
66 + | return type == Material.ARMOR_STAND; |
73 67 | } |
74 68 | |
75 69 | |
76 70 | boolean isEmpty() { |
77 71 | return super.isEmpty() && isArmorStandEmpty(); |
78 72 | } |
79 73 | |
80 74 | boolean isArmorStandEmpty() { |
81 75 | return !(entityTag != null); |
82 76 | } |