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

@@ -12,7 +12,7 @@ This is useful for implementing a ProfileCache for Player Skulls
diff --git a/src/main/java/com/destroystokyo/paper/event/profile/FillProfileEvent.java b/src/main/java/com/destroystokyo/paper/event/profile/FillProfileEvent.java
new file mode 100644
index 00000000..182bd661
index 000000000..71f36e9ca
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/profile/FillProfileEvent.java
@@ -0,0 +0,0 @@
@@ -46,16 +46,16 @@ index 00000000..182bd661
+import org.bukkit.event.Event;
+import org.bukkit.event.HandlerList;
+
+import javax.annotation.Nonnull;
+import java.util.Set;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Fired once a profiles additional properties (such as textures) has been filled
+ */
+public class FillProfileEvent extends Event {
+ private final PlayerProfile profile;
+ @NotNull private final PlayerProfile profile;
+
+ public FillProfileEvent(@Nonnull PlayerProfile profile) {
+ public FillProfileEvent(@NotNull PlayerProfile profile) {
+ super(!org.bukkit.Bukkit.isPrimaryThread());
+ this.profile = profile;
+ }
@@ -63,7 +63,7 @@ index 00000000..182bd661
+ /**
+ * @return The Profile that had properties filled
+ */
+ @Nonnull
+ @NotNull
+ public PlayerProfile getPlayerProfile() {
+ return profile;
+ }
@@ -74,23 +74,26 @@ index 00000000..182bd661
+ * @see PlayerProfile#getProperties()
+ * @return The new properties on the profile.
+ */
+ @NotNull
+ public Set<ProfileProperty> getProperties() {
+ return profile.getProperties();
+ }
+
+ private static final HandlerList handlers = new HandlerList();
+
+ @NotNull
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+}
diff --git a/src/main/java/com/destroystokyo/paper/event/profile/PreFillProfileEvent.java b/src/main/java/com/destroystokyo/paper/event/profile/PreFillProfileEvent.java
new file mode 100644
index 00000000..aba0c087
index 000000000..021bc8631
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/profile/PreFillProfileEvent.java
@@ -0,0 +0,0 @@
@@ -124,8 +127,8 @@ index 00000000..aba0c087
+import org.bukkit.event.Event;
+import org.bukkit.event.HandlerList;
+
+import javax.annotation.Nonnull;
+import java.util.Collection;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Fired when the server is requesting to fill in properties of an incomplete profile, such as textures.
@@ -133,9 +136,9 @@ index 00000000..aba0c087
+ * Allows plugins to pre populate cached properties and avoid a call to the Mojang API
+ */
+public class PreFillProfileEvent extends Event {
+ private final PlayerProfile profile;
+ @NotNull private final PlayerProfile profile;
+
+ public PreFillProfileEvent(PlayerProfile profile) {
+ public PreFillProfileEvent(@NotNull PlayerProfile profile) {
+ super(!org.bukkit.Bukkit.isPrimaryThread());
+ this.profile = profile;
+ }
@@ -143,6 +146,7 @@ index 00000000..aba0c087
+ /**
+ * @return The profile that needs its properties filled
+ */
+ @NotNull
+ public PlayerProfile getPlayerProfile() {
+ return profile;
+ }
@@ -154,16 +158,18 @@ index 00000000..aba0c087
+ * @see PlayerProfile#setProperties(Collection)
+ * @param properties The properties to set/append
+ */
+ public void setProperties(@Nonnull Collection<ProfileProperty> properties) {
+ public void setProperties(@NotNull Collection<ProfileProperty> properties) {
+ profile.setProperties(properties);
+ }
+
+ private static final HandlerList handlers = new HandlerList();
+
+ @NotNull
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }