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 c3c889523f
commit 0976d52bbd
261 changed files with 3224 additions and 2923 deletions

View file

@ -1,4 +1,4 @@
From fa9d75620f187b39ddf397a8a37e951768f1a1f5 Mon Sep 17 00:00:00 2001
From 72e0411e853da36205ab8e3d24041de5d7b80ac5 Mon Sep 17 00:00:00 2001
From: pkt77 <parkerkt77@gmail.com>
Date: Fri, 10 Nov 2017 23:45:59 -0500
Subject: [PATCH] Add PlayerArmorChangeEvent
@ -6,10 +6,10 @@ Subject: [PATCH] Add PlayerArmorChangeEvent
diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerArmorChangeEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerArmorChangeEvent.java
new file mode 100644
index 00000000..0783ac82
index 000000000..2827a1002
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerArmorChangeEvent.java
@@ -0,0 +1,135 @@
@@ -0,0 +1,137 @@
+package com.destroystokyo.paper.event.player;
+
+import org.bukkit.Material;
@ -18,12 +18,12 @@ index 00000000..0783ac82
+import org.bukkit.event.player.PlayerEvent;
+import org.bukkit.inventory.ItemStack;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import static org.bukkit.Material.*;
+
@ -35,11 +35,11 @@ index 00000000..0783ac82
+public class PlayerArmorChangeEvent extends PlayerEvent {
+ private static final HandlerList HANDLERS = new HandlerList();
+
+ private final SlotType slotType;
+ private final ItemStack oldItem;
+ private final ItemStack newItem;
+ @NotNull private final SlotType slotType;
+ @Nullable private final ItemStack oldItem;
+ @Nullable private final ItemStack newItem;
+
+ public PlayerArmorChangeEvent(Player player, SlotType slotType, ItemStack oldItem, ItemStack newItem) {
+ public PlayerArmorChangeEvent(@NotNull Player player, @NotNull SlotType slotType, @Nullable ItemStack oldItem, @Nullable ItemStack newItem) {
+ super(player);
+ this.slotType = slotType;
+ this.oldItem = oldItem;
@ -51,7 +51,7 @@ index 00000000..0783ac82
+ *
+ * @return type of slot being altered
+ */
+ @Nonnull
+ @NotNull
+ public SlotType getSlotType() {
+ return this.slotType;
+ }
@ -81,11 +81,13 @@ index 00000000..0783ac82
+ return "ArmorChangeEvent{" + "player=" + player + ", slotType=" + slotType + ", oldItem=" + oldItem + ", newItem=" + newItem + '}';
+ }
+
+ @NotNull
+ @Override
+ public HandlerList getHandlers() {
+ return HANDLERS;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return HANDLERS;
+ }
@ -109,7 +111,7 @@ index 00000000..0783ac82
+ *
+ * @return immutable set of material types
+ */
+ @Nonnull
+ @NotNull
+ public Set<Material> getTypes() {
+ if (immutableTypes == null) {
+ immutableTypes = Collections.unmodifiableSet(mutableTypes);
@ -125,7 +127,7 @@ index 00000000..0783ac82
+ * @return slot type the material will go in, or null if it won't
+ */
+ @Nullable
+ public static SlotType getByMaterial(Material material) {
+ public static SlotType getByMaterial(@NotNull Material material) {
+ for (SlotType slotType : values()) {
+ if (slotType.getTypes().contains(material)) {
+ return slotType;
@ -140,11 +142,11 @@ index 00000000..0783ac82
+ * @param material material to check
+ * @return whether or not this material can be equipped
+ */
+ public static boolean isEquipable(Material material) {
+ public static boolean isEquipable(@NotNull Material material) {
+ return getByMaterial(material) != null;
+ }
+ }
+}
--
2.20.1
2.21.0