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

@@ -7,7 +7,7 @@ Control what potion the witch readies to use
diff --git a/src/main/java/com/destroystokyo/paper/event/entity/WitchReadyPotionEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/WitchReadyPotionEvent.java
new file mode 100644
index 00000000..0e0c6da7
index 000000000..5351b523d
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/entity/WitchReadyPotionEvent.java
@@ -0,0 +0,0 @@
@@ -16,15 +16,16 @@ index 00000000..0e0c6da7
+import org.bukkit.Material;
+import org.bukkit.entity.Witch;
+import org.bukkit.event.Cancellable;
+import org.bukkit.event.Event;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.entity.EntityEvent;
+import org.bukkit.inventory.ItemStack;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+public class WitchReadyPotionEvent extends EntityEvent implements Cancellable {
+ private ItemStack potion;
+
+ public WitchReadyPotionEvent(Witch witch, ItemStack potion) {
+ public WitchReadyPotionEvent(@NotNull Witch witch, @Nullable ItemStack potion) {
+ super(witch);
+ this.potion = potion;
+ }
@@ -35,7 +36,8 @@ index 00000000..0e0c6da7
+ * @param potion the potion to be used
+ * @return The ItemStack to be used
+ */
+ public static ItemStack process(Witch witch, ItemStack potion) {
+ @Nullable
+ public static ItemStack process(@NotNull Witch witch, @Nullable ItemStack potion) {
+ WitchReadyPotionEvent event = new WitchReadyPotionEvent(witch, potion);
+ if (!event.callEvent() || event.getPotion() == null) {
+ return new ItemStack(Material.AIR);
@@ -43,6 +45,7 @@ index 00000000..0e0c6da7
+ return event.getPotion();
+ }
+
+ @NotNull
+ @Override
+ public Witch getEntity() {
+ return (Witch) super.getEntity();
@@ -51,6 +54,7 @@ index 00000000..0e0c6da7
+ /**
+ * @return the potion the witch is readying to use
+ */
+ @Nullable
+ public ItemStack getPotion() {
+ return potion;
+ }
@@ -59,16 +63,18 @@ index 00000000..0e0c6da7
+ * Sets the potion the which is going to hold and use
+ * @param potion The potion
+ */
+ public void setPotion(ItemStack potion) {
+ public void setPotion(@Nullable ItemStack potion) {
+ this.potion = potion != null ? potion.clone() : null;
+ }
+
+ private static final HandlerList handlers = new HandlerList();
+
+ @NotNull
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }