mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-08 16:12:18 -07:00
Finish converting all events to jspecify annotations
This commit is contained in:
@@ -19,24 +19,25 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+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;
|
||||
+import org.jspecify.annotations.NullMarked;
|
||||
+import org.jspecify.annotations.Nullable;
|
||||
+
|
||||
+/**
|
||||
+ * Called when the player is attempting to rename a mob
|
||||
+ */
|
||||
+@NullMarked
|
||||
+public class PlayerNameEntityEvent extends PlayerEvent implements Cancellable {
|
||||
+
|
||||
+ private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||
+
|
||||
+ private LivingEntity entity;
|
||||
+ private Component name;
|
||||
+ private @Nullable Component name;
|
||||
+ private boolean persistent;
|
||||
+
|
||||
+ private boolean cancelled;
|
||||
+
|
||||
+ @ApiStatus.Internal
|
||||
+ public PlayerNameEntityEvent(@NotNull Player player, @NotNull LivingEntity entity, @NotNull Component name, boolean persistent) {
|
||||
+ public PlayerNameEntityEvent(final Player player, final LivingEntity entity, final Component name, final boolean persistent) {
|
||||
+ super(player);
|
||||
+ this.entity = entity;
|
||||
+ this.name = name;
|
||||
@@ -48,8 +49,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ *
|
||||
+ * @return the name
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ public Component getName() {
|
||||
+ public @Nullable Component getName() {
|
||||
+ return this.name;
|
||||
+ }
|
||||
+
|
||||
@@ -58,7 +58,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ *
|
||||
+ * @param name the name
|
||||
+ */
|
||||
+ public void setName(@Nullable Component name) {
|
||||
+ public void setName(final @Nullable Component name) {
|
||||
+ this.name = name;
|
||||
+ }
|
||||
+
|
||||
@@ -67,7 +67,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ *
|
||||
+ * @return the entity
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public LivingEntity getEntity() {
|
||||
+ return this.entity;
|
||||
+ }
|
||||
@@ -77,7 +76,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ *
|
||||
+ * @param entity the entity
|
||||
+ */
|
||||
+ public void setEntity(@NotNull LivingEntity entity) {
|
||||
+ public void setEntity(final LivingEntity entity) {
|
||||
+ this.entity = entity;
|
||||
+ }
|
||||
+
|
||||
@@ -95,7 +94,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ *
|
||||
+ * @param persistent persistent
|
||||
+ */
|
||||
+ public void setPersistent(boolean persistent) {
|
||||
+ public void setPersistent(final boolean persistent) {
|
||||
+ this.persistent = persistent;
|
||||
+ }
|
||||
+
|
||||
@@ -105,17 +104,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setCancelled(boolean cancel) {
|
||||
+ public void setCancelled(final boolean cancel) {
|
||||
+ this.cancelled = cancel;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ @Override
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return HANDLER_LIST;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return HANDLER_LIST;
|
||||
+ }
|
||||
|
Reference in New Issue
Block a user