[ci skip] Cleanup events (#10202)

This commit is contained in:
Lulu13022002
2024-02-01 10:15:57 +01:00
parent d676979ea0
commit f7e469eb2e
187 changed files with 2415 additions and 2258 deletions

View File

@@ -18,13 +18,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.player.PlayerEvent;
+import org.bukkit.inventory.ItemStack;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Called when a player places an item in or takes an item out of a flowerpot.
+ */
+public class PlayerFlowerPotManipulateEvent extends PlayerEvent implements Cancellable {
+ private static final HandlerList handlers = new HandlerList();
+
+ private static final HandlerList HANDLER_LIST = new HandlerList();
+
+ @NotNull
+ private final Block flowerpot;
@@ -32,8 +34,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ private final ItemStack item;
+ private final boolean placing;
+
+ private boolean cancel = false;
+ private boolean cancelled;
+
+ @ApiStatus.Internal
+ public PlayerFlowerPotManipulateEvent(@NotNull final Player player, @NotNull final Block flowerpot, @NotNull final ItemStack item, final boolean placing) {
+ super(player);
+ this.flowerpot = flowerpot;
@@ -41,16 +44,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ this.placing = placing;
+ }
+
+ @Override
+ public boolean isCancelled() {
+ return cancel;
+ }
+
+ @Override
+ public void setCancelled(boolean cancel) {
+ this.cancel = cancel;
+ }
+
+ /**
+ * Gets the flowerpot that is involved in this event.
+ *
@@ -58,7 +51,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ */
+ @NotNull
+ public Block getFlowerpot() {
+ return flowerpot;
+ return this.flowerpot;
+ }
+
+ /**
@@ -69,7 +62,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ */
+ @NotNull
+ public ItemStack getItem() {
+ return item;
+ return this.item;
+ }
+
+ /**
@@ -78,17 +71,27 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * @return if the item is being placed into the flowerpot
+ */
+ public boolean isPlacing() {
+ return placing;
+ return this.placing;
+ }
+
+ @Override
+ public boolean isCancelled() {
+ return this.cancelled;
+ }
+
+ @Override
+ public void setCancelled(boolean cancel) {
+ this.cancelled = cancel;
+ }
+
+ @NotNull
+ @Override
+ public HandlerList getHandlers() {
+ return handlers;
+ return HANDLER_LIST;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ return HANDLER_LIST;
+ }
+}