ItemBuilder getter Methods

This commit is contained in:
NichtStudioCode 2021-05-08 14:41:16 +02:00
parent c623250e3a
commit bdf74fb191

@ -225,13 +225,56 @@ public class ItemBuilder implements Cloneable {
return this; return this;
} }
public ItemStack getBase() {
return base;
}
public Material getMaterial() {
return material;
}
public int getAmount() {
return amount;
}
public int getDamage() {
return damage;
}
public int getCustomModelData() {
return customModelData;
}
public String getDisplayName() {
return displayName;
}
public List<String> getLore() {
return lore;
}
public List<ItemFlag> getItemFlags() {
return itemFlags;
}
public HashMap<Enchantment, Pair<Integer, Boolean>> getEnchantments() {
return enchantments;
}
public GameProfile getGameProfile() {
return gameProfile;
}
@Override @Override
public ItemBuilder clone() { public ItemBuilder clone() {
try { try {
return ((ItemBuilder) super.clone()) ItemBuilder clone = ((ItemBuilder) super.clone());
.setLore(new ArrayList<>(lore)) if (base != null) clone.base = base.clone();
.setItemFlags(new ArrayList<>(itemFlags)) clone.lore = new ArrayList<>(lore);
.setEnchantments(new HashMap<>(enchantments)); clone.itemFlags = new ArrayList<>(itemFlags);
clone.enchantments = new HashMap<>(enchantments);
return clone;
} catch (CloneNotSupportedException e) { } catch (CloneNotSupportedException e) {
throw new Error(e); throw new Error(e);
} }