Swap some nullable annotations (#9696)

This commit is contained in:
Lulu13022002
2023-09-14 12:44:12 +02:00
parent 11f2c20c6a
commit abbdae4f53
9 changed files with 171 additions and 57 deletions

View File

@@ -22,6 +22,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
@@ -36,10 +37,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ private static final HandlerList HANDLERS = new HandlerList();
+
+ @NotNull private final SlotType slotType;
+ @Nullable private final ItemStack oldItem;
+ @Nullable private final ItemStack newItem;
+ @NotNull private final ItemStack oldItem;
+ @NotNull private final ItemStack newItem;
+
+ public PlayerArmorChangeEvent(@NotNull Player player, @NotNull SlotType slotType, @Nullable ItemStack oldItem, @Nullable ItemStack newItem) {
+ @ApiStatus.Internal
+ public PlayerArmorChangeEvent(@NotNull Player player, @NotNull SlotType slotType, @NotNull ItemStack oldItem, @NotNull ItemStack newItem) {
+ super(player);
+ this.slotType = slotType;
+ this.oldItem = oldItem;
@@ -61,7 +63,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ *
+ * @return old item
+ */
+ @Nullable
+ @NotNull
+ public ItemStack getOldItem() {
+ return this.oldItem;
+ }
@@ -71,7 +73,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ *
+ * @return new item
+ */
+ @Nullable
+ @NotNull
+ public ItemStack getNewItem() {
+ return this.newItem;
+ }
@@ -137,10 +139,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+
+ /**
+ * Gets whether or not this material can be equipped to a slot
+ * Gets whether this material can be equipped to a slot
+ *
+ * @param material material to check
+ * @return whether or not this material can be equipped
+ * @return whether this material can be equipped
+ */
+ public static boolean isEquipable(@NotNull Material material) {
+ return getByMaterial(material) != null;