geforkt von Mirrors/Paper
Fix Nullability Annotations for PrepareItemEnchantEvent (#7681)
Dieser Commit ist enthalten in:
Ursprung
98451ad73f
Commit
2e9ebc6ff4
@ -106,6 +106,15 @@ diff --git a/src/main/java/org/bukkit/event/enchantment/PrepareItemEnchantEvent.
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/event/enchantment/PrepareItemEnchantEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/enchantment/PrepareItemEnchantEvent.java
|
||||
@@ -0,0 +0,0 @@ public class PrepareItemEnchantEvent extends InventoryEvent implements Cancellab
|
||||
private boolean cancelled;
|
||||
private final Player enchanter;
|
||||
|
||||
- public PrepareItemEnchantEvent(@NotNull final Player enchanter, @NotNull InventoryView view, @NotNull final Block table, @NotNull final ItemStack item, @NotNull final EnchantmentOffer[] offers, final int bonus) {
|
||||
+ public PrepareItemEnchantEvent(@NotNull final Player enchanter, @NotNull InventoryView view, @NotNull final Block table, @NotNull final ItemStack item, @org.jetbrains.annotations.Nullable final EnchantmentOffer @NotNull [] offers, final int bonus) { // Paper - offers can contain null values
|
||||
super(view);
|
||||
this.enchanter = enchanter;
|
||||
this.table = table;
|
||||
@@ -0,0 +0,0 @@ public class PrepareItemEnchantEvent extends InventoryEvent implements Cancellab
|
||||
* @return experience level costs offered
|
||||
* @deprecated Use {@link #getOffers()} instead of this method
|
||||
@ -114,6 +123,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
@NotNull
|
||||
public int[] getExpLevelCostsOffered() {
|
||||
int[] levelOffers = new int[offers.length];
|
||||
@@ -0,0 +0,0 @@ public class PrepareItemEnchantEvent extends InventoryEvent implements Cancellab
|
||||
*
|
||||
* @return list of available enchantment offers
|
||||
*/
|
||||
- @NotNull
|
||||
- public EnchantmentOffer[] getOffers() {
|
||||
+ public @org.jetbrains.annotations.Nullable EnchantmentOffer @NotNull [] getOffers() { // Paper offers can contain null values
|
||||
return offers;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/inventory/CraftingInventory.java b/src/main/java/org/bukkit/inventory/CraftingInventory.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/CraftingInventory.java
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren