[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,6 +18,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import org.bukkit.event.Cancellable;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.player.PlayerEvent;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
@@ -29,8 +30,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ private final Block bed;
+ private boolean willExplode;
+ private Component message;
+
+ private boolean cancelled;
+
+ @ApiStatus.Internal
+ public PlayerBedFailEnterEvent(@NotNull Player player, @NotNull FailReason failReason, @NotNull Block bed, boolean willExplode, @Nullable Component message) {
+ super(player);
+ this.failReason = failReason;
@@ -41,16 +44,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ @NotNull
+ public FailReason getFailReason() {
+ return failReason;
+ return this.failReason;
+ }
+
+ @NotNull
+ public Block getBed() {
+ return bed;
+ return this.bed;
+ }
+
+ public boolean getWillExplode() {
+ return willExplode;
+ return this.willExplode;
+ }
+
+ public void setWillExplode(boolean willExplode) {
@@ -59,7 +62,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ @Nullable
+ public Component getMessage() {
+ return message;
+ return this.message;
+ }
+
+ public void setMessage(@Nullable Component message) {
@@ -68,19 +71,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ @Override
+ public boolean isCancelled() {
+ return cancelled;
+ return this.cancelled;
+ }
+
+ /**
+ * Cancel this event.
+ * {@inheritDoc}
+ * <p>
+ * <b>NOTE: This does not cancel the player getting in the bed, but any messages/explosions
+ * that may occur because of the interaction.</b>
+ * @param cancel true if you wish to cancel this event
+ * <b>NOTE</b>: This does not cancel the player getting in the bed, but any messages/explosions
+ * that may occur because of the interaction.
+ */
+ @Override
+ public void setCancelled(boolean cancel) {
+ cancelled = cancel;
+ this.cancelled = cancel;
+ }
+
+ @NotNull
@@ -94,7 +96,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return HANDLER_LIST;
+ }
+
+ public static enum FailReason {
+ public enum FailReason {
+ /**
+ * The world doesn't allow sleeping (ex. Nether or The End). Entering
+ * the bed is prevented and the bed explodes.
@@ -124,8 +126,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ /**
+ * Entering the bed is prevented due to there being monsters nearby.
+ */
+ NOT_SAFE;
+
+ public static final FailReason[] VALUES = values();
+ NOT_SAFE
+ }
+}