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] AnvilDamageEvent
diff --git a/src/main/java/com/destroystokyo/paper/event/block/AnvilDamagedEvent.java b/src/main/java/com/destroystokyo/paper/event/block/AnvilDamagedEvent.java
new file mode 100644
index 00000000..fd3c5c02
index 000000000..a83c286c1
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/block/AnvilDamagedEvent.java
@@ -0,0 +0,0 @@
@@ -19,6 +19,8 @@ index 00000000..fd3c5c02
+import org.bukkit.event.inventory.InventoryEvent;
+import org.bukkit.inventory.AnvilInventory;
+import org.bukkit.inventory.InventoryView;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Called when an anvil is damaged from being used
@@ -28,11 +30,12 @@ index 00000000..fd3c5c02
+ private boolean cancel;
+ private DamageState damageState;
+
+ public AnvilDamagedEvent(InventoryView inventory, BlockData blockData) {
+ public AnvilDamagedEvent(@NotNull InventoryView inventory, @NotNull BlockData blockData) {
+ super(inventory);
+ this.damageState = DamageState.getState(blockData);
+ }
+
+ @NotNull
+ @Override
+ public AnvilInventory getInventory() {
+ return (AnvilInventory) super.getInventory();
@@ -43,6 +46,7 @@ index 00000000..fd3c5c02
+ *
+ * @return Damage state
+ */
+ @NotNull
+ public DamageState getDamageState() {
+ return damageState;
+ }
@@ -52,7 +56,7 @@ index 00000000..fd3c5c02
+ *
+ * @param damageState Damage state
+ */
+ public void setDamageState(DamageState damageState) {
+ public void setDamageState(@NotNull DamageState damageState) {
+ this.damageState = damageState;
+ }
+
@@ -86,10 +90,12 @@ index 00000000..fd3c5c02
+ this.cancel = cancel;
+ }
+
+ @NotNull
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
@@ -105,7 +111,7 @@ index 00000000..fd3c5c02
+
+ private Material material;
+
+ DamageState(Material material) {
+ DamageState(@NotNull Material material) {
+ this.material = material;
+ }
+
@@ -114,6 +120,7 @@ index 00000000..fd3c5c02
+ *
+ * @return Material
+ */
+ @NotNull
+ public Material getMaterial() {
+ return material;
+ }
@@ -125,7 +132,8 @@ index 00000000..fd3c5c02
+ * @return DamageState
+ * @throws IllegalArgumentException If non anvil block data is given
+ */
+ public static DamageState getState(BlockData blockData) {
+ @NotNull
+ public static DamageState getState(@Nullable BlockData blockData) {
+ return blockData == null ? BROKEN : getState(blockData.getMaterial());
+ }
+
@@ -136,7 +144,8 @@ index 00000000..fd3c5c02
+ * @return DamageState
+ * @throws IllegalArgumentException If non anvil material is given
+ */
+ public static DamageState getState(Material material) {
+ @NotNull
+ public static DamageState getState(@Nullable Material material) {
+ if (material == null) {
+ return BROKEN;
+ }