aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api/0278-More-Enchantment-API.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/api/0278-More-Enchantment-API.patch')
-rw-r--r--patches/api/0278-More-Enchantment-API.patch15
1 files changed, 13 insertions, 2 deletions
diff --git a/patches/api/0278-More-Enchantment-API.patch b/patches/api/0278-More-Enchantment-API.patch
index a58f9ad820..0ff08e7317 100644
--- a/patches/api/0278-More-Enchantment-API.patch
+++ b/patches/api/0278-More-Enchantment-API.patch
@@ -4,6 +4,7 @@ Date: Thu, 6 May 2021 19:58:03 -0700
Subject: [PATCH] More Enchantment API
Co-authored-by: Luis <[email protected]>
+Co-authored-by: Janet Blackquill <[email protected]>
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
@@ -37,7 +38,7 @@ index 0000000000000000000000000000000000000000..50c49739cc25679c9d241466e3069c9c
+ }
+}
diff --git a/src/main/java/org/bukkit/enchantments/Enchantment.java b/src/main/java/org/bukkit/enchantments/Enchantment.java
-index 4e41980dfbb256356231bc9565f6a90ea66aab76..de616cecaeb45018d96685c916532188e369bdd4 100644
+index 4e41980dfbb256356231bc9565f6a90ea66aab76..73e367fdf405b926599f4a7d34d61c25bb6c6e81 100644
--- a/src/main/java/org/bukkit/enchantments/Enchantment.java
+++ b/src/main/java/org/bukkit/enchantments/Enchantment.java
@@ -292,11 +292,7 @@ public abstract class Enchantment implements Keyed, Translatable, net.kyori.adve
@@ -52,7 +53,7 @@ index 4e41980dfbb256356231bc9565f6a90ea66aab76..de616cecaeb45018d96685c916532188
public abstract boolean isCursed();
/**
-@@ -330,6 +326,87 @@ public abstract class Enchantment implements Keyed, Translatable, net.kyori.adve
+@@ -330,6 +326,97 @@ public abstract class Enchantment implements Keyed, Translatable, net.kyori.adve
* @return the name of the enchantment with {@code level} applied
*/
public abstract net.kyori.adventure.text.@NotNull Component displayName(int level);
@@ -97,6 +98,16 @@ index 4e41980dfbb256356231bc9565f6a90ea66aab76..de616cecaeb45018d96685c916532188
+ 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