@Overridden void applyToItem(net.minecraft.nbt.NBTTagCompound itemTag) { if (hasDisplayName()) { setDisplayTag(itemTag, NAME.NBT, new net.minecraft.nbt.NBTTagString(displayName)); } if (hasLore()) { setDisplayTag(itemTag, LORE.NBT, createStringList(lore)); } applyEnchantments(enchantments, itemTag, ENCHANTMENTS); if (hasRepairCost()) { itemTag.setInteger(REPAIR.NBT, repairCost); } if (attributes != null) { itemTag.setTag(ATTRIBUTES.NBT, attributes); } }
@Overridden ImmutableMap.Builder<String, Object> serialize(ImmutableMap.Builder<String, Object> builder) { if (hasDisplayName()) { builder.put(NAME.BUKKIT, displayName); } if (hasLore()) { builder.put(LORE.BUKKIT, ImmutableList.copyOf(lore)); } serializeEnchantments(enchantments, builder, ENCHANTMENTS); if (hasRepairCost()) { builder.put(REPAIR.BUKKIT, repairCost); } return builder; }
@Overridden void applyToItem(NBTTagCompound itemTag) { if (hasDisplayName()) { setDisplayTag(itemTag, NAME.NBT, new NBTTagString(displayName)); } if (hasLore()) { setDisplayTag(itemTag, LORE.NBT, createStringList(lore)); } applyEnchantments(enchantments, itemTag, ENCHANTMENTS); if (hasRepairCost()) { itemTag.setInt(REPAIR.NBT, repairCost); } if (attributes != null) { itemTag.set(ATTRIBUTES.NBT, attributes); } }
@Overridden void applyToItem(NBTTagCompound itemTag) { if (hasDisplayName()) { setDisplayTag(itemTag, NAME.NBT, new NBTTagString(displayName)); } if (hasLore()) { setDisplayTag(itemTag, LORE.NBT, createStringList(lore)); } if (hideFlag != 0) { itemTag.setInt(HIDEFLAGS.NBT, hideFlag); } applyEnchantments(enchantments, itemTag, ENCHANTMENTS); if (hasRepairCost()) { itemTag.setInt(REPAIR.NBT, repairCost); } for (Map.Entry<String, NBTBase> e : unhandledTags.entrySet()) { itemTag.set(e.getKey(), e.getValue()); } }
@Overridden void applyToItem(NBTTagCompound itemTag) { if (hasDisplayName()) { setDisplayTag(itemTag, NAME.NBT, new NBTTagString(NAME.NBT, displayName)); } if (hasLore()) { setDisplayTag(itemTag, LORE.NBT, createStringList(lore, LORE)); } applyEnchantments(enchantments, itemTag, ENCHANTMENTS); if (hasRepairCost()) { itemTag.setInt(REPAIR.NBT, repairCost); } if (attributes != null) { itemTag.set(ATTRIBUTES.NBT, attributes); } }
@Overridden void applyToItem(NBTTagCompound itemTag) { if (hasDisplayName()) { setDisplayTag(itemTag, NAME.NBT, new NBTTagString(NAME.NBT, displayName)); } if (hasLore()) { setDisplayTag(itemTag, LORE.NBT, createStringList(lore, LORE)); } applyEnchantments(enchantments, itemTag, ENCHANTMENTS); if (hasRepairCost()) { itemTag.setInt(REPAIR.NBT, repairCost); } }
@Overridden void applyToItem(net.minecraft.nbt.NBTTagCompound itemTag) { if (hasDisplayName()) { setDisplayTag(itemTag, NAME.NBT, new net.minecraft.nbt.NBTTagString(NAME.NBT, displayName)); } if (hasLore()) { setDisplayTag(itemTag, LORE.NBT, createStringList(lore, LORE)); } applyEnchantments(enchantments, itemTag, ENCHANTMENTS); if (hasRepairCost()) { itemTag.func_74768_a(REPAIR.NBT, repairCost); } }
/** * This method is almost as weird as notUncommon. * Only return false if your common internals are unequal. * Checking your own internals is redundant if you are not common, as notUncommon is meant for checking those 'not common' variables. */ @Overridden boolean equalsCommon(CraftMetaItem that) { return ((this.hasDisplayName() ? that.hasDisplayName() && this.displayName.equals(that.displayName) : !that.hasDisplayName())) && (this.hasEnchants() ? that.hasEnchants() && this.enchantments.equals(that.enchantments) : !that.hasEnchants()) && (this.hasLore() ? that.hasLore() && this.lore.equals(that.lore) : !that.hasLore()) && (this.hasAttributes() ? that.hasAttributes() && this.attributes.equals(that.attributes) : !that.hasAttributes()) && (this.hasRepairCost() ? that.hasRepairCost() && this.repairCost == that.repairCost : !that.hasRepairCost()); }
@Overridden int applyHash() { int hash = 3; hash = 61 * hash + (hasDisplayName() ? this.displayName.hashCode() : 0); hash = 61 * hash + (hasLore() ? this.lore.hashCode() : 0); hash = 61 * hash + (hasEnchants() ? this.enchantments.hashCode() : 0); hash = 61 * hash + (hasAttributes() ? this.attributes.hashCode() : 0); hash = 61 * hash + (hasRepairCost() ? this.repairCost : 0); return hash; }