Updated Upstream (Bukkit/CraftBukkit/Spigot)

Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Please note that this build includes changes to meet upstreams
requirements for nullability annotations. While we aim for a level of
accuracy, these might not be 100% correct, if there are any issues,
please speak to us on discord, or open an issue on the tracker to
discuss.

Bukkit Changes:
9a6a1de3 Remove nullability annotations from enum constructors
3f0591ea SPIGOT-2540: Add nullability annotations to entire Bukkit API

CraftBukkit Changes:
8d8475fc SPIGOT-4666: Force parameter in HumanEntity#sleep
8b1588e2 Fix ExplosionPrimeEvent#setFire not working with EnderCrystals
39a287b7 Don't ignore newlines in PlayerListHeader/Footer

Spigot Changes:
cf694d87 Add nullability annotations
This commit is contained in:
Shane Freeder
2019-03-20 00:28:15 +00:00
parent 2b722719b3
commit a7ba5db3de
260 changed files with 2328 additions and 2021 deletions

View File

@@ -6,7 +6,7 @@ Subject: [PATCH] Turtle API
diff --git a/src/main/java/com/destroystokyo/paper/event/entity/TurtleGoHomeEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/TurtleGoHomeEvent.java
new file mode 100644
index 00000000..11248ee9
index 000000000..021356d15
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/entity/TurtleGoHomeEvent.java
@@ -0,0 +0,0 @@
@@ -16,6 +16,7 @@ index 00000000..11248ee9
+import org.bukkit.event.Cancellable;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.entity.EntityEvent;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Fired when a Turtle decides to go home
@@ -24,7 +25,7 @@ index 00000000..11248ee9
+ private static final HandlerList handlers = new HandlerList();
+ private boolean cancelled = false;
+
+ public TurtleGoHomeEvent(Turtle turtle) {
+ public TurtleGoHomeEvent(@NotNull Turtle turtle) {
+ super(turtle);
+ }
+
@@ -33,6 +34,7 @@ index 00000000..11248ee9
+ *
+ * @return The turtle
+ */
+ @NotNull
+ public Turtle getEntity() {
+ return (Turtle) entity;
+ }
@@ -47,17 +49,19 @@ index 00000000..11248ee9
+ cancelled = cancel;
+ }
+
+ @NotNull
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+}
diff --git a/src/main/java/com/destroystokyo/paper/event/entity/TurtleLayEggEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/TurtleLayEggEvent.java
new file mode 100644
index 00000000..7cb00f78
index 000000000..a315c5185
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/entity/TurtleLayEggEvent.java
@@ -0,0 +0,0 @@
@@ -68,6 +72,7 @@ index 00000000..7cb00f78
+import org.bukkit.event.Cancellable;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.entity.EntityEvent;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Fired when a Turtle lays eggs
@@ -75,10 +80,11 @@ index 00000000..7cb00f78
+public class TurtleLayEggEvent extends EntityEvent implements Cancellable {
+ private static final HandlerList handlers = new HandlerList();
+ private boolean cancelled = false;
+ @NotNull
+ private final Location location;
+ private int eggCount;
+
+ public TurtleLayEggEvent(Turtle turtle, Location location, int eggCount) {
+ public TurtleLayEggEvent(@NotNull Turtle turtle, @NotNull Location location, int eggCount) {
+ super(turtle);
+ this.location = location;
+ this.eggCount = eggCount;
@@ -89,6 +95,7 @@ index 00000000..7cb00f78
+ *
+ * @return The turtle
+ */
+ @NotNull
+ public Turtle getEntity() {
+ return (Turtle) entity;
+ }
@@ -98,6 +105,7 @@ index 00000000..7cb00f78
+ *
+ * @return Location of eggs
+ */
+ @NotNull
+ public Location getLocation() {
+ return location;
+ }
@@ -134,17 +142,19 @@ index 00000000..7cb00f78
+ cancelled = cancel;
+ }
+
+ @NotNull
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+}
diff --git a/src/main/java/com/destroystokyo/paper/event/entity/TurtleStartDiggingEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/TurtleStartDiggingEvent.java
new file mode 100644
index 00000000..5d53ee08
index 000000000..abeb24fcc
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/entity/TurtleStartDiggingEvent.java
@@ -0,0 +0,0 @@
@@ -155,6 +165,7 @@ index 00000000..5d53ee08
+import org.bukkit.event.Cancellable;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.entity.EntityEvent;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Fired when a Turtle starts digging to lay eggs
@@ -162,9 +173,9 @@ index 00000000..5d53ee08
+public class TurtleStartDiggingEvent extends EntityEvent implements Cancellable {
+ private static final HandlerList handlers = new HandlerList();
+ private boolean cancelled = false;
+ private final Location location;
+ @NotNull private final Location location;
+
+ public TurtleStartDiggingEvent(Turtle turtle, Location location) {
+ public TurtleStartDiggingEvent(@NotNull Turtle turtle, @NotNull Location location) {
+ super(turtle);
+ this.location = location;
+ }
@@ -174,6 +185,7 @@ index 00000000..5d53ee08
+ *
+ * @return The turtle
+ */
+ @NotNull
+ public Turtle getEntity() {
+ return (Turtle) entity;
+ }
@@ -183,6 +195,7 @@ index 00000000..5d53ee08
+ *
+ * @return Location where digging
+ */
+ @NotNull
+ public Location getLocation() {
+ return location;
+ }
@@ -197,22 +210,25 @@ index 00000000..5d53ee08
+ cancelled = cancel;
+ }
+
+ @NotNull
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+}
diff --git a/src/main/java/org/bukkit/entity/Turtle.java b/src/main/java/org/bukkit/entity/Turtle.java
index 0a4cd299..e547eead 100644
index 0a4cd2993..5375ea140 100644
--- a/src/main/java/org/bukkit/entity/Turtle.java
+++ b/src/main/java/org/bukkit/entity/Turtle.java
@@ -0,0 +0,0 @@
package org.bukkit.entity;
+import org.bukkit.Location;
+import org.jetbrains.annotations.NotNull;
+
/**
* Represents a turtle.
@@ -226,6 +242,7 @@ index 0a4cd299..e547eead 100644
+ *
+ * @return Home location
+ */
+ @NotNull
+ Location getHome();
+
+ /**
@@ -233,7 +250,7 @@ index 0a4cd299..e547eead 100644
+ *
+ * @param location Home location
+ */
+ void setHome(Location location);
+ void setHome(@NotNull Location location);
+
+ /**
+ * Check if turtle is currently pathfinding to it's home