Search in sources :

Example 11 with Overridden

use of org.bukkit.craftbukkit.v1_12_R1.Overridden in project LoliServer by Loli-Server.

the class CraftMetaItem method clone.

@Overridden
@Override
public CraftMetaItem clone() {
    try {
        CraftMetaItem clone = (CraftMetaItem) super.clone();
        if (this.lore != null) {
            clone.lore = new ArrayList<String>(this.lore);
        }
        clone.customModelData = this.customModelData;
        clone.blockData = this.blockData;
        if (this.enchantments != null) {
            clone.enchantments = new LinkedHashMap<Enchantment, Integer>(this.enchantments);
        }
        if (this.hasAttributeModifiers()) {
            clone.attributeModifiers = LinkedHashMultimap.create(this.attributeModifiers);
        }
        clone.persistentDataContainer = new CraftPersistentDataContainer(this.persistentDataContainer.getRaw(), DATA_TYPE_REGISTRY);
        clone.hideFlag = this.hideFlag;
        clone.unbreakable = this.unbreakable;
        clone.damage = this.damage;
        clone.version = this.version;
        return clone;
    } catch (CloneNotSupportedException e) {
        throw new Error(e);
    }
}
Also used : CraftPersistentDataContainer(org.bukkit.craftbukkit.v1_16_R3.persistence.CraftPersistentDataContainer) Enchantment(org.bukkit.enchantments.Enchantment) Overridden(org.bukkit.craftbukkit.v1_16_R3.Overridden)

Aggregations

ImmutableMap (com.google.common.collect.ImmutableMap)8 HashMap (java.util.HashMap)6 Map (java.util.Map)6 Overridden (org.bukkit.craftbukkit.v1_16_R3.Overridden)6 ByteArrayOutputStream (java.io.ByteArrayOutputStream)5 IOException (java.io.IOException)5 ItemFlag (org.bukkit.inventory.ItemFlag)5 ArrayList (java.util.ArrayList)4 LinkedHashMap (java.util.LinkedHashMap)4 CompoundNBT (net.minecraft.nbt.CompoundNBT)4 INBT (net.minecraft.nbt.INBT)4 CraftAttributeMap (org.bukkit.craftbukkit.v1_16_R3.attribute.CraftAttributeMap)4 Overridden (org.bukkit.craftbukkit.v1_18_R2.Overridden)3 Enchantment (org.bukkit.enchantments.Enchantment)3 CompoundTag (net.minecraft.nbt.CompoundTag)2 ListTag (net.minecraft.nbt.ListTag)2 StringTag (net.minecraft.nbt.StringTag)2 Tag (net.minecraft.nbt.Tag)2 Overridden (org.bukkit.craftbukkit.v1_12_R1.Overridden)2 CraftPersistentDataContainer (org.bukkit.craftbukkit.v1_16_R3.persistence.CraftPersistentDataContainer)2