mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
Fix Nullability Annotations for PrepareItemEnchantEvent (#7681)
This commit is contained in:
parent
98451ad73f
commit
2e9ebc6ff4
1 changed files with 19 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue