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] Add ray tracing methods to LivingEntity
diff --git a/src/main/java/com/destroystokyo/paper/block/TargetBlockInfo.java b/src/main/java/com/destroystokyo/paper/block/TargetBlockInfo.java
new file mode 100644
index 00000000..fe43d955
index 000000000..18a96dbb0
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/block/TargetBlockInfo.java
@@ -0,0 +0,0 @@
@@ -14,6 +14,7 @@ index 00000000..fe43d955
+
+import org.bukkit.block.Block;
+import org.bukkit.block.BlockFace;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Represents information about a targeted block
@@ -22,7 +23,7 @@ index 00000000..fe43d955
+ private final Block block;
+ private final BlockFace blockFace;
+
+ public TargetBlockInfo(Block block, BlockFace blockFace) {
+ public TargetBlockInfo(@NotNull Block block, @NotNull BlockFace blockFace) {
+ this.block = block;
+ this.blockFace = blockFace;
+ }
@@ -32,6 +33,7 @@ index 00000000..fe43d955
+ *
+ * @return Targeted block
+ */
+ @NotNull
+ public Block getBlock() {
+ return block;
+ }
@@ -41,6 +43,7 @@ index 00000000..fe43d955
+ *
+ * @return Targeted blockface
+ */
+ @NotNull
+ public BlockFace getBlockFace() {
+ return blockFace;
+ }
@@ -50,6 +53,7 @@ index 00000000..fe43d955
+ *
+ * @return Block relative to targeted block
+ */
+ @NotNull
+ public Block getRelativeBlock() {
+ return block.getRelative(blockFace);
+ }
@@ -61,12 +65,12 @@ index 00000000..fe43d955
+ }
+}
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index e3bc04e1..bd47e720 100644
index 863d727d0..4dec50caf 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -0,0 +0,0 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
*/
public Block getTargetBlock(Set<Material> transparent, int maxDistance);
@NotNull
public Block getTargetBlock(@Nullable Set<Material> transparent, int maxDistance);
+ // Paper start
+ /**
@@ -90,7 +94,7 @@ index e3bc04e1..bd47e720 100644
+ * or null if no block is within maxDistance
+ */
+ @Nullable
+ public Block getTargetBlock(int maxDistance, com.destroystokyo.paper.block.TargetBlockInfo.FluidMode fluidMode);
+ public Block getTargetBlock(int maxDistance, @NotNull com.destroystokyo.paper.block.TargetBlockInfo.FluidMode fluidMode);
+
+ /**
+ * Gets the blockface of that block that the living entity has targeted, ignoring fluids
@@ -113,7 +117,7 @@ index e3bc04e1..bd47e720 100644
+ * or null if no block is targeted
+ */
+ @Nullable
+ public org.bukkit.block.BlockFace getTargetBlockFace(int maxDistance, com.destroystokyo.paper.block.TargetBlockInfo.FluidMode fluidMode);
+ public org.bukkit.block.BlockFace getTargetBlockFace(int maxDistance, @NotNull com.destroystokyo.paper.block.TargetBlockInfo.FluidMode fluidMode);
+
+ /**
+ * Gets information about the block the living entity has targeted, ignoring fluids
@@ -136,7 +140,7 @@ index e3bc04e1..bd47e720 100644
+ * or null if no block is targeted
+ */
+ @Nullable
+ public com.destroystokyo.paper.block.TargetBlockInfo getTargetBlockInfo(int maxDistance, com.destroystokyo.paper.block.TargetBlockInfo.FluidMode fluidMode);
+ public com.destroystokyo.paper.block.TargetBlockInfo getTargetBlockInfo(int maxDistance, @NotNull com.destroystokyo.paper.block.TargetBlockInfo.FluidMode fluidMode);
+ // Paper end
+
/**