[ci skip] Cleanup events (#10202)

This commit is contained in:
Lulu13022002 2024-02-01 10:15:57 +01:00 committed by GitHub
parent b3c81089ae
commit 294347bee2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
295 changed files with 3245 additions and 3088 deletions

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Add PlayerShearBlockEvent
diff --git a/src/main/java/io/papermc/paper/event/block/PlayerShearBlockEvent.java b/src/main/java/io/papermc/paper/event/block/PlayerShearBlockEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..aa7d440b797eac9e62678d03cc87f42838758bfd
index 0000000000000000000000000000000000000000..9bb4a79320eac7d662d9d04765664b6a7e955a4f
--- /dev/null
+++ b/src/main/java/io/papermc/paper/event/block/PlayerShearBlockEvent.java
@@ -0,0 +1,108 @@
@@ -0,0 +1,113 @@
+package io.papermc.paper.event.block;
+
+import org.bukkit.block.Block;
@ -19,6 +19,7 @@ index 0000000000000000000000000000000000000000..aa7d440b797eac9e62678d03cc87f428
+import org.bukkit.event.player.PlayerEvent;
+import org.bukkit.inventory.EquipmentSlot;
+import org.bukkit.inventory.ItemStack;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.List;
@ -32,15 +33,19 @@ index 0000000000000000000000000000000000000000..aa7d440b797eac9e62678d03cc87f428
+ * Examples include shearing a pumpkin to turn it into a carved pumpkin or shearing a beehive to get honeycomb.
+ */
+public class PlayerShearBlockEvent extends PlayerEvent implements Cancellable {
+ private static final HandlerList handlers = new HandlerList();
+ private boolean cancelled = false;
+
+ private static final HandlerList HANDLER_LIST = new HandlerList();
+
+ private final Block block;
+ private final ItemStack item;
+ private final EquipmentSlot hand;
+ private final List<ItemStack> drops;
+
+ public PlayerShearBlockEvent(@NotNull Player who, @NotNull Block block, @NotNull ItemStack item, @NotNull EquipmentSlot hand, @NotNull List<ItemStack> drops) {
+ super(who);
+ private boolean cancelled;
+
+ @ApiStatus.Internal
+ public PlayerShearBlockEvent(@NotNull Player player, @NotNull Block block, @NotNull ItemStack item, @NotNull EquipmentSlot hand, @NotNull List<ItemStack> drops) {
+ super(player);
+ this.block = block;
+ this.item = item;
+ this.hand = hand;
@ -54,7 +59,7 @@ index 0000000000000000000000000000000000000000..aa7d440b797eac9e62678d03cc87f428
+ */
+ @NotNull
+ public Block getBlock() {
+ return block;
+ return this.block;
+ }
+
+ /**
@ -64,7 +69,7 @@ index 0000000000000000000000000000000000000000..aa7d440b797eac9e62678d03cc87f428
+ */
+ @NotNull
+ public ItemStack getItem() {
+ return item;
+ return this.item;
+ }
+
+ /**
@ -74,7 +79,7 @@ index 0000000000000000000000000000000000000000..aa7d440b797eac9e62678d03cc87f428
+ */
+ @NotNull
+ public EquipmentSlot getHand() {
+ return hand;
+ return this.hand;
+ }
+
+ /**
@ -84,7 +89,7 @@ index 0000000000000000000000000000000000000000..aa7d440b797eac9e62678d03cc87f428
+ */
+ @NotNull
+ public List<ItemStack> getDrops() {
+ return drops;
+ return this.drops;
+ }
+
+ /**
@ -94,7 +99,7 @@ index 0000000000000000000000000000000000000000..aa7d440b797eac9e62678d03cc87f428
+ */
+ @Override
+ public boolean isCancelled() {
+ return cancelled;
+ return this.cancelled;
+ }
+
+ /**
@ -110,11 +115,11 @@ index 0000000000000000000000000000000000000000..aa7d440b797eac9e62678d03cc87f428
+ @NotNull
+ @Override
+ public HandlerList getHandlers() {
+ return handlers;
+ return HANDLER_LIST;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ return HANDLER_LIST;
+ }
+}