Expose anvil cost in the API (#10682)
This commit is contained in:
@@ -4,6 +4,7 @@ Date: Thu, 6 May 2021 19:58:03 -0700
|
||||
Subject: [PATCH] More Enchantment API
|
||||
|
||||
Co-authored-by: Luis <luisc99@icloud.com>
|
||||
Co-authored-by: Janet Blackquill <uhhadd@gmail.com>
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/enchantments/EnchantmentRarity.java b/src/main/java/io/papermc/paper/enchantments/EnchantmentRarity.java
|
||||
new file mode 100644
|
||||
@@ -97,6 +98,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ public abstract int getMaxModifiedCost(int level);
|
||||
+
|
||||
+ /**
|
||||
+ * Gets cost of applying this enchantment using an anvil.
|
||||
+ * <p>
|
||||
+ * Note that this is halved when using an enchantment book, and is multiplied by the level of the enchantment.
|
||||
+ * See <a href="https://minecraft.wiki/w/Anvil_mechanics">https://minecraft.wiki/w/Anvil_mechanics</a> for more information.
|
||||
+ * </p>
|
||||
+ * @return The anvil cost of this enchantment
|
||||
+ */
|
||||
+ public abstract int getAnvilCost();
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the rarity of this enchantment.
|
||||
+ *
|
||||
+ * @return the rarity
|
||||
|
||||
Reference in New Issue
Block a user