mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-02 21:22:05 -07:00
Begin switching to JSpecify annotations (#11448)
* Begin switching to JSpecify annotations * more * fixes
This commit is contained in:
@@ -17,11 +17,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.entity.EntityEvent;
|
||||
+import org.jetbrains.annotations.ApiStatus;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jspecify.annotations.NullMarked;
|
||||
+
|
||||
+/**
|
||||
+ * Fired when a Turtle decides to go home
|
||||
+ */
|
||||
+@NullMarked
|
||||
+public class TurtleGoHomeEvent extends EntityEvent implements Cancellable {
|
||||
+
|
||||
+ private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||
@@ -29,7 +30,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ private boolean cancelled;
|
||||
+
|
||||
+ @ApiStatus.Internal
|
||||
+ public TurtleGoHomeEvent(@NotNull Turtle turtle) {
|
||||
+ public TurtleGoHomeEvent(final Turtle turtle) {
|
||||
+ super(turtle);
|
||||
+ }
|
||||
+
|
||||
@@ -38,7 +39,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ *
|
||||
+ * @return The turtle
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public Turtle getEntity() {
|
||||
+ return (Turtle) super.getEntity();
|
||||
+ }
|
||||
@@ -49,16 +49,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setCancelled(boolean cancel) {
|
||||
+ public void setCancelled(final boolean cancel) {
|
||||
+ this.cancelled = cancel;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return HANDLER_LIST;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return HANDLER_LIST;
|
||||
+ }
|
||||
@@ -77,23 +75,23 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.entity.EntityEvent;
|
||||
+import org.jetbrains.annotations.ApiStatus;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jspecify.annotations.NullMarked;
|
||||
+
|
||||
+/**
|
||||
+ * Fired when a Turtle lays eggs
|
||||
+ */
|
||||
+@NullMarked
|
||||
+public class TurtleLayEggEvent extends EntityEvent implements Cancellable {
|
||||
+
|
||||
+ private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||
+
|
||||
+ @NotNull
|
||||
+ private final Location location;
|
||||
+ private int eggCount;
|
||||
+
|
||||
+ private boolean cancelled;
|
||||
+
|
||||
+ @ApiStatus.Internal
|
||||
+ public TurtleLayEggEvent(@NotNull Turtle turtle, @NotNull Location location, int eggCount) {
|
||||
+ public TurtleLayEggEvent(final Turtle turtle, final Location location, final int eggCount) {
|
||||
+ super(turtle);
|
||||
+ this.location = location;
|
||||
+ this.eggCount = eggCount;
|
||||
@@ -104,7 +102,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ *
|
||||
+ * @return The turtle
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public Turtle getEntity() {
|
||||
+ return (Turtle) super.getEntity();
|
||||
+ }
|
||||
@@ -114,7 +111,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ *
|
||||
+ * @return Location of eggs
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public Location getLocation() {
|
||||
+ return this.location.clone();
|
||||
+ }
|
||||
@@ -133,7 +129,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ *
|
||||
+ * @param eggCount Number of eggs
|
||||
+ */
|
||||
+ public void setEggCount(int eggCount) {
|
||||
+ public void setEggCount(final int eggCount) {
|
||||
+ if (eggCount < 1) {
|
||||
+ this.cancelled = true;
|
||||
+ return;
|
||||
@@ -147,16 +143,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setCancelled(boolean cancel) {
|
||||
+ public void setCancelled(final boolean cancel) {
|
||||
+ this.cancelled = cancel;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return HANDLER_LIST;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return HANDLER_LIST;
|
||||
+ }
|
||||
@@ -175,20 +169,21 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.entity.EntityEvent;
|
||||
+import org.jetbrains.annotations.ApiStatus;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jspecify.annotations.NullMarked;
|
||||
+
|
||||
+/**
|
||||
+ * Fired when a Turtle starts digging to lay eggs
|
||||
+ */
|
||||
+@NullMarked
|
||||
+public class TurtleStartDiggingEvent extends EntityEvent implements Cancellable {
|
||||
+
|
||||
+ private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||
+
|
||||
+ @NotNull private final Location location;
|
||||
+ private final Location location;
|
||||
+ private boolean cancelled;
|
||||
+
|
||||
+ @ApiStatus.Internal
|
||||
+ public TurtleStartDiggingEvent(@NotNull Turtle turtle, @NotNull Location location) {
|
||||
+ public TurtleStartDiggingEvent(final Turtle turtle, final Location location) {
|
||||
+ super(turtle);
|
||||
+ this.location = location;
|
||||
+ }
|
||||
@@ -198,7 +193,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ *
|
||||
+ * @return The turtle
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public Turtle getEntity() {
|
||||
+ return (Turtle) super.getEntity();
|
||||
+ }
|
||||
@@ -208,7 +202,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ *
|
||||
+ * @return Location where digging
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public Location getLocation() {
|
||||
+ return this.location.clone();
|
||||
+ }
|
||||
@@ -219,16 +212,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setCancelled(boolean cancel) {
|
||||
+ public void setCancelled(final boolean cancel) {
|
||||
+ this.cancelled = cancel;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return HANDLER_LIST;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return HANDLER_LIST;
|
||||
+ }
|
||||
|
Reference in New Issue
Block a user