switch to JSpecify annotations

This commit is contained in:
granny
2024-10-03 19:33:40 -07:00
parent 212c942316
commit 2eaea6a060
13 changed files with 158 additions and 173 deletions

View File

@@ -6,10 +6,10 @@ Subject: [PATCH] Grindstone API
diff --git a/src/main/java/org/purpurmc/purpur/event/inventory/GrindstoneTakeResultEvent.java b/src/main/java/org/purpurmc/purpur/event/inventory/GrindstoneTakeResultEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..d4ccbce1dc8817dcc97c7cdce65d099b6c16b0c8
index 0000000000000000000000000000000000000000..d6db2d355553c9c54b83328d237b9c75e7a8e375
--- /dev/null
+++ b/src/main/java/org/purpurmc/purpur/event/inventory/GrindstoneTakeResultEvent.java
@@ -0,0 +1,74 @@
@@ -0,0 +1,72 @@
+package org.purpurmc.purpur.event.inventory;
+
+import org.bukkit.entity.HumanEntity;
@@ -19,35 +19,35 @@ index 0000000000000000000000000000000000000000..d4ccbce1dc8817dcc97c7cdce65d099b
+import org.bukkit.inventory.GrindstoneInventory;
+import org.bukkit.inventory.InventoryView;
+import org.bukkit.inventory.ItemStack;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.ApiStatus;
+import org.jspecify.annotations.NullMarked;
+
+/**
+ * Called when a player takes the result item out of a Grindstone
+ */
+@NullMarked
+public class GrindstoneTakeResultEvent extends InventoryEvent {
+ private static final HandlerList handlers = new HandlerList();
+ private final Player player;
+ private final ItemStack result;
+ private int experienceAmount;
+
+ public GrindstoneTakeResultEvent(@NotNull HumanEntity player, @NotNull InventoryView view, @NotNull ItemStack result, int experienceAmount) {
+ @ApiStatus.Internal
+ public GrindstoneTakeResultEvent(HumanEntity player, InventoryView view, ItemStack result, int experienceAmount) {
+ super(view);
+ this.player = (Player) player;
+ this.result = result;
+ this.experienceAmount = experienceAmount;
+ }
+
+ @NotNull
+ public Player getPlayer() {
+ return player;
+ }
+
+ @NotNull
+ public ItemStack getResult() {
+ return result;
+ }
+
+ @NotNull
+ @Override
+ public GrindstoneInventory getInventory() {
+ return (GrindstoneInventory) super.getInventory();
@@ -73,13 +73,11 @@ index 0000000000000000000000000000000000000000..d4ccbce1dc8817dcc97c7cdce65d099b
+ this.experienceAmount = experienceAmount;
+ }
+
+ @NotNull
+ @Override
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }