Skip to content

Commit 75e81d8

Browse files
committed
deprecate old anvil api methods
1 parent 73a90e8 commit 75e81d8

File tree

1 file changed

+52
-4
lines changed

1 file changed

+52
-4
lines changed

patches/api/0014-Anvil-API.patch

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,40 +5,88 @@ Subject: [PATCH] Anvil API
55

66

77
diff --git a/src/main/java/org/bukkit/inventory/AnvilInventory.java b/src/main/java/org/bukkit/inventory/AnvilInventory.java
8-
index f1f97a85ec713c05c882d7588f4a3e4a017f4795..468d8b336c8060da346e2dfe60900868148376f6 100644
8+
index f1f97a85ec713c05c882d7588f4a3e4a017f4795..813f6cd253322538bdf96eb323dd23a7809a1c1e 100644
99
--- a/src/main/java/org/bukkit/inventory/AnvilInventory.java
1010
+++ b/src/main/java/org/bukkit/inventory/AnvilInventory.java
11-
@@ -138,4 +138,14 @@ public interface AnvilInventory extends Inventory {
11+
@@ -138,4 +138,42 @@ public interface AnvilInventory extends Inventory {
1212
setItem(2, result);
1313
}
1414
// Paper end
1515
+
1616
+ // Purpur start
17+
+ /**
18+
+ * Gets if the player viewing the anvil inventory can bypass experience cost
19+
+ *
20+
+ * @return whether the player viewing the anvil inventory can bypass the experience cost
21+
+ * @deprecated use {@link AnvilView#canBypassCost()}.
22+
+ */
23+
+ @Deprecated(forRemoval = true, since = "1.21")
1724
+ boolean canBypassCost();
1825
+
26+
+ /**
27+
+ * Set if the player viewing the anvil inventory can bypass the experience cost
28+
+ *
29+
+ * @param bypassCost whether the player viewing the anvil inventory can bypass the experience cost
30+
+ * @deprecated use {@link AnvilView#setBypassCost(boolean)}.
31+
+ */
32+
+ @Deprecated(forRemoval = true, since = "1.21")
1933
+ void setBypassCost(boolean bypassCost);
2034
+
35+
+ /**
36+
+ * Gets if the player viewing the anvil inventory can do unsafe enchants
37+
+ *
38+
+ * @return whether the player viewing the anvil inventory can do unsafe enchants
39+
+ * @deprecated use {@link AnvilView#canDoUnsafeEnchants()}.
40+
+ */
41+
+ @Deprecated(forRemoval = true, since = "1.21")
2142
+ boolean canDoUnsafeEnchants();
2243
+
44+
+ /**
45+
+ * Set if the player viewing the anvil inventory can do unsafe enchants
46+
+ *
47+
+ * @param canDoUnsafeEnchants whether the player viewing the anvil inventory can do unsafe enchants
48+
+ * @deprecated use {@link AnvilView#setDoUnsafeEnchants(boolean)}.
49+
+ */
50+
+ @Deprecated(forRemoval = true, since = "1.21")
2351
+ void setDoUnsafeEnchants(boolean canDoUnsafeEnchants);
2452
+ // Purpur end
2553
}
2654
diff --git a/src/main/java/org/bukkit/inventory/view/AnvilView.java b/src/main/java/org/bukkit/inventory/view/AnvilView.java
27-
index 0344b3db789baf1da0b59f2d2cd66154b69b38a9..c824a94f81925abc91eff7424c8021da10980bad 100644
55+
index 0344b3db789baf1da0b59f2d2cd66154b69b38a9..4b130327c84b05938d21d563f78361f9483a6a4e 100644
2856
--- a/src/main/java/org/bukkit/inventory/view/AnvilView.java
2957
+++ b/src/main/java/org/bukkit/inventory/view/AnvilView.java
30-
@@ -59,4 +59,14 @@ public interface AnvilView extends InventoryView {
58+
@@ -59,4 +59,34 @@ public interface AnvilView extends InventoryView {
3159
* @param levels the levels to set
3260
*/
3361
void setMaximumRepairCost(int levels);
3462
+
3563
+ // Purpur start
64+
+ /**
65+
+ * Gets if the player viewing the anvil inventory can bypass experience cost
66+
+ *
67+
+ * @return whether the player viewing the anvil inventory can bypass the experience cost
68+
+ */
3669
+ boolean canBypassCost();
3770
+
71+
+ /**
72+
+ * Set if the player viewing the anvil inventory can bypass the experience cost
73+
+ *
74+
+ * @param bypassCost whether the player viewing the anvil inventory can bypass the experience cost
75+
+ */
3876
+ void setBypassCost(boolean bypassCost);
3977
+
78+
+ /**
79+
+ * Gets if the player viewing the anvil inventory can do unsafe enchants
80+
+ *
81+
+ * @return whether the player viewing the anvil inventory can do unsafe enchants
82+
+ */
4083
+ boolean canDoUnsafeEnchants();
4184
+
85+
+ /**
86+
+ * Set if the player viewing the anvil inventory can do unsafe enchants
87+
+ *
88+
+ * @param canDoUnsafeEnchants whether the player viewing the anvil inventory can do unsafe enchants
89+
+ */
4290
+ void setDoUnsafeEnchants(boolean canDoUnsafeEnchants);
4391
+ // Purpur end
4492
}

0 commit comments

Comments
 (0)