+ * If the amount of this {@link ItemReference}: + *
+ *
+ * @return The correct amount of this reference or linked item.
+ */
+ public int getAmount() {
+ return amount > 0 ? amount : getItem().getAmount();
+ }
+
+ /**
+ * Sets the amount of this APIReference.
+ * Note: That a value of 0 or less indicates that the amount of this APIReference is equal to the linked ItemStack.
+ *
+ * @param amount The amount of this APIReference.
+ */
+ public void setAmount(int amount) {
+ this.amount = amount;
+ }
+
+ /**
+ * The weight can be used to select an item randomly based on their weight.
+ * For example for recipes like CustomCrafting does.
+ *
+ * If the weight is bigger than 0 it will override the weight of the {@link CustomItem}, that is created from this reference.
+ *
+ * @return The weight of this reference.
+ */
+ public double getWeight() {
+ return weight;
+ }
+
+ /**
+ * The weight can be used to select an item randomly based on their weight.
+ * For example for recipes like CustomCrafting does.
+ *
+ * If the weight is bigger than 0 it will override the weight of the {@link CustomItem}, that is created from this reference.
+ *
+ * @param weight The weight of this reference.
+ */
+ public void setWeight(double weight) {
+ this.weight = weight;
+ }
+
+ @JsonIgnore
+ @Override
+ public NamespacedKey getNamespacedKey() {
+ return type;
+ }
+
+ @Override
+ public String toString() {
+ return "ItemReference{" +
+ "type=" + type +
+ ", amount=" + amount +
+ ", weight=" + weight +
+ '}';
+ }
+
+ public interface Parser
+ * Parser with higher priority are called before Parsers with lower priority.
+ * Each time it chooses the next parser, if and only if the current parser returns null.
+ * The moment it returns a non-null value that value is used.
+ *
+ * @return The priority of this parser.
+ */
+ short priority() default 0;
+
+ /**
+ * The class of the custom Reference Parser
+ *
+ * @return The Parser for this ItemReference Type
+ */
+ Class extends ItemReference.Parser>> parser();
+
+ String plugin() default "";
+
+ class Creator {
+
+ public static