[ci skip] Cleanup events (#10202)
This commit is contained in:
@@ -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;
|
||||
+
|
||||
@@ -26,11 +27,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ */
|
||||
+public class PlayerNameEntityEvent extends PlayerEvent implements Cancellable {
|
||||
+
|
||||
+ private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||
+
|
||||
+ private LivingEntity entity;
|
||||
+ private Component name;
|
||||
+ private boolean persistent;
|
||||
+
|
||||
+ private boolean cancelled;
|
||||
+
|
||||
+ @ApiStatus.Internal
|
||||
+ public PlayerNameEntityEvent(@NotNull Player player, @NotNull LivingEntity entity, @NotNull Component name, boolean persistent) {
|
||||
+ super(player);
|
||||
+ this.entity = entity;
|
||||
@@ -40,11 +45,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the name to be given to the entity.
|
||||
+ *
|
||||
+ * @return the name
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ public Component getName() {
|
||||
+ return name;
|
||||
+ return this.name;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -63,7 +69,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public LivingEntity getEntity() {
|
||||
+ return entity;
|
||||
+ return this.entity;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -81,7 +87,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ * @return persistent
|
||||
+ */
|
||||
+ public boolean isPersistent() {
|
||||
+ return persistent;
|
||||
+ return this.persistent;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
@@ -93,30 +99,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ this.persistent = persistent;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the cancellation state of this event. A cancelled event will not
|
||||
+ * be executed in the server, but will still pass to other plugins
|
||||
+ *
|
||||
+ * @return true if this event is cancelled
|
||||
+ */
|
||||
+ @Override
|
||||
+ public boolean isCancelled() {
|
||||
+ return cancelled;
|
||||
+ return this.cancelled;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the cancellation state of this event. A cancelled event will not
|
||||
+ * be executed in the server, but will still pass to other plugins.
|
||||
+ *
|
||||
+ * @param cancel true if you wish to cancel this event
|
||||
+ */
|
||||
+ @Override
|
||||
+ public void setCancelled(boolean cancel) {
|
||||
+ this.cancelled = cancel;
|
||||
+ }
|
||||
+
|
||||
+ private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||
+
|
||||
+ @NotNull
|
||||
+ @Override
|
||||
+ public HandlerList getHandlers() {
|
||||
|
||||
Reference in New Issue
Block a user