diff --git a/Spigot-API-Patches/API-to-get-a-BlockState-without-a-snapshot.patch b/Spigot-API-Patches/API-to-get-a-BlockState-without-a-snapshot.patch index 5a628e5985..c8e2703965 100644 --- a/Spigot-API-Patches/API-to-get-a-BlockState-without-a-snapshot.patch +++ b/Spigot-API-Patches/API-to-get-a-BlockState-without-a-snapshot.patch @@ -9,11 +9,11 @@ on the real tile entity. This is useful for where performance is needed diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java -index 7664728a..064acf32 100644 +index c88088c0f..708288e99 100644 --- a/src/main/java/org/bukkit/block/Block.java +++ b/src/main/java/org/bukkit/block/Block.java @@ -0,0 +0,0 @@ public interface Block extends Metadatable { - */ + @NotNull BlockState getState(); + // Paper start @@ -22,6 +22,7 @@ index 7664728a..064acf32 100644 + * @param useSnapshot if this block is a TE, should we create a fully copy of the TileEntity + * @return BlockState with the current state of this block + */ ++ @NotNull + BlockState getState(boolean useSnapshot); + // Paper end + diff --git a/Spigot-API-Patches/Ability-to-apply-mending-to-XP-API.patch b/Spigot-API-Patches/Ability-to-apply-mending-to-XP-API.patch index 4dec48c4ff..6edf62f271 100644 --- a/Spigot-API-Patches/Ability-to-apply-mending-to-XP-API.patch +++ b/Spigot-API-Patches/Ability-to-apply-mending-to-XP-API.patch @@ -10,7 +10,7 @@ of giving the player experience points. Both an API To standalone mend, and apply mending logic to .giveExp has been added. diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 5e65657a..c273b9dc 100644 +index 7be6778a..f19b8b99 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM diff --git a/Spigot-API-Patches/Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch b/Spigot-API-Patches/Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch index cee4325068..42b96dffb0 100644 --- a/Spigot-API-Patches/Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch +++ b/Spigot-API-Patches/Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Ability to change PlayerProfile in AsyncPreLoginEvent This will allow you to change the players name or skin on login. diff --git a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java -index 1d571889..0c16128e 100644 +index a0909736..6c09ea6c 100644 --- a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java +++ b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java @@ -0,0 +0,0 @@ package org.bukkit.event.player; @@ -17,11 +17,11 @@ index 1d571889..0c16128e 100644 +import org.bukkit.Bukkit; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; - + import org.jetbrains.annotations.NotNull; @@ -0,0 +0,0 @@ public class AsyncPlayerPreLoginEvent extends Event { } - public AsyncPlayerPreLoginEvent(final String name, final InetAddress ipAddress, final UUID uniqueId) { + public AsyncPlayerPreLoginEvent(@NotNull final String name, @NotNull final InetAddress ipAddress, @NotNull final UUID uniqueId) { + // Paper start + this(name, ipAddress, uniqueId, Bukkit.createProfile(uniqueId, name)); + } @@ -31,6 +31,7 @@ index 1d571889..0c16128e 100644 + * Gets the PlayerProfile of the player logging in + * @return The Profile + */ ++ @NotNull + public PlayerProfile getPlayerProfile() { + return profile; + } @@ -39,11 +40,11 @@ index 1d571889..0c16128e 100644 + * Changes the PlayerProfile the player will login as + * @param profile The profile to use + */ -+ public void setPlayerProfile(PlayerProfile profile) { ++ public void setPlayerProfile(@NotNull PlayerProfile profile) { + this.profile = profile; + } + -+ public AsyncPlayerPreLoginEvent(final String name, final InetAddress ipAddress, final UUID uniqueId, PlayerProfile profile) { ++ public AsyncPlayerPreLoginEvent(@NotNull final String name, @NotNull final InetAddress ipAddress, @NotNull final UUID uniqueId, @NotNull PlayerProfile profile) { super(true); + this.profile = profile; + // Paper end diff --git a/Spigot-API-Patches/Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch b/Spigot-API-Patches/Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch index 72377fc9bb..1600dc0c90 100644 --- a/Spigot-API-Patches/Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch +++ b/Spigot-API-Patches/Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch @@ -5,30 +5,32 @@ Subject: [PATCH] Ability to get Tile Entities from a chunk without snapshots diff --git a/src/main/java/org/bukkit/Chunk.java b/src/main/java/org/bukkit/Chunk.java -index 33cd0ea0..35407d5e 100644 +index 893300a77..22ff63e52 100644 --- a/src/main/java/org/bukkit/Chunk.java +++ b/src/main/java/org/bukkit/Chunk.java @@ -0,0 +0,0 @@ public interface Chunk { - */ + @NotNull Entity[] getEntities(); + // Paper start - /** - * Get a list of all tile entities in the chunk. - * - * @return The tile entities. - */ -- BlockState[] getTileEntities(); ++ /** ++ * Get a list of all tile entities in the chunk. ++ * ++ * @return The tile entities. ++ */ ++ @NotNull + default BlockState[] getTileEntities() { + return getTileEntities(true); + } + -+ /** -+ * Get a list of all tile entities in the chunk. -+ * + /** + * Get a list of all tile entities in the chunk. + * + * @param useSnapshot Take snapshots or direct references -+ * @return The tile entities. -+ */ + * @return The tile entities. + */ + @NotNull +- BlockState[] getTileEntities(); + BlockState[] getTileEntities(boolean useSnapshot); + // Paper end diff --git a/Spigot-API-Patches/Access-items-by-EquipmentSlot.patch b/Spigot-API-Patches/Access-items-by-EquipmentSlot.patch index 37c9f5a86e..292699ca7d 100644 --- a/Spigot-API-Patches/Access-items-by-EquipmentSlot.patch +++ b/Spigot-API-Patches/Access-items-by-EquipmentSlot.patch @@ -5,12 +5,12 @@ Subject: [PATCH] Access items by EquipmentSlot diff --git a/src/main/java/org/bukkit/inventory/PlayerInventory.java b/src/main/java/org/bukkit/inventory/PlayerInventory.java -index fc5772e8..d56f6e00 100644 +index ef55b1463..eb71f01e4 100644 --- a/src/main/java/org/bukkit/inventory/PlayerInventory.java +++ b/src/main/java/org/bukkit/inventory/PlayerInventory.java @@ -0,0 +0,0 @@ public interface PlayerInventory extends Inventory { - public void setHeldItemSlot(int slot); + @Nullable public HumanEntity getHolder(); + + // Paper start @@ -20,7 +20,8 @@ index fc5772e8..d56f6e00 100644 + * @param slot The slot + * @return The item stack in the slot + */ -+ ItemStack getItem(EquipmentSlot slot); ++ @Nullable ++ ItemStack getItem(@NotNull EquipmentSlot slot); + + /** + * Sets the {@link ItemStack} at the given {@link EquipmentSlot}. @@ -28,7 +29,7 @@ index fc5772e8..d56f6e00 100644 + * @param slot The slot for the stack + * @param stack The item stack to set + */ -+ void setItem(EquipmentSlot slot, ItemStack stack); ++ void setItem(@NotNull EquipmentSlot slot, @Nullable ItemStack stack); + // Paper end } -- \ No newline at end of file diff --git a/Spigot-API-Patches/Add-API-methods-to-control-if-armour-stands-can-move.patch b/Spigot-API-Patches/Add-API-methods-to-control-if-armour-stands-can-move.patch index caeeb4c560..d4d1498534 100644 --- a/Spigot-API-Patches/Add-API-methods-to-control-if-armour-stands-can-move.patch +++ b/Spigot-API-Patches/Add-API-methods-to-control-if-armour-stands-can-move.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add API methods to control if armour stands can move diff --git a/src/main/java/org/bukkit/entity/ArmorStand.java b/src/main/java/org/bukkit/entity/ArmorStand.java -index b4f04517..099da6ce 100644 +index d04e52fb..387d04e5 100644 --- a/src/main/java/org/bukkit/entity/ArmorStand.java +++ b/src/main/java/org/bukkit/entity/ArmorStand.java @@ -0,0 +0,0 @@ public interface ArmorStand extends LivingEntity { diff --git a/Spigot-API-Patches/Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch b/Spigot-API-Patches/Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch index c00352d820..c30de9047e 100644 --- a/Spigot-API-Patches/Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch +++ b/Spigot-API-Patches/Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch @@ -16,7 +16,7 @@ intent to remove) and replace it with two new methods, clearly named and documented as to their purpose. diff --git a/src/main/java/org/bukkit/OfflinePlayer.java b/src/main/java/org/bukkit/OfflinePlayer.java -index 658eac26..335d3803 100644 +index 919d1b66a..30195c045 100644 --- a/src/main/java/org/bukkit/OfflinePlayer.java +++ b/src/main/java/org/bukkit/OfflinePlayer.java @@ -0,0 +0,0 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio @@ -30,7 +30,7 @@ index 658eac26..335d3803 100644 /** @@ -0,0 +0,0 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio - */ + @Nullable public Location getBedSpawnLocation(); + // Paper start diff --git a/Spigot-API-Patches/Add-Ban-Methods-to-Player-Objects.patch b/Spigot-API-Patches/Add-Ban-Methods-to-Player-Objects.patch index eeee115329..b0ab0a0189 100644 --- a/Spigot-API-Patches/Add-Ban-Methods-to-Player-Objects.patch +++ b/Spigot-API-Patches/Add-Ban-Methods-to-Player-Objects.patch @@ -8,7 +8,7 @@ Allows a more logical API for banning players. player.banPlayer("Breaking the rules"); diff --git a/src/main/java/org/bukkit/OfflinePlayer.java b/src/main/java/org/bukkit/OfflinePlayer.java -index d8279071..658eac26 100644 +index cf8a2cb8a..919d1b66a 100644 --- a/src/main/java/org/bukkit/OfflinePlayer.java +++ b/src/main/java/org/bukkit/OfflinePlayer.java @@ -0,0 +0,0 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio @@ -23,7 +23,8 @@ index d8279071..658eac26 100644 + * @param reason Reason for Ban + * @return Ban Entry + */ -+ public default BanEntry banPlayer(String reason) { ++ @NotNull ++ public default BanEntry banPlayer(@Nullable String reason) { + return banPlayer(reason, null, null); + } + @@ -33,7 +34,8 @@ index d8279071..658eac26 100644 + * @param source Source of the ban, or null for default + * @return Ban Entry + */ -+ public default BanEntry banPlayer(String reason, String source) { ++ @NotNull ++ public default BanEntry banPlayer(@Nullable String reason, @Nullable String source) { + return banPlayer(reason, null, source); + } + @@ -43,7 +45,8 @@ index d8279071..658eac26 100644 + * @param expires When to expire the ban + * @return Ban Entry + */ -+ public default BanEntry banPlayer(String reason, java.util.Date expires) { ++ @NotNull ++ public default BanEntry banPlayer(@Nullable String reason, @Nullable java.util.Date expires) { + return banPlayer(reason, expires, null); + } + @@ -54,10 +57,12 @@ index d8279071..658eac26 100644 + * @param source Source of the ban or null for default + * @return Ban Entry + */ -+ public default BanEntry banPlayer(String reason, java.util.Date expires, String source) { ++ @NotNull ++ public default BanEntry banPlayer(@Nullable String reason, @Nullable java.util.Date expires, @Nullable String source) { + return banPlayer(reason, expires, source, true); + } -+ public default BanEntry banPlayer(String reason, java.util.Date expires, String source, boolean kickIfOnline) { ++ @NotNull ++ public default BanEntry banPlayer(@Nullable String reason, @Nullable java.util.Date expires, @Nullable String source, boolean kickIfOnline) { + BanEntry banEntry = Bukkit.getServer().getBanList(BanList.Type.NAME).addBan(getName(), reason, expires, source); + if (kickIfOnline && isOnline()) { + getPlayer().kickPlayer(reason); @@ -69,7 +74,7 @@ index d8279071..658eac26 100644 /** * Checks if this player is whitelisted or not diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 5dc04f47..ddf226a4 100644 +index 06154a5c5..a840b49d4 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -0,0 +0,0 @@ @@ -84,11 +89,12 @@ index 5dc04f47..ddf226a4 100644 +import org.bukkit.BanEntry; +import org.bukkit.BanList; +import org.bukkit.Bukkit; - import org.bukkit.ChatColor; ++import org.bukkit.ChatColor; import org.bukkit.Effect; import org.bukkit.GameMode; + import org.bukkit.Instrument; @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM - public void sendMap(MapView map); + public void sendMap(@NotNull MapView map); // Paper start + /** @@ -97,7 +103,9 @@ index 5dc04f47..ddf226a4 100644 + * @param reason Reason for ban + * @return Ban Entry + */ -+ public default BanEntry banPlayerFull(String reason) { ++ // For reference, Bukkit defines this as nullable, while they impl isn't, we'll follow API. ++ @Nullable ++ public default BanEntry banPlayerFull(@Nullable String reason) { + return banPlayerFull(reason, null, null); + } + @@ -108,7 +116,8 @@ index 5dc04f47..ddf226a4 100644 + * @param source Source of ban, or null for default + * @return Ban Entry + */ -+ public default BanEntry banPlayerFull(String reason, String source) { ++ @Nullable ++ public default BanEntry banPlayerFull(@Nullable String reason, @Nullable String source) { + return banPlayerFull(reason, null, source); + } + @@ -119,7 +128,8 @@ index 5dc04f47..ddf226a4 100644 + * @param expires When to expire the ban + * @return Ban Entry + */ -+ public default BanEntry banPlayerFull(String reason, Date expires) { ++ @Nullable ++ public default BanEntry banPlayerFull(@Nullable String reason, @Nullable Date expires) { + return banPlayerFull(reason, expires, null); + } + @@ -131,7 +141,8 @@ index 5dc04f47..ddf226a4 100644 + * @param source Source of the ban, or null for default + * @return Ban Entry + */ -+ public default BanEntry banPlayerFull(String reason, Date expires, String source) { ++ @Nullable ++ public default BanEntry banPlayerFull(@Nullable String reason, @Nullable Date expires, @Nullable String source) { + banPlayer(reason, expires, source); + return banPlayerIP(reason, expires, source, true); + } @@ -144,7 +155,8 @@ index 5dc04f47..ddf226a4 100644 + * @param kickPlayer Whether or not to kick the player afterwards + * @return Ban Entry + */ -+ public default BanEntry banPlayerIP(String reason, boolean kickPlayer) { ++ @Nullable ++ public default BanEntry banPlayerIP(@Nullable String reason, boolean kickPlayer) { + return banPlayerIP(reason, null, null, kickPlayer); + } + @@ -156,7 +168,8 @@ index 5dc04f47..ddf226a4 100644 + * @param kickPlayer Whether or not to kick the player afterwards + * @return Ban Entry + */ -+ public default BanEntry banPlayerIP(String reason, String source, boolean kickPlayer) { ++ @Nullable ++ public default BanEntry banPlayerIP(@Nullable String reason, @Nullable String source, boolean kickPlayer) { + return banPlayerIP(reason, null, source, kickPlayer); + } + @@ -168,7 +181,8 @@ index 5dc04f47..ddf226a4 100644 + * @param kickPlayer Whether or not to kick the player afterwards + * @return Ban Entry + */ -+ public default BanEntry banPlayerIP(String reason, Date expires, boolean kickPlayer) { ++ @Nullable ++ public default BanEntry banPlayerIP(@Nullable String reason, @Nullable Date expires, boolean kickPlayer) { + return banPlayerIP(reason, expires, null, kickPlayer); + } + @@ -179,7 +193,8 @@ index 5dc04f47..ddf226a4 100644 + * @param reason Reason for ban + * @return Ban Entry + */ -+ public default BanEntry banPlayerIP(String reason) { ++ @Nullable ++ public default BanEntry banPlayerIP(@Nullable String reason) { + return banPlayerIP(reason, null, null); + } + @@ -190,7 +205,8 @@ index 5dc04f47..ddf226a4 100644 + * @param source Source of ban, or null for default + * @return Ban Entry + */ -+ public default BanEntry banPlayerIP(String reason, String source) { ++ @Nullable ++ public default BanEntry banPlayerIP(@Nullable String reason, @Nullable String source) { + return banPlayerIP(reason, null, source); + } + @@ -201,7 +217,8 @@ index 5dc04f47..ddf226a4 100644 + * @param expires When to expire the ban + * @return Ban Entry + */ -+ public default BanEntry banPlayerIP(String reason, Date expires) { ++ @Nullable ++ public default BanEntry banPlayerIP(@Nullable String reason, @Nullable Date expires) { + return banPlayerIP(reason, expires, null); + } + @@ -213,10 +230,22 @@ index 5dc04f47..ddf226a4 100644 + * @param source Source of the banm or null for default + * @return Ban Entry + */ -+ public default BanEntry banPlayerIP(String reason, Date expires, String source) { ++ @Nullable ++ public default BanEntry banPlayerIP(@Nullable String reason, @Nullable Date expires, @Nullable String source) { + return banPlayerIP(reason, expires, source, true); + } -+ public default BanEntry banPlayerIP(String reason, Date expires, String source, boolean kickPlayer) { ++ ++ /** ++ * Bans the IP address currently used by the player. ++ * Does not ban the Profile, use {@link #banPlayerFull(String, Date, String)} ++ * @param reason Reason for Ban ++ * @param expires When to expire the ban ++ * @param source Source of the banm or null for default ++ * @param kickPlayer if the targeted player should be kicked ++ * @return Ban Entry ++ */ ++ @Nullable ++ public default BanEntry banPlayerIP(@Nullable String reason, @Nullable Date expires, @Nullable String source, boolean kickPlayer) { + BanEntry banEntry = Bukkit.getServer().getBanList(BanList.Type.IP).addBan(getAddress().getAddress().getHostAddress(), reason, expires, source); + if (kickPlayer && isOnline()) { + getPlayer().kickPlayer(reason); diff --git a/Spigot-API-Patches/Add-BaseComponent-sendMessage-methods-to-CommandSend.patch b/Spigot-API-Patches/Add-BaseComponent-sendMessage-methods-to-CommandSend.patch index ee21c7b452..87190f9609 100644 --- a/Spigot-API-Patches/Add-BaseComponent-sendMessage-methods-to-CommandSend.patch +++ b/Spigot-API-Patches/Add-BaseComponent-sendMessage-methods-to-CommandSend.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Add BaseComponent sendMessage methods to CommandSender diff --git a/src/main/java/org/bukkit/command/CommandSender.java b/src/main/java/org/bukkit/command/CommandSender.java -index abf68a2c..fcb03b83 100644 +index 74816c63f..be11d52a0 100644 --- a/src/main/java/org/bukkit/command/CommandSender.java +++ b/src/main/java/org/bukkit/command/CommandSender.java @@ -0,0 +0,0 @@ public interface CommandSender extends Permissible { - + @NotNull Spigot spigot(); // Spigot end + @@ -22,7 +22,7 @@ index abf68a2c..fcb03b83 100644 + * + * @param component the component to send + */ -+ default void sendMessage(net.md_5.bungee.api.chat.BaseComponent component) { ++ default void sendMessage(@NotNull net.md_5.bungee.api.chat.BaseComponent component) { + this.sendMessage(component.toLegacyText()); + } + @@ -34,29 +34,9 @@ index abf68a2c..fcb03b83 100644 + * + * @param components the components to send + */ -+ default void sendMessage(net.md_5.bungee.api.chat.BaseComponent... components) { ++ default void sendMessage(@NotNull net.md_5.bungee.api.chat.BaseComponent... components) { + this.sendMessage(new net.md_5.bungee.api.chat.TextComponent(components).toLegacyText()); + } + // Paper end } -diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 959add05..5109a0c3 100644 ---- a/src/main/java/org/bukkit/entity/Player.java -+++ b/src/main/java/org/bukkit/entity/Player.java -@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM - * - * @param component the components to send - */ -+ @Override - public default void sendMessage(net.md_5.bungee.api.chat.BaseComponent component) { - spigot().sendMessage(component); - } -@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM - * - * @param components the components to send - */ -+ @Override - public default void sendMessage(net.md_5.bungee.api.chat.BaseComponent... components) { - spigot().sendMessage(components); - } -- \ No newline at end of file diff --git a/Spigot-API-Patches/Add-BeaconEffectEvent.patch b/Spigot-API-Patches/Add-BeaconEffectEvent.patch index e82f5fe3bf..f3eaf5387e 100644 --- a/Spigot-API-Patches/Add-BeaconEffectEvent.patch +++ b/Spigot-API-Patches/Add-BeaconEffectEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add BeaconEffectEvent diff --git a/src/main/java/com/destroystokyo/paper/event/block/BeaconEffectEvent.java b/src/main/java/com/destroystokyo/paper/event/block/BeaconEffectEvent.java new file mode 100644 -index 00000000..6579ae99 +index 000000000..978813b94 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/block/BeaconEffectEvent.java @@ -0,0 +0,0 @@ @@ -18,6 +18,7 @@ index 00000000..6579ae99 +import org.bukkit.event.HandlerList; +import org.bukkit.event.block.BlockEvent; +import org.bukkit.potion.PotionEffect; ++import org.jetbrains.annotations.NotNull; + +/** + * Called when a beacon effect is being applied to a player. @@ -29,7 +30,7 @@ index 00000000..6579ae99 + private Player player; + private boolean primary; + -+ public BeaconEffectEvent(Block block, PotionEffect effect, Player player, boolean primary) { ++ public BeaconEffectEvent(@NotNull Block block, @NotNull PotionEffect effect, @NotNull Player player, boolean primary) { + super(block); + this.effect = effect; + this.player = player; @@ -51,6 +52,7 @@ index 00000000..6579ae99 + * + * @return Potion effect + */ ++ @NotNull + public PotionEffect getEffect() { + return effect; + } @@ -60,7 +62,7 @@ index 00000000..6579ae99 + * + * @param effect Potion effect + */ -+ public void setEffect(PotionEffect effect) { ++ public void setEffect(@NotNull PotionEffect effect) { + this.effect = effect; + } + @@ -69,6 +71,7 @@ index 00000000..6579ae99 + * + * @return Affected player + */ ++ @NotNull + public Player getPlayer() { + return player; + } @@ -82,11 +85,13 @@ index 00000000..6579ae99 + return primary; + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } diff --git a/Spigot-API-Patches/Add-EntityKnockbackByEntityEvent.patch b/Spigot-API-Patches/Add-EntityKnockbackByEntityEvent.patch index 6cc16824c8..ceb17a9f42 100644 --- a/Spigot-API-Patches/Add-EntityKnockbackByEntityEvent.patch +++ b/Spigot-API-Patches/Add-EntityKnockbackByEntityEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add EntityKnockbackByEntityEvent diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EntityKnockbackByEntityEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EntityKnockbackByEntityEvent.java new file mode 100644 -index 00000000..f6ef1162 +index 000000000..9efecabab --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/EntityKnockbackByEntityEvent.java @@ -0,0 +0,0 @@ @@ -18,6 +18,7 @@ index 00000000..f6ef1162 +import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.EntityEvent; +import org.bukkit.util.Vector; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired when an Entity is knocked back by the hit of another Entity. The acceleration @@ -27,22 +28,24 @@ index 00000000..f6ef1162 +public class EntityKnockbackByEntityEvent extends EntityEvent implements Cancellable { + private static final HandlerList handlers = new HandlerList(); + -+ private final Entity hitBy; ++ @NotNull private final Entity hitBy; + private final float knockbackStrength; -+ private final Vector acceleration; ++ @NotNull private final Vector acceleration; + private boolean cancelled = false; + -+ public EntityKnockbackByEntityEvent(LivingEntity entity, Entity hitBy, float knockbackStrength, Vector acceleration) { ++ public EntityKnockbackByEntityEvent(@NotNull LivingEntity entity, @NotNull Entity hitBy, float knockbackStrength, @NotNull Vector acceleration) { + super(entity); + this.hitBy = hitBy; + this.knockbackStrength = knockbackStrength; + this.acceleration = acceleration; + } + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } @@ -60,6 +63,7 @@ index 00000000..f6ef1162 + /** + * @return the entity which was knocked back + */ ++ @NotNull + @Override + public LivingEntity getEntity() { + return (LivingEntity) super.getEntity(); @@ -75,6 +79,7 @@ index 00000000..f6ef1162 + /** + * @return the Entity which hit + */ ++ @NotNull + public Entity getHitBy() { + return hitBy; + } @@ -82,6 +87,7 @@ index 00000000..f6ef1162 + /** + * @return the acceleration that will be applied + */ ++ @NotNull + public Vector getAcceleration() { + return acceleration; + } diff --git a/Spigot-API-Patches/Add-EntityTeleportEndGatewayEvent.patch b/Spigot-API-Patches/Add-EntityTeleportEndGatewayEvent.patch index 4b05c47835..c46ab02ccb 100644 --- a/Spigot-API-Patches/Add-EntityTeleportEndGatewayEvent.patch +++ b/Spigot-API-Patches/Add-EntityTeleportEndGatewayEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add EntityTeleportEndGatewayEvent diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EntityTeleportEndGatewayEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EntityTeleportEndGatewayEvent.java new file mode 100644 -index 00000000..80899ecb +index 000000000..bfc69a43c --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/EntityTeleportEndGatewayEvent.java @@ -0,0 +0,0 @@ @@ -16,15 +16,16 @@ index 00000000..80899ecb +import org.bukkit.block.EndGateway; +import org.bukkit.entity.Entity; +import org.bukkit.event.entity.EntityTeleportEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired any time an entity attempts to teleport in an end gateway + */ +public class EntityTeleportEndGatewayEvent extends EntityTeleportEvent { + -+ private final EndGateway gateway; ++ @NotNull private final EndGateway gateway; + -+ public EntityTeleportEndGatewayEvent(Entity what, Location from, Location to, EndGateway gateway) { ++ public EntityTeleportEndGatewayEvent(@NotNull Entity what, @NotNull Location from, @NotNull Location to, @NotNull EndGateway gateway) { + super(what, from, to); + this.gateway = gateway; + } @@ -34,6 +35,7 @@ index 00000000..80899ecb + * + * @return EndGateway used + */ ++ @NotNull + public EndGateway getGateway() { + return gateway; + } diff --git a/Spigot-API-Patches/Add-EntityZapEvent.patch b/Spigot-API-Patches/Add-EntityZapEvent.patch index 1f13ea50c7..da52ffacb4 100644 --- a/Spigot-API-Patches/Add-EntityZapEvent.patch +++ b/Spigot-API-Patches/Add-EntityZapEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add EntityZapEvent diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EntityZapEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EntityZapEvent.java new file mode 100644 -index 00000000..c8f0bb05 +index 000000000..3b725a489 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/EntityZapEvent.java @@ -0,0 +0,0 @@ @@ -20,8 +20,8 @@ index 00000000..c8f0bb05 +import org.bukkit.event.entity.EntityEvent; +import org.bukkit.event.entity.EntityTransformEvent; + -+import javax.annotation.Nonnull; +import java.util.Collections; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired when lightning strikes an entity @@ -29,9 +29,9 @@ index 00000000..c8f0bb05 +public class EntityZapEvent extends EntityTransformEvent implements Cancellable { + private static final HandlerList handlers = new HandlerList(); + private boolean cancelled; -+ private final LightningStrike bolt; ++ @NotNull private final LightningStrike bolt; + -+ public EntityZapEvent(final Entity entity, @Nonnull final LightningStrike bolt, @Nonnull final Entity replacementEntity) { ++ public EntityZapEvent(@NotNull final Entity entity, @NotNull final LightningStrike bolt, @NotNull final Entity replacementEntity) { + super(entity, Collections.singletonList(replacementEntity), TransformReason.LIGHTNING); + Validate.notNull(bolt); + Validate.notNull(replacementEntity); @@ -50,7 +50,7 @@ index 00000000..c8f0bb05 + * Gets the lightning bolt that is striking the entity. + * @return The lightning bolt responsible for this event + */ -+ @Nonnull ++ @NotNull + public LightningStrike getBolt() { + return bolt; + } @@ -59,22 +59,24 @@ index 00000000..c8f0bb05 + * Gets the entity that will replace the struck entity. + * @return The entity that will replace the struck entity + */ -+ @Nonnull ++ @NotNull + public Entity getReplacementEntity() { + return getTransformedEntity(); + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } +} diff --git a/src/main/java/org/bukkit/event/entity/PigZapEvent.java b/src/main/java/org/bukkit/event/entity/PigZapEvent.java -index c1d4b30a..de8cad81 100644 +index 0074423fd..0eaa8df94 100644 --- a/src/main/java/org/bukkit/event/entity/PigZapEvent.java +++ b/src/main/java/org/bukkit/event/entity/PigZapEvent.java @@ -0,0 +0,0 @@ package org.bukkit.event.entity; @@ -85,7 +87,7 @@ index c1d4b30a..de8cad81 100644 import org.bukkit.entity.LightningStrike; import org.bukkit.entity.Pig; import org.bukkit.entity.PigZombie; -@@ -0,0 +0,0 @@ import org.bukkit.event.HandlerList; +@@ -0,0 +0,0 @@ import org.jetbrains.annotations.NotNull; /** * Stores data for pigs being zapped */ @@ -97,7 +99,7 @@ index c1d4b30a..de8cad81 100644 private final PigZombie pigzombie; private final LightningStrike bolt; - public PigZapEvent(final Pig pig, final LightningStrike bolt, final PigZombie pigzombie) { + public PigZapEvent(@NotNull final Pig pig, @NotNull final LightningStrike bolt, @NotNull final PigZombie pigzombie) { - super(pig, Collections.singletonList((Entity) pigzombie), TransformReason.LIGHTNING); + super(pig, bolt, pigzombie); this.bolt = bolt; @@ -109,9 +111,9 @@ index c1d4b30a..de8cad81 100644 + // Paper start + /* + @NotNull @Override public HandlerList getHandlers() { - return handlers; @@ -0,0 +0,0 @@ public class PigZapEvent extends EntityTransformEvent implements Cancellable { public static HandlerList getHandlerList() { return handlers; diff --git a/Spigot-API-Patches/Add-ItemStack-Recipe-API-helper-methods.patch b/Spigot-API-Patches/Add-ItemStack-Recipe-API-helper-methods.patch index d0c1d66df3..7071b2c5e8 100644 --- a/Spigot-API-Patches/Add-ItemStack-Recipe-API-helper-methods.patch +++ b/Spigot-API-Patches/Add-ItemStack-Recipe-API-helper-methods.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add ItemStack Recipe API helper methods Allows using ExactChoice Recipes with easier methodss diff --git a/src/main/java/org/bukkit/inventory/ShapedRecipe.java b/src/main/java/org/bukkit/inventory/ShapedRecipe.java -index 80af6cf5..3eae5a55 100644 +index 64a43f426..76b2dd7cb 100644 --- a/src/main/java/org/bukkit/inventory/ShapedRecipe.java +++ b/src/main/java/org/bukkit/inventory/ShapedRecipe.java @@ -0,0 +0,0 @@ public class ShapedRecipe implements Recipe, Keyed { @@ -14,7 +14,8 @@ index 80af6cf5..3eae5a55 100644 } + // Paper start -+ public ShapedRecipe setIngredient(char key, ItemStack item) { ++ @NotNull ++ public ShapedRecipe setIngredient(char key, @NotNull ItemStack item) { + return setIngredient(key, new RecipeChoice.ExactChoice(item)); + } + // Paper end @@ -23,7 +24,7 @@ index 80af6cf5..3eae5a55 100644 * Get a copy of the ingredients map. * diff --git a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java -index 7347e746..4de38b33 100644 +index 46a398e88..818bf2936 100644 --- a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java +++ b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java @@ -0,0 +0,0 @@ public class ShapelessRecipe implements Recipe, Keyed { @@ -31,20 +32,27 @@ index 7347e746..4de38b33 100644 } + // Paper start -+ public ShapelessRecipe addIngredient(ItemStack item) { ++ @NotNull ++ public ShapelessRecipe addIngredient(@NotNull ItemStack item) { + return addIngredient(1, item); + } -+ public ShapelessRecipe addIngredient(int count, ItemStack item) { ++ ++ @NotNull ++ public ShapelessRecipe addIngredient(int count, @NotNull ItemStack item) { + Validate.isTrue(ingredients.size() + count <= 9, "Shapeless recipes cannot have more than 9 ingredients"); + while (count-- > 0) { + ingredients.add(new RecipeChoice.ExactChoice(item)); + } + return this; + } -+ public ShapelessRecipe removeIngredient(ItemStack item) { ++ ++ @NotNull ++ public ShapelessRecipe removeIngredient(@NotNull ItemStack item) { + return removeIngredient(1, item); + } -+ public ShapelessRecipe removeIngredient(int count, ItemStack item) { ++ ++ @NotNull ++ public ShapelessRecipe removeIngredient(int count, @NotNull ItemStack item) { + Iterator iterator = ingredients.iterator(); + while (count > 0 && iterator.hasNext()) { + ItemStack stack = iterator.next().getItemStack(); @@ -57,7 +65,7 @@ index 7347e746..4de38b33 100644 + } + // Paper end + - public ShapelessRecipe addIngredient(RecipeChoice ingredient) { - Validate.isTrue(ingredients.size() + 1 <= 9, "Shapeless recipes cannot have more than 9 ingredients"); - + /** + * Removes an ingredient from the list. + * -- \ No newline at end of file diff --git a/Spigot-API-Patches/Add-ItemStackRecipeChoice-Draft-API.patch b/Spigot-API-Patches/Add-ItemStackRecipeChoice-Draft-API.patch index 3e2d518f36..6001f94448 100644 --- a/Spigot-API-Patches/Add-ItemStackRecipeChoice-Draft-API.patch +++ b/Spigot-API-Patches/Add-ItemStackRecipeChoice-Draft-API.patch @@ -9,7 +9,7 @@ Allows creating recipes that must match isSimilar to full item stack. diff --git a/src/main/java/com/destroystokyo/paper/inventory/ItemStackRecipeChoice.java b/src/main/java/com/destroystokyo/paper/inventory/ItemStackRecipeChoice.java new file mode 100644 -index 00000000..43e6576b +index 000000000..43e6576b1 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/inventory/ItemStackRecipeChoice.java @@ -0,0 +0,0 @@ diff --git a/Spigot-API-Patches/Add-LivingEntity-getTargetEntity.patch b/Spigot-API-Patches/Add-LivingEntity-getTargetEntity.patch index 9f411c3699..c02a504874 100644 --- a/Spigot-API-Patches/Add-LivingEntity-getTargetEntity.patch +++ b/Spigot-API-Patches/Add-LivingEntity-getTargetEntity.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add LivingEntity#getTargetEntity diff --git a/src/main/java/com/destroystokyo/paper/entity/TargetEntityInfo.java b/src/main/java/com/destroystokyo/paper/entity/TargetEntityInfo.java new file mode 100644 -index 00000000..5df8eed2 +index 000000000..f52644fab --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/entity/TargetEntityInfo.java @@ -0,0 +0,0 @@ @@ -14,6 +14,7 @@ index 00000000..5df8eed2 + +import org.bukkit.entity.Entity; +import org.bukkit.util.Vector; ++import org.jetbrains.annotations.NotNull; + +/** + * Represents information about a targeted entity @@ -22,7 +23,7 @@ index 00000000..5df8eed2 + private final Entity entity; + private final Vector hitVec; + -+ public TargetEntityInfo(Entity entity, Vector hitVec) { ++ public TargetEntityInfo(@NotNull Entity entity, @NotNull Vector hitVec) { + this.entity = entity; + this.hitVec = hitVec; + } @@ -32,6 +33,7 @@ index 00000000..5df8eed2 + * + * @return Targeted entity + */ ++ @NotNull + public Entity getEntity() { + return entity; + } @@ -41,18 +43,19 @@ index 00000000..5df8eed2 + * + * @return Targeted position + */ ++ @NotNull + public Vector getHitVector() { + return hitVec; + } +} diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java -index bd47e720..34a8fe3f 100644 +index 4dec50caf..956d68867 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 */ @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); + + /** + * Gets information about the entity being targeted diff --git a/Spigot-API-Patches/Add-Material-Tags.patch b/Spigot-API-Patches/Add-Material-Tags.patch index 72a6446183..e33f3d51d4 100644 --- a/Spigot-API-Patches/Add-Material-Tags.patch +++ b/Spigot-API-Patches/Add-Material-Tags.patch @@ -8,7 +8,7 @@ are related to each other by a trait. diff --git a/src/main/java/com/destroystokyo/paper/MaterialSetTag.java b/src/main/java/com/destroystokyo/paper/MaterialSetTag.java new file mode 100644 -index 00000000..b036c374 +index 000000000..c91ea2a06 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/MaterialSetTag.java @@ -0,0 +0,0 @@ @@ -33,6 +33,8 @@ index 00000000..b036c374 +import java.util.function.Predicate; +import java.util.stream.Collectors; +import java.util.stream.Stream; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +public class MaterialSetTag implements Tag { + @@ -43,7 +45,7 @@ index 00000000..b036c374 + * @deprecated Use NamespacedKey version of constructor + */ + @Deprecated -+ public MaterialSetTag(Predicate filter) { ++ public MaterialSetTag(@NotNull Predicate filter) { + this(null, Stream.of(Material.values()).filter(filter).collect(Collectors.toList())); + } + @@ -51,7 +53,7 @@ index 00000000..b036c374 + * @deprecated Use NamespacedKey version of constructor + */ + @Deprecated -+ public MaterialSetTag(Collection materials) { ++ public MaterialSetTag(@NotNull Collection materials) { + this(null, materials); + } + @@ -59,123 +61,140 @@ index 00000000..b036c374 + * @deprecated Use NamespacedKey version of constructor + */ + @Deprecated -+ public MaterialSetTag(Material... materials) { ++ public MaterialSetTag(@NotNull Material... materials) { + this(null, materials); + } + -+ public MaterialSetTag(NamespacedKey key, Predicate filter) { ++ public MaterialSetTag(@Nullable NamespacedKey key, @NotNull Predicate filter) { + this(key, Stream.of(Material.values()).filter(filter).collect(Collectors.toList())); + } + -+ public MaterialSetTag(NamespacedKey key, Material... materials) { ++ public MaterialSetTag(@Nullable NamespacedKey key, @NotNull Material... materials) { + this(key, Lists.newArrayList(materials)); + } + -+ public MaterialSetTag(NamespacedKey key, Collection materials) { ++ public MaterialSetTag(@Nullable NamespacedKey key, @NotNull Collection materials) { + this.key = key != null ? key : NamespacedKey.randomKey(); + this.materials = Sets.newEnumSet(materials, Material.class); + } + ++ @NotNull + @Override + public NamespacedKey getKey() { + return key; + } + -+ public MaterialSetTag add(Tag... tags) { ++ @NotNull ++ public MaterialSetTag add(@NotNull Tag... tags) { + for (Tag tag : tags) { + add(tag.getValues()); + } + return this; + } + -+ public MaterialSetTag add(MaterialSetTag... tags) { ++ @NotNull ++ public MaterialSetTag add(@NotNull MaterialSetTag... tags) { + for (Tag tag : tags) { + add(tag.getValues()); + } + return this; + } + -+ public MaterialSetTag add(Material... material) { ++ @NotNull ++ public MaterialSetTag add(@NotNull Material... material) { + this.materials.addAll(Lists.newArrayList(material)); + return this; + } + -+ public MaterialSetTag add(Collection materials) { ++ @NotNull ++ public MaterialSetTag add(@NotNull Collection materials) { + this.materials.addAll(materials); + return this; + } + -+ public MaterialSetTag contains(String with) { -+ return add(mat -> mat.name().contains(with)); } ++ @NotNull ++ public MaterialSetTag contains(@NotNull String with) { ++ return add(mat -> mat.name().contains(with)); ++ } + -+ public MaterialSetTag endsWith(String with) { ++ @NotNull ++ public MaterialSetTag endsWith(@NotNull String with) { + return add(mat -> mat.name().endsWith(with)); + } + + -+ public MaterialSetTag startsWith(String with) { ++ @NotNull ++ public MaterialSetTag startsWith(@NotNull String with) { + return add(mat -> mat.name().startsWith(with)); + } -+ -+ public MaterialSetTag add(Predicate filter) { ++ @NotNull ++ public MaterialSetTag add(@NotNull Predicate filter) { + add(Stream.of(Material.values()).filter(((Predicate) Material::isLegacy).negate()).filter(filter).collect(Collectors.toList())); + return this; + } + -+ public MaterialSetTag not(MaterialSetTag tags) { ++ @NotNull ++ public MaterialSetTag not(@NotNull MaterialSetTag tags) { + not(tags.getValues()); + return this; + } + -+ public MaterialSetTag not(Material... material) { ++ @NotNull ++ public MaterialSetTag not(@NotNull Material... material) { + this.materials.removeAll(Lists.newArrayList(material)); + return this; + } + -+ public MaterialSetTag not(Collection materials) { ++ @NotNull ++ public MaterialSetTag not(@NotNull Collection materials) { + this.materials.removeAll(materials); + return this; + } + -+ public MaterialSetTag not(Predicate filter) { ++ @NotNull ++ public MaterialSetTag not(@NotNull Predicate filter) { + not(Stream.of(Material.values()).filter(((Predicate) Material::isLegacy).negate()).filter(filter).collect(Collectors.toList())); + return this; + } + -+ public MaterialSetTag notEndsWith(String with) { ++ @NotNull ++ public MaterialSetTag notEndsWith(@NotNull String with) { + return not(mat -> mat.name().endsWith(with)); + } + + -+ public MaterialSetTag notStartsWith(String with) { ++ @NotNull ++ public MaterialSetTag notStartsWith(@NotNull String with) { + return not(mat -> mat.name().startsWith(with)); + } + ++ @NotNull + public Set getValues() { + return this.materials; + } + -+ public boolean isTagged(BlockData block) { ++ public boolean isTagged(@NotNull BlockData block) { + return isTagged(block.getMaterial()); + } + -+ public boolean isTagged(BlockState block) { ++ public boolean isTagged(@NotNull BlockState block) { + return isTagged(block.getType()); + } + -+ public boolean isTagged(Block block) { ++ public boolean isTagged(@NotNull Block block) { + return isTagged(block.getType()); + } + -+ public boolean isTagged(ItemStack item) { ++ public boolean isTagged(@NotNull ItemStack item) { + return isTagged(item.getType()); + } + -+ public boolean isTagged(Material material) { ++ public boolean isTagged(@NotNull Material material) { + return this.materials.contains(material); + } + -+ public MaterialSetTag ensureSize(String label, int size) { ++ @NotNull ++ public MaterialSetTag ensureSize(@NotNull String label, int size) { + long actual = this.materials.stream().filter(((Predicate) Material::isLegacy).negate()).count(); + if (size != actual) { + throw new IllegalStateException(label + " - Expected " + size + " materials, got " + actual); @@ -185,7 +204,7 @@ index 00000000..b036c374 +} diff --git a/src/main/java/com/destroystokyo/paper/MaterialTags.java b/src/main/java/com/destroystokyo/paper/MaterialTags.java new file mode 100644 -index 00000000..660191c2 +index 000000000..660191c24 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/MaterialTags.java @@ -0,0 +0,0 @@ @@ -573,7 +592,7 @@ index 00000000..660191c2 +} diff --git a/src/test/java/com/destroystokyo/paper/MaterialTagsTest.java b/src/test/java/com/destroystokyo/paper/MaterialTagsTest.java new file mode 100644 -index 00000000..328c5147 +index 000000000..328c51471 --- /dev/null +++ b/src/test/java/com/destroystokyo/paper/MaterialTagsTest.java @@ -0,0 +0,0 @@ @@ -603,7 +622,7 @@ index 00000000..328c5147 + } +} diff --git a/src/test/java/org/bukkit/TestServer.java b/src/test/java/org/bukkit/TestServer.java -index 2d840320..613675c3 100644 +index 2d8403206..613675c3b 100644 --- a/src/test/java/org/bukkit/TestServer.java +++ b/src/test/java/org/bukkit/TestServer.java @@ -0,0 +0,0 @@ public class TestServer implements InvocationHandler { diff --git a/Spigot-API-Patches/Add-MetadataStoreBase.removeAll-Plugin.patch b/Spigot-API-Patches/Add-MetadataStoreBase.removeAll-Plugin.patch index 922477bd6a..c351c9205c 100644 --- a/Spigot-API-Patches/Add-MetadataStoreBase.removeAll-Plugin.patch +++ b/Spigot-API-Patches/Add-MetadataStoreBase.removeAll-Plugin.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add MetadataStoreBase.removeAll(Plugin) So that on reload, metadata will be cleared diff --git a/src/main/java/org/bukkit/metadata/MetadataStoreBase.java b/src/main/java/org/bukkit/metadata/MetadataStoreBase.java -index 64c0f0a7..6da6abd8 100644 +index 32728628e..b634b124e 100644 --- a/src/main/java/org/bukkit/metadata/MetadataStoreBase.java +++ b/src/main/java/org/bukkit/metadata/MetadataStoreBase.java @@ -0,0 +0,0 @@ public abstract class MetadataStoreBase { @@ -20,7 +20,7 @@ index 64c0f0a7..6da6abd8 100644 + * @param owningPlugin the plugin requesting the invalidation. + * @throws IllegalArgumentException If plugin is null + */ -+ public void removeAll(Plugin owningPlugin) { ++ public void removeAll(@NotNull Plugin owningPlugin) { + Validate.notNull(owningPlugin, "Plugin cannot be null"); + for (Iterator> iterator = metadataMap.values().iterator(); iterator.hasNext(); ) { + Map values = iterator.next(); diff --git a/Spigot-API-Patches/Add-More-Creeper-API.patch b/Spigot-API-Patches/Add-More-Creeper-API.patch index 3e56f5241b..63d13fb5d7 100644 --- a/Spigot-API-Patches/Add-More-Creeper-API.patch +++ b/Spigot-API-Patches/Add-More-Creeper-API.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add More Creeper API diff --git a/src/main/java/com/destroystokyo/paper/event/entity/CreeperIgniteEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/CreeperIgniteEvent.java new file mode 100644 -index 00000000..3d10bb03 +index 000000000..ff10251b6 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/CreeperIgniteEvent.java @@ -0,0 +0,0 @@ @@ -16,6 +16,7 @@ index 00000000..3d10bb03 +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.EntityEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Called when a Creeper is ignite flag is changed (armed/disarmed to explode). @@ -25,11 +26,12 @@ index 00000000..3d10bb03 + private boolean canceled; + private boolean ignited; + -+ public CreeperIgniteEvent(Creeper creeper, boolean ignited) { ++ public CreeperIgniteEvent(@NotNull Creeper creeper, boolean ignited) { + super(creeper); + this.ignited = ignited; + } + ++ @NotNull + @Override + public Creeper getEntity() { + return (Creeper) entity; @@ -51,17 +53,19 @@ index 00000000..3d10bb03 + canceled = cancel; + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } +} diff --git a/src/main/java/org/bukkit/entity/Creeper.java b/src/main/java/org/bukkit/entity/Creeper.java -index f957d836..b9877fb8 100644 +index f957d8368..b9877fb88 100644 --- a/src/main/java/org/bukkit/entity/Creeper.java +++ b/src/main/java/org/bukkit/entity/Creeper.java @@ -0,0 +0,0 @@ public interface Creeper extends Monster { diff --git a/Spigot-API-Patches/Add-PhantomPreSpawnEvent.patch b/Spigot-API-Patches/Add-PhantomPreSpawnEvent.patch index 60c899c4d3..a451798d35 100644 --- a/Spigot-API-Patches/Add-PhantomPreSpawnEvent.patch +++ b/Spigot-API-Patches/Add-PhantomPreSpawnEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add PhantomPreSpawnEvent diff --git a/src/main/java/com/destroystokyo/paper/event/entity/PhantomPreSpawnEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/PhantomPreSpawnEvent.java new file mode 100644 -index 00000000..303a1ec9 +index 000000000..9022f697a --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/PhantomPreSpawnEvent.java @@ -0,0 +0,0 @@ @@ -16,16 +16,17 @@ index 00000000..303a1ec9 +import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; +import org.bukkit.event.entity.CreatureSpawnEvent; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + -+import javax.annotation.Nullable; + +/** + * Called when a phantom is spawned for an exhausted player + */ +public class PhantomPreSpawnEvent extends PreCreatureSpawnEvent { -+ private final Entity entity; ++ @NotNull private final Entity entity; + -+ public PhantomPreSpawnEvent(Location location, Entity entity, CreatureSpawnEvent.SpawnReason reason) { ++ public PhantomPreSpawnEvent(@NotNull Location location, @NotNull Entity entity, @NotNull CreatureSpawnEvent.SpawnReason reason) { + super(location, EntityType.PHANTOM, reason); + this.entity = entity; + } @@ -41,9 +42,18 @@ index 00000000..303a1ec9 + } +} diff --git a/src/main/java/org/bukkit/entity/Phantom.java b/src/main/java/org/bukkit/entity/Phantom.java -index 1a1044ed..65b703a2 100644 +index 1a1044edc..ed4d417c2 100644 --- a/src/main/java/org/bukkit/entity/Phantom.java +++ b/src/main/java/org/bukkit/entity/Phantom.java +@@ -0,0 +0,0 @@ + package org.bukkit.entity; + ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; ++ + /** + * Represents a phantom. + */ @@ -0,0 +0,0 @@ public interface Phantom extends Flying { * @param sz The new size of the phantom. */ @@ -55,6 +65,7 @@ index 1a1044ed..65b703a2 100644 + * + * @return UUID + */ ++ @Nullable + public java.util.UUID getSpawningEntity(); + // Paper end } diff --git a/Spigot-API-Patches/Add-PlayerArmorChangeEvent.patch b/Spigot-API-Patches/Add-PlayerArmorChangeEvent.patch index 7c72c82e43..0a048a332e 100644 --- a/Spigot-API-Patches/Add-PlayerArmorChangeEvent.patch +++ b/Spigot-API-Patches/Add-PlayerArmorChangeEvent.patch @@ -6,7 +6,7 @@ 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 +0,0 @@ @@ -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 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,7 +142,7 @@ 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; + } + } diff --git a/Spigot-API-Patches/Add-PlayerConnectionCloseEvent.patch b/Spigot-API-Patches/Add-PlayerConnectionCloseEvent.patch index 194f01b898..de5db59aac 100644 --- a/Spigot-API-Patches/Add-PlayerConnectionCloseEvent.patch +++ b/Spigot-API-Patches/Add-PlayerConnectionCloseEvent.patch @@ -35,7 +35,7 @@ is undefined. diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerConnectionCloseEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerConnectionCloseEvent.java new file mode 100644 -index 00000000..80896bbf +index 000000000..12c1c6fe9 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerConnectionCloseEvent.java @@ -0,0 +0,0 @@ @@ -46,6 +46,7 @@ index 00000000..80896bbf + +import java.net.InetAddress; +import java.util.UUID; ++import org.jetbrains.annotations.NotNull; + +/** + *

@@ -87,11 +88,11 @@ index 00000000..80896bbf + + private static final HandlerList HANDLERS = new HandlerList(); + -+ private final UUID playerUniqueId; -+ private final String playerName; -+ private final InetAddress ipAddress; ++ @NotNull private final UUID playerUniqueId; ++ @NotNull private final String playerName; ++ @NotNull private final InetAddress ipAddress; + -+ public PlayerConnectionCloseEvent(final UUID playerUniqueId, final String playerName, final InetAddress ipAddress, final boolean async) { ++ public PlayerConnectionCloseEvent(@NotNull final UUID playerUniqueId, @NotNull final String playerName, @NotNull final InetAddress ipAddress, final boolean async) { + super(async); + this.playerUniqueId = playerUniqueId; + this.playerName = playerName; @@ -101,6 +102,7 @@ index 00000000..80896bbf + /** + * Returns the {@code UUID} of the player disconnecting. + */ ++ @NotNull + public UUID getPlayerUniqueId() { + return this.playerUniqueId; + } @@ -108,6 +110,7 @@ index 00000000..80896bbf + /** + * Returns the name of the player disconnecting. + */ ++ @NotNull + public String getPlayerName() { + return this.playerName; + } @@ -115,15 +118,18 @@ index 00000000..80896bbf + /** + * Returns the player's IP address. + */ ++ @NotNull + public InetAddress getIpAddress() { + return this.ipAddress; + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return HANDLERS; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return HANDLERS; + } diff --git a/Spigot-API-Patches/Add-PlayerInitialSpawnEvent.patch b/Spigot-API-Patches/Add-PlayerInitialSpawnEvent.patch index c984bd2058..147127befd 100644 --- a/Spigot-API-Patches/Add-PlayerInitialSpawnEvent.patch +++ b/Spigot-API-Patches/Add-PlayerInitialSpawnEvent.patch @@ -7,7 +7,7 @@ For modifying a player's initial spawn location as they join the server diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerInitialSpawnEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerInitialSpawnEvent.java new file mode 100644 -index 00000000..d1d6f33c +index 000000000..8e407eff1 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerInitialSpawnEvent.java @@ -0,0 +0,0 @@ @@ -17,12 +17,13 @@ index 00000000..d1d6f33c +import org.bukkit.entity.Player; +import org.bukkit.event.HandlerList; +import org.bukkit.event.player.PlayerEvent; ++import org.jetbrains.annotations.NotNull; + +public class PlayerInitialSpawnEvent extends PlayerEvent { + private static final HandlerList handlers = new HandlerList(); -+ private Location spawnLocation; ++ @NotNull private Location spawnLocation; + -+ public PlayerInitialSpawnEvent(final Player player, final Location spawnLocation) { ++ public PlayerInitialSpawnEvent(@NotNull final Player player, @NotNull final Location spawnLocation) { + super(player); + this.spawnLocation = spawnLocation; + } @@ -32,6 +33,7 @@ index 00000000..d1d6f33c + * + * @return Location current spawn location + */ ++ @NotNull + public Location getSpawnLocation() { + return this.spawnLocation; + } @@ -41,15 +43,17 @@ index 00000000..d1d6f33c + * + * @param spawnLocation new location for the spawn + */ -+ public void setSpawnLocation(Location spawnLocation) { ++ public void setSpawnLocation(@NotNull Location spawnLocation) { + this.spawnLocation = spawnLocation; + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } diff --git a/Spigot-API-Patches/Add-PlayerJumpEvent.patch b/Spigot-API-Patches/Add-PlayerJumpEvent.patch index 5d9e7616f0..5073f15292 100644 --- a/Spigot-API-Patches/Add-PlayerJumpEvent.patch +++ b/Spigot-API-Patches/Add-PlayerJumpEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add PlayerJumpEvent diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerJumpEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerJumpEvent.java new file mode 100644 -index 00000000..dd24f9b0 +index 000000000..289a0d784 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerJumpEvent.java @@ -0,0 +0,0 @@ @@ -18,6 +18,7 @@ index 00000000..dd24f9b0 +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.event.player.PlayerEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Called when the server detects the player is jumping. @@ -29,10 +30,10 @@ index 00000000..dd24f9b0 +public class PlayerJumpEvent extends PlayerEvent implements Cancellable { + private static final HandlerList handlers = new HandlerList(); + private boolean cancel = false; -+ private Location from; -+ private Location to; ++ @NotNull private Location from; ++ @NotNull private Location to; + -+ public PlayerJumpEvent(final Player player, final Location from, final Location to) { ++ public PlayerJumpEvent(@NotNull final Player player, @NotNull final Location from, @NotNull final Location to) { + super(player); + this.from = from; + this.to = to; @@ -71,6 +72,7 @@ index 00000000..dd24f9b0 + * + * @return Location the player jumped from + */ ++ @NotNull + public Location getFrom() { + return from; + } @@ -80,7 +82,7 @@ index 00000000..dd24f9b0 + * + * @param from New location to mark as the players previous location + */ -+ public void setFrom(Location from) { ++ public void setFrom(@NotNull Location from) { + validateLocation(from); + this.from = from; + } @@ -93,6 +95,7 @@ index 00000000..dd24f9b0 + * + * @return Location the player jumped to + */ ++ @NotNull + public Location getTo() { + return to; + } @@ -102,11 +105,13 @@ index 00000000..dd24f9b0 + Preconditions.checkArgument(loc.getWorld() != null, "Cannot use location with null world!"); + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } diff --git a/Spigot-API-Patches/Add-PlayerUseUnknownEntityEvent.patch b/Spigot-API-Patches/Add-PlayerUseUnknownEntityEvent.patch index f55bc6b35d..3d9a115c2c 100644 --- a/Spigot-API-Patches/Add-PlayerUseUnknownEntityEvent.patch +++ b/Spigot-API-Patches/Add-PlayerUseUnknownEntityEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add PlayerUseUnknownEntityEvent diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerUseUnknownEntityEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerUseUnknownEntityEvent.java new file mode 100644 -index 00000000..70eeaf5c +index 000000000..09cfdf48e --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerUseUnknownEntityEvent.java @@ -0,0 +0,0 @@ @@ -16,15 +16,16 @@ index 00000000..70eeaf5c +import org.bukkit.event.HandlerList; +import org.bukkit.event.player.PlayerEvent; +import org.bukkit.inventory.EquipmentSlot; ++import org.jetbrains.annotations.NotNull; + +public class PlayerUseUnknownEntityEvent extends PlayerEvent { + + private static final HandlerList handlers = new HandlerList(); + private final int entityId; + private final boolean attack; -+ private final EquipmentSlot hand; ++ @NotNull private final EquipmentSlot hand; + -+ public PlayerUseUnknownEntityEvent(Player who, int entityId, boolean attack, EquipmentSlot hand) { ++ public PlayerUseUnknownEntityEvent(@NotNull Player who, int entityId, boolean attack, @NotNull EquipmentSlot hand) { + super(who); + this.entityId = entityId; + this.attack = attack; @@ -39,15 +40,18 @@ index 00000000..70eeaf5c + return this.attack; + } + ++ @NotNull + public EquipmentSlot getHand() { + return this.hand; + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } diff --git a/Spigot-API-Patches/Add-ProjectileCollideEvent.patch b/Spigot-API-Patches/Add-ProjectileCollideEvent.patch index 1fef00cdac..d5fa2bfee9 100644 --- a/Spigot-API-Patches/Add-ProjectileCollideEvent.patch +++ b/Spigot-API-Patches/Add-ProjectileCollideEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add ProjectileCollideEvent diff --git a/src/main/java/com/destroystokyo/paper/event/entity/ProjectileCollideEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/ProjectileCollideEvent.java new file mode 100644 -index 00000000..f42e9851 +index 000000000..453663893 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/ProjectileCollideEvent.java @@ -0,0 +0,0 @@ @@ -17,6 +17,7 @@ index 00000000..f42e9851 +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.EntityEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Called when an projectile collides with an entity @@ -24,18 +25,19 @@ index 00000000..f42e9851 + * This event is called before {@link org.bukkit.event.entity.EntityDamageByEntityEvent}, and cancelling it will allow the projectile to continue flying + */ +public class ProjectileCollideEvent extends EntityEvent implements Cancellable { -+ private final Entity collidedWith; ++ @NotNull private final Entity collidedWith; + + /** + * Get the entity the projectile collided with + * + * @return the entity collided with + */ ++ @NotNull + public Entity getCollidedWith() { + return collidedWith; + } + -+ public ProjectileCollideEvent(Projectile what, Entity collidedWith) { ++ public ProjectileCollideEvent(@NotNull Projectile what, @NotNull Entity collidedWith) { + super(what); + this.collidedWith = collidedWith; + } @@ -45,16 +47,19 @@ index 00000000..f42e9851 + * + * @return the projectile that collided + */ ++ @NotNull + public Projectile getEntity() { + return (Projectile) super.getEntity(); + } + + private static final HandlerList handlerList = new HandlerList(); + ++ @NotNull + public static HandlerList getHandlerList() { + return handlerList; + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlerList; diff --git a/Spigot-API-Patches/Add-String-based-Action-Bar-API.patch b/Spigot-API-Patches/Add-String-based-Action-Bar-API.patch index 8ccfb9fa05..5bd3679c02 100644 --- a/Spigot-API-Patches/Add-String-based-Action-Bar-API.patch +++ b/Spigot-API-Patches/Add-String-based-Action-Bar-API.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Add String based Action Bar API diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 96d97bf3..d9965ddc 100644 +index c237073a3..219556ed5 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM - public void sendMap(MapView map); + public void sendMap(@NotNull MapView map); // Paper start + @@ -20,7 +20,7 @@ index 96d97bf3..d9965ddc 100644 + * + * @param message The message to send + */ -+ public void sendActionBar(String message); ++ public void sendActionBar(@NotNull String message); + + /** + * Sends an Action Bar message to the client. @@ -30,7 +30,7 @@ index 96d97bf3..d9965ddc 100644 + * @param alternateChar Alternate symbol such as '&' + * @param message The message to send + */ -+ public void sendActionBar(char alternateChar, String message); ++ public void sendActionBar(char alternateChar, @NotNull String message); + /** * Sends the component to the player @@ -56,7 +56,7 @@ index 96d97bf3..d9965ddc 100644 * @param component the components to send */ + @Deprecated - public void sendMessage(net.md_5.bungee.api.ChatMessageType position, net.md_5.bungee.api.chat.BaseComponent component) { + public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @NotNull net.md_5.bungee.api.chat.BaseComponent component) { throw new UnsupportedOperationException("Not supported yet."); } @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM @@ -68,7 +68,7 @@ index 96d97bf3..d9965ddc 100644 * @param components the components to send */ + @Deprecated - public void sendMessage(net.md_5.bungee.api.ChatMessageType position, net.md_5.bungee.api.chat.BaseComponent... components) { + public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @NotNull net.md_5.bungee.api.chat.BaseComponent... components) { throw new UnsupportedOperationException("Not supported yet."); } -- \ No newline at end of file diff --git a/Spigot-API-Patches/Add-TNTPrimeEvent.patch b/Spigot-API-Patches/Add-TNTPrimeEvent.patch index e7ec2b09ff..8ac36284ab 100644 --- a/Spigot-API-Patches/Add-TNTPrimeEvent.patch +++ b/Spigot-API-Patches/Add-TNTPrimeEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add TNTPrimeEvent diff --git a/src/main/java/com/destroystokyo/paper/event/block/TNTPrimeEvent.java b/src/main/java/com/destroystokyo/paper/event/block/TNTPrimeEvent.java new file mode 100644 -index 00000000..2ae8826b +index 000000000..73dabb82c --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/block/TNTPrimeEvent.java @@ -0,0 +0,0 @@ @@ -17,6 +17,8 @@ index 00000000..2ae8826b +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.event.block.BlockEvent; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * Called when TNT block is about to turn into {@link org.bukkit.entity.TNTPrimed} @@ -29,10 +31,10 @@ index 00000000..2ae8826b +public class TNTPrimeEvent extends BlockEvent implements Cancellable { + private static final HandlerList handlers = new HandlerList(); + private boolean cancelled; -+ private PrimeReason reason; -+ private Entity primerEntity; ++ @NotNull private PrimeReason reason; ++ @Nullable private Entity primerEntity; + -+ public TNTPrimeEvent(Block theBlock, PrimeReason reason, Entity primerEntity) { ++ public TNTPrimeEvent(@NotNull Block theBlock, @NotNull PrimeReason reason, @Nullable Entity primerEntity) { + super(theBlock); + this.reason = reason; + this.primerEntity = primerEntity; @@ -43,6 +45,7 @@ index 00000000..2ae8826b + * + * @return Prime reason + */ ++ @NotNull + public PrimeReason getReason() { + return this.reason; + } @@ -56,6 +59,7 @@ index 00000000..2ae8826b + * + * @return The {@link Entity} who primed the TNT + */ ++ @Nullable + public Entity getPrimerEntity() { + return this.primerEntity; + } @@ -80,11 +84,13 @@ index 00000000..2ae8826b + this.cancelled = cancel; + } + ++ @Nullable + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @Nullable + public static HandlerList getHandlerList() { + return handlers; + } diff --git a/Spigot-API-Patches/Add-UnknownCommandEvent.patch b/Spigot-API-Patches/Add-UnknownCommandEvent.patch index bc80c3f5b4..0c8c86aa27 100644 --- a/Spigot-API-Patches/Add-UnknownCommandEvent.patch +++ b/Spigot-API-Patches/Add-UnknownCommandEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add UnknownCommandEvent diff --git a/src/main/java/org/bukkit/event/command/UnknownCommandEvent.java b/src/main/java/org/bukkit/event/command/UnknownCommandEvent.java new file mode 100644 -index 00000000..19d634c3 +index 000000000..251342c3c --- /dev/null +++ b/src/main/java/org/bukkit/event/command/UnknownCommandEvent.java @@ -0,0 +0,0 @@ @@ -16,18 +16,19 @@ index 00000000..19d634c3 +import org.bukkit.event.HandlerList; +import org.bukkit.event.Event; + -+import javax.annotation.Nullable; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * Thrown when a player executes a command that is not defined + */ +public class UnknownCommandEvent extends Event { + private static final HandlerList handlers = new HandlerList(); -+ private CommandSender sender; -+ private String commandLine; -+ private String message; ++ @NotNull private CommandSender sender; ++ @NotNull private String commandLine; ++ @Nullable private String message; + -+ public UnknownCommandEvent(final CommandSender sender, final String commandLine, final String message) { ++ public UnknownCommandEvent(@NotNull final CommandSender sender, @NotNull final String commandLine, @Nullable final String message) { + super(false); + this.sender = sender; + this.commandLine = commandLine; @@ -40,6 +41,7 @@ index 00000000..19d634c3 + * + * @return Sender of the command + */ ++ @NotNull + public CommandSender getSender() { + return sender; + } @@ -50,6 +52,7 @@ index 00000000..19d634c3 + * + * @return Command sent + */ ++ @NotNull + public String getCommandLine() { + return commandLine; + } @@ -73,15 +76,17 @@ index 00000000..19d634c3 + * + * @param message the message to be returned, or null + */ -+ public void setMessage(String message) { ++ public void setMessage(@Nullable String message) { + this.message = message; + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } diff --git a/Spigot-API-Patches/Add-WhitelistToggleEvent.patch b/Spigot-API-Patches/Add-WhitelistToggleEvent.patch index 9852a6c010..371239c150 100644 --- a/Spigot-API-Patches/Add-WhitelistToggleEvent.patch +++ b/Spigot-API-Patches/Add-WhitelistToggleEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add WhitelistToggleEvent diff --git a/src/main/java/com/destroystokyo/paper/event/server/WhitelistToggleEvent.java b/src/main/java/com/destroystokyo/paper/event/server/WhitelistToggleEvent.java new file mode 100644 -index 00000000..e7b785e7 +index 000000000..fdd5eedb2 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/server/WhitelistToggleEvent.java @@ -0,0 +0,0 @@ @@ -14,6 +14,7 @@ index 00000000..e7b785e7 + +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; ++import org.jetbrains.annotations.NotNull; + +/** + * This event is fired when whitelist is toggled @@ -38,11 +39,13 @@ index 00000000..e7b785e7 + return enabled; + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } diff --git a/Spigot-API-Patches/Add-World.getEntity-UUID-API.patch b/Spigot-API-Patches/Add-World.getEntity-UUID-API.patch index 2cea2171d2..8b5dafb945 100644 --- a/Spigot-API-Patches/Add-World.getEntity-UUID-API.patch +++ b/Spigot-API-Patches/Add-World.getEntity-UUID-API.patch @@ -5,12 +5,12 @@ Subject: [PATCH] Add World.getEntity(UUID) API diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index c73b7065..e424ed4e 100644 +index dcc47cde5..5ccd8500d 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable { - */ - public Collection getNearbyEntities(Location location, double x, double y, double z); + @NotNull + public Collection getNearbyEntities(@NotNull Location location, double x, double y, double z); + // Paper start - getEntity by UUID API + /** @@ -19,7 +19,8 @@ index c73b7065..e424ed4e 100644 + * @param uuid the UUID of the entity + * @return the entity with the given UUID, or null if it isn't found + */ -+ public Entity getEntity(UUID uuid); ++ @Nullable ++ public Entity getEntity(@NotNull UUID uuid); + // Paper end + /** diff --git a/Spigot-API-Patches/Add-a-call-helper-to-Event.patch b/Spigot-API-Patches/Add-a-call-helper-to-Event.patch index cd0409ae08..0a5819a14a 100644 --- a/Spigot-API-Patches/Add-a-call-helper-to-Event.patch +++ b/Spigot-API-Patches/Add-a-call-helper-to-Event.patch @@ -6,16 +6,9 @@ Subject: [PATCH] Add a call helper to Event Reduces diff in Server patches diff --git a/src/main/java/org/bukkit/event/Event.java b/src/main/java/org/bukkit/event/Event.java -index 6677e1bd..e7061112 100644 +index 18d0636b..8ec56cd6 100644 --- a/src/main/java/org/bukkit/event/Event.java +++ b/src/main/java/org/bukkit/event/Event.java -@@ -0,0 +0,0 @@ - package org.bukkit.event; - -+import org.bukkit.Bukkit; - import org.bukkit.plugin.PluginManager; - - /** @@ -0,0 +0,0 @@ public abstract class Event { this.async = isAsync; } @@ -27,7 +20,7 @@ index 6677e1bd..e7061112 100644 + * @return false if event was cancelled, if cancellable. otherwise true. + */ + public boolean callEvent() { -+ Bukkit.getPluginManager().callEvent(this); ++ org.bukkit.Bukkit.getPluginManager().callEvent(this); + if (this instanceof Cancellable) { + return !((Cancellable) this).isCancelled(); + } else { diff --git a/Spigot-API-Patches/Add-an-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch b/Spigot-API-Patches/Add-an-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch index ab8f65f071..92b31f4d65 100644 --- a/Spigot-API-Patches/Add-an-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch +++ b/Spigot-API-Patches/Add-an-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch @@ -6,12 +6,14 @@ Subject: [PATCH] Add an API for CanPlaceOn and CanDestroy NBT values diff --git a/src/main/java/com/destroystokyo/paper/Namespaced.java b/src/main/java/com/destroystokyo/paper/Namespaced.java new file mode 100644 -index 00000000..2baf58b7 +index 000000000..cd1a34b82 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/Namespaced.java @@ -0,0 +0,0 @@ +package com.destroystokyo.paper; + ++import org.jetbrains.annotations.NotNull; ++ +/** + * Represents a namespaced resource, see {@link org.bukkit.NamespacedKey} for single elements + * or {@link com.destroystokyo.paper.NamespacedTag} for a collection of elements @@ -34,6 +36,7 @@ index 00000000..2baf58b7 + * + * @return resource namespace + */ ++ @NotNull + String getNamespace(); + + /** @@ -44,11 +47,12 @@ index 00000000..2baf58b7 + * + * @return resource key + */ ++ @NotNull + String getKey(); +} diff --git a/src/main/java/com/destroystokyo/paper/NamespacedTag.java b/src/main/java/com/destroystokyo/paper/NamespacedTag.java new file mode 100644 -index 00000000..89949827 +index 000000000..28f3fda95 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/NamespacedTag.java @@ -0,0 +0,0 @@ @@ -59,6 +63,7 @@ index 00000000..89949827 +import java.util.UUID; +import java.util.regex.Pattern; +import org.bukkit.plugin.Plugin; ++import org.jetbrains.annotations.NotNull; + +/** + * Represents a String based key pertaining to a tagged entry. Consists of two components - a namespace @@ -98,7 +103,7 @@ index 00000000..89949827 + * @deprecated should never be used by plugins, for internal use only!! + */ + @Deprecated -+ public NamespacedTag(String namespace, String key) { ++ public NamespacedTag(@NotNull String namespace, @NotNull String key) { + Preconditions.checkArgument(namespace != null && VALID_NAMESPACE.matcher(namespace).matches(), "Invalid namespace. Must be [a-z0-9._-]: %s", namespace); + Preconditions.checkArgument(key != null && VALID_KEY.matcher(key).matches(), "Invalid key. Must be [a-z0-9/._-]: %s", key); + @@ -121,7 +126,7 @@ index 00000000..89949827 + * @param plugin the plugin to use for the namespace + * @param key the key to create + */ -+ public NamespacedTag(Plugin plugin, String key) { ++ public NamespacedTag(@NotNull Plugin plugin, @NotNull String key) { + Preconditions.checkArgument(plugin != null, "Plugin cannot be null"); + Preconditions.checkArgument(key != null, "Key cannot be null"); + @@ -136,10 +141,12 @@ index 00000000..89949827 + Preconditions.checkArgument(string.length() < 256, "NamespacedTag must be less than 256 characters (%s)", string); + } + ++ @NotNull + public String getNamespace() { + return namespace; + } + ++ @NotNull + public String getKey() { + return key; + } @@ -186,15 +193,16 @@ index 00000000..89949827 + * @param key the key to use + * @return new key in the Minecraft namespace + */ -+ public static NamespacedTag minecraft(String key) { ++ @NotNull ++ public static NamespacedTag minecraft(@NotNull String key) { + return new NamespacedTag(MINECRAFT, key); + } +} diff --git a/src/main/java/org/bukkit/NamespacedKey.java b/src/main/java/org/bukkit/NamespacedKey.java -index fe8d3468..074769c1 100644 +index f5e3929aa..8648e8fb6 100644 --- a/src/main/java/org/bukkit/NamespacedKey.java +++ b/src/main/java/org/bukkit/NamespacedKey.java -@@ -0,0 +0,0 @@ import org.bukkit.plugin.Plugin; +@@ -0,0 +0,0 @@ import org.jetbrains.annotations.NotNull; * underscores, hyphens, and forward slashes. * */ @@ -204,20 +212,21 @@ index fe8d3468..074769c1 100644 /** * The namespace representing all inbuilt keys. @@ -0,0 +0,0 @@ public final class NamespacedKey { - Preconditions.checkArgument(string.length() < 256, "NamespacedKey must be less than 256 characters (%s)", string); } + @NotNull + @Override // Paper public String getNamespace() { return namespace; } + @NotNull + @Override // Paper public String getKey() { return key; } diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java -index 4d0351c4..03e3cfd4 100644 +index f2a6755a5..3ed7ea06a 100644 --- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java +++ b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java @@ -0,0 +0,0 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable { @@ -228,6 +237,7 @@ index 4d0351c4..03e3cfd4 100644 + * * @return a list of lore that is set */ + @Nullable List getLore(); /** @@ -237,7 +247,7 @@ index 4d0351c4..03e3cfd4 100644 * * @param lore the lore that will be set @@ -0,0 +0,0 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable { - int getEnchantLevel(Enchantment ench); + int getEnchantLevel(@NotNull Enchantment ench); /** - * Returns a copy the enchantments in this ItemMeta.
@@ -246,7 +256,7 @@ index 4d0351c4..03e3cfd4 100644 * * @return An immutable copy of the enchantments @@ -0,0 +0,0 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable { - + @NotNull Spigot spigot(); // Spigot end + // Paper start - Add an API for CanPlaceOn and CanDestroy NBT values @@ -291,6 +301,7 @@ index 4d0351c4..03e3cfd4 100644 + * + * @return Set of {@link com.destroystokyo.paper.Namespaced} + */ ++ @NotNull + Set getDestroyableKeys(); + + /** @@ -298,13 +309,14 @@ index 4d0351c4..03e3cfd4 100644 + * + * @param canDestroy Collection of {@link com.destroystokyo.paper.Namespaced} + */ -+ void setDestroyableKeys(Collection canDestroy); ++ void setDestroyableKeys(@NotNull Collection canDestroy); + + /** + * Gets the collection of namespaced keys that the item can be placed on in {@link org.bukkit.GameMode#ADVENTURE} + * + * @return Set of {@link com.destroystokyo.paper.Namespaced} + */ ++ @NotNull + Set getPlaceableKeys(); + + /** @@ -312,7 +324,8 @@ index 4d0351c4..03e3cfd4 100644 + * + * @param canPlaceOn Collection of {@link com.destroystokyo.paper.Namespaced} + */ -+ void setPlaceableKeys(Collection canPlaceOn); ++ @NotNull ++ void setPlaceableKeys(@NotNull Collection canPlaceOn); + + /** + * Checks for the existence of any keys that the item can be placed on diff --git a/Spigot-API-Patches/Add-an-asterisk-to-legacy-API-plugins.patch b/Spigot-API-Patches/Add-an-asterisk-to-legacy-API-plugins.patch index 9cee698a79..368d95d7bf 100644 --- a/Spigot-API-Patches/Add-an-asterisk-to-legacy-API-plugins.patch +++ b/Spigot-API-Patches/Add-an-asterisk-to-legacy-API-plugins.patch @@ -7,7 +7,7 @@ Not here to name and shame, only so server admins can be aware of which plugins have and haven't been updated. diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java -index a4aabfe7..f462b631 100644 +index a4aabfe7f..f462b631b 100644 --- a/src/main/java/org/bukkit/UnsafeValues.java +++ b/src/main/java/org/bukkit/UnsafeValues.java @@ -0,0 +0,0 @@ public interface UnsafeValues { @@ -22,7 +22,7 @@ index a4aabfe7..f462b631 100644 + // Paper end } diff --git a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java -index b1d384e8..72c0c0bc 100644 +index d4e74d292..6cfd9f3c6 100644 --- a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java +++ b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java @@ -0,0 +0,0 @@ public class PluginsCommand extends BukkitCommand { @@ -42,7 +42,7 @@ index b1d384e8..72c0c0bc 100644 StringBuilder pluginList = new StringBuilder(); diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -index c7782e7d..39f92d88 100644 +index 095448fe7..e91cb2c78 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java @@ -0,0 +0,0 @@ public final class JavaPluginLoader implements PluginLoader { diff --git a/Spigot-API-Patches/Add-command-to-reload-permissions.yml-and-require-co.patch b/Spigot-API-Patches/Add-command-to-reload-permissions.yml-and-require-co.patch index 66355bcc8b..012b29c199 100644 --- a/Spigot-API-Patches/Add-command-to-reload-permissions.yml-and-require-co.patch +++ b/Spigot-API-Patches/Add-command-to-reload-permissions.yml-and-require-co.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add command to reload permissions.yml and require confirm to diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 22704949..2d588c6b 100644 +index e27bdb7bf..d009aebd6 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java @@ -0,0 +0,0 @@ public final class Bukkit { @@ -22,24 +22,24 @@ index 22704949..2d588c6b 100644 + } // Paper end - public static Server.Spigot spigot() + @NotNull diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index f4f4f291..18e5dd48 100644 +index ab0438b81..e7e7dab8c 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient { - + @NotNull Spigot spigot(); // Spigot end + + void reloadPermissions(); // Paper } diff --git a/src/main/java/org/bukkit/command/defaults/ReloadCommand.java b/src/main/java/org/bukkit/command/defaults/ReloadCommand.java -index 0ab7e295..f331a442 100644 +index 1104c6037..ba118dbfe 100644 --- a/src/main/java/org/bukkit/command/defaults/ReloadCommand.java +++ b/src/main/java/org/bukkit/command/defaults/ReloadCommand.java @@ -0,0 +0,0 @@ public class ReloadCommand extends BukkitCommand { - public ReloadCommand(String name) { + public ReloadCommand(@NotNull String name) { super(name); this.description = "Reloads the server configuration and plugins"; - this.usageMessage = "/reload"; @@ -49,8 +49,8 @@ index 0ab7e295..f331a442 100644 } @Override - public boolean execute(CommandSender sender, String currentAlias, String[] args) { -+ +- public boolean execute(@NotNull CommandSender sender, @NotNull String currentAlias, @NotNull String[] args) { ++ public boolean execute(@NotNull CommandSender sender, @NotNull String currentAlias, @NotNull String[] args) { // Paper if (!testPermission(sender)) return true; + // Paper start - Reload permissions.yml & require confirm @@ -77,22 +77,20 @@ index 0ab7e295..f331a442 100644 Command.broadcastCommandMessage(sender, ChatColor.RED + "If you encounter any issues please use the /stop command to restart your server."); Bukkit.reload(); @@ -0,0 +0,0 @@ public class ReloadCommand extends BukkitCommand { - } - + @NotNull @Override -- public List tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { + public List tabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException { - return Collections.emptyList(); -+ public java.util.List tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { + return java.util.Collections.singletonList("permissions"); // Paper } } diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java -index b7627e39..5034215a 100644 +index 4c55f5f8c..12e17709c 100644 --- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java +++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java @@ -0,0 +0,0 @@ public final class SimplePluginManager implements PluginManager { public void useTimings(boolean use) { - co.aikar.timings.Timings.setTimingsEnabled(use); // Spigot + co.aikar.timings.Timings.setTimingsEnabled(use); // Paper } + + // Paper start diff --git a/Spigot-API-Patches/Add-configuration-option-to-prevent-player-names-fro.patch b/Spigot-API-Patches/Add-configuration-option-to-prevent-player-names-fro.patch index ee90d46b77..8093f3e79a 100644 --- a/Spigot-API-Patches/Add-configuration-option-to-prevent-player-names-fro.patch +++ b/Spigot-API-Patches/Add-configuration-option-to-prevent-player-names-fro.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add configuration option to prevent player names from being diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 5715057a..eb180374 100644 +index 8e0cbbf15..90b41fd25 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java @@ -0,0 +0,0 @@ public final class Bukkit { @@ -25,9 +25,9 @@ index 5715057a..eb180374 100644 + } // Paper end - public static Server.Spigot spigot() + @NotNull diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 259a0fbe..c57f81fd 100644 +index 8f61619a3..fe3144c00 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient { @@ -46,7 +46,7 @@ index 259a0fbe..c57f81fd 100644 + // Paper end } diff --git a/src/main/java/org/bukkit/command/PluginCommand.java b/src/main/java/org/bukkit/command/PluginCommand.java -index 2abe1208..c660c178 100644 +index 92c23424e..e420b7902 100644 --- a/src/main/java/org/bukkit/command/PluginCommand.java +++ b/src/main/java/org/bukkit/command/PluginCommand.java @@ -0,0 +0,0 @@ public final class PluginCommand extends Command implements PluginIdentifiableCo diff --git a/Spigot-API-Patches/Add-exception-reporting-event.patch b/Spigot-API-Patches/Add-exception-reporting-event.patch index 4919521a80..1858ea2600 100644 --- a/Spigot-API-Patches/Add-exception-reporting-event.patch +++ b/Spigot-API-Patches/Add-exception-reporting-event.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add exception reporting event diff --git a/src/main/java/com/destroystokyo/paper/event/server/ServerExceptionEvent.java b/src/main/java/com/destroystokyo/paper/event/server/ServerExceptionEvent.java new file mode 100644 -index 00000000..4109454a +index 000000000..d3b00f741 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/server/ServerExceptionEvent.java @@ -0,0 +0,0 @@ @@ -17,15 +17,16 @@ index 00000000..4109454a +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; +import com.destroystokyo.paper.exception.ServerException; ++import org.jetbrains.annotations.NotNull; + +/** + * Called whenever an exception is thrown in a recoverable section of the server. + */ +public class ServerExceptionEvent extends Event { + private static final HandlerList handlers = new HandlerList(); -+ private ServerException exception; ++ @NotNull private ServerException exception; + -+ public ServerExceptionEvent(ServerException exception) { ++ public ServerExceptionEvent(@NotNull ServerException exception) { + this.exception = Preconditions.checkNotNull(exception, "exception"); + } + @@ -34,22 +35,25 @@ index 00000000..4109454a + * + * @return Exception thrown + */ ++ @NotNull + public ServerException getException() { + return exception; + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } +} diff --git a/src/main/java/com/destroystokyo/paper/exception/ServerCommandException.java b/src/main/java/com/destroystokyo/paper/exception/ServerCommandException.java new file mode 100644 -index 00000000..6fb39af0 +index 000000000..6fb39af04 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/exception/ServerCommandException.java @@ -0,0 +0,0 @@ @@ -119,7 +123,7 @@ index 00000000..6fb39af0 +} diff --git a/src/main/java/com/destroystokyo/paper/exception/ServerEventException.java b/src/main/java/com/destroystokyo/paper/exception/ServerEventException.java new file mode 100644 -index 00000000..410b2413 +index 000000000..410b24139 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/exception/ServerEventException.java @@ -0,0 +0,0 @@ @@ -177,7 +181,7 @@ index 00000000..410b2413 +} diff --git a/src/main/java/com/destroystokyo/paper/exception/ServerException.java b/src/main/java/com/destroystokyo/paper/exception/ServerException.java new file mode 100644 -index 00000000..c06ea394 +index 000000000..c06ea3942 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/exception/ServerException.java @@ -0,0 +0,0 @@ @@ -206,7 +210,7 @@ index 00000000..c06ea394 +} diff --git a/src/main/java/com/destroystokyo/paper/exception/ServerInternalException.java b/src/main/java/com/destroystokyo/paper/exception/ServerInternalException.java new file mode 100644 -index 00000000..e762ed0d +index 000000000..e762ed0db --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/exception/ServerInternalException.java @@ -0,0 +0,0 @@ @@ -247,7 +251,7 @@ index 00000000..e762ed0d +} diff --git a/src/main/java/com/destroystokyo/paper/exception/ServerPluginEnableDisableException.java b/src/main/java/com/destroystokyo/paper/exception/ServerPluginEnableDisableException.java new file mode 100644 -index 00000000..f016ba3b +index 000000000..f016ba3b1 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/exception/ServerPluginEnableDisableException.java @@ -0,0 +0,0 @@ @@ -274,7 +278,7 @@ index 00000000..f016ba3b \ No newline at end of file diff --git a/src/main/java/com/destroystokyo/paper/exception/ServerPluginException.java b/src/main/java/com/destroystokyo/paper/exception/ServerPluginException.java new file mode 100644 -index 00000000..6defac28 +index 000000000..6defac287 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/exception/ServerPluginException.java @@ -0,0 +0,0 @@ @@ -318,7 +322,7 @@ index 00000000..6defac28 +} diff --git a/src/main/java/com/destroystokyo/paper/exception/ServerPluginMessageException.java b/src/main/java/com/destroystokyo/paper/exception/ServerPluginMessageException.java new file mode 100644 -index 00000000..89e13252 +index 000000000..89e132525 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/exception/ServerPluginMessageException.java @@ -0,0 +0,0 @@ @@ -388,7 +392,7 @@ index 00000000..89e13252 +} diff --git a/src/main/java/com/destroystokyo/paper/exception/ServerSchedulerException.java b/src/main/java/com/destroystokyo/paper/exception/ServerSchedulerException.java new file mode 100644 -index 00000000..2d0b2d4a +index 000000000..2d0b2d4a9 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/exception/ServerSchedulerException.java @@ -0,0 +0,0 @@ @@ -431,7 +435,7 @@ index 00000000..2d0b2d4a +} diff --git a/src/main/java/com/destroystokyo/paper/exception/ServerTabCompleteException.java b/src/main/java/com/destroystokyo/paper/exception/ServerTabCompleteException.java new file mode 100644 -index 00000000..5582999f +index 000000000..5582999fe --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/exception/ServerTabCompleteException.java @@ -0,0 +0,0 @@ @@ -458,7 +462,7 @@ index 00000000..5582999f + } +} diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java -index 43e52a77..65ad78c4 100644 +index f7ec2e55f..f52d91d19 100644 --- a/src/main/java/org/bukkit/command/SimpleCommandMap.java +++ b/src/main/java/org/bukkit/command/SimpleCommandMap.java @@ -0,0 +0,0 @@ import java.util.Iterator; @@ -499,7 +503,7 @@ index 43e52a77..65ad78c4 100644 } diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java -index 0185934b..b7627e39 100644 +index fe5725519..4c55f5f8c 100644 --- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java +++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java @@ -0,0 +0,0 @@ import java.util.logging.Level; diff --git a/Spigot-API-Patches/Add-extended-PaperServerListPingEvent.patch b/Spigot-API-Patches/Add-extended-PaperServerListPingEvent.patch index f5a84ee1e7..bc386c329c 100644 --- a/Spigot-API-Patches/Add-extended-PaperServerListPingEvent.patch +++ b/Spigot-API-Patches/Add-extended-PaperServerListPingEvent.patch @@ -8,7 +8,7 @@ and allows full control of the response sent to the client. diff --git a/src/main/java/com/destroystokyo/paper/event/server/PaperServerListPingEvent.java b/src/main/java/com/destroystokyo/paper/event/server/PaperServerListPingEvent.java new file mode 100644 -index 00000000..b2a8476c +index 000000000..0cc5dd573 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/server/PaperServerListPingEvent.java @@ -0,0 +0,0 @@ @@ -30,8 +30,8 @@ index 00000000..b2a8476c +import java.util.NoSuchElementException; +import java.util.UUID; + -+import javax.annotation.Nonnull; -+import javax.annotation.Nullable; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * Extended version of {@link ServerListPingEvent} that allows full control @@ -39,13 +39,13 @@ index 00000000..b2a8476c + */ +public class PaperServerListPingEvent extends ServerListPingEvent implements Cancellable { + -+ @Nonnull private final StatusClient client; ++ @NotNull private final StatusClient client; + + private int numPlayers; + private boolean hidePlayers; -+ @Nonnull private final List playerSample = new ArrayList<>(); ++ @NotNull private final List playerSample = new ArrayList<>(); + -+ @Nonnull private String version; ++ @NotNull private String version; + private int protocolVersion; + + @Nullable private CachedServerIcon favicon; @@ -55,8 +55,8 @@ index 00000000..b2a8476c + private boolean originalPlayerCount = true; + private Object[] players; + -+ public PaperServerListPingEvent(@Nonnull StatusClient client, String motd, int numPlayers, int maxPlayers, -+ @Nonnull String version, int protocolVersion, @Nullable CachedServerIcon favicon) { ++ public PaperServerListPingEvent(@NotNull StatusClient client, @NotNull String motd, int numPlayers, int maxPlayers, ++ @NotNull String version, int protocolVersion, @Nullable CachedServerIcon favicon) { + super(client.getAddress().getAddress(), motd, numPlayers, maxPlayers); + this.client = client; + this.numPlayers = numPlayers; @@ -70,7 +70,7 @@ index 00000000..b2a8476c + * + * @return The client + */ -+ @Nonnull ++ @NotNull + public StatusClient getClient() { + return this.client; + } @@ -157,7 +157,7 @@ index 00000000..b2a8476c + * + * @return The mutable player sample list + */ -+ @Nonnull ++ @NotNull + public List getPlayerSample() { + return this.playerSample; + } @@ -167,7 +167,7 @@ index 00000000..b2a8476c + * + * @return The server version + */ -+ @Nonnull ++ @NotNull + public String getVersion() { + return version; + } @@ -177,7 +177,7 @@ index 00000000..b2a8476c + * + * @param version The server version + */ -+ public void setVersion(@Nonnull String version) { ++ public void setVersion(@NotNull String version) { + this.version = requireNonNull(version, "version"); + } + @@ -263,7 +263,7 @@ index 00000000..b2a8476c + * the removed player (based on their {@link UUID}). + * + */ -+ @Nonnull ++ @NotNull + @Override + public Iterator iterator() { + if (this.players == null) { @@ -273,11 +273,13 @@ index 00000000..b2a8476c + return new PlayerIterator(); + } + ++ @NotNull + protected Object[] getOnlinePlayers() { + return Bukkit.getOnlinePlayers().toArray(); + } + -+ protected Player getBukkitPlayer(Object player) { ++ @NotNull ++ protected Player getBukkitPlayer(@NotNull Object player) { + return (Player) player; + } + @@ -298,6 +300,7 @@ index 00000000..b2a8476c + return false; + } + ++ @NotNull + @Override + public Player next() { + if (!hasNext()) { @@ -334,7 +337,7 @@ index 00000000..b2a8476c +} diff --git a/src/main/java/com/destroystokyo/paper/network/StatusClient.java b/src/main/java/com/destroystokyo/paper/network/StatusClient.java new file mode 100644 -index 00000000..517d1523 +index 000000000..517d15238 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/network/StatusClient.java @@ -0,0 +0,0 @@ @@ -352,14 +355,13 @@ index 00000000..517d1523 + +} diff --git a/src/main/java/org/bukkit/util/CachedServerIcon.java b/src/main/java/org/bukkit/util/CachedServerIcon.java -index 04804706..44563482 100644 +index 612958a33..bb4f7702c 100644 --- a/src/main/java/org/bukkit/util/CachedServerIcon.java +++ b/src/main/java/org/bukkit/util/CachedServerIcon.java -@@ -0,0 +0,0 @@ import org.bukkit.event.server.ServerListPingEvent; - */ - public interface CachedServerIcon { - public String getData(); // Spigot -+ +@@ -0,0 +0,0 @@ public interface CachedServerIcon { + @Nullable + public String getData(); // Paper + + // Paper start + default boolean isEmpty() { + return getData() == null; diff --git a/Spigot-API-Patches/Add-getI18NDisplayName-API.patch b/Spigot-API-Patches/Add-getI18NDisplayName-API.patch index ba2ce00c92..f00538b1fb 100644 --- a/Spigot-API-Patches/Add-getI18NDisplayName-API.patch +++ b/Spigot-API-Patches/Add-getI18NDisplayName-API.patch @@ -8,13 +8,13 @@ Currently the server only supports the English language. To override this, You must replace the language file embedded in the server jar. diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java -index 3012aec2..63dd1b32 100644 +index 8e602cf51..dca77bbaf 100644 --- a/src/main/java/org/bukkit/inventory/ItemFactory.java +++ b/src/main/java/org/bukkit/inventory/ItemFactory.java @@ -0,0 +0,0 @@ public interface ItemFactory { - * @return A potentially Data Converted ItemStack */ - ItemStack ensureServerConversions(ItemStack item); + @NotNull + ItemStack ensureServerConversions(@NotNull ItemStack item); + + /** + * Gets the Display name as seen in the Client. @@ -24,11 +24,12 @@ index 3012aec2..63dd1b32 100644 + * @param item Item to return Display name of + * @return Display name of Item + */ -+ String getI18NDisplayName(ItemStack item); ++ @Nullable ++ String getI18NDisplayName(@Nullable ItemStack item); // Paper end } diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java -index 5e8de115..c3cb1247 100644 +index e8f97c949..b1c02ac0d 100644 --- a/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java @@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { @@ -43,6 +44,7 @@ index 5e8de115..c3cb1247 100644 + * + * @return Display name of Item + */ ++ @Nullable + public String getI18NDisplayName() { + return Bukkit.getServer().getItemFactory().getI18NDisplayName(this); + } diff --git a/Spigot-API-Patches/Add-getNearbyXXX-methods-to-Location.patch b/Spigot-API-Patches/Add-getNearbyXXX-methods-to-Location.patch deleted file mode 100644 index 84ab412c7a..0000000000 --- a/Spigot-API-Patches/Add-getNearbyXXX-methods-to-Location.patch +++ /dev/null @@ -1,256 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: BillyGalbreath -Date: Mon, 18 Jun 2018 00:41:46 -0500 -Subject: [PATCH] Add "getNearbyXXX" methods to Location - - -diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java -index 916238c4..162a76e8 100644 ---- a/src/main/java/org/bukkit/Location.java -+++ b/src/main/java/org/bukkit/Location.java -@@ -0,0 +0,0 @@ import org.bukkit.configuration.serialization.ConfigurationSerializable; - import org.bukkit.util.NumberConversions; - import org.bukkit.util.Vector; - -+// Paper start -+import java.util.Collection; -+import java.util.Collections; -+import java.util.function.Predicate; -+import org.bukkit.entity.Entity; -+import org.bukkit.entity.LivingEntity; -+import org.bukkit.entity.Player; -+// Paper end -+ - /** - * Represents a 3-dimensional position in a world. - *
-@@ -0,0 +0,0 @@ public class Location implements Cloneable, ConfigurationSerializable { - centerLoc.setZ(getBlockZ() + 0.5); - return centerLoc; - } -+ -+ /** -+ * Returns a list of entities within a bounding box centered around a Location. -+ * -+ * Some implementations may impose artificial restrictions on the size of the search bounding box. -+ * -+ * @param x 1/2 the size of the box along x axis -+ * @param y 1/2 the size of the box along y axis -+ * @param z 1/2 the size of the box along z axis -+ * @return the collection of entities near location. This will always be a non-null collection. -+ */ -+ public Collection getNearbyEntities(double x, double y, double z) { -+ if (world == null) { -+ throw new IllegalArgumentException("Location has no world"); -+ } -+ return world.getNearbyEntities(this, x, y, z); -+ } -+ -+ /** -+ * Gets nearby players within the specified radius (bounding box) -+ * @param radius X Radius -+ * @return the collection of entities near location. This will always be a non-null collection. -+ */ -+ public Collection getNearbyLivingEntities(double radius) { -+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, radius, radius, radius); -+ } -+ -+ /** -+ * Gets nearby players within the specified radius (bounding box) -+ * @param xzRadius X/Z Radius -+ * @param yRadius Y Radius -+ * @return the collection of living entities near location. This will always be a non-null collection. -+ */ -+ public Collection getNearbyLivingEntities(double xzRadius, double yRadius) { -+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, xzRadius, yRadius, xzRadius); -+ } -+ -+ /** -+ * Gets nearby players within the specified radius (bounding box) -+ * @param xRadius X Radius -+ * @param yRadius Y Radius -+ * @param zRadius Z radius -+ * @return the collection of living entities near location. This will always be a non-null collection. -+ */ -+ public Collection getNearbyLivingEntities(double xRadius, double yRadius, double zRadius) { -+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, xRadius, yRadius, zRadius); -+ } -+ -+ /** -+ * Gets nearby players within the specified radius (bounding box) -+ * @param radius Radius -+ * @param predicate a predicate used to filter results -+ * @return the collection of living entities near location. This will always be a non-null collection. -+ */ -+ public Collection getNearbyLivingEntities(double radius, Predicate predicate) { -+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, radius, radius, radius, predicate); -+ } -+ -+ /** -+ * Gets nearby players within the specified radius (bounding box) -+ * @param xzRadius X/Z Radius -+ * @param yRadius Y Radius -+ * @param predicate a predicate used to filter results -+ * @return the collection of living entities near location. This will always be a non-null collection. -+ */ -+ public Collection getNearbyLivingEntities(double xzRadius, double yRadius, Predicate predicate) { -+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, xzRadius, yRadius, xzRadius, predicate); -+ } -+ -+ /** -+ * Gets nearby players within the specified radius (bounding box) -+ * @param xRadius X Radius -+ * @param yRadius Y Radius -+ * @param zRadius Z radius -+ * @param predicate a predicate used to filter results -+ * @return the collection of living entities near location. This will always be a non-null collection. -+ */ -+ public Collection getNearbyLivingEntities(double xRadius, double yRadius, double zRadius, Predicate predicate) { -+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, xRadius, yRadius, zRadius, predicate); -+ } -+ -+ /** -+ * Gets nearby players within the specified radius (bounding box) -+ * @param radius X/Y/Z Radius -+ * @return the collection of players near location. This will always be a non-null collection. -+ */ -+ -+ public Collection getNearbyPlayers(double radius) { -+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, radius, radius, radius); -+ } -+ -+ /** -+ * Gets nearby players within the specified radius (bounding box) -+ * @param xzRadius X/Z Radius -+ * @param yRadius Y Radius -+ * @return the collection of players near location. This will always be a non-null collection. -+ */ -+ public Collection getNearbyPlayers(double xzRadius, double yRadius) { -+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, xzRadius, yRadius, xzRadius); -+ } -+ -+ /** -+ * Gets nearby players within the specified radius (bounding box) -+ * @param xRadius X Radius -+ * @param yRadius Y Radius -+ * @param zRadius Z Radius -+ * @return the collection of players near location. This will always be a non-null collection. -+ */ -+ public Collection getNearbyPlayers(double xRadius, double yRadius, double zRadius) { -+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, xRadius, yRadius, zRadius); -+ } -+ -+ /** -+ * Gets nearby players within the specified radius (bounding box) -+ * @param radius X/Y/Z Radius -+ * @param predicate a predicate used to filter results -+ * @return the collection of players near location. This will always be a non-null collection. -+ */ -+ public Collection getNearbyPlayers(double radius, Predicate predicate) { -+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, radius, radius, radius, predicate); -+ } -+ -+ /** -+ * Gets nearby players within the specified radius (bounding box) -+ * @param xzRadius X/Z Radius -+ * @param yRadius Y Radius -+ * @param predicate a predicate used to filter results -+ * @return the collection of players near location. This will always be a non-null collection. -+ */ -+ public Collection getNearbyPlayers(double xzRadius, double yRadius, Predicate predicate) { -+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, xzRadius, yRadius, xzRadius, predicate); -+ } -+ -+ /** -+ * Gets nearby players within the specified radius (bounding box) -+ * @param xRadius X Radius -+ * @param yRadius Y Radius -+ * @param zRadius Z Radius -+ * @param predicate a predicate used to filter results -+ * @return the collection of players near location. This will always be a non-null collection. -+ */ -+ public Collection getNearbyPlayers(double xRadius, double yRadius, double zRadius, Predicate predicate) { -+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, xRadius, yRadius, zRadius, predicate); -+ } -+ -+ /** -+ * Gets all nearby entities of the specified type, within the specified radius (bounding box) -+ * @param clazz Type to filter by -+ * @param radius X/Y/Z radius to search within -+ * @param the entity type -+ * @return the collection of entities of type clazz near location. This will always be a non-null collection. -+ */ -+ public Collection getNearbyEntitiesByType(Class clazz, double radius) { -+ return getNearbyEntitiesByType(clazz, radius, radius, radius, null); -+ } -+ -+ /** -+ * Gets all nearby entities of the specified type, within the specified radius, with x and x radius matching (bounding box) -+ * @param clazz Type to filter by -+ * @param xzRadius X/Z radius to search within -+ * @param yRadius Y radius to search within -+ * @param the entity type -+ * @return the collection of entities near location. This will always be a non-null collection. -+ */ -+ public Collection getNearbyEntitiesByType(Class clazz, double xzRadius, double yRadius) { -+ return getNearbyEntitiesByType(clazz, xzRadius, yRadius, xzRadius, null); -+ } -+ -+ /** -+ * Gets all nearby entities of the specified type, within the specified radius (bounding box) -+ * @param clazz Type to filter by -+ * @param xRadius X Radius -+ * @param yRadius Y Radius -+ * @param zRadius Z Radius -+ * @param the entity type -+ * @return the collection of entities near location. This will always be a non-null collection. -+ */ -+ public Collection getNearbyEntitiesByType(Class clazz, double xRadius, double yRadius, double zRadius) { -+ return getNearbyEntitiesByType(clazz, xRadius, yRadius, zRadius, null); -+ } -+ -+ /** -+ * Gets all nearby entities of the specified type, within the specified radius (bounding box) -+ * @param clazz Type to filter by -+ * @param radius X/Y/Z radius to search within -+ * @param predicate a predicate used to filter results -+ * @param the entity type -+ * @return the collection of entities near location. This will always be a non-null collection. -+ */ -+ public Collection getNearbyEntitiesByType(Class clazz, double radius, Predicate predicate) { -+ return getNearbyEntitiesByType(clazz, radius, radius, radius, predicate); -+ } -+ -+ /** -+ * Gets all nearby entities of the specified type, within the specified radius, with x and x radius matching (bounding box) -+ * @param clazz Type to filter by -+ * @param xzRadius X/Z radius to search within -+ * @param yRadius Y radius to search within -+ * @param predicate a predicate used to filter results -+ * @param the entity type -+ * @return the collection of entities near location. This will always be a non-null collection. -+ */ -+ public Collection getNearbyEntitiesByType(Class clazz, double xzRadius, double yRadius, Predicate predicate) { -+ return getNearbyEntitiesByType(clazz, xzRadius, yRadius, xzRadius, predicate); -+ } -+ -+ /** -+ * Gets all nearby entities of the specified type, within the specified radius (bounding box) -+ * @param clazz Type to filter by -+ * @param xRadius X Radius -+ * @param yRadius Y Radius -+ * @param zRadius Z Radius -+ * @param predicate a predicate used to filter results -+ * @param the entity type -+ * @return the collection of entities near location. This will always be a non-null collection. -+ */ -+ public Collection getNearbyEntitiesByType(Class clazz, double xRadius, double yRadius, double zRadius, Predicate predicate) { -+ if (world == null) { -+ throw new IllegalArgumentException("Location has no world"); -+ } -+ return world.getNearbyEntitiesByType(clazz, this, xRadius, yRadius, zRadius, predicate); -+ } - // Paper end - @Override - public boolean equals(Object obj) { --- \ No newline at end of file diff --git a/Spigot-API-Patches/Add-getTPS-method.patch b/Spigot-API-Patches/Add-getTPS-method.patch index c589db7602..41ce46c5a5 100644 --- a/Spigot-API-Patches/Add-getTPS-method.patch +++ b/Spigot-API-Patches/Add-getTPS-method.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add getTPS method diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 14e425d1..6055c801 100644 +index cffa0c65f..2ad9a7d7f 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java @@ -0,0 +0,0 @@ public final class Bukkit { @@ -17,6 +17,7 @@ index 14e425d1..6055c801 100644 + * Gets the current server TPS + * @return current server TPS (1m, 5m, 15m in Paper-Server) + */ ++ @NotNull + public static double[] getTPS() { + return server.getTPS(); + } @@ -26,12 +27,12 @@ index 14e425d1..6055c801 100644 * Get the advancement specified by this key. * diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 9d2326ca..1632af18 100644 +index 9f7f760af..3ad70b92f 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient { - */ - Entity getEntity(UUID uuid); + @Nullable + Entity getEntity(@NotNull UUID uuid); + // Paper start + /** @@ -39,6 +40,7 @@ index 9d2326ca..1632af18 100644 + * + * @return current server TPS (1m, 5m, 15m in Paper-Server) + */ ++ @NotNull + public double[] getTPS(); + // Paper end + diff --git a/Spigot-API-Patches/Add-hand-to-bucket-events.patch b/Spigot-API-Patches/Add-hand-to-bucket-events.patch index d402920ad1..78e46e62ec 100644 --- a/Spigot-API-Patches/Add-hand-to-bucket-events.patch +++ b/Spigot-API-Patches/Add-hand-to-bucket-events.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add hand to bucket events diff --git a/src/main/java/org/bukkit/event/player/PlayerBucketEmptyEvent.java b/src/main/java/org/bukkit/event/player/PlayerBucketEmptyEvent.java -index 8fb121a9..7b9596f3 100644 +index cdf2e2016..5e93f1bbb 100644 --- a/src/main/java/org/bukkit/event/player/PlayerBucketEmptyEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerBucketEmptyEvent.java @@ -0,0 +0,0 @@ import org.bukkit.block.Block; @@ -14,23 +14,23 @@ index 8fb121a9..7b9596f3 100644 import org.bukkit.event.HandlerList; +import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.ItemStack; + import org.jetbrains.annotations.NotNull; - /** @@ -0,0 +0,0 @@ public class PlayerBucketEmptyEvent extends PlayerBucketEvent { super(who, blockClicked, blockFace, bucket, itemInHand); } + // Paper start - add EquipmentSlot -+ public PlayerBucketEmptyEvent(final Player who, final Block blockClicked, final BlockFace blockFace, final Material bucket, final ItemStack itemInHand, final EquipmentSlot hand) { ++ public PlayerBucketEmptyEvent(@NotNull final Player who, @NotNull final Block blockClicked, @NotNull final BlockFace blockFace, @NotNull final Material bucket, @NotNull final ItemStack itemInHand, @org.jetbrains.annotations.Nullable final EquipmentSlot hand) { + super(who, blockClicked, blockFace, bucket, itemInHand, hand); + } + // Paper end + + @NotNull @Override public HandlerList getHandlers() { - return handlers; diff --git a/src/main/java/org/bukkit/event/player/PlayerBucketEvent.java b/src/main/java/org/bukkit/event/player/PlayerBucketEvent.java -index 56584687..3dbe428b 100644 +index d0ccba060..280ca87bb 100644 --- a/src/main/java/org/bukkit/event/player/PlayerBucketEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerBucketEvent.java @@ -0,0 +0,0 @@ import org.bukkit.block.Block; @@ -39,20 +39,20 @@ index 56584687..3dbe428b 100644 import org.bukkit.event.Cancellable; +import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.ItemStack; - - /** + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; @@ -0,0 +0,0 @@ public abstract class PlayerBucketEvent extends PlayerEvent implements Cancellab private final Block blockClicked; private final BlockFace blockFace; private final Material bucket; + private final EquipmentSlot hand; // Paper - add EquipmentSlot - public PlayerBucketEvent(final Player who, final Block blockClicked, final BlockFace blockFace, final Material bucket, final ItemStack itemInHand) { + public PlayerBucketEvent(@NotNull final Player who, @NotNull final Block blockClicked, @NotNull final BlockFace blockFace, @NotNull final Material bucket, @NotNull final ItemStack itemInHand) { + // Paper start - add EquipmentSlot + this(who, blockClicked, blockFace, bucket, itemInHand, null); + } + -+ public PlayerBucketEvent(final Player who, final Block blockClicked, final BlockFace blockFace, final Material bucket, final ItemStack itemInHand, final EquipmentSlot hand) { ++ public PlayerBucketEvent(@NotNull final Player who, @NotNull final Block blockClicked, @NotNull final BlockFace blockFace, @NotNull final Material bucket, @NotNull final ItemStack itemInHand, @Nullable final EquipmentSlot hand) { + // Paper end super(who); this.blockClicked = blockClicked; @@ -73,6 +73,7 @@ index 56584687..3dbe428b 100644 + * + * @return the hand used + */ ++ @NotNull + public EquipmentSlot getHand() { + return hand; + } @@ -82,7 +83,7 @@ index 56584687..3dbe428b 100644 return cancelled; } diff --git a/src/main/java/org/bukkit/event/player/PlayerBucketFillEvent.java b/src/main/java/org/bukkit/event/player/PlayerBucketFillEvent.java -index 94e042a3..884b9240 100644 +index cc1b03eb2..15be7128b 100644 --- a/src/main/java/org/bukkit/event/player/PlayerBucketFillEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerBucketFillEvent.java @@ -0,0 +0,0 @@ import org.bukkit.block.Block; @@ -91,19 +92,20 @@ index 94e042a3..884b9240 100644 import org.bukkit.event.HandlerList; +import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.ItemStack; + import org.jetbrains.annotations.NotNull; - /** @@ -0,0 +0,0 @@ public class PlayerBucketFillEvent extends PlayerBucketEvent { super(who, blockClicked, blockFace, bucket, itemInHand); } ++ + // Paper start - add EquipmentSlot -+ public PlayerBucketFillEvent(final Player who, final Block blockClicked, final BlockFace blockFace, final Material bucket, final ItemStack itemInHand, final EquipmentSlot hand) { ++ public PlayerBucketFillEvent(@NotNull final Player who, @NotNull final Block blockClicked, @NotNull final BlockFace blockFace, @NotNull final Material bucket, @NotNull final ItemStack itemInHand, @org.jetbrains.annotations.Nullable final EquipmentSlot hand) { + super(who, blockClicked, blockFace, bucket, itemInHand, hand); + } + // Paper end + + @NotNull @Override public HandlerList getHandlers() { - return handlers; -- \ No newline at end of file diff --git a/Spigot-API-Patches/Add-handshake-event-to-allow-plugins-to-handle-clien.patch b/Spigot-API-Patches/Add-handshake-event-to-allow-plugins-to-handle-clien.patch index 46a7076cee..90c24c5347 100644 --- a/Spigot-API-Patches/Add-handshake-event-to-allow-plugins-to-handle-clien.patch +++ b/Spigot-API-Patches/Add-handshake-event-to-allow-plugins-to-handle-clien.patch @@ -7,7 +7,7 @@ Subject: [PATCH] Add handshake event to allow plugins to handle client diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerHandshakeEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerHandshakeEvent.java new file mode 100644 -index 00000000..e44d03a2 +index 000000000..46d6f6ad6 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerHandshakeEvent.java @@ -0,0 +0,0 @@ @@ -19,6 +19,8 @@ index 00000000..e44d03a2 +import org.bukkit.event.HandlerList; + +import java.util.UUID; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * This event is fired during a player handshake. @@ -31,12 +33,12 @@ index 00000000..e44d03a2 +public class PlayerHandshakeEvent extends Event implements Cancellable { + + private static final HandlerList HANDLERS = new HandlerList(); -+ private final String originalHandshake; ++ @NotNull private final String originalHandshake; + private boolean cancelled; -+ private String serverHostname; -+ private String socketAddressHostname; -+ private UUID uniqueId; -+ private String propertiesJson; ++ @Nullable private String serverHostname; ++ @Nullable private String socketAddressHostname; ++ @Nullable private UUID uniqueId; ++ @Nullable private String propertiesJson; + private boolean failed; + private String failMessage = "If you wish to use IP forwarding, please enable it in your BungeeCord config as well!"; + @@ -46,7 +48,7 @@ index 00000000..e44d03a2 + * @param originalHandshake the original handshake string + * @param cancelled if this event is enabled + */ -+ public PlayerHandshakeEvent(String originalHandshake, boolean cancelled) { ++ public PlayerHandshakeEvent(@NotNull String originalHandshake, boolean cancelled) { + this.originalHandshake = originalHandshake; + this.cancelled = cancelled; + } @@ -82,6 +84,7 @@ index 00000000..e44d03a2 + * + * @return the original handshake string + */ ++ @NotNull + public String getOriginalHandshake() { + return this.originalHandshake; + } @@ -93,6 +96,7 @@ index 00000000..e44d03a2 + * + * @return the server hostname string + */ ++ @Nullable + public String getServerHostname() { + return this.serverHostname; + } @@ -104,7 +108,7 @@ index 00000000..e44d03a2 + * + * @param serverHostname the server hostname string + */ -+ public void setServerHostname(String serverHostname) { ++ public void setServerHostname(@NotNull String serverHostname) { + this.serverHostname = serverHostname; + } + @@ -115,6 +119,7 @@ index 00000000..e44d03a2 + * + * @return the socket address hostname string + */ ++ @Nullable + public String getSocketAddressHostname() { + return this.socketAddressHostname; + } @@ -126,7 +131,7 @@ index 00000000..e44d03a2 + * + * @param socketAddressHostname the socket address hostname string + */ -+ public void setSocketAddressHostname(String socketAddressHostname) { ++ public void setSocketAddressHostname(@NotNull String socketAddressHostname) { + this.socketAddressHostname = socketAddressHostname; + } + @@ -135,6 +140,7 @@ index 00000000..e44d03a2 + * + * @return the unique id + */ ++ @Nullable + public UUID getUniqueId() { + return this.uniqueId; + } @@ -144,7 +150,7 @@ index 00000000..e44d03a2 + * + * @param uniqueId the unique id + */ -+ public void setUniqueId(UUID uniqueId) { ++ public void setUniqueId(@NotNull UUID uniqueId) { + this.uniqueId = uniqueId; + } + @@ -155,6 +161,7 @@ index 00000000..e44d03a2 + * + * @return the profile properties, as JSON + */ ++ @Nullable + public String getPropertiesJson() { + return this.propertiesJson; + } @@ -190,7 +197,7 @@ index 00000000..e44d03a2 + * + * @param propertiesJson the profile properties, as JSON + */ -+ public void setPropertiesJson(String propertiesJson) { ++ public void setPropertiesJson(@NotNull String propertiesJson) { + this.propertiesJson = propertiesJson; + } + @@ -199,6 +206,7 @@ index 00000000..e44d03a2 + * + * @return the message to display to the client + */ ++ @NotNull + public String getFailMessage() { + return this.failMessage; + } @@ -208,16 +216,18 @@ index 00000000..e44d03a2 + * + * @param failMessage the message to display to the client + */ -+ public void setFailMessage(String failMessage) { ++ public void setFailMessage(@NotNull String failMessage) { + Validate.notEmpty(failMessage, "fail message cannot be null or empty"); + this.failMessage = failMessage; + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return HANDLERS; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return HANDLERS; + } diff --git a/Spigot-API-Patches/Add-method-to-open-already-placed-sign.patch b/Spigot-API-Patches/Add-method-to-open-already-placed-sign.patch index b8932974fe..62714e5513 100644 --- a/Spigot-API-Patches/Add-method-to-open-already-placed-sign.patch +++ b/Spigot-API-Patches/Add-method-to-open-already-placed-sign.patch @@ -5,13 +5,13 @@ Subject: [PATCH] Add method to open already placed sign diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java -index 040562eb..b5ed8447 100644 +index 037e23930..04f0e08fd 100644 --- a/src/main/java/org/bukkit/entity/HumanEntity.java +++ b/src/main/java/org/bukkit/entity/HumanEntity.java @@ -0,0 +0,0 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder */ @Deprecated - public void setShoulderEntityRight(Entity entity); + public void setShoulderEntityRight(@Nullable Entity entity); + + // Paper start - Add method to open already placed sign + /** @@ -19,7 +19,7 @@ index 040562eb..b5ed8447 100644 + * + * @param sign The sign to open + */ -+ void openSign(org.bukkit.block.Sign sign); ++ void openSign(@NotNull org.bukkit.block.Sign sign); + // Paper end } -- \ No newline at end of file diff --git a/Spigot-API-Patches/Add-methods-for-working-with-arrows-stuck-in-living-.patch b/Spigot-API-Patches/Add-methods-for-working-with-arrows-stuck-in-living-.patch index 802d463f59..293f8f5d1c 100644 --- a/Spigot-API-Patches/Add-methods-for-working-with-arrows-stuck-in-living-.patch +++ b/Spigot-API-Patches/Add-methods-for-working-with-arrows-stuck-in-living-.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add methods for working with arrows stuck in living entities diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java -index 8cf98673..f67711fd 100644 +index af8ea5ca..1100e305 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 diff --git a/Spigot-API-Patches/Add-more-Witch-API.patch b/Spigot-API-Patches/Add-more-Witch-API.patch index 5971ceafd3..c035ca3db1 100644 --- a/Spigot-API-Patches/Add-more-Witch-API.patch +++ b/Spigot-API-Patches/Add-more-Witch-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add more Witch API diff --git a/src/main/java/org/bukkit/entity/Witch.java b/src/main/java/org/bukkit/entity/Witch.java -index 4b27f689..64ec8409 100644 +index 4b27f6890..1828b2ced 100644 --- a/src/main/java/org/bukkit/entity/Witch.java +++ b/src/main/java/org/bukkit/entity/Witch.java @@ -0,0 +0,0 @@ package org.bukkit.entity; @@ -14,7 +14,7 @@ index 4b27f689..64ec8409 100644 +// Paper start +import org.bukkit.inventory.ItemStack; -+import javax.annotation.Nullable; ++import org.jetbrains.annotations.Nullable; +// Paper end + /** @@ -42,6 +42,7 @@ index 4b27f689..64ec8409 100644 + * + * @return The potion the witch is drinking + */ ++ @Nullable + ItemStack getDrinkingPotion(); + + /** diff --git a/Spigot-API-Patches/Add-more-Zombie-API.patch b/Spigot-API-Patches/Add-more-Zombie-API.patch index e6ba3f7f7b..aeaf741e87 100644 --- a/Spigot-API-Patches/Add-more-Zombie-API.patch +++ b/Spigot-API-Patches/Add-more-Zombie-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add more Zombie API diff --git a/src/main/java/org/bukkit/entity/Zombie.java b/src/main/java/org/bukkit/entity/Zombie.java -index 48034198..615dd990 100644 +index ee2e70c67..74d6529a1 100644 --- a/src/main/java/org/bukkit/entity/Zombie.java +++ b/src/main/java/org/bukkit/entity/Zombie.java @@ -0,0 +0,0 @@ public interface Zombie extends Monster { diff --git a/Spigot-API-Patches/Add-player-view-distance-API.patch b/Spigot-API-Patches/Add-player-view-distance-API.patch index c0ded1d30d..25107fed86 100644 --- a/Spigot-API-Patches/Add-player-view-distance-API.patch +++ b/Spigot-API-Patches/Add-player-view-distance-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add player view distance API diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 694254f1..d72a7e3d 100644 +index 95ebf016..51a145a4 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM diff --git a/Spigot-API-Patches/Add-ray-tracing-methods-to-LivingEntity.patch b/Spigot-API-Patches/Add-ray-tracing-methods-to-LivingEntity.patch index 369cf36bb8..2df14ae892 100644 --- a/Spigot-API-Patches/Add-ray-tracing-methods-to-LivingEntity.patch +++ b/Spigot-API-Patches/Add-ray-tracing-methods-to-LivingEntity.patch @@ -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 transparent, int maxDistance); + @NotNull + public Block getTargetBlock(@Nullable Set 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 + /** diff --git a/Spigot-API-Patches/Add-sender-name-to-commands.yml-replacement.patch b/Spigot-API-Patches/Add-sender-name-to-commands.yml-replacement.patch index 8eb92a3973..b822abbdc4 100644 --- a/Spigot-API-Patches/Add-sender-name-to-commands.yml-replacement.patch +++ b/Spigot-API-Patches/Add-sender-name-to-commands.yml-replacement.patch @@ -7,19 +7,18 @@ This allows you to use $sender in commands.yml definitions to make commands that auto target self. diff --git a/src/main/java/org/bukkit/command/FormattedCommandAlias.java b/src/main/java/org/bukkit/command/FormattedCommandAlias.java -index 9c80f464..631be1cb 100644 +index 982f0fb4..3276879d 100644 --- a/src/main/java/org/bukkit/command/FormattedCommandAlias.java +++ b/src/main/java/org/bukkit/command/FormattedCommandAlias.java @@ -0,0 +0,0 @@ package org.bukkit.command; import java.util.ArrayList; -+import java.util.logging.Level; -+import java.util.regex.Matcher; -+import java.util.regex.Pattern; ++import java.util.regex.Matcher; // Paper ++import java.util.regex.Pattern; // Paper import org.bukkit.Bukkit; - + import org.jetbrains.annotations.NotNull; @@ -0,0 +0,0 @@ public class FormattedCommandAlias extends Command { ArrayList commands = new ArrayList(); for (String formatString : formatStrings) { @@ -33,8 +32,8 @@ index 9c80f464..631be1cb 100644 return result; } -- private String buildCommand(String formatString, String[] args) { -+ private String buildCommand(CommandSender sender, String formatString, String[] args) { // Paper +- private String buildCommand(@NotNull String formatString, @NotNull String[] args) { ++ private String buildCommand(@NotNull CommandSender sender, @NotNull String formatString, @NotNull String[] args) { // Paper + if (formatString.contains("$sender")) { // Paper + formatString = formatString.replaceAll(Pattern.quote("$sender"), Matcher.quoteReplacement(sender.getName())); // Paper + } // Paper diff --git a/Spigot-API-Patches/Add-setPlayerProfile-API-for-Skulls.patch b/Spigot-API-Patches/Add-setPlayerProfile-API-for-Skulls.patch index 9329858e77..202ef2906c 100644 --- a/Spigot-API-Patches/Add-setPlayerProfile-API-for-Skulls.patch +++ b/Spigot-API-Patches/Add-setPlayerProfile-API-for-Skulls.patch @@ -7,28 +7,27 @@ This allows you to create already filled textures on Skulls to avoid texture loo which commonly cause rate limit issues with Mojang API diff --git a/src/main/java/org/bukkit/block/Skull.java b/src/main/java/org/bukkit/block/Skull.java -index 499a153e..3c75341e 100644 +index 6325f583..27675ecd 100644 --- a/src/main/java/org/bukkit/block/Skull.java +++ b/src/main/java/org/bukkit/block/Skull.java -@@ -0,0 +0,0 @@ import org.bukkit.Material; - import org.bukkit.OfflinePlayer; - import org.bukkit.SkullType; - import org.bukkit.block.data.BlockData; -+import com.destroystokyo.paper.profile.PlayerProfile; -+import javax.annotation.Nullable; +@@ -0,0 +0,0 @@ import org.bukkit.block.data.BlockData; + import org.jetbrains.annotations.Contract; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; ++import com.destroystokyo.paper.profile.PlayerProfile; // Paper /** * Represents a captured state of a skull block. @@ -0,0 +0,0 @@ public interface Skull extends BlockState { */ - public void setOwningPlayer(OfflinePlayer player); + public void setOwningPlayer(@NotNull OfflinePlayer player); + // Paper start + /** + * Sets this skull to use the supplied Player Profile, which can include textures already prefilled. + * @param profile The profile to set this Skull to use, may not be null + */ -+ void setPlayerProfile(PlayerProfile profile); ++ void setPlayerProfile(@NotNull PlayerProfile profile); + + /** + * If the skull has an owner, per {@link #hasOwner()}, return the owners {@link PlayerProfile} @@ -41,15 +40,16 @@ index 499a153e..3c75341e 100644 * Gets the rotation of the skull in the world (or facing direction if this * is a wall mounted skull). diff --git a/src/main/java/org/bukkit/inventory/meta/SkullMeta.java b/src/main/java/org/bukkit/inventory/meta/SkullMeta.java -index 15c1dfd9..a458000f 100644 +index 1583764b..43cdc4c6 100644 --- a/src/main/java/org/bukkit/inventory/meta/SkullMeta.java +++ b/src/main/java/org/bukkit/inventory/meta/SkullMeta.java @@ -0,0 +0,0 @@ package org.bukkit.inventory.meta; +import com.destroystokyo.paper.profile.PlayerProfile; -+import javax.annotation.Nullable; import org.bukkit.OfflinePlayer; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + /** @@ -57,7 +57,7 @@ index 15c1dfd9..a458000f 100644 */ @@ -0,0 +0,0 @@ public interface SkullMeta extends ItemMeta { @Deprecated - boolean setOwner(String owner); + boolean setOwner(@Nullable String owner); + // Paper start + /** diff --git a/Spigot-API-Patches/Add-source-block-to-BlockPhysicsEvent.patch b/Spigot-API-Patches/Add-source-block-to-BlockPhysicsEvent.patch index aace16ee51..9575b13093 100644 --- a/Spigot-API-Patches/Add-source-block-to-BlockPhysicsEvent.patch +++ b/Spigot-API-Patches/Add-source-block-to-BlockPhysicsEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add source block to BlockPhysicsEvent diff --git a/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java b/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java -index a34359ed..cda896fa 100644 +index 75d4e70f5..a28731dc2 100644 --- a/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java @@ -0,0 +0,0 @@ public class BlockPhysicsEvent extends BlockEvent implements Cancellable { @@ -19,7 +19,7 @@ index a34359ed..cda896fa 100644 + } + // Paper end + - public BlockPhysicsEvent(final Block block, final BlockData changed) { + public BlockPhysicsEvent(@NotNull final Block block, @NotNull final BlockData changed) { this(block, changed, block); } -- \ No newline at end of file diff --git a/Spigot-API-Patches/Add-source-to-PlayerExpChangeEvent.patch b/Spigot-API-Patches/Add-source-to-PlayerExpChangeEvent.patch index 6a464a6b10..a35fe74a8c 100644 --- a/Spigot-API-Patches/Add-source-to-PlayerExpChangeEvent.patch +++ b/Spigot-API-Patches/Add-source-to-PlayerExpChangeEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add source to PlayerExpChangeEvent diff --git a/src/main/java/org/bukkit/event/player/PlayerExpChangeEvent.java b/src/main/java/org/bukkit/event/player/PlayerExpChangeEvent.java -index f37491d7..30882559 100644 +index c99c9281e..7c340f539 100644 --- a/src/main/java/org/bukkit/event/player/PlayerExpChangeEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerExpChangeEvent.java @@ -0,0 +0,0 @@ @@ -14,8 +14,9 @@ index f37491d7..30882559 100644 +import org.bukkit.entity.Entity; // Paper import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; + import org.jetbrains.annotations.NotNull; -+import javax.annotation.Nullable; // Paper ++import org.jetbrains.annotations.Nullable; // Paper + /** * Called when a players experience changes naturally @@ -27,11 +28,11 @@ index f37491d7..30882559 100644 + private final Entity source; private int exp; - public PlayerExpChangeEvent(final Player player, final int expAmount) { + public PlayerExpChangeEvent(@NotNull final Player player, final int expAmount) { + this(player, null, expAmount); + } + -+ public PlayerExpChangeEvent(final Player player, @Nullable final Entity sourceEntity, final int expAmount) { ++ public PlayerExpChangeEvent(@NotNull final Player player, @Nullable final Entity sourceEntity, final int expAmount) { super(player); + source = sourceEntity; exp = expAmount; diff --git a/Spigot-API-Patches/Add-spectator-target-events.patch b/Spigot-API-Patches/Add-spectator-target-events.patch index 1fee66a22b..d35da72066 100644 --- a/Spigot-API-Patches/Add-spectator-target-events.patch +++ b/Spigot-API-Patches/Add-spectator-target-events.patch @@ -8,7 +8,7 @@ Subject: [PATCH] Add spectator target events diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerStartSpectatingEntityEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerStartSpectatingEntityEvent.java new file mode 100644 -index 00000000..d3b7cc27 +index 000000000..b8ec7ef2d --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerStartSpectatingEntityEvent.java @@ -0,0 +0,0 @@ @@ -19,6 +19,7 @@ index 00000000..d3b7cc27 +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.event.player.PlayerEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Triggered when a player starts spectating an entity in spectator mode. @@ -27,10 +28,10 @@ index 00000000..d3b7cc27 + + private static final HandlerList handlers = new HandlerList(); + private boolean cancelled; -+ private final Entity currentSpectatorTarget; -+ private final Entity newSpectatorTarget; ++ @NotNull private final Entity currentSpectatorTarget; ++ @NotNull private final Entity newSpectatorTarget; + -+ public PlayerStartSpectatingEntityEvent(Player player, Entity currentSpectatorTarget, Entity newSpectatorTarget) { ++ public PlayerStartSpectatingEntityEvent(@NotNull Player player, @NotNull Entity currentSpectatorTarget, @NotNull Entity newSpectatorTarget) { + super(player); + this.currentSpectatorTarget = currentSpectatorTarget; + this.newSpectatorTarget = newSpectatorTarget; @@ -41,6 +42,7 @@ index 00000000..d3b7cc27 + * + * @return The entity the player is currently spectating (before they start spectating the new target). + */ ++ @NotNull + public Entity getCurrentSpectatorTarget() { + return currentSpectatorTarget; + } @@ -50,6 +52,7 @@ index 00000000..d3b7cc27 + * + * @return The entity the player is now going to be spectating. + */ ++ @NotNull + public Entity getNewSpectatorTarget() { + return newSpectatorTarget; + } @@ -64,11 +67,13 @@ index 00000000..d3b7cc27 + this.cancelled = cancel; + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } @@ -76,7 +81,7 @@ index 00000000..d3b7cc27 + diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerStopSpectatingEntityEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerStopSpectatingEntityEvent.java new file mode 100644 -index 00000000..ce23caaf +index 000000000..693d119ab --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerStopSpectatingEntityEvent.java @@ -0,0 +0,0 @@ @@ -87,6 +92,7 @@ index 00000000..ce23caaf +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.event.player.PlayerEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Triggered when a player stops spectating an entity in spectator mode. @@ -95,9 +101,9 @@ index 00000000..ce23caaf + + private static final HandlerList handlers = new HandlerList(); + private boolean cancelled; -+ private final Entity spectatorTarget; ++ @NotNull private final Entity spectatorTarget; + -+ public PlayerStopSpectatingEntityEvent(Player player, Entity spectatorTarget) { ++ public PlayerStopSpectatingEntityEvent(@NotNull Player player, @NotNull Entity spectatorTarget) { + super(player); + this.spectatorTarget = spectatorTarget; + } @@ -107,6 +113,7 @@ index 00000000..ce23caaf + * + * @return The entity the player is currently spectating (before they will stop). + */ ++ @NotNull + public Entity getSpectatorTarget() { + return spectatorTarget; + } @@ -121,11 +128,13 @@ index 00000000..ce23caaf + this.cancelled = cancel; + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } diff --git a/Spigot-API-Patches/Add-sun-related-API.patch b/Spigot-API-Patches/Add-sun-related-API.patch index 38665fccc2..6048868b15 100644 --- a/Spigot-API-Patches/Add-sun-related-API.patch +++ b/Spigot-API-Patches/Add-sun-related-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add sun related API diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 60b7f2e3..5df75830 100644 +index 6b91635fe..3d8ff98a8 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable { @@ -26,12 +26,12 @@ index 60b7f2e3..5df75830 100644 * Returns whether the world has an ongoing storm. * diff --git a/src/main/java/org/bukkit/entity/Mob.java b/src/main/java/org/bukkit/entity/Mob.java -index 48eddcd3..1b108a4a 100644 +index afdc103fe..784db447d 100644 --- a/src/main/java/org/bukkit/entity/Mob.java +++ b/src/main/java/org/bukkit/entity/Mob.java @@ -0,0 +0,0 @@ public interface Mob extends LivingEntity, Lootable { - * @return Pathfinding Manager for this entity */ + @NotNull com.destroystokyo.paper.entity.Pathfinder getPathfinder(); + + /** diff --git a/Spigot-API-Patches/Add-version-history-to-version-command.patch b/Spigot-API-Patches/Add-version-history-to-version-command.patch index ef42428007..751463ebb2 100644 --- a/Spigot-API-Patches/Add-version-history-to-version-command.patch +++ b/Spigot-API-Patches/Add-version-history-to-version-command.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add version history to version command diff --git a/src/main/java/com/destroystokyo/paper/VersionHistoryManager.java b/src/main/java/com/destroystokyo/paper/VersionHistoryManager.java new file mode 100644 -index 00000000..1daaca2f +index 000000000..648b247ef --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/VersionHistoryManager.java @@ -0,0 +0,0 @@ @@ -26,8 +26,9 @@ index 00000000..1daaca2f +import java.util.Objects; +import java.util.logging.Level; +import java.util.logging.Logger; -+import javax.annotation.Nullable; +import org.bukkit.Bukkit; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +public enum VersionHistoryManager { + INSTANCE; @@ -84,7 +85,7 @@ index 00000000..1daaca2f + } + } + -+ private void writeFile(final Path path) { ++ private void writeFile(@NotNull final Path path) { + try (final BufferedWriter writer = Files.newBufferedWriter( + path, + StandardCharsets.UTF_8, @@ -103,7 +104,7 @@ index 00000000..1daaca2f + return currentData; + } + -+ public class VersionData { ++ public static class VersionData { + private String oldVersion; + + private String currentVersion; @@ -135,7 +136,7 @@ index 00000000..1daaca2f + } + + @Override -+ public boolean equals(Object o) { ++ public boolean equals(@Nullable Object o) { + if (this == o) { + return true; + } @@ -154,7 +155,7 @@ index 00000000..1daaca2f + } +} diff --git a/src/main/java/org/bukkit/command/defaults/VersionCommand.java b/src/main/java/org/bukkit/command/defaults/VersionCommand.java -index f38f6864..5cebb245 100644 +index 8e57aa911..746cedd87 100644 --- a/src/main/java/org/bukkit/command/defaults/VersionCommand.java +++ b/src/main/java/org/bukkit/command/defaults/VersionCommand.java @@ -0,0 +0,0 @@ import org.json.simple.parser.ParseException; @@ -193,7 +194,7 @@ index f38f6864..5cebb245 100644 + } + // Paper end + - private void describeToSender(Plugin plugin, CommandSender sender) { + private void describeToSender(@NotNull Plugin plugin, @NotNull CommandSender sender) { PluginDescriptionFile desc = plugin.getDescription(); sender.sendMessage(ChatColor.GREEN + desc.getName() + ChatColor.WHITE + " version " + ChatColor.GREEN + desc.getVersion()); -- \ No newline at end of file diff --git a/Spigot-API-Patches/Add-workaround-for-plugins-modifying-the-parent-of-t.patch b/Spigot-API-Patches/Add-workaround-for-plugins-modifying-the-parent-of-t.patch index 7c0a692bea..b7e16d257f 100644 --- a/Spigot-API-Patches/Add-workaround-for-plugins-modifying-the-parent-of-t.patch +++ b/Spigot-API-Patches/Add-workaround-for-plugins-modifying-the-parent-of-t.patch @@ -14,7 +14,7 @@ parent of the plugin logger to avoid this. diff --git a/src/main/java/com/destroystokyo/paper/utils/PaperPluginLogger.java b/src/main/java/com/destroystokyo/paper/utils/PaperPluginLogger.java new file mode 100644 -index 00000000..d052b2f5 +index 000000000..76f2cb9cd --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/utils/PaperPluginLogger.java @@ -0,0 +0,0 @@ @@ -25,13 +25,15 @@ index 00000000..d052b2f5 +import java.util.logging.Level; +import java.util.logging.LogManager; +import java.util.logging.Logger; ++import org.jetbrains.annotations.NotNull; + +/** + * Prevents plugins (e.g. Essentials) from changing the parent of the plugin logger. + */ +public class PaperPluginLogger extends Logger { + -+ public static Logger getLogger(PluginDescriptionFile description) { ++ @NotNull ++ public static Logger getLogger(@NotNull PluginDescriptionFile description) { + Logger logger = new PaperPluginLogger(description); + if (!LogManager.getLogManager().addLogger(logger)) { + // Disable this if it's going to happen across reloads anyways... @@ -42,12 +44,12 @@ index 00000000..d052b2f5 + return logger; + } + -+ private PaperPluginLogger(PluginDescriptionFile description) { ++ private PaperPluginLogger(@NotNull PluginDescriptionFile description) { + super(description.getPrefix() != null ? description.getPrefix() : description.getName(), null); + } + + @Override -+ public void setParent(Logger parent) { ++ public void setParent(@NotNull Logger parent) { + if (getParent() != null) { + warning("Ignoring attempt to change parent of plugin logger"); + } else { @@ -58,7 +60,7 @@ index 00000000..d052b2f5 + +} diff --git a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java -index a81dae43..15f22ade 100644 +index 9a3427882..96ebe72ca 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java @@ -0,0 +0,0 @@ public abstract class JavaPlugin extends PluginBase { @@ -85,7 +87,7 @@ index a81dae43..15f22ade 100644 /** diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java -index bc33ff33..213f6234 100644 +index c39fcac5a..0df1926fa 100644 --- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java +++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java @@ -0,0 +0,0 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot diff --git a/Spigot-API-Patches/Additional-world.getNearbyEntities-API-s.patch b/Spigot-API-Patches/Additional-world.getNearbyEntities-API-s.patch index eccfa959e7..41d4f84caa 100644 --- a/Spigot-API-Patches/Additional-world.getNearbyEntities-API-s.patch +++ b/Spigot-API-Patches/Additional-world.getNearbyEntities-API-s.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Additional world.getNearbyEntities API's Provides more methods to get nearby entities, and filter by types and predicates diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index d499e41b..bc6a51d7 100644 +index 84abeb216..0dcdbb59a 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -0,0 +0,0 @@ package org.bukkit; @@ -19,8 +19,8 @@ index d499e41b..bc6a51d7 100644 import java.util.HashMap; import java.util.List; @@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable { - */ - public Collection getEntitiesByClasses(Class... classes); + @NotNull + public Collection getEntitiesByClasses(@NotNull Class... classes); + // Paper start + /** @@ -29,7 +29,8 @@ index d499e41b..bc6a51d7 100644 + * @param radius Radius + * @return the collection of entities near location. This will always be a non-null collection. + */ -+ public default Collection getNearbyLivingEntities(Location loc, double radius) { ++ @NotNull ++ public default Collection getNearbyLivingEntities(@NotNull Location loc, double radius) { + return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, loc, radius, radius, radius); + } + @@ -40,7 +41,8 @@ index d499e41b..bc6a51d7 100644 + * @param yRadius Y Radius + * @return the collection of entities near location. This will always be a non-null collection. + */ -+ public default Collection getNearbyLivingEntities(Location loc, double xzRadius, double yRadius) { ++ @NotNull ++ public default Collection getNearbyLivingEntities(@NotNull Location loc, double xzRadius, double yRadius) { + return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, loc, xzRadius, yRadius, xzRadius); + } + @@ -52,7 +54,8 @@ index d499e41b..bc6a51d7 100644 + * @param zRadius Z radius + * @return the collection of entities near location. This will always be a non-null collection. + */ -+ public default Collection getNearbyLivingEntities(Location loc, double xRadius, double yRadius, double zRadius) { ++ @NotNull ++ public default Collection getNearbyLivingEntities(@NotNull Location loc, double xRadius, double yRadius, double zRadius) { + return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, loc, xRadius, yRadius, zRadius); + } + @@ -63,7 +66,8 @@ index d499e41b..bc6a51d7 100644 + * @param predicate a predicate used to filter results + * @return the collection of living entities near location. This will always be a non-null collection + */ -+ public default Collection getNearbyLivingEntities(Location loc, double radius, Predicate predicate) { ++ @NotNull ++ public default Collection getNearbyLivingEntities(@NotNull Location loc, double radius, @Nullable Predicate predicate) { + return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, loc, radius, radius, radius, predicate); + } + @@ -75,7 +79,8 @@ index d499e41b..bc6a51d7 100644 + * @param predicate a predicate used to filter results + * @return the collection of living entities near location. This will always be a non-null collection + */ -+ public default Collection getNearbyLivingEntities(Location loc, double xzRadius, double yRadius, Predicate predicate) { ++ @NotNull ++ public default Collection getNearbyLivingEntities(@NotNull Location loc, double xzRadius, double yRadius, @Nullable Predicate predicate) { + return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, loc, xzRadius, yRadius, xzRadius, predicate); + } + @@ -88,7 +93,8 @@ index d499e41b..bc6a51d7 100644 + * @param predicate a predicate used to filter results + * @return the collection of living entities near location. This will always be a non-null collection. + */ -+ public default Collection getNearbyLivingEntities(Location loc, double xRadius, double yRadius, double zRadius, Predicate predicate) { ++ @NotNull ++ public default Collection getNearbyLivingEntities(@NotNull Location loc, double xRadius, double yRadius, double zRadius, @Nullable Predicate predicate) { + return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, loc, xRadius, yRadius, zRadius, predicate); + } + @@ -98,7 +104,8 @@ index d499e41b..bc6a51d7 100644 + * @param radius X/Y/Z Radius + * @return the collection of living entities near location. This will always be a non-null collection. + */ -+ public default Collection getNearbyPlayers(Location loc, double radius) { ++ @NotNull ++ public default Collection getNearbyPlayers(@NotNull Location loc, double radius) { + return getNearbyEntitiesByType(org.bukkit.entity.Player.class, loc, radius, radius, radius); + } + @@ -109,7 +116,8 @@ index d499e41b..bc6a51d7 100644 + * @param yRadius Y Radius + * @return the collection of living entities near location. This will always be a non-null collection. + */ -+ public default Collection getNearbyPlayers(Location loc, double xzRadius, double yRadius) { ++ @NotNull ++ public default Collection getNearbyPlayers(@NotNull Location loc, double xzRadius, double yRadius) { + return getNearbyEntitiesByType(org.bukkit.entity.Player.class, loc, xzRadius, yRadius, xzRadius); + } + @@ -121,7 +129,8 @@ index d499e41b..bc6a51d7 100644 + * @param zRadius Z Radius + * @return the collection of players near location. This will always be a non-null collection. + */ -+ public default Collection getNearbyPlayers(Location loc, double xRadius, double yRadius, double zRadius) { ++ @NotNull ++ public default Collection getNearbyPlayers(@NotNull Location loc, double xRadius, double yRadius, double zRadius) { + return getNearbyEntitiesByType(org.bukkit.entity.Player.class, loc, xRadius, yRadius, zRadius); + } + @@ -132,7 +141,8 @@ index d499e41b..bc6a51d7 100644 + * @param predicate a predicate used to filter results + * @return the collection of players near location. This will always be a non-null collection. + */ -+ public default Collection getNearbyPlayers(Location loc, double radius, Predicate predicate) { ++ @NotNull ++ public default Collection getNearbyPlayers(@NotNull Location loc, double radius, @Nullable Predicate predicate) { + return getNearbyEntitiesByType(org.bukkit.entity.Player.class, loc, radius, radius, radius, predicate); + } + @@ -144,7 +154,8 @@ index d499e41b..bc6a51d7 100644 + * @param predicate a predicate used to filter results + * @return the collection of players near location. This will always be a non-null collection. + */ -+ public default Collection getNearbyPlayers(Location loc, double xzRadius, double yRadius, Predicate predicate) { ++ @NotNull ++ public default Collection getNearbyPlayers(@NotNull Location loc, double xzRadius, double yRadius, @Nullable Predicate predicate) { + return getNearbyEntitiesByType(org.bukkit.entity.Player.class, loc, xzRadius, yRadius, xzRadius, predicate); + } + @@ -157,7 +168,8 @@ index d499e41b..bc6a51d7 100644 + * @param predicate a predicate used to filter results + * @return the collection of players near location. This will always be a non-null collection. + */ -+ public default Collection getNearbyPlayers(Location loc, double xRadius, double yRadius, double zRadius, Predicate predicate) { ++ @NotNull ++ public default Collection getNearbyPlayers(@NotNull Location loc, double xRadius, double yRadius, double zRadius, @Nullable Predicate predicate) { + return getNearbyEntitiesByType(org.bukkit.entity.Player.class, loc, xRadius, yRadius, zRadius, predicate); + } + @@ -169,7 +181,8 @@ index d499e41b..bc6a51d7 100644 + * @param the entity type + * @return the collection of entities near location. This will always be a non-null collection. + */ -+ public default Collection getNearbyEntitiesByType(Class clazz, Location loc, double radius) { ++ @NotNull ++ public default Collection getNearbyEntitiesByType(@Nullable Class clazz, @NotNull Location loc, double radius) { + return getNearbyEntitiesByType(clazz, loc, radius, radius, radius, null); + } + @@ -182,7 +195,8 @@ index d499e41b..bc6a51d7 100644 + * @param the entity type + * @return the collection of entities near location. This will always be a non-null collection. + */ -+ public default Collection getNearbyEntitiesByType(Class clazz, Location loc, double xzRadius, double yRadius) { ++ @NotNull ++ public default Collection getNearbyEntitiesByType(@Nullable Class clazz, @NotNull Location loc, double xzRadius, double yRadius) { + return getNearbyEntitiesByType(clazz, loc, xzRadius, yRadius, xzRadius, null); + } + @@ -196,7 +210,8 @@ index d499e41b..bc6a51d7 100644 + * @param the entity type + * @return the collection of entities near location. This will always be a non-null collection. + */ -+ public default Collection getNearbyEntitiesByType(Class clazz, Location loc, double xRadius, double yRadius, double zRadius) { ++ @NotNull ++ public default Collection getNearbyEntitiesByType(@Nullable Class clazz, @NotNull Location loc, double xRadius, double yRadius, double zRadius) { + return getNearbyEntitiesByType(clazz, loc, xRadius, yRadius, zRadius, null); + } + @@ -209,7 +224,8 @@ index d499e41b..bc6a51d7 100644 + * @param the entity type + * @return the collection of entities near location. This will always be a non-null collection. + */ -+ public default Collection getNearbyEntitiesByType(Class clazz, Location loc, double radius, Predicate predicate) { ++ @NotNull ++ public default Collection getNearbyEntitiesByType(@Nullable Class clazz, @NotNull Location loc, double radius, @Nullable Predicate predicate) { + return getNearbyEntitiesByType(clazz, loc, radius, radius, radius, predicate); + } + @@ -223,7 +239,8 @@ index d499e41b..bc6a51d7 100644 + * @param the entity type + * @return the collection of entities near location. This will always be a non-null collection. + */ -+ public default Collection getNearbyEntitiesByType(Class clazz, Location loc, double xzRadius, double yRadius, Predicate predicate) { ++ @NotNull ++ public default Collection getNearbyEntitiesByType(@Nullable Class clazz, @NotNull Location loc, double xzRadius, double yRadius, @Nullable Predicate predicate) { + return getNearbyEntitiesByType(clazz, loc, xzRadius, yRadius, xzRadius, predicate); + } + @@ -238,7 +255,8 @@ index d499e41b..bc6a51d7 100644 + * @param the entity type + * @return the collection of entities near location. This will always be a non-null collection. + */ -+ public default Collection getNearbyEntitiesByType(Class clazz, Location loc, double xRadius, double yRadius, double zRadius, Predicate predicate) { ++ @NotNull ++ public default Collection getNearbyEntitiesByType(@Nullable Class clazz, @NotNull Location loc, double xRadius, double yRadius, double zRadius, @Nullable Predicate predicate) { + if (clazz == null) { + clazz = Entity.class; + } diff --git a/Spigot-API-Patches/Allow-Blocks-to-be-accessed-via-a-long-key.patch b/Spigot-API-Patches/Allow-Blocks-to-be-accessed-via-a-long-key.patch index 42bb81e660..9730c2f6aa 100644 --- a/Spigot-API-Patches/Allow-Blocks-to-be-accessed-via-a-long-key.patch +++ b/Spigot-API-Patches/Allow-Blocks-to-be-accessed-via-a-long-key.patch @@ -18,17 +18,9 @@ Y range: [0, 1023] X, Z range: [-67 108 864, 67 108 863] diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java -index 8dcb15fb..7e1ee875 100644 +index d38f15142..d3cff9de8 100644 --- a/src/main/java/org/bukkit/Location.java +++ b/src/main/java/org/bukkit/Location.java -@@ -0,0 +0,0 @@ import org.bukkit.util.Vector; - - // Paper start - import java.util.Collection; --import java.util.Collections; - import java.util.function.Predicate; - import org.bukkit.entity.Entity; - import org.bukkit.entity.LivingEntity; @@ -0,0 +0,0 @@ public class Location implements Cloneable, ConfigurationSerializable { blockLoc.setZ(getBlockZ()); return blockLoc; @@ -49,12 +41,12 @@ index 8dcb15fb..7e1ee875 100644 * @return A new location where X/Y/Z are the center of the block */ diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 61f2cd9a..30204b98 100644 +index 1b0744ed9..158917492 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable { - */ - public Block getBlockAt(Location location); + @NotNull + public Block getBlockAt(@NotNull Location location); + // Paper start + /** @@ -65,6 +57,7 @@ index 61f2cd9a..30204b98 100644 + * @see Location#toBlockKey() + * @see Block#getBlockKey() + */ ++ @NotNull + public default Block getBlockAtKey(long key) { + int x = (int) ((key << 37) >> 37); + int y = (int) (key >>> 54); @@ -79,6 +72,7 @@ index 61f2cd9a..30204b98 100644 + * @see Location#toBlockKey() + * @see Block#getBlockKey() + */ ++ @NotNull + public default Location getLocationAtKey(long key) { + int x = (int) ((key << 37) >> 37); + int y = (int) (key >>> 54); @@ -91,7 +85,7 @@ index 61f2cd9a..30204b98 100644 * Gets the y coordinate of the lowest block at this position such that the * block and all blocks above it are transparent for lighting purposes. diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java -index 064acf32..d1a9512a 100644 +index 708288e99..42f31db29 100644 --- a/src/main/java/org/bukkit/block/Block.java +++ b/src/main/java/org/bukkit/block/Block.java @@ -0,0 +0,0 @@ public interface Block extends Metadatable { diff --git a/Spigot-API-Patches/Allow-Reloading-of-Command-Aliases.patch b/Spigot-API-Patches/Allow-Reloading-of-Command-Aliases.patch index 4fb41ad488..ea7732ae8c 100644 --- a/Spigot-API-Patches/Allow-Reloading-of-Command-Aliases.patch +++ b/Spigot-API-Patches/Allow-Reloading-of-Command-Aliases.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Allow Reloading of Command Aliases Reload the aliases stored in commands.yml diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 2d588c6b..5715057a 100644 +index d009aebd6..8e0cbbf15 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java @@ -0,0 +0,0 @@ public final class Bukkit { @@ -24,9 +24,9 @@ index 2d588c6b..5715057a 100644 + } // Paper end - public static Server.Spigot spigot() + @NotNull diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 18e5dd48..259a0fbe 100644 +index e7e7dab8c..8f61619a3 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient { @@ -37,13 +37,13 @@ index 18e5dd48..259a0fbe 100644 + boolean reloadCommandAliases(); // Paper } diff --git a/src/main/java/org/bukkit/command/CommandMap.java b/src/main/java/org/bukkit/command/CommandMap.java -index 30d60247..938959aa 100644 +index bd2c7a696..864c263bb 100644 --- a/src/main/java/org/bukkit/command/CommandMap.java +++ b/src/main/java/org/bukkit/command/CommandMap.java @@ -0,0 +0,0 @@ public interface CommandMap { - * @throws IllegalArgumentException if either sender or cmdLine are null */ - public List tabComplete(CommandSender sender, String cmdLine, Location location) throws IllegalArgumentException; + @Nullable + public List tabComplete(@NotNull CommandSender sender, @NotNull String cmdLine, @Nullable Location location) throws IllegalArgumentException; + + // Paper start - Expose Known Commands + /** @@ -51,11 +51,12 @@ index 30d60247..938959aa 100644 + * + * @return known commands + */ ++ @NotNull + public java.util.Map getKnownCommands(); + // Paper end } diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java -index 65ad78c4..41e95692 100644 +index f52d91d19..d7ca4fa3f 100644 --- a/src/main/java/org/bukkit/command/SimpleCommandMap.java +++ b/src/main/java/org/bukkit/command/SimpleCommandMap.java @@ -0,0 +0,0 @@ public class SimpleCommandMap implements CommandMap { @@ -64,17 +65,18 @@ index 65ad78c4..41e95692 100644 } + + // Paper start - Expose Known Commands ++ @NotNull + public Map getKnownCommands() { + return knownCommands; + } + // Paper end } diff --git a/src/main/java/org/bukkit/command/defaults/ReloadCommand.java b/src/main/java/org/bukkit/command/defaults/ReloadCommand.java -index f331a442..a977045d 100644 +index ba118dbfe..607323a83 100644 --- a/src/main/java/org/bukkit/command/defaults/ReloadCommand.java +++ b/src/main/java/org/bukkit/command/defaults/ReloadCommand.java @@ -0,0 +0,0 @@ public class ReloadCommand extends BukkitCommand { - public ReloadCommand(String name) { + public ReloadCommand(@NotNull String name) { super(name); this.description = "Reloads the server configuration and plugins"; - this.usageMessage = "/reload [permissions]"; // Paper diff --git a/Spigot-API-Patches/Allow-disabling-armour-stand-ticking.patch b/Spigot-API-Patches/Allow-disabling-armour-stand-ticking.patch index 67092293db..65c9530a4e 100644 --- a/Spigot-API-Patches/Allow-disabling-armour-stand-ticking.patch +++ b/Spigot-API-Patches/Allow-disabling-armour-stand-ticking.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Allow disabling armour stand ticking diff --git a/src/main/java/org/bukkit/entity/ArmorStand.java b/src/main/java/org/bukkit/entity/ArmorStand.java -index 099da6ce..859f166f 100644 +index 387d04e5b..492df420b 100644 --- a/src/main/java/org/bukkit/entity/ArmorStand.java +++ b/src/main/java/org/bukkit/entity/ArmorStand.java @@ -0,0 +0,0 @@ public interface ArmorStand extends LivingEntity { diff --git a/Spigot-API-Patches/Allow-plugins-to-use-SLF4J-for-logging.patch b/Spigot-API-Patches/Allow-plugins-to-use-SLF4J-for-logging.patch index fff8fb9ff9..58a4289cc6 100644 --- a/Spigot-API-Patches/Allow-plugins-to-use-SLF4J-for-logging.patch +++ b/Spigot-API-Patches/Allow-plugins-to-use-SLF4J-for-logging.patch @@ -14,13 +14,13 @@ it without having to shade it in the plugin and going through several layers of logging abstraction. diff --git a/pom.xml b/pom.xml -index 84ba2076..3ebc6287 100644 +index 082f2f0c5..13cdc25f8 100644 --- a/pom.xml +++ b/pom.xml @@ -0,0 +0,0 @@ - compile + 17.0.0 + provided - + + + org.slf4j @@ -28,19 +28,19 @@ index 84ba2076..3ebc6287 100644 + 1.7.25 + compile + -+ junit diff --git a/src/main/java/org/bukkit/plugin/Plugin.java b/src/main/java/org/bukkit/plugin/Plugin.java -index 55debf5d..8d2999ac 100644 +index 076ec041f..b4882f48b 100644 --- a/src/main/java/org/bukkit/plugin/Plugin.java +++ b/src/main/java/org/bukkit/plugin/Plugin.java @@ -0,0 +0,0 @@ public interface Plugin extends TabExecutor { - */ + @NotNull public Logger getLogger(); + // Paper start - Add SLF4J logger ++ @NotNull + default org.slf4j.Logger getSLF4JLogger() { + return org.slf4j.LoggerFactory.getLogger(getLogger().getName()); + } diff --git a/Spigot-API-Patches/Allow-setting-the-vex-s-summoner.patch b/Spigot-API-Patches/Allow-setting-the-vex-s-summoner.patch index f4b057adac..8a36888663 100644 --- a/Spigot-API-Patches/Allow-setting-the-vex-s-summoner.patch +++ b/Spigot-API-Patches/Allow-setting-the-vex-s-summoner.patch @@ -5,29 +5,37 @@ Subject: [PATCH] Allow setting the vex's summoner diff --git a/src/main/java/org/bukkit/entity/Vex.java b/src/main/java/org/bukkit/entity/Vex.java -index 7b9b21e5..23a15f8f 100644 +index 6b61c4ab7..c34a3ea7b 100644 --- a/src/main/java/org/bukkit/entity/Vex.java +++ b/src/main/java/org/bukkit/entity/Vex.java +@@ -0,0 +0,0 @@ + package org.bukkit.entity; + ++import org.jetbrains.annotations.Nullable; ++ + /** + * Represents a Vex. + */ @@ -0,0 +0,0 @@ public interface Vex extends Monster { + * @param charging new state */ void setCharging(boolean charging); - ++ + // Paper start - /** -- * @return What Entity (most likely an Evoker, but not guaranteed) summoned this Vex ++ /** + * Get the Mob that summoned this vex + * + * @return Mob that summoned this vex + */ ++ @Nullable + Mob getSummoner(); + + /** + * Set the summoner of this vex + * + * @param summoner New summoner - */ -- Mob getSummoner(); // Paper -+ void setSummoner(Mob summoner); ++ */ ++ void setSummoner(@Nullable Mob summoner); + // Paper end } -- \ No newline at end of file diff --git a/Spigot-API-Patches/Annotation-Test-changes.patch b/Spigot-API-Patches/Annotation-Test-changes.patch new file mode 100644 index 0000000000..637156d334 --- /dev/null +++ b/Spigot-API-Patches/Annotation-Test-changes.patch @@ -0,0 +1,30 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Shane Freeder +Date: Sun, 17 Mar 2019 23:04:30 +0000 +Subject: [PATCH] Annotation Test changes + + +diff --git a/src/test/java/org/bukkit/AnnotationTest.java b/src/test/java/org/bukkit/AnnotationTest.java +index dfd6e137c..596f28076 100644 +--- a/src/test/java/org/bukkit/AnnotationTest.java ++++ b/src/test/java/org/bukkit/AnnotationTest.java +@@ -0,0 +0,0 @@ public class AnnotationTest { + "org/bukkit/util/io/Wrapper", + "org/bukkit/plugin/java/PluginClassLoader", + // Generic functional interface +- "org/bukkit/util/Consumer" ++ "org/bukkit/util/Consumer", ++ // Paper start ++ // Timings history is broken in terms of nullability due to guavas Function defining that the param is NonNull ++ "co/aikar/timings/TimingHistory$2", ++ "co/aikar/timings/TimingHistory$2$1", ++ "co/aikar/timings/TimingHistory$2$1$1", ++ "co/aikar/timings/TimingHistory$2$1$2", ++ "co/aikar/timings/TimingHistory$3", ++ "co/aikar/timings/TimingHistory$4", ++ "co/aikar/timings/TimingHistoryEntry$1" ++ // Paper end + }; + + @Test +-- \ No newline at end of file diff --git a/Spigot-API-Patches/AnvilDamageEvent.patch b/Spigot-API-Patches/AnvilDamageEvent.patch index d6d5ec79e7..bf28b73a01 100644 --- a/Spigot-API-Patches/AnvilDamageEvent.patch +++ b/Spigot-API-Patches/AnvilDamageEvent.patch @@ -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; + } diff --git a/Spigot-API-Patches/Arrow-pickup-rule-API.patch b/Spigot-API-Patches/Arrow-pickup-rule-API.patch index ad886dbbd8..9096616bb0 100644 --- a/Spigot-API-Patches/Arrow-pickup-rule-API.patch +++ b/Spigot-API-Patches/Arrow-pickup-rule-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Arrow pickup rule API diff --git a/src/main/java/org/bukkit/entity/Arrow.java b/src/main/java/org/bukkit/entity/Arrow.java -index b74d5f9d..99a44006 100644 +index 99f73a2b..b63f2fd9 100644 --- a/src/main/java/org/bukkit/entity/Arrow.java +++ b/src/main/java/org/bukkit/entity/Arrow.java @@ -0,0 +0,0 @@ public interface Arrow extends Projectile { diff --git a/Spigot-API-Patches/Async-Chunks-API.patch b/Spigot-API-Patches/Async-Chunks-API.patch index c809c81356..722995d782 100644 --- a/Spigot-API-Patches/Async-Chunks-API.patch +++ b/Spigot-API-Patches/Async-Chunks-API.patch @@ -8,7 +8,7 @@ Adds API's to load or generate chunks asynchronously. Also adds utility methods to Entity to teleport asynchronously. diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 807bd7fc..51cf7fd3 100644 +index c5da4d387..1b0744ed9 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable { @@ -33,11 +33,11 @@ index 807bd7fc..51cf7fd3 100644 + */ + @Deprecated + public static interface ChunkLoadCallback extends java.util.function.Consumer { -+ public void onLoad(Chunk chunk); ++ public void onLoad(@NotNull Chunk chunk); + + // backwards compat to old api + @Override -+ default void accept(Chunk chunk) { ++ default void accept(@NotNull Chunk chunk) { + onLoad(chunk); + } + } @@ -62,7 +62,7 @@ index 807bd7fc..51cf7fd3 100644 + * will be executed synchronously + */ + @Deprecated -+ public default void getChunkAtAsync(int x, int z, ChunkLoadCallback cb) { ++ public default void getChunkAtAsync(int x, int z, @NotNull ChunkLoadCallback cb) { + getChunkAtAsync(x, z, true).thenAccept(cb::onLoad); + } + @@ -85,7 +85,7 @@ index 807bd7fc..51cf7fd3 100644 + * will be executed synchronously + */ + @Deprecated -+ public default void getChunkAtAsync(Location loc, ChunkLoadCallback cb) { ++ public default void getChunkAtAsync(@NotNull Location loc, @NotNull ChunkLoadCallback cb) { + getChunkAtAsync(loc, true).thenAccept(cb::onLoad); + } + @@ -108,7 +108,7 @@ index 807bd7fc..51cf7fd3 100644 + * will be executed synchronously + */ + @Deprecated -+ public default void getChunkAtAsync(Block block, ChunkLoadCallback cb) { ++ public default void getChunkAtAsync(@NotNull Block block, @NotNull ChunkLoadCallback cb) { + getChunkAtAsync(block, true).thenAccept(cb::onLoad); + } + @@ -130,7 +130,7 @@ index 807bd7fc..51cf7fd3 100644 + * @param cb Callback to receive the chunk when it is loaded. + * will be executed synchronously + */ -+ public default void getChunkAtAsync(int x, int z, java.util.function.Consumer cb) { ++ public default void getChunkAtAsync(int x, int z, @NotNull java.util.function.Consumer cb) { + getChunkAtAsync(x, z, true).thenAccept(cb); + } + @@ -153,7 +153,7 @@ index 807bd7fc..51cf7fd3 100644 + * @param cb Callback to receive the chunk when it is loaded. + * will be executed synchronously + */ -+ public default void getChunkAtAsync(int x, int z, boolean gen, java.util.function.Consumer cb) { ++ public default void getChunkAtAsync(int x, int z, boolean gen, @NotNull java.util.function.Consumer cb) { + getChunkAtAsync(x, z, gen).thenAccept(cb); + } + @@ -174,7 +174,7 @@ index 807bd7fc..51cf7fd3 100644 + * @param cb Callback to receive the chunk when it is loaded. + * will be executed synchronously + */ -+ public default void getChunkAtAsync(Location loc, java.util.function.Consumer cb) { ++ public default void getChunkAtAsync(@NotNull Location loc, @NotNull java.util.function.Consumer cb) { + getChunkAtAsync((int)Math.floor(loc.getX()) >> 4, (int)Math.floor(loc.getZ()) >> 4, true, cb); + } + @@ -196,7 +196,7 @@ index 807bd7fc..51cf7fd3 100644 + * @param cb Callback to receive the chunk when it is loaded. + * will be executed synchronously + */ -+ public default void getChunkAtAsync(Location loc, boolean gen, java.util.function.Consumer cb) { ++ public default void getChunkAtAsync(@NotNull Location loc, boolean gen, @NotNull java.util.function.Consumer cb) { + getChunkAtAsync((int)Math.floor(loc.getX()) >> 4, (int)Math.floor(loc.getZ()) >> 4, gen, cb); + } + @@ -217,7 +217,7 @@ index 807bd7fc..51cf7fd3 100644 + * @param cb Callback to receive the chunk when it is loaded. + * will be executed synchronously + */ -+ public default void getChunkAtAsync(Block block, java.util.function.Consumer cb) { ++ public default void getChunkAtAsync(@NotNull Block block, @NotNull java.util.function.Consumer cb) { + getChunkAtAsync(block.getX() >> 4, block.getZ() >> 4, true, cb); + } + @@ -239,7 +239,7 @@ index 807bd7fc..51cf7fd3 100644 + * @param cb Callback to receive the chunk when it is loaded. + * will be executed synchronously + */ -+ public default void getChunkAtAsync(Block block, boolean gen, java.util.function.Consumer cb) { ++ public default void getChunkAtAsync(@NotNull Block block, boolean gen, @NotNull java.util.function.Consumer cb) { + getChunkAtAsync(block.getX() >> 4, block.getZ() >> 4, gen, cb); + } + @@ -258,7 +258,8 @@ index 807bd7fc..51cf7fd3 100644 + * @param loc Location to load the corresponding chunk from + * @return Future that will resolve when the chunk is loaded + */ -+ public default java.util.concurrent.CompletableFuture getChunkAtAsync(Location loc) { ++ @NotNull ++ public default java.util.concurrent.CompletableFuture getChunkAtAsync(@NotNull Location loc) { + return getChunkAtAsync((int)Math.floor(loc.getX()) >> 4, (int)Math.floor(loc.getZ()) >> 4, true); + } + @@ -278,7 +279,8 @@ index 807bd7fc..51cf7fd3 100644 + * @param gen Should the chunk generate + * @return Future that will resolve when the chunk is loaded + */ -+ public default java.util.concurrent.CompletableFuture getChunkAtAsync(Location loc, boolean gen) { ++ @NotNull ++ public default java.util.concurrent.CompletableFuture getChunkAtAsync(@NotNull Location loc, boolean gen) { + return getChunkAtAsync((int)Math.floor(loc.getX()) >> 4, (int)Math.floor(loc.getZ()) >> 4, gen); + } + @@ -297,7 +299,8 @@ index 807bd7fc..51cf7fd3 100644 + * @param block Block to load the corresponding chunk from + * @return Future that will resolve when the chunk is loaded + */ -+ public default java.util.concurrent.CompletableFuture getChunkAtAsync(Block block) { ++ @NotNull ++ public default java.util.concurrent.CompletableFuture getChunkAtAsync(@NotNull Block block) { + return getChunkAtAsync(block.getX() >> 4, block.getZ() >> 4, true); + } + @@ -317,7 +320,8 @@ index 807bd7fc..51cf7fd3 100644 + * @param gen Should the chunk generate + * @return Future that will resolve when the chunk is loaded + */ -+ public default java.util.concurrent.CompletableFuture getChunkAtAsync(Block block, boolean gen) { ++ @NotNull ++ public default java.util.concurrent.CompletableFuture getChunkAtAsync(@NotNull Block block, boolean gen) { + return getChunkAtAsync(block.getX() >> 4, block.getZ() >> 4, gen); + } + @@ -338,6 +342,7 @@ index 807bd7fc..51cf7fd3 100644 + * @param z Z Coord + * @return Future that will resolve when the chunk is loaded + */ ++ @NotNull + public default java.util.concurrent.CompletableFuture getChunkAtAsync(int x, int z) { + return getChunkAtAsync(x, z, true); + } @@ -360,17 +365,18 @@ index 807bd7fc..51cf7fd3 100644 + * @param gen Should we generate a chunk if it doesn't exists or not + * @return Future that will resolve when the chunk is loaded + */ ++ @NotNull + public java.util.concurrent.CompletableFuture getChunkAtAsync(int x, int z, boolean gen); // Paper end /** diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java -index 2dd7a03c..59787c47 100644 +index a7f81d17d..73b75ffda 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java @@ -0,0 +0,0 @@ public interface Entity extends Metadatable, CommandSender, Nameable { */ - public boolean teleport(Entity destination, TeleportCause cause); + public boolean teleport(@NotNull Entity destination, @NotNull TeleportCause cause); + // Paper start + /** @@ -378,7 +384,8 @@ index 2dd7a03c..59787c47 100644 + * @param loc Location to teleport to + * @return A future that will be completed with the result of the teleport + */ -+ public default java.util.concurrent.CompletableFuture teleportAsync(Location loc) { ++ @NotNull ++ public default java.util.concurrent.CompletableFuture teleportAsync(@NotNull Location loc) { + return teleportAsync(loc, TeleportCause.PLUGIN); + } + /** @@ -387,7 +394,8 @@ index 2dd7a03c..59787c47 100644 + * @param cause Reason for teleport + * @return A future that will be completed with the result of the teleport + */ -+ public default java.util.concurrent.CompletableFuture teleportAsync(Location loc, TeleportCause cause) { ++ @NotNull ++ public default java.util.concurrent.CompletableFuture teleportAsync(@NotNull Location loc, @NotNull TeleportCause cause) { + java.util.concurrent.CompletableFuture future = new java.util.concurrent.CompletableFuture<>(); + loc.getWorld().getChunkAtAsync(loc).thenAccept((chunk) -> future.complete(teleport(loc, cause))); + return future; diff --git a/Spigot-API-Patches/AsyncTabCompleteEvent.patch b/Spigot-API-Patches/AsyncTabCompleteEvent.patch index 6a73197407..4786cbf562 100644 --- a/Spigot-API-Patches/AsyncTabCompleteEvent.patch +++ b/Spigot-API-Patches/AsyncTabCompleteEvent.patch @@ -13,7 +13,7 @@ completion, such as offline players. diff --git a/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java b/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java new file mode 100644 -index 00000000..3c51aaf9 +index 000000000..619ed3716 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java @@ -0,0 +0,0 @@ @@ -53,6 +53,8 @@ index 00000000..3c51aaf9 + +import java.util.ArrayList; +import java.util.List; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * Allows plugins to compute tab completion results asynchronously. If this event provides completions, then the standard synchronous process will not be fired to populate the results. However, the synchronous TabCompleteEvent will fire with the Async results. @@ -60,16 +62,17 @@ index 00000000..3c51aaf9 + * Only 1 process will be allowed to provide completions, the Async Event, or the standard process. + */ +public class AsyncTabCompleteEvent extends Event implements Cancellable { -+ private final CommandSender sender; -+ private final String buffer; ++ @NotNull private final CommandSender sender; ++ @NotNull private final String buffer; + private final boolean isCommand; ++ @Nullable + private final Location loc; -+ private List completions; ++ @NotNull private List completions; + private boolean cancelled; + private boolean handled = false; + private boolean fireSyncHandler = true; + -+ public AsyncTabCompleteEvent(CommandSender sender, List completions, String buffer, boolean isCommand, Location loc) { ++ public AsyncTabCompleteEvent(@NotNull CommandSender sender, @NotNull List completions, @NotNull String buffer, boolean isCommand, @Nullable Location loc) { + super(true); + this.sender = sender; + this.completions = completions; @@ -83,6 +86,7 @@ index 00000000..3c51aaf9 + * + * @return the {@link CommandSender} instance + */ ++ @NotNull + public CommandSender getSender() { + return sender; + } @@ -97,6 +101,7 @@ index 00000000..3c51aaf9 + * + * @return a list of offered completions + */ ++ @NotNull + public List getCompletions() { + return completions; + } @@ -111,7 +116,7 @@ index 00000000..3c51aaf9 + * + * @param completions the new completions + */ -+ public void setCompletions(List completions) { ++ public void setCompletions(@NotNull List completions) { + Validate.notNull(completions); + this.completions = new ArrayList<>(completions); + } @@ -121,6 +126,7 @@ index 00000000..3c51aaf9 + * + * @return command buffer, as entered + */ ++ @NotNull + public String getBuffer() { + return buffer; + } @@ -135,6 +141,7 @@ index 00000000..3c51aaf9 + /** + * @return The position looked at by the sender, or null if none + */ ++ @Nullable + public Location getLocation() { + return loc; + } @@ -177,16 +184,18 @@ index 00000000..3c51aaf9 + this.cancelled = cancelled; + } + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } +} diff --git a/src/main/java/org/bukkit/event/server/TabCompleteEvent.java b/src/main/java/org/bukkit/event/server/TabCompleteEvent.java -index a6229839..f0bc3563 100644 +index d1a9956a1..f96c4ba53 100644 --- a/src/main/java/org/bukkit/event/server/TabCompleteEvent.java +++ b/src/main/java/org/bukkit/event/server/TabCompleteEvent.java @@ -0,0 +0,0 @@ @@ -196,14 +205,22 @@ index a6229839..f0bc3563 100644 import java.util.List; import org.apache.commons.lang.Validate; import org.bukkit.command.CommandSender; +@@ -0,0 +0,0 @@ import org.bukkit.event.Event; + import org.bukkit.event.HandlerList; + import org.bukkit.event.player.PlayerCommandSendEvent; + import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + + /** + * Called when a {@link CommandSender} of any description (ie: player or @@ -0,0 +0,0 @@ public class TabCompleteEvent extends Event implements Cancellable { private boolean cancelled; - public TabCompleteEvent(CommandSender sender, String buffer, List completions) { + public TabCompleteEvent(@NotNull CommandSender sender, @NotNull String buffer, @NotNull List completions) { + // Paper start + this(sender, buffer, completions, sender instanceof org.bukkit.command.ConsoleCommandSender || buffer.startsWith("/"), null); + } -+ public TabCompleteEvent(CommandSender sender, String buffer, List completions, boolean isCommand, org.bukkit.Location location) { ++ public TabCompleteEvent(@NotNull CommandSender sender, @NotNull String buffer, @NotNull List completions, boolean isCommand, @Nullable org.bukkit.Location location) { + this.isCommand = isCommand; + this.loc = location; + // Paper end @@ -227,6 +244,7 @@ index a6229839..f0bc3563 100644 + /** + * @return The position looked at by the sender, or null if none + */ ++ @Nullable + public org.bukkit.Location getLocation() { + return loc; + } @@ -239,7 +257,7 @@ index a6229839..f0bc3563 100644 + * * @param completions the new completions */ - public void setCompletions(List completions) { + public void setCompletions(@NotNull List completions) { Validate.notNull(completions); - this.completions = completions; + this.completions = new ArrayList<>(completions); // Paper diff --git a/Spigot-API-Patches/Automatically-disable-plugins-that-fail-to-load.patch b/Spigot-API-Patches/Automatically-disable-plugins-that-fail-to-load.patch index a0a81ec118..b77c2052fa 100644 --- a/Spigot-API-Patches/Automatically-disable-plugins-that-fail-to-load.patch +++ b/Spigot-API-Patches/Automatically-disable-plugins-that-fail-to-load.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Automatically disable plugins that fail to load diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -index 54594546..bf972302 100644 +index 5b29076f..ac0702df 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java @@ -0,0 +0,0 @@ public final class JavaPluginLoader implements PluginLoader { diff --git a/Spigot-API-Patches/Basic-PlayerProfile-API.patch b/Spigot-API-Patches/Basic-PlayerProfile-API.patch index 6eea2a468a..bb8a5e0281 100644 --- a/Spigot-API-Patches/Basic-PlayerProfile-API.patch +++ b/Spigot-API-Patches/Basic-PlayerProfile-API.patch @@ -7,17 +7,17 @@ Provides basic elements of a PlayerProfile to be used by future API/events diff --git a/src/main/java/com/destroystokyo/paper/profile/PlayerProfile.java b/src/main/java/com/destroystokyo/paper/profile/PlayerProfile.java new file mode 100644 -index 00000000..529c5376 +index 000000000..476151d2a --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/profile/PlayerProfile.java @@ -0,0 +0,0 @@ +package com.destroystokyo.paper.profile; + -+import javax.annotation.Nonnull; -+import javax.annotation.Nullable; +import java.util.Collection; +import java.util.Set; +import java.util.UUID; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * Represents a players profile for the game, such as UUID, Name, and textures. @@ -27,7 +27,8 @@ index 00000000..529c5376 + /** + * @return The players name, if set + */ -+ @Nullable String getName(); ++ @Nullable ++ String getName(); + + /** + * Sets this profiles Name @@ -35,6 +36,7 @@ index 00000000..529c5376 + * @param name The new Name + * @return The previous Name + */ ++ @NotNull + String setName(@Nullable String name); + + /** @@ -48,46 +50,47 @@ index 00000000..529c5376 + * @param uuid The new UUID + * @return The previous UUID + */ ++ @Nullable + UUID setId(@Nullable UUID uuid); + + /** + * @return A Mutable set of this players properties, such as textures. + * Values specified here are subject to implementation details. + */ -+ @Nonnull Set getProperties(); ++ @NotNull Set getProperties(); + + /** + * Check if the Profile has the specified property + * @param property Property name to check + * @return If the property is set + */ -+ boolean hasProperty(String property); ++ boolean hasProperty(@Nullable String property); + + /** + * Sets a property. If the property already exists, the previous one will be replaced + * @param property Property to set. + */ -+ void setProperty(ProfileProperty property); ++ void setProperty(@NotNull ProfileProperty property); + + /** + * Sets multiple properties. If any of the set properties already exist, it will be replaced + * @param properties The properties to set + */ -+ void setProperties(Collection properties); ++ void setProperties(@NotNull Collection properties); + + /** + * Removes a specific property from this profile + * @param property The property to remove + * @return If a property was removed + */ -+ boolean removeProperty(String property); ++ boolean removeProperty(@Nullable String property); + + /** + * Removes a specific property from this profile + * @param property The property to remove + * @return If a property was removed + */ -+ default boolean removeProperty(@Nonnull ProfileProperty property) { ++ default boolean removeProperty(@NotNull ProfileProperty property) { + return removeProperty(property.getName()); + } + @@ -96,7 +99,7 @@ index 00000000..529c5376 + * @param properties The properties to remove + * @return If any property was removed + */ -+ default boolean removeProperties(Collection properties) { ++ default boolean removeProperties(@NotNull Collection properties) { + boolean removed = false; + for (ProfileProperty property : properties) { + if (removeProperty(property)) { @@ -155,7 +158,7 @@ index 00000000..529c5376 +} diff --git a/src/main/java/com/destroystokyo/paper/profile/ProfileProperty.java b/src/main/java/com/destroystokyo/paper/profile/ProfileProperty.java new file mode 100644 -index 00000000..d17061e6 +index 000000000..7b3b6ef53 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/profile/ProfileProperty.java @@ -0,0 +0,0 @@ @@ -163,9 +166,9 @@ index 00000000..d17061e6 + +import com.google.common.base.Preconditions; + -+import javax.annotation.Nonnull; -+import javax.annotation.Nullable; +import java.util.Objects; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * Represents a property on a {@link PlayerProfile} @@ -175,11 +178,11 @@ index 00000000..d17061e6 + private final String value; + private final String signature; + -+ public ProfileProperty(@Nonnull String name, @Nonnull String value) { ++ public ProfileProperty(@NotNull String name, @NotNull String value) { + this(name, value, null); + } + -+ public ProfileProperty(@Nonnull String name, @Nonnull String value, @Nullable String signature) { ++ public ProfileProperty(@NotNull String name, @NotNull String value, @Nullable String signature) { + this.name = Preconditions.checkNotNull(name, "ProfileProperty name can not be null"); + this.value = Preconditions.checkNotNull(value, "ProfileProperty value can not be null"); + this.signature = signature; @@ -188,7 +191,7 @@ index 00000000..d17061e6 + /** + * @return The property name, ie "textures" + */ -+ @Nonnull ++ @NotNull + public String getName() { + return name; + } @@ -196,7 +199,7 @@ index 00000000..d17061e6 + /** + * @return The property value, likely to be base64 encoded + */ -+ @Nonnull ++ @NotNull + public String getValue() { + return value; + } @@ -232,19 +235,9 @@ index 00000000..d17061e6 + } +} diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index eb180374..75634a8d 100644 +index 90b41fd25..16fa78b86 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -0,0 +0,0 @@ import org.bukkit.generator.ChunkGenerator; - import org.bukkit.inventory.ItemFactory; - import org.bukkit.inventory.meta.ItemMeta; - -+import javax.annotation.Nullable; // Paper -+import javax.annotation.Nonnull; // Paper -+ - /** - * Represents the Bukkit core, for version and Server singleton handling - */ @@ -0,0 +0,0 @@ public final class Bukkit { public static boolean suggestPlayerNamesWhenNullTabCompletions() { return server.suggestPlayerNamesWhenNullTabCompletions(); @@ -255,7 +248,8 @@ index eb180374..75634a8d 100644 + * @param uuid UUID to create profile for + * @return A PlayerProfile object + */ -+ public static com.destroystokyo.paper.profile.PlayerProfile createProfile(@Nonnull UUID uuid) { ++ @NotNull ++ public static com.destroystokyo.paper.profile.PlayerProfile createProfile(@NotNull UUID uuid) { + return server.createProfile(uuid); + } + @@ -264,7 +258,8 @@ index eb180374..75634a8d 100644 + * @param name Name to create profile for + * @return A PlayerProfile object + */ -+ public static com.destroystokyo.paper.profile.PlayerProfile createProfile(@Nonnull String name) { ++ @NotNull ++ public static com.destroystokyo.paper.profile.PlayerProfile createProfile(@NotNull String name) { + return server.createProfile(name); + } + @@ -277,26 +272,17 @@ index eb180374..75634a8d 100644 + * @param name Name to create profile for + * @return A PlayerProfile object + */ ++ @NotNull + public static com.destroystokyo.paper.profile.PlayerProfile createProfile(@Nullable UUID uuid, @Nullable String name) { + return server.createProfile(uuid, name); + } // Paper end - public static Server.Spigot spigot() + @NotNull diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index c57f81fd..1d1f7784 100644 +index fe3144c00..edbfa3fdc 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -0,0 +0,0 @@ import org.bukkit.generator.ChunkGenerator; - import org.bukkit.inventory.ItemFactory; - import org.bukkit.inventory.meta.ItemMeta; - -+import javax.annotation.Nullable; // Paper -+import javax.annotation.Nonnull; // Paper -+ - /** - * Represents a server implementation. - */ @@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient { * @return true if player names should be suggested */ @@ -307,14 +293,16 @@ index c57f81fd..1d1f7784 100644 + * @param uuid UUID to create profile for + * @return A PlayerProfile object + */ -+ com.destroystokyo.paper.profile.PlayerProfile createProfile(@Nonnull UUID uuid); ++ @NotNull ++ com.destroystokyo.paper.profile.PlayerProfile createProfile(@NotNull UUID uuid); + + /** + * Creates a PlayerProfile for the specified name, with UUID as null + * @param name Name to create profile for + * @return A PlayerProfile object + */ -+ com.destroystokyo.paper.profile.PlayerProfile createProfile(@Nonnull String name); ++ @NotNull ++ com.destroystokyo.paper.profile.PlayerProfile createProfile(@NotNull String name); + + /** + * Creates a PlayerProfile for the specified name/uuid @@ -325,6 +313,7 @@ index c57f81fd..1d1f7784 100644 + * @param name Name to create profile for + * @return A PlayerProfile object + */ ++ @NotNull + com.destroystokyo.paper.profile.PlayerProfile createProfile(@Nullable UUID uuid, @Nullable String name); // Paper end } diff --git a/Spigot-API-Patches/BlockDestroyEvent.patch b/Spigot-API-Patches/BlockDestroyEvent.patch index 20cfbee8a0..6943350ed9 100644 --- a/Spigot-API-Patches/BlockDestroyEvent.patch +++ b/Spigot-API-Patches/BlockDestroyEvent.patch @@ -12,7 +12,7 @@ This can replace many uses of BlockPhysicsEvent diff --git a/src/main/java/com/destroystokyo/paper/event/block/BlockDestroyEvent.java b/src/main/java/com/destroystokyo/paper/event/block/BlockDestroyEvent.java new file mode 100644 -index 00000000..a6247718 +index 000000000..3aee12f1c --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/block/BlockDestroyEvent.java @@ -0,0 +0,0 @@ @@ -23,6 +23,7 @@ index 00000000..a6247718 +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.event.block.BlockEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired anytime the server intends to 'destroy' a block through some triggering reason. @@ -39,13 +40,13 @@ index 00000000..a6247718 + + private static final HandlerList handlers = new HandlerList(); + -+ private final BlockData newState; ++ @NotNull private final BlockData newState; + private final boolean willDrop; + private boolean playEffect; + + private boolean cancelled = false; + -+ public BlockDestroyEvent(Block block, BlockData newState, boolean willDrop) { ++ public BlockDestroyEvent(@NotNull Block block, @NotNull BlockData newState, boolean willDrop) { + super(block); + this.newState = newState; + this.willDrop = willDrop; @@ -54,6 +55,7 @@ index 00000000..a6247718 + /** + * @return The new state of this block (Air, or a Fluid type) + */ ++ @NotNull + public BlockData getNewState() { + return newState; + } @@ -96,10 +98,12 @@ index 00000000..a6247718 + cancelled = cancel; + } + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } diff --git a/Spigot-API-Patches/Change-the-reserved-channel-check-to-be-sensible.patch b/Spigot-API-Patches/Change-the-reserved-channel-check-to-be-sensible.patch index faff25b571..f0f62cb356 100644 --- a/Spigot-API-Patches/Change-the-reserved-channel-check-to-be-sensible.patch +++ b/Spigot-API-Patches/Change-the-reserved-channel-check-to-be-sensible.patch @@ -5,20 +5,20 @@ Subject: [PATCH] Change the reserved channel check to be sensible diff --git a/src/main/java/org/bukkit/plugin/messaging/StandardMessenger.java b/src/main/java/org/bukkit/plugin/messaging/StandardMessenger.java -index f21cae72..865028d3 100644 +index 8227b375e..cc750eb3e 100644 --- a/src/main/java/org/bukkit/plugin/messaging/StandardMessenger.java +++ b/src/main/java/org/bukkit/plugin/messaging/StandardMessenger.java @@ -0,0 +0,0 @@ public class StandardMessenger implements Messenger { - public boolean isReservedChannel(String channel) { + public boolean isReservedChannel(@NotNull String channel) { channel = validateAndCorrectChannel(channel); - return channel.contains("minecraft") && !channel.equals("minecraft:brand"); + return channel.equals("minecraft:register") || channel.equals("minecraft:unregister"); // Paper } - public void registerOutgoingPluginChannel(Plugin plugin, String channel) { + public void registerOutgoingPluginChannel(@NotNull Plugin plugin, @NotNull String channel) { diff --git a/src/test/java/org/bukkit/plugin/messaging/StandardMessengerTest.java b/src/test/java/org/bukkit/plugin/messaging/StandardMessengerTest.java -index c15fa003..31ff2f61 100644 +index c15fa0039..31ff2f61d 100644 --- a/src/test/java/org/bukkit/plugin/messaging/StandardMessengerTest.java +++ b/src/test/java/org/bukkit/plugin/messaging/StandardMessengerTest.java @@ -0,0 +0,0 @@ public class StandardMessengerTest { diff --git a/Spigot-API-Patches/Check-Paper-versions.patch b/Spigot-API-Patches/Check-Paper-versions.patch index 8146ae1131..2cbf51d378 100644 --- a/Spigot-API-Patches/Check-Paper-versions.patch +++ b/Spigot-API-Patches/Check-Paper-versions.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Check Paper versions diff --git a/src/main/java/org/bukkit/command/defaults/VersionCommand.java b/src/main/java/org/bukkit/command/defaults/VersionCommand.java -index 5a994953..f38f6864 100644 +index 0305548e..8e57aa91 100644 --- a/src/main/java/org/bukkit/command/defaults/VersionCommand.java +++ b/src/main/java/org/bukkit/command/defaults/VersionCommand.java @@ -0,0 +0,0 @@ import org.json.simple.JSONObject; @@ -18,11 +18,11 @@ index 5a994953..f38f6864 100644 +// Paper end + public class VersionCommand extends BukkitCommand { - public VersionCommand(String name) { + public VersionCommand(@NotNull String name) { super(name); @@ -0,0 +0,0 @@ public class VersionCommand extends BukkitCommand { - private void sendVersion(CommandSender sender) { + private void sendVersion(@NotNull CommandSender sender) { if (hasVersion) { - if (System.currentTimeMillis() - lastCheck > 21600000) { + if (System.currentTimeMillis() - lastCheck > 7200000) { // Paper - Lower to 2 hours @@ -74,9 +74,9 @@ index 5a994953..f38f6864 100644 } } -- private static int getDistance(String repo, String hash) { +- private static int getDistance(@NotNull String repo, @NotNull String hash) { + // Paper start -+ private static int getDistance(String repo, String verInfo) { ++ private static int getDistance(@NotNull String repo, @NotNull String verInfo) { try { + int currentVer = Integer.decode(verInfo); + return getFromJenkins(currentVer); diff --git a/Spigot-API-Patches/Close-Plugin-Class-Loaders-on-Disable.patch b/Spigot-API-Patches/Close-Plugin-Class-Loaders-on-Disable.patch index 1838da9149..5076a7e00e 100644 --- a/Spigot-API-Patches/Close-Plugin-Class-Loaders-on-Disable.patch +++ b/Spigot-API-Patches/Close-Plugin-Class-Loaders-on-Disable.patch @@ -7,14 +7,13 @@ This should close more memory leaks from /reload and disabling plugins, by closing the class loader and the jar file. diff --git a/src/main/java/org/bukkit/plugin/PluginLoader.java b/src/main/java/org/bukkit/plugin/PluginLoader.java -index e7981a1d..d34756f1 100644 +index da7839aa9..fbd65e8b0 100644 --- a/src/main/java/org/bukkit/plugin/PluginLoader.java +++ b/src/main/java/org/bukkit/plugin/PluginLoader.java @@ -0,0 +0,0 @@ public interface PluginLoader { * @param plugin Plugin to disable */ - public void disablePlugin(Plugin plugin); -+ + public void disablePlugin(@NotNull Plugin plugin); + // Paper start - close Classloader on disable + /** + * Disables the specified plugin @@ -25,18 +24,18 @@ index e7981a1d..d34756f1 100644 + * @param closeClassloader if the classloader for the Plugin should be closed + */ + // provide default to allow other PluginLoader implementations to work -+ default public void disablePlugin(Plugin plugin, boolean closeClassloader) { ++ default public void disablePlugin(@NotNull Plugin plugin, boolean closeClassloader) { + disablePlugin(plugin); + } + // Paper end - close Classloader on disable } diff --git a/src/main/java/org/bukkit/plugin/PluginManager.java b/src/main/java/org/bukkit/plugin/PluginManager.java -index e5638d56..b72d5a9b 100644 +index a468467b4..ba4ed7ed7 100644 --- a/src/main/java/org/bukkit/plugin/PluginManager.java +++ b/src/main/java/org/bukkit/plugin/PluginManager.java @@ -0,0 +0,0 @@ public interface PluginManager { */ - public void disablePlugin(Plugin plugin); + public void disablePlugin(@NotNull Plugin plugin); + // Paper start - close Classloader on disable + /** @@ -47,14 +46,14 @@ index e5638d56..b72d5a9b 100644 + * @param plugin Plugin to disable + * @param closeClassloader if the classloader for the Plugin should be closed + */ -+ public void disablePlugin(Plugin plugin, boolean closeClassloader); ++ public void disablePlugin(@NotNull Plugin plugin, boolean closeClassloader); + // Paper end - close Classloader on disable + /** * Gets a {@link Permission} from its fully qualified name * diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java -index 5034215a..d925423d 100644 +index 12e17709c..7d4ca43b5 100644 --- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java +++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java @@ -0,0 +0,0 @@ public final class SimplePluginManager implements PluginManager { @@ -75,13 +74,12 @@ index 5034215a..d925423d 100644 } } -- public void disablePlugin(final Plugin plugin) { + // Paper start - close Classloader on disable -+ public void disablePlugin(Plugin plugin) { + public void disablePlugin(@NotNull final Plugin plugin) { + disablePlugin(plugin, false); + } + -+ public void disablePlugin(final Plugin plugin, boolean closeClassloader) { ++ public void disablePlugin(@NotNull final Plugin plugin, boolean closeClassloader) { + // Paper end - close Classloader on disable if (plugin.isEnabled()) { try { @@ -100,7 +98,7 @@ index 5034215a..d925423d 100644 lookupNames.clear(); HandlerList.unregisterAll(); diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -index 77207f14..c7782e7d 100644 +index b9bf2124b..095448fe7 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java @@ -0,0 +0,0 @@ public final class JavaPluginLoader implements PluginLoader { @@ -113,15 +111,14 @@ index 77207f14..c7782e7d 100644 // Paper end } @@ -0,0 +0,0 @@ public final class JavaPluginLoader implements PluginLoader { - } } + public void disablePlugin(@NotNull Plugin plugin) { + // Paper start - close Classloader on disable - public void disablePlugin(Plugin plugin) { + disablePlugin(plugin, false); // Retain old behavior unless requested + } + -+ public void disablePlugin(Plugin plugin, boolean closeClassloader) { ++ public void disablePlugin(@NotNull Plugin plugin, boolean closeClassloader) { + // Paper end - close Class Loader on disable Validate.isTrue(plugin instanceof JavaPlugin, "Plugin is not associated with this PluginLoader"); diff --git a/Spigot-API-Patches/Complete-resource-pack-API.patch b/Spigot-API-Patches/Complete-resource-pack-API.patch index ab1b4baf4f..a057b5a278 100644 --- a/Spigot-API-Patches/Complete-resource-pack-API.patch +++ b/Spigot-API-Patches/Complete-resource-pack-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Complete resource pack API diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 5109a0c3..96d97bf3 100644 +index 1de43bd33..c237073a3 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM @@ -15,7 +15,7 @@ index 5109a0c3..96d97bf3 100644 + * @deprecated use {@link #setResourcePack(String, String)} */ + @Deprecated // Paper - public void setResourcePack(String url); + public void setResourcePack(@NotNull String url); /** @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM @@ -52,12 +52,13 @@ index 5109a0c3..96d97bf3 100644 + * @throws IllegalArgumentException Thrown if the URL is too long. The + * length restriction is an implementation specific arbitrary value. + */ -+ void setResourcePack(String url, String hash); ++ void setResourcePack(@NotNull String url, @NotNull String hash); + + /** + * @return the most recent resource pack status received from the player, + * or null if no status has ever been received from this player. + */ ++ @Nullable + org.bukkit.event.player.PlayerResourcePackStatusEvent.Status getResourcePackStatus(); + + /** @@ -66,6 +67,7 @@ index 5109a0c3..96d97bf3 100644 + * + * @deprecated This is no longer sent from the client and will always be null + */ ++ @Nullable + @Deprecated + String getResourcePackHash(); + @@ -80,10 +82,10 @@ index 5109a0c3..96d97bf3 100644 public class Spigot extends Entity.Spigot { diff --git a/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java b/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java -index 4c498016..aa18a766 100644 +index b98195650..4c2102a11 100644 --- a/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java -@@ -0,0 +0,0 @@ import org.bukkit.event.HandlerList; +@@ -0,0 +0,0 @@ import org.jetbrains.annotations.NotNull; public class PlayerResourcePackStatusEvent extends PlayerEvent { private static final HandlerList handlers = new HandlerList(); @@ -91,7 +93,7 @@ index 4c498016..aa18a766 100644 + private final String hash; // Paper private final Status status; - public PlayerResourcePackStatusEvent(final Player who, Status resourcePackStatus) { + public PlayerResourcePackStatusEvent(@NotNull final Player who, @NotNull Status resourcePackStatus) { super(who); + this.hash = null; // Paper this.status = resourcePackStatus; diff --git a/Spigot-API-Patches/Custom-replacement-for-eaten-items.patch b/Spigot-API-Patches/Custom-replacement-for-eaten-items.patch index 1a7150a569..e48bb7601e 100644 --- a/Spigot-API-Patches/Custom-replacement-for-eaten-items.patch +++ b/Spigot-API-Patches/Custom-replacement-for-eaten-items.patch @@ -5,18 +5,9 @@ Subject: [PATCH] Custom replacement for eaten items diff --git a/src/main/java/org/bukkit/event/player/PlayerItemConsumeEvent.java b/src/main/java/org/bukkit/event/player/PlayerItemConsumeEvent.java -index 8ab76b1d..7d28155b 100644 +index ee0f95b1..864c0a9e 100644 --- a/src/main/java/org/bukkit/event/player/PlayerItemConsumeEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerItemConsumeEvent.java -@@ -0,0 +0,0 @@ import org.bukkit.event.Cancellable; - import org.bukkit.event.HandlerList; - import org.bukkit.inventory.ItemStack; - -+import javax.annotation.Nullable; -+ - /** - * This event will fire when a player is finishing consuming an item (food, - * potion, milk bucket). @@ -0,0 +0,0 @@ public class PlayerItemConsumeEvent extends PlayerEvent implements Cancellable { private static final HandlerList handlers = new HandlerList(); private boolean isCancelled = false; diff --git a/Spigot-API-Patches/Display-warning-on-deprecated-recipe-API.patch b/Spigot-API-Patches/Display-warning-on-deprecated-recipe-API.patch index ae7cffa54e..71160d2e18 100644 --- a/Spigot-API-Patches/Display-warning-on-deprecated-recipe-API.patch +++ b/Spigot-API-Patches/Display-warning-on-deprecated-recipe-API.patch @@ -10,24 +10,24 @@ on the players login. Plugin authors need to define a key to keep it consistent between server restarts. diff --git a/src/main/java/org/bukkit/inventory/ShapedRecipe.java b/src/main/java/org/bukkit/inventory/ShapedRecipe.java -index 90d6d50c..80af6cf5 100644 +index 77e6ccf5..64a43f42 100644 --- a/src/main/java/org/bukkit/inventory/ShapedRecipe.java +++ b/src/main/java/org/bukkit/inventory/ShapedRecipe.java @@ -0,0 +0,0 @@ public class ShapedRecipe implements Recipe, Keyed { @Deprecated - public ShapedRecipe(ItemStack result) { + public ShapedRecipe(@NotNull ItemStack result) { this.key = NamespacedKey.randomKey(); + new Throwable("Warning: A plugin is creating a recipe using a Deprecated method. This will cause you to receive warnings stating 'Tried to load unrecognized recipe: bukkit:'. Please ask the author to give their recipe a static key using NamespacedKey.").printStackTrace(); this.output = new ItemStack(result); } diff --git a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java -index ea359c54..7347e746 100644 +index a8d5f330..46a398e8 100644 --- a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java +++ b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java @@ -0,0 +0,0 @@ public class ShapelessRecipe implements Recipe, Keyed { @Deprecated - public ShapelessRecipe(ItemStack result) { + public ShapelessRecipe(@NotNull ItemStack result) { this.key = NamespacedKey.randomKey(); + new Throwable("Warning: A plugin is creating a recipe using a Deprecated method. This will cause you to receive warnings stating 'Tried to load unrecognized recipe: bukkit:'. Please ask the author to give their recipe a static key using NamespacedKey.").printStackTrace(); this.output = new ItemStack(result); diff --git a/Spigot-API-Patches/Don-t-use-snapshots-for-Timings-Tile-Entity-reports.patch b/Spigot-API-Patches/Don-t-use-snapshots-for-Timings-Tile-Entity-reports.patch index 33668a50d6..2e5c4254d3 100644 --- a/Spigot-API-Patches/Don-t-use-snapshots-for-Timings-Tile-Entity-reports.patch +++ b/Spigot-API-Patches/Don-t-use-snapshots-for-Timings-Tile-Entity-reports.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Don't use snapshots for Timings Tile Entity reports diff --git a/src/main/java/co/aikar/timings/TimingHistory.java b/src/main/java/co/aikar/timings/TimingHistory.java -index 28d0954a..7ad9400a 100644 +index 8726bb9a2..21b929f94 100644 --- a/src/main/java/co/aikar/timings/TimingHistory.java +++ b/src/main/java/co/aikar/timings/TimingHistory.java @@ -0,0 +0,0 @@ public class TimingHistory { diff --git a/Spigot-API-Patches/EnderDragon-Events.patch b/Spigot-API-Patches/EnderDragon-Events.patch index 62125a9d5a..654426dc04 100644 --- a/Spigot-API-Patches/EnderDragon-Events.patch +++ b/Spigot-API-Patches/EnderDragon-Events.patch @@ -6,7 +6,7 @@ Subject: [PATCH] EnderDragon Events diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EnderDragonFireballHitEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EnderDragonFireballHitEvent.java new file mode 100644 -index 00000000..ef2a8dab +index 000000000..118c7b677 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/EnderDragonFireballHitEvent.java @@ -0,0 +0,0 @@ @@ -20,15 +20,17 @@ index 00000000..ef2a8dab +import org.bukkit.event.entity.EntityEvent; + +import java.util.Collection; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * Fired when a DragonFireball collides with a block/entity and spawns an AreaEffectCloud + */ +public class EnderDragonFireballHitEvent extends EntityEvent implements Cancellable { -+ private final Collection targets; -+ private final AreaEffectCloud areaEffectCloud; ++ @Nullable private final Collection targets; ++ @NotNull private final AreaEffectCloud areaEffectCloud; + -+ public EnderDragonFireballHitEvent(DragonFireball fireball, Collection targets, AreaEffectCloud areaEffectCloud) { ++ public EnderDragonFireballHitEvent(@NotNull DragonFireball fireball, @Nullable Collection targets, @NotNull AreaEffectCloud areaEffectCloud) { + super(fireball); + this.targets = targets; + this.areaEffectCloud = areaEffectCloud; @@ -37,6 +39,7 @@ index 00000000..ef2a8dab + /** + * The fireball involved in this event + */ ++ @NotNull + @Override + public DragonFireball getEntity() { + return (DragonFireball) super.getEntity(); @@ -49,6 +52,7 @@ index 00000000..ef2a8dab + * + * @return the targets + */ ++ @Nullable + public Collection getTargets() { + return targets; + } @@ -56,16 +60,19 @@ index 00000000..ef2a8dab + /** + * @return The area effect cloud spawned in this collision + */ ++ @NotNull + public AreaEffectCloud getAreaEffectCloud() { + return areaEffectCloud; + } + + private static final HandlerList handlers = new HandlerList(); + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } @@ -84,7 +91,7 @@ index 00000000..ef2a8dab +} diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EnderDragonFlameEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EnderDragonFlameEvent.java new file mode 100644 -index 00000000..d8c3ab33 +index 000000000..1915177f4 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/EnderDragonFlameEvent.java @@ -0,0 +0,0 @@ @@ -95,14 +102,15 @@ index 00000000..d8c3ab33 +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.EntityEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired when an EnderDragon spawns an AreaEffectCloud by shooting flames + */ +public class EnderDragonFlameEvent extends EntityEvent implements Cancellable { -+ private final AreaEffectCloud areaEffectCloud; ++ @NotNull private final AreaEffectCloud areaEffectCloud; + -+ public EnderDragonFlameEvent(EnderDragon enderDragon, AreaEffectCloud areaEffectCloud) { ++ public EnderDragonFlameEvent(@NotNull EnderDragon enderDragon, @NotNull AreaEffectCloud areaEffectCloud) { + super(enderDragon); + this.areaEffectCloud = areaEffectCloud; + } @@ -110,6 +118,7 @@ index 00000000..d8c3ab33 + /** + * The enderdragon involved in this event + */ ++ @NotNull + @Override + public EnderDragon getEntity() { + return (EnderDragon) super.getEntity(); @@ -118,16 +127,19 @@ index 00000000..d8c3ab33 + /** + * @return The area effect cloud spawned in this collision + */ ++ @NotNull + public AreaEffectCloud getAreaEffectCloud() { + return areaEffectCloud; + } + + private static final HandlerList handlers = new HandlerList(); + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } @@ -146,7 +158,7 @@ index 00000000..d8c3ab33 +} diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EnderDragonShootFireballEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EnderDragonShootFireballEvent.java new file mode 100644 -index 00000000..aa70dda1 +index 000000000..8414bd805 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/EnderDragonShootFireballEvent.java @@ -0,0 +0,0 @@ @@ -157,14 +169,15 @@ index 00000000..aa70dda1 +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.EntityEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired when an EnderDragon shoots a fireball + */ +public class EnderDragonShootFireballEvent extends EntityEvent implements Cancellable { -+ private final DragonFireball fireball; ++ @NotNull private final DragonFireball fireball; + -+ public EnderDragonShootFireballEvent(EnderDragon entity, DragonFireball fireball) { ++ public EnderDragonShootFireballEvent(@NotNull EnderDragon entity, @NotNull DragonFireball fireball) { + super(entity); + this.fireball = fireball; + } @@ -172,6 +185,7 @@ index 00000000..aa70dda1 + /** + * The enderdragon shooting the fireball + */ ++ @NotNull + @Override + public EnderDragon getEntity() { + return (EnderDragon) super.getEntity(); @@ -180,16 +194,19 @@ index 00000000..aa70dda1 + /** + * @return The fireball being shot + */ ++ @NotNull + public DragonFireball getFireball() { + return fireball; + } + + private static final HandlerList handlers = new HandlerList(); + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } diff --git a/Spigot-API-Patches/Enderman.teleportRandomly.patch b/Spigot-API-Patches/Enderman.teleportRandomly.patch index 0bcb2a42e3..4382e52d87 100644 --- a/Spigot-API-Patches/Enderman.teleportRandomly.patch +++ b/Spigot-API-Patches/Enderman.teleportRandomly.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Enderman.teleportRandomly() Ability to trigger the vanilla "teleport randomly" mechanic of an enderman. diff --git a/src/main/java/org/bukkit/entity/Enderman.java b/src/main/java/org/bukkit/entity/Enderman.java -index edb49a20..1ea289b5 100644 +index bb325d9c..821c690f 100644 --- a/src/main/java/org/bukkit/entity/Enderman.java +++ b/src/main/java/org/bukkit/entity/Enderman.java -@@ -0,0 +0,0 @@ import org.bukkit.material.MaterialData; +@@ -0,0 +0,0 @@ import org.jetbrains.annotations.Nullable; */ public interface Enderman extends Monster { diff --git a/Spigot-API-Patches/EndermanAttackPlayerEvent.patch b/Spigot-API-Patches/EndermanAttackPlayerEvent.patch index 5f57184fc9..b98e2b1ae5 100644 --- a/Spigot-API-Patches/EndermanAttackPlayerEvent.patch +++ b/Spigot-API-Patches/EndermanAttackPlayerEvent.patch @@ -9,7 +9,7 @@ This allows you to override/extend the pumpkin/stare logic. diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EndermanAttackPlayerEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EndermanAttackPlayerEvent.java new file mode 100644 -index 00000000..ab5a7a6b +index 000000000..f530a3d93 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/EndermanAttackPlayerEvent.java @@ -0,0 +0,0 @@ @@ -45,6 +45,7 @@ index 00000000..ab5a7a6b +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.EntityEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired when an Enderman determines if it should attack a player or not. @@ -53,9 +54,9 @@ index 00000000..ab5a7a6b + * + */ +public class EndermanAttackPlayerEvent extends EntityEvent implements Cancellable { -+ private final Player player; ++ @NotNull private final Player player; + -+ public EndermanAttackPlayerEvent(Enderman entity, Player player) { ++ public EndermanAttackPlayerEvent(@NotNull Enderman entity, @NotNull Player player) { + super(entity); + this.player = player; + } @@ -65,6 +66,7 @@ index 00000000..ab5a7a6b + * + * @return The enderman considering attacking + */ ++ @NotNull + @Override + public Enderman getEntity() { + return (Enderman) super.getEntity(); @@ -75,16 +77,19 @@ index 00000000..ab5a7a6b + * + * @return The player the Enderman is considering attacking + */ ++ @NotNull + public Player getPlayer() { + return player; + } + + private static final HandlerList handlers = new HandlerList(); + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } diff --git a/Spigot-API-Patches/EndermanEscapeEvent.patch b/Spigot-API-Patches/EndermanEscapeEvent.patch index fa1db68299..6f161a4a5a 100644 --- a/Spigot-API-Patches/EndermanEscapeEvent.patch +++ b/Spigot-API-Patches/EndermanEscapeEvent.patch @@ -9,7 +9,7 @@ You may cancel this, enabling ranged attacks to damage the enderman for example. diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EndermanEscapeEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EndermanEscapeEvent.java new file mode 100644 -index 00000000..0d15a8ab +index 000000000..806112a8b --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/EndermanEscapeEvent.java @@ -0,0 +0,0 @@ @@ -21,15 +21,17 @@ index 00000000..0d15a8ab +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.EntityEvent; ++import org.jetbrains.annotations.NotNull; + +public class EndermanEscapeEvent extends EntityEvent implements Cancellable { -+ private final Reason reason; ++ @NotNull private final Reason reason; + -+ public EndermanEscapeEvent(Enderman entity, Reason reason) { ++ public EndermanEscapeEvent(@NotNull Enderman entity, @NotNull Reason reason) { + super(entity); + this.reason = reason; + } + ++ @NotNull + @Override + public Enderman getEntity() { + return (Enderman) super.getEntity(); @@ -38,16 +40,19 @@ index 00000000..0d15a8ab + /** + * @return The reason the enderman is trying to escape + */ ++ @NotNull + public Reason getReason() { + return reason; + } + + private static final HandlerList handlers = new HandlerList(); + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } diff --git a/Spigot-API-Patches/Entity-AddTo-RemoveFrom-World-Events.patch b/Spigot-API-Patches/Entity-AddTo-RemoveFrom-World-Events.patch index 5342f51464..31eac7748f 100644 --- a/Spigot-API-Patches/Entity-AddTo-RemoveFrom-World-Events.patch +++ b/Spigot-API-Patches/Entity-AddTo-RemoveFrom-World-Events.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Entity AddTo/RemoveFrom World Events diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EntityAddToWorldEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EntityAddToWorldEvent.java new file mode 100644 -index 00000000..18b158cd +index 000000000..07660202e --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/EntityAddToWorldEvent.java @@ -0,0 +0,0 @@ @@ -16,6 +16,7 @@ index 00000000..18b158cd +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.EntityEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired any time an entity is being added to the world for any reason. @@ -25,23 +26,25 @@ index 00000000..18b158cd + */ +public class EntityAddToWorldEvent extends EntityEvent { + -+ public EntityAddToWorldEvent(Entity entity) { ++ public EntityAddToWorldEvent(@NotNull Entity entity) { + super(entity); + } + + 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/entity/EntityRemoveFromWorldEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EntityRemoveFromWorldEvent.java new file mode 100644 -index 00000000..800be6aa +index 000000000..e5dbbd660 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/EntityRemoveFromWorldEvent.java @@ -0,0 +0,0 @@ @@ -51,22 +54,25 @@ index 00000000..800be6aa +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.EntityEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired any time an entity is being removed from a world for any reason + */ +public class EntityRemoveFromWorldEvent extends EntityEvent { + -+ public EntityRemoveFromWorldEvent(Entity entity) { ++ public EntityRemoveFromWorldEvent(@NotNull Entity entity) { + super(entity); + } + + private static final HandlerList handlers = new HandlerList(); + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } diff --git a/Spigot-API-Patches/Entity-Origin-API.patch b/Spigot-API-Patches/Entity-Origin-API.patch index 7adc7964cc..add6ef754c 100644 --- a/Spigot-API-Patches/Entity-Origin-API.patch +++ b/Spigot-API-Patches/Entity-Origin-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Entity Origin API diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java -index 236cddb2..015a4c56 100644 +index 19dc1e6a8..69307e252 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java @@ -0,0 +0,0 @@ public interface Entity extends Metadatable, CommandSender, Nameable { @@ -21,11 +21,12 @@ index 236cddb2..015a4c56 100644 + * + * @return Location where entity originates or null if not yet added + */ ++ @Nullable + Location getOrigin(); + // Paper end } diff --git a/src/main/java/org/bukkit/entity/FallingBlock.java b/src/main/java/org/bukkit/entity/FallingBlock.java -index 0cd830d9..170a9aee 100644 +index 64f9d3fd8..14cb0d770 100644 --- a/src/main/java/org/bukkit/entity/FallingBlock.java +++ b/src/main/java/org/bukkit/entity/FallingBlock.java @@ -0,0 +0,0 @@ public interface FallingBlock extends Entity { @@ -45,12 +46,12 @@ index 0cd830d9..170a9aee 100644 + } } diff --git a/src/main/java/org/bukkit/entity/TNTPrimed.java b/src/main/java/org/bukkit/entity/TNTPrimed.java -index a439eaf5..04cc23ef 100644 +index 5a8789324..3022b4a27 100644 --- a/src/main/java/org/bukkit/entity/TNTPrimed.java +++ b/src/main/java/org/bukkit/entity/TNTPrimed.java @@ -0,0 +0,0 @@ public interface TNTPrimed extends Explosive { - * @return the source of this primed TNT */ + @Nullable public Entity getSource(); + + /** diff --git a/Spigot-API-Patches/Entity-fromMobSpawner.patch b/Spigot-API-Patches/Entity-fromMobSpawner.patch index 414ca55a65..c5f76249de 100644 --- a/Spigot-API-Patches/Entity-fromMobSpawner.patch +++ b/Spigot-API-Patches/Entity-fromMobSpawner.patch @@ -5,12 +5,12 @@ Subject: [PATCH] Entity#fromMobSpawner() diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java -index 015a4c56..13de2d74 100644 +index 69307e252..373204d37 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java @@ -0,0 +0,0 @@ public interface Entity extends Metadatable, CommandSender, Nameable { - * @return Location where entity originates or null if not yet added */ + @Nullable Location getOrigin(); + + /** diff --git a/Spigot-API-Patches/Entity-getChunk-API.patch b/Spigot-API-Patches/Entity-getChunk-API.patch index 3ad29c42b8..d21cf4f2b8 100644 --- a/Spigot-API-Patches/Entity-getChunk-API.patch +++ b/Spigot-API-Patches/Entity-getChunk-API.patch @@ -6,15 +6,16 @@ Subject: [PATCH] Entity#getChunk API Get the chunk the entity is currently registered to diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java -index 13de2d74..2dd7a03c 100644 +index 373204d37..a7f81d17d 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java @@ -0,0 +0,0 @@ package org.bukkit.entity; +import org.bukkit.Chunk; - import org.bukkit.Location; ++import org.bukkit.Location; import org.bukkit.EntityEffect; + import org.bukkit.Location; import org.bukkit.Nameable; @@ -0,0 +0,0 @@ public interface Entity extends Metadatable, CommandSender, Nameable { * @return True if entity spawned from a mob spawner @@ -26,6 +27,7 @@ index 13de2d74..2dd7a03c 100644 + * + * @return The current, or most recent chunk if the entity is invalid (which may load the chunk) + */ ++ @NotNull + Chunk getChunk(); // Paper end } diff --git a/Spigot-API-Patches/EntityPathfindEvent.patch b/Spigot-API-Patches/EntityPathfindEvent.patch index 880030e17e..ef25f30b38 100644 --- a/Spigot-API-Patches/EntityPathfindEvent.patch +++ b/Spigot-API-Patches/EntityPathfindEvent.patch @@ -7,7 +7,7 @@ Fires when an Entity decides to start moving to a location. diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EntityPathfindEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EntityPathfindEvent.java new file mode 100644 -index 00000000..0e4902d9 +index 000000000..63e46b2fb --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/EntityPathfindEvent.java @@ -0,0 +0,0 @@ @@ -18,6 +18,8 @@ index 00000000..0e4902d9 +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.EntityEvent; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * Fired when an Entity decides to start moving towards a location. @@ -26,9 +28,10 @@ index 00000000..0e4902d9 + * is choosing to start moving to a location. + */ +public class EntityPathfindEvent extends EntityEvent implements Cancellable { -+ private final Entity targetEntity; -+ private final Location loc; -+ public EntityPathfindEvent(Entity entity, Location loc, Entity targetEntity) { ++ @Nullable private final Entity targetEntity; ++ @NotNull private final Location loc; ++ ++ public EntityPathfindEvent(@NotNull Entity entity, @NotNull Location loc, @Nullable Entity targetEntity) { + super(entity); + this.targetEntity = targetEntity; + this.loc = loc; @@ -38,6 +41,7 @@ index 00000000..0e4902d9 + * The Entity that is pathfinding. + * @return The Entity that is pathfinding. + */ ++ @NotNull + public Entity getEntity() { + return entity; + } @@ -49,6 +53,7 @@ index 00000000..0e4902d9 + * + * @return The entity target or null + */ ++ @Nullable + public Entity getTargetEntity() { + return targetEntity; + } @@ -59,16 +64,19 @@ index 00000000..0e4902d9 + * Note that if the target happened to of been an entity + * @return Location of where the entity is trying to pathfind to. + */ ++ @NotNull + public Location getLoc() { + return loc; + } + + private static final HandlerList handlers = new HandlerList(); + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } diff --git a/Spigot-API-Patches/EntityRegainHealthEvent-isFastRegen-API.patch b/Spigot-API-Patches/EntityRegainHealthEvent-isFastRegen-API.patch index 6f6b969fad..3e73984dcd 100644 --- a/Spigot-API-Patches/EntityRegainHealthEvent-isFastRegen-API.patch +++ b/Spigot-API-Patches/EntityRegainHealthEvent-isFastRegen-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] EntityRegainHealthEvent isFastRegen API diff --git a/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java b/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java -index 976b80b7..a5ac3edf 100644 +index 8feb6698..d51d2ec1 100644 --- a/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java @@ -0,0 +0,0 @@ public class EntityRegainHealthEvent extends EntityEvent implements Cancellable @@ -14,12 +14,12 @@ index 976b80b7..a5ac3edf 100644 private final RegainReason regainReason; + private final boolean isFastRegen; // Paper - public EntityRegainHealthEvent(final Entity entity, final double amount, final RegainReason regainReason) { + public EntityRegainHealthEvent(@NotNull final Entity entity, final double amount, @NotNull final RegainReason regainReason) { + // Paper start - Forward + this(entity, amount, regainReason, false); + } + -+ public EntityRegainHealthEvent(final Entity entity, final double amount, final RegainReason regainReason, boolean isFastRegen) { ++ public EntityRegainHealthEvent(@NotNull final Entity entity, final double amount, @NotNull final RegainReason regainReason, boolean isFastRegen) { + // Paper end super(entity); this.amount = amount; diff --git a/Spigot-API-Patches/EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch b/Spigot-API-Patches/EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch index 51fe0a8034..7f2833ff82 100644 --- a/Spigot-API-Patches/EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch +++ b/Spigot-API-Patches/EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch @@ -6,7 +6,7 @@ Subject: [PATCH] EntityShootBowEvent consumeArrow and getArrowItem API Adds ability to get what arrow was shot, and control if it should be consumed. diff --git a/src/main/java/org/bukkit/event/entity/EntityShootBowEvent.java b/src/main/java/org/bukkit/event/entity/EntityShootBowEvent.java -index f8c91a13..c9eb75aa 100644 +index 57f6203d4..efde16174 100644 --- a/src/main/java/org/bukkit/event/entity/EntityShootBowEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityShootBowEvent.java @@ -0,0 +0,0 @@ public class EntityShootBowEvent extends EntityEvent implements Cancellable { @@ -16,22 +16,24 @@ index f8c91a13..c9eb75aa 100644 + // Paper start + private boolean consumeArrow = true; + private final ItemStack arrowItem; -+ public boolean getConsumeArrow() { -+ return consumeArrow; -+ } + public void setConsumeArrow(boolean consumeArrow) { + this.consumeArrow = consumeArrow; + } ++ public boolean getConsumeArrow() { ++ return consumeArrow; ++ } ++ @NotNull + public ItemStack getArrowItem() { + return arrowItem; + } + + @Deprecated - public EntityShootBowEvent(final LivingEntity shooter, final ItemStack bow, final Projectile projectile, final float force) { + public EntityShootBowEvent(@NotNull final LivingEntity shooter, @Nullable final ItemStack bow, @NotNull final Projectile projectile, final float force) { + this(shooter, bow, new ItemStack(org.bukkit.Material.AIR), projectile, force); + } -+ public EntityShootBowEvent(final LivingEntity shooter, final ItemStack bow, ItemStack arrowItem, final Projectile projectile, final float force) { ++ ++ public EntityShootBowEvent(@NotNull final LivingEntity shooter, @Nullable final ItemStack bow, @NotNull ItemStack arrowItem, @NotNull final Projectile projectile, final float force) { super(shooter); + this.arrowItem = arrowItem; + // Paper end diff --git a/Spigot-API-Patches/EntityTransformedEvent.patch b/Spigot-API-Patches/EntityTransformedEvent.patch index 67f5730436..be8750ba7a 100644 --- a/Spigot-API-Patches/EntityTransformedEvent.patch +++ b/Spigot-API-Patches/EntityTransformedEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] EntityTransformedEvent diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EntityTransformedEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EntityTransformedEvent.java new file mode 100644 -index 00000000..12194f1f +index 000000000..12194f1fc --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/EntityTransformedEvent.java @@ -0,0 +0,0 @@ diff --git a/Spigot-API-Patches/Expand-ArmorStand-API.patch b/Spigot-API-Patches/Expand-ArmorStand-API.patch index 8f4cc2b8e7..bb409aa6af 100644 --- a/Spigot-API-Patches/Expand-ArmorStand-API.patch +++ b/Spigot-API-Patches/Expand-ArmorStand-API.patch @@ -8,7 +8,7 @@ Add the following: - Enable/Disable slot interactions diff --git a/src/main/java/org/bukkit/entity/ArmorStand.java b/src/main/java/org/bukkit/entity/ArmorStand.java -index 859f166f..eda4873d 100644 +index 492df420b..e7f71e65e 100644 --- a/src/main/java/org/bukkit/entity/ArmorStand.java +++ b/src/main/java/org/bukkit/entity/ArmorStand.java @@ -0,0 +0,0 @@ @@ -17,7 +17,7 @@ index 859f166f..eda4873d 100644 +import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.ItemStack; import org.bukkit.util.EulerAngle; - + import org.jetbrains.annotations.NotNull; @@ -0,0 +0,0 @@ public interface ArmorStand extends LivingEntity { * currently holding * @@ -27,6 +27,7 @@ index 859f166f..eda4873d 100644 + * @see ArmorStand#getItem(EquipmentSlot) + // Paper end */ + @NotNull + @Deprecated // Paper ItemStack getItemInHand(); @@ -41,7 +42,7 @@ index 859f166f..eda4873d 100644 + // Paper end */ + @Deprecated // Paper - void setItemInHand(ItemStack item); + void setItemInHand(@Nullable ItemStack item); /** @@ -0,0 +0,0 @@ public interface ArmorStand extends LivingEntity { @@ -56,7 +57,8 @@ index 859f166f..eda4873d 100644 + * @param slot the equipment slot to get + * @return the ItemStack in the equipment slot + */ -+ ItemStack getItem(final org.bukkit.inventory.EquipmentSlot slot); ++ @NotNull ++ ItemStack getItem(@NotNull final org.bukkit.inventory.EquipmentSlot slot); + + /** + * Sets the item the armor stand has @@ -65,13 +67,14 @@ index 859f166f..eda4873d 100644 + * @param slot the equipment slot to set + * @param item the item to hold + */ -+ void setItem(final org.bukkit.inventory.EquipmentSlot slot, final ItemStack item); ++ void setItem(@NotNull final org.bukkit.inventory.EquipmentSlot slot, @Nullable final ItemStack item); + + /** + * Get the list of disabled slots + * + * @return list of disabled slots + */ ++ @NotNull + java.util.Set getDisabledSlots(); + + /** @@ -82,7 +85,7 @@ index 859f166f..eda4873d 100644 + * + * @param slots var-arg array of slots to lock + */ -+ void setDisabledSlots(org.bukkit.inventory.EquipmentSlot... slots); ++ void setDisabledSlots(@NotNull org.bukkit.inventory.EquipmentSlot... slots); + + /** + * Disable specific slots, adding them @@ -93,7 +96,7 @@ index 859f166f..eda4873d 100644 + * + * @param slots var-arg array of slots to lock + */ -+ void addDisabledSlots(final org.bukkit.inventory.EquipmentSlot... slots); ++ void addDisabledSlots(@NotNull final org.bukkit.inventory.EquipmentSlot... slots); + + /** + * Remove the given slots from the disabled @@ -103,7 +106,7 @@ index 859f166f..eda4873d 100644 + * + * @param slots var-arg array of slots to unlock + */ -+ void removeDisabledSlots(final org.bukkit.inventory.EquipmentSlot... slots); ++ void removeDisabledSlots(@NotNull final org.bukkit.inventory.EquipmentSlot... slots); + + /** + * Check if a specific slot is disabled @@ -111,7 +114,7 @@ index 859f166f..eda4873d 100644 + * @param slot The slot to check + * @return {@code true} if the slot is disabled, else {@code false}. + */ -+ boolean isSlotDisabled(org.bukkit.inventory.EquipmentSlot slot); ++ boolean isSlotDisabled(@NotNull org.bukkit.inventory.EquipmentSlot slot); // Paper end } -- \ No newline at end of file diff --git a/Spigot-API-Patches/Expand-Explosions-API.patch b/Spigot-API-Patches/Expand-Explosions-API.patch index 166dce4ec3..754d6c0097 100644 --- a/Spigot-API-Patches/Expand-Explosions-API.patch +++ b/Spigot-API-Patches/Expand-Explosions-API.patch @@ -6,12 +6,20 @@ Subject: [PATCH] Expand Explosions API Add Entity as a Source capability, and add more API choices, and on Location. diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java -index 162a76e8..056a4d6b 100644 +index 3387fb477..56be7e5fa 100644 --- a/src/main/java/org/bukkit/Location.java +++ b/src/main/java/org/bukkit/Location.java +@@ -0,0 +0,0 @@ import java.util.Map; + + import org.bukkit.block.Block; + import org.bukkit.configuration.serialization.ConfigurationSerializable; ++import org.bukkit.entity.Entity; // Paper + import org.bukkit.util.NumberConversions; + import org.bukkit.util.Vector; + import org.jetbrains.annotations.NotNull; @@ -0,0 +0,0 @@ public class Location implements Cloneable, ConfigurationSerializable { - } - return world.getNearbyEntitiesByType(clazz, this, xRadius, yRadius, zRadius, predicate); + centerLoc.setZ(getBlockZ() + 0.5); + return centerLoc; } + + /** @@ -62,7 +70,7 @@ index 162a76e8..056a4d6b 100644 + * @param power The power of explosion, where 4F is TNT + * @return false if explosion was canceled, otherwise true + */ -+ public boolean createExplosion(Entity source, float power) { ++ public boolean createExplosion(@Nullable Entity source, float power) { + return world.createExplosion(source, this, power, true, true); + } + @@ -77,7 +85,7 @@ index 162a76e8..056a4d6b 100644 + * @param setFire Whether or not to set blocks on fire + * @return false if explosion was canceled, otherwise true + */ -+ public boolean createExplosion(Entity source, float power, boolean setFire) { ++ public boolean createExplosion(@Nullable Entity source, float power, boolean setFire) { + return world.createExplosion(source, this, power, setFire, true); + } + @@ -91,19 +99,19 @@ index 162a76e8..056a4d6b 100644 + * @param breakBlocks Whether or not to have blocks be destroyed + * @return false if explosion was canceled, otherwise true + */ -+ public boolean createExplosion(Entity source, float power, boolean setFire, boolean breakBlocks) { ++ public boolean createExplosion(@NotNull Entity source, float power, boolean setFire, boolean breakBlocks) { + return world.createExplosion(source, source.getLocation(), power, setFire, breakBlocks); + } // Paper end @Override public boolean equals(Object obj) { diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 6b7eeeac..c73b7065 100644 +index bec405feb..dcc47cde5 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable { */ - public boolean createExplosion(Location loc, float power, boolean setFire); + public boolean createExplosion(@NotNull Location loc, float power, boolean setFire); + // Paper start + /** @@ -117,7 +125,7 @@ index 6b7eeeac..c73b7065 100644 + * @param breakBlocks Whether or not to have blocks be destroyed + * @return false if explosion was canceled, otherwise true + */ -+ public boolean createExplosion(Entity source, Location loc, float power, boolean setFire, boolean breakBlocks); ++ public boolean createExplosion(@Nullable Entity source, @NotNull Location loc, float power, boolean setFire, boolean breakBlocks); + + /** + * Creates explosion at given location with given power and optionally @@ -131,7 +139,7 @@ index 6b7eeeac..c73b7065 100644 + * @param setFire Whether or not to set blocks on fire + * @return false if explosion was canceled, otherwise true + */ -+ public default boolean createExplosion(Entity source, Location loc, float power, boolean setFire) { ++ public default boolean createExplosion(@Nullable Entity source, @NotNull Location loc, float power, boolean setFire) { + return createExplosion(source, loc, power, setFire, true); + } + /** @@ -143,7 +151,7 @@ index 6b7eeeac..c73b7065 100644 + * @param power The power of explosion, where 4F is TNT + * @return false if explosion was canceled, otherwise true + */ -+ public default boolean createExplosion(Entity source, Location loc, float power) { ++ public default boolean createExplosion(@Nullable Entity source, @NotNull Location loc, float power) { + return createExplosion(source, loc, power, true, true); + } + /** @@ -156,7 +164,7 @@ index 6b7eeeac..c73b7065 100644 + * @param breakBlocks Whether or not to have blocks be destroyed + * @return false if explosion was canceled, otherwise true + */ -+ public default boolean createExplosion(Entity source, float power, boolean setFire, boolean breakBlocks) { ++ public default boolean createExplosion(@NotNull Entity source, float power, boolean setFire, boolean breakBlocks) { + return createExplosion(source, source.getLocation(), power, setFire, breakBlocks); + } + /** @@ -170,7 +178,7 @@ index 6b7eeeac..c73b7065 100644 + * @param setFire Whether or not to set blocks on fire + * @return false if explosion was canceled, otherwise true + */ -+ public default boolean createExplosion(Entity source, float power, boolean setFire) { ++ public default boolean createExplosion(@NotNull Entity source, float power, boolean setFire) { + return createExplosion(source, source.getLocation(), power, setFire, true); + } + @@ -182,7 +190,7 @@ index 6b7eeeac..c73b7065 100644 + * @param power The power of explosion, where 4F is TNT + * @return false if explosion was canceled, otherwise true + */ -+ public default boolean createExplosion(Entity source, float power) { ++ public default boolean createExplosion(@NotNull Entity source, float power) { + return createExplosion(source, source.getLocation(), power, true, true); + } + @@ -196,7 +204,7 @@ index 6b7eeeac..c73b7065 100644 + * @param breakBlocks Whether or not to have blocks be destroyed + * @return false if explosion was canceled, otherwise true + */ -+ public default boolean createExplosion(Location loc, float power, boolean setFire, boolean breakBlocks) { ++ public default boolean createExplosion(@NotNull Location loc, float power, boolean setFire, boolean breakBlocks) { + return createExplosion(loc.getX(), loc.getY(), loc.getZ(), power, setFire, breakBlocks); + } + // Paper end diff --git a/Spigot-API-Patches/Expand-Location-Manipulation-API.patch b/Spigot-API-Patches/Expand-Location-Manipulation-API.patch index 871d24565d..0e0c850832 100644 --- a/Spigot-API-Patches/Expand-Location-Manipulation-API.patch +++ b/Spigot-API-Patches/Expand-Location-Manipulation-API.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Expand Location Manipulation API Adds set(x, y, z), add(base, x, y, z), subtract(base, x, y, z); diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java -index 056a4d6b..8dcb15fb 100644 +index 56be7e5fa..d38f15142 100644 --- a/src/main/java/org/bukkit/Location.java +++ b/src/main/java/org/bukkit/Location.java @@ -0,0 +0,0 @@ public class Location implements Cloneable, ConfigurationSerializable { @@ -23,6 +23,7 @@ index 056a4d6b..8dcb15fb 100644 + * @param z Z coordinate + * @return self (not cloned) + */ ++ @NotNull + public Location set(double x, double y, double z) { + this.x = x; + this.y = y; @@ -40,7 +41,8 @@ index 056a4d6b..8dcb15fb 100644 + * @param z Z coordinate to add to base + * @return self (not cloned) + */ -+ public Location add(Location base, double x, double y, double z) { ++ @NotNull ++ public Location add(@NotNull Location base, double x, double y, double z) { + return this.set(base.x + x, base.y + y, base.z + z); + } + @@ -54,7 +56,8 @@ index 056a4d6b..8dcb15fb 100644 + * @param z Z coordinate to subtract from base + * @return self (not cloned) + */ -+ public Location subtract(Location base, double x, double y, double z) { ++ @NotNull ++ public Location subtract(@NotNull Location base, double x, double y, double z) { + return this.set(base.x - x, base.y - y, base.z - z); + } + diff --git a/Spigot-API-Patches/Expand-World.spawnParticle-API-and-add-Builder.patch b/Spigot-API-Patches/Expand-World.spawnParticle-API-and-add-Builder.patch index 27beee4cc1..2ba44af315 100644 --- a/Spigot-API-Patches/Expand-World.spawnParticle-API-and-add-Builder.patch +++ b/Spigot-API-Patches/Expand-World.spawnParticle-API-and-add-Builder.patch @@ -10,7 +10,7 @@ This adds a new Builder API which is much friendlier to use. diff --git a/src/main/java/com/destroystokyo/paper/ParticleBuilder.java b/src/main/java/com/destroystokyo/paper/ParticleBuilder.java new file mode 100644 -index 00000000..50b52d6b +index 000000000..06f1602f5 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/ParticleBuilder.java @@ -0,0 +0,0 @@ @@ -24,9 +24,10 @@ index 00000000..50b52d6b +import org.bukkit.entity.Player; +import org.bukkit.util.NumberConversions; + -+import javax.annotation.Nullable; +import java.util.Collection; +import java.util.List; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * Helps prepare a particle to be sent to players. @@ -34,6 +35,7 @@ index 00000000..50b52d6b + * Usage of the builder is preferred over the super long {@link World#spawnParticle(Particle, Location, int, double, double, double, double, Object)} API + */ +public class ParticleBuilder { ++ + private Particle particle; + private List receivers; + private Player source; @@ -44,16 +46,17 @@ index 00000000..50b52d6b + private Object data; + private boolean force = true; + -+ public ParticleBuilder(Particle particle) { ++ public ParticleBuilder(@NotNull Particle particle) { + this.particle = particle; + } + + /** -+ * Sends the particle to all receiving players (or all). -+ * This method is safe to use Asynchronously ++ * Sends the particle to all receiving players (or all). This method is safe to use ++ * Asynchronously + * + * @return a reference to this object. + */ ++ @NotNull + public ParticleBuilder spawn() { + if (this.location == null) { + throw new IllegalStateException("Please specify location for this particle"); @@ -68,16 +71,19 @@ index 00000000..50b52d6b + /** + * @return The particle going to be sent + */ ++ @NotNull + public Particle particle() { + return particle; + } + + /** + * Changes what particle will be sent ++ * + * @param particle The particle + * @return a reference to this object. + */ -+ public ParticleBuilder particle(Particle particle) { ++ @NotNull ++ public ParticleBuilder particle(@NotNull Particle particle) { + this.particle = particle; + return this; + } @@ -93,31 +99,35 @@ index 00000000..50b52d6b + /** + * Example use: + * -+ * builder.receivers(16); -+ * if (builder.hasReceivers()) { -+ * sendParticleAsync(builder); -+ * } ++ * builder.receivers(16); if (builder.hasReceivers()) { sendParticleAsync(builder); } ++ * + * @return If this particle is going to be sent to someone + */ + public boolean hasReceivers() { -+ return (receivers == null && !location.getWorld().getPlayers().isEmpty()) || (receivers != null && !receivers.isEmpty()); ++ return (receivers == null && !location.getWorld().getPlayers().isEmpty()) || ( ++ receivers != null && !receivers.isEmpty()); + } + + /** -+ * Sends this particle to all players in the world. This is rather silly and you should likely not be doing this. ++ * Sends this particle to all players in the world. This is rather silly and you should likely not ++ * be doing this. + * + * Just be a logical person and use receivers by radius or collection. ++ * + * @return a reference to this object. + */ ++ @NotNull + public ParticleBuilder allPlayers() { -+ this.receivers = null; -+ return this; ++ this.receivers = null; ++ return this; + } + + /** -+ * @param receivers List of players to receive this particle, or null for all players in the world ++ * @param receivers List of players to receive this particle, or null for all players in the ++ * world + * @return a reference to this object. + */ ++ @NotNull + public ParticleBuilder receivers(@Nullable List receivers) { + // Had to keep this as we first made API List<> and not Collection, but removing this may break plugins compiled on older jars + // TODO: deprecate? @@ -126,48 +136,57 @@ index 00000000..50b52d6b + } + + /** -+ * @param receivers List of players to receive this particle, or null for all players in the world ++ * @param receivers List of players to receive this particle, or null for all players in the ++ * world + * @return a reference to this object. + */ ++ @NotNull + public ParticleBuilder receivers(@Nullable Collection receivers) { + this.receivers = receivers != null ? Lists.newArrayList(receivers) : null; + return this; + } + + /** -+ * @param receivers List of players to be receive this particle, or null for all players in the world ++ * @param receivers List of players to be receive this particle, or null for all players in the ++ * world + * @return a reference to this object. + */ -+ public ParticleBuilder receivers(Player... receivers) { ++ @NotNull ++ public ParticleBuilder receivers(@Nullable Player... receivers) { + this.receivers = receivers != null ? Lists.newArrayList(receivers) : null; + return this; + } + + /** -+ * Selects all players within a cuboid selection around the particle location, within the specified bounding box. -+ * If you want a more spherical check, see {@link #receivers(int, boolean)} ++ * Selects all players within a cuboid selection around the particle location, within the ++ * specified bounding box. If you want a more spherical check, see {@link #receivers(int, ++ * boolean)} + * + * @param radius amount to add on all axis + * @return a reference to this object. + */ ++ @NotNull + public ParticleBuilder receivers(int radius) { + return receivers(radius, radius); + } + + /** -+ * Selects all players within the specified radius around the particle location. -+ * If byDistance is false, behavior uses cuboid selection the same as {@link #receivers(int, int)} -+ * If byDistance is true, radius is tested by distance in a spherical shape -+ * @param radius amount to add on each axis ++ * Selects all players within the specified radius around the particle location. If byDistance is ++ * false, behavior uses cuboid selection the same as {@link #receivers(int, int)} If byDistance is ++ * true, radius is tested by distance in a spherical shape ++ * ++ * @param radius amount to add on each axis + * @param byDistance true to use a spherical radius, false to use a cuboid + * @return a reference to this object. + */ ++ @NotNull + public ParticleBuilder receivers(int radius, boolean byDistance) { + if (!byDistance) { + return receivers(radius, radius, radius); + } else { + this.receivers = Lists.newArrayList(); -+ for (Player nearbyPlayer : location.getWorld().getNearbyPlayers(location, radius, radius, radius)) { ++ for (Player nearbyPlayer : location.getWorld() ++ .getNearbyPlayers(location, radius, radius, radius)) { + Location loc = nearbyPlayer.getLocation(); + double x = NumberConversions.square(location.getX() - loc.getX()); + double y = NumberConversions.square(location.getY() - loc.getY()); @@ -182,34 +201,38 @@ index 00000000..50b52d6b + } + + /** -+ * Selects all players within a cuboid selection around the particle location, within the specified bounding box. -+ * Allows specifying a different Y size than X and Z -+ * If you want a more cylinder check, see {@link #receivers(int, int, boolean)} -+ * If you want a more spherical check, see {@link #receivers(int, boolean)} ++ * Selects all players within a cuboid selection around the particle location, within the ++ * specified bounding box. Allows specifying a different Y size than X and Z If you want a more ++ * cylinder check, see {@link #receivers(int, int, boolean)} If you want a more spherical check, ++ * see {@link #receivers(int, boolean)} + * + * @param xzRadius amount to add on the x/z axis + * @param yRadius amount to add on the y axis + * @return a reference to this object. + */ ++ @NotNull + public ParticleBuilder receivers(int xzRadius, int yRadius) { + return receivers(xzRadius, yRadius, xzRadius); + } + + /** -+ * Selects all players within the specified radius around the particle location. -+ * If byDistance is false, behavior uses cuboid selection the same as {@link #receivers(int, int)} -+ * If byDistance is true, radius is tested by distance on the y plane and on the x/z plane, in a cylinder shape. ++ * Selects all players within the specified radius around the particle location. If byDistance is ++ * false, behavior uses cuboid selection the same as {@link #receivers(int, int)} If byDistance is ++ * true, radius is tested by distance on the y plane and on the x/z plane, in a cylinder shape. ++ * + * @param xzRadius amount to add on the x/z axis + * @param yRadius amount to add on the y axis + * @param byDistance true to use a cylinder shape, false to use cuboid + * @return a reference to this object. + */ ++ @NotNull + public ParticleBuilder receivers(int xzRadius, int yRadius, boolean byDistance) { + if (!byDistance) { + return receivers(xzRadius, yRadius, xzRadius); + } else { + this.receivers = Lists.newArrayList(); -+ for (Player nearbyPlayer : location.getWorld().getNearbyPlayers(location, xzRadius, yRadius, xzRadius)) { ++ for (Player nearbyPlayer : location.getWorld() ++ .getNearbyPlayers(location, xzRadius, yRadius, xzRadius)) { + Location loc = nearbyPlayer.getLocation(); + if (Math.abs(loc.getY() - this.location.getY()) > yRadius) { + continue; @@ -226,15 +249,16 @@ index 00000000..50b52d6b + } + + /** -+ * Selects all players within a cuboid selection around the particle location, within the specified bounding box. -+ * If you want a more cylinder check, see {@link #receivers(int, int, boolean)} -+ * If you want a more spherical check, see {@link #receivers(int, boolean)} ++ * Selects all players within a cuboid selection around the particle location, within the ++ * specified bounding box. If you want a more cylinder check, see {@link #receivers(int, int, ++ * boolean)} If you want a more spherical check, see {@link #receivers(int, boolean)} + * + * @param xRadius amount to add on the x axis + * @param yRadius amount to add on the y axis + * @param zRadius amount to add on the z axis + * @return a reference to this object. + */ ++ @NotNull + public ParticleBuilder receivers(int xRadius, int yRadius, int zRadius) { + if (location == null) { + throw new IllegalStateException("Please set location first"); @@ -245,16 +269,19 @@ index 00000000..50b52d6b + /** + * @return The player considered the source of this particle (for Visibility concerns), or null + */ ++ @Nullable + public Player source() { + return source; + } + + /** + * Sets the source of this particle for visibility concerns (Vanish API) ++ * + * @param source The player who is considered the source + * @return a reference to this object. + */ -+ public ParticleBuilder source(Player source) { ++ @NotNull ++ public ParticleBuilder source(@Nullable Player source) { + this.source = source; + return this; + } @@ -262,29 +289,34 @@ index 00000000..50b52d6b + /** + * @return Location of where the particle will spawn + */ ++ @Nullable + public Location location() { + return location; + } + + /** + * Sets the location of where to spawn the particle ++ * + * @param location The location of the particle + * @return a reference to this object. + */ -+ public ParticleBuilder location(Location location) { ++ @NotNull ++ public ParticleBuilder location(@NotNull Location location) { + this.location = location.clone(); + return this; + } + + /** + * Sets the location of where to spawn the particle ++ * + * @param world World to spawn particle in + * @param x X location + * @param y Y location + * @param z Z location + * @return a reference to this object. + */ -+ public ParticleBuilder location(World world, double x, double y, double z) { ++ @NotNull ++ public ParticleBuilder location(@NotNull World world, double x, double y, double z) { + this.location = new Location(world, x, y, z); + return this; + } @@ -298,9 +330,11 @@ index 00000000..50b52d6b + + /** + * Sets the number of particles to spawn ++ * + * @param count Number of particles + * @return a reference to this object. + */ ++ @NotNull + public ParticleBuilder count(int count) { + this.count = count; + return this; @@ -308,20 +342,25 @@ index 00000000..50b52d6b + + /** + * Particle offset X. Varies by particle on how this is used ++ * + * @return Particle offset X. + */ + public double offsetX() { + return offsetX; + } ++ + /** + * Particle offset Y. Varies by particle on how this is used ++ * + * @return Particle offset Y. + */ + public double offsetY() { + return offsetY; + } ++ + /** + * Particle offset Z. Varies by particle on how this is used ++ * + * @return Particle offset Z. + */ + public double offsetZ() { @@ -330,11 +369,13 @@ index 00000000..50b52d6b + + /** + * Sets the particle offset. Varies by particle on how this is used ++ * + * @param offsetX Particle offset X + * @param offsetY Particle offset Y + * @param offsetZ Particle offset Z + * @return a reference to this object. + */ ++ @NotNull + public ParticleBuilder offset(double offsetX, double offsetY, double offsetZ) { + this.offsetX = offsetX; + this.offsetY = offsetY; @@ -344,6 +385,7 @@ index 00000000..50b52d6b + + /** + * Gets the Particle extra data. Varies by particle on how this is used ++ * + * @return the extra particle data + */ + public double extra() { @@ -352,9 +394,11 @@ index 00000000..50b52d6b + + /** + * Sets the particle extra data. Varies by particle on how this is used ++ * + * @param extra the extra particle data + * @return a reference to this object. + */ ++ @NotNull + public ParticleBuilder extra(double extra) { + this.extra = extra; + return this; @@ -362,9 +406,11 @@ index 00000000..50b52d6b + + /** + * Gets the particle custom data. Varies by particle on how this is used ++ * + * @param The Particle data type + * @return the ParticleData for this particle + */ ++ @Nullable + public T data() { + //noinspection unchecked + return (T) data; @@ -372,49 +418,64 @@ index 00000000..50b52d6b + + /** + * Sets the particle custom data. Varies by particle on how this is used ++ * + * @param data The new particle data + * @param The Particle data type + * @return a reference to this object. + */ -+ public ParticleBuilder data(T data) { ++ @NotNull ++ public ParticleBuilder data(@Nullable T data) { + this.data = data; + return this; + } + + /** -+ * Sets whether the particle is forcefully shown to the player. -+ * If forced, the particle will show faraway, as far as the player's view distance allows. -+ * If false, the particle will show according to the client's particle settings. ++ * Sets whether the particle is forcefully shown to the player. If forced, the particle will show ++ * faraway, as far as the player's view distance allows. If false, the particle will show ++ * according to the client's particle settings. + * + * @param force true to force, false for normal + * @return a reference to this object. + */ ++ @NotNull + public ParticleBuilder force(boolean force) { + this.force = force; + return this; + } + + /** -+ * Sets the particle Color. -+ * Only valid for REDSTONE. ++ * Sets the particle Color. Only valid for REDSTONE. ++ * + * @param color the new particle color + * @return a reference to this object. + */ -+ public ParticleBuilder color(Color color) { ++ @NotNull ++ public ParticleBuilder color(@Nullable Color color) { + return color(color, 1); + } + + /** -+ * Sets the particle Color and size. -+ * Only valid for REDSTONE. ++ * Sets the particle Color and size. Only valid for REDSTONE. ++ * + * @param color the new particle color + * @param size the size of the particle + * @return a reference to this object. + */ -+ public ParticleBuilder color(Color color, float size) { -+ if (particle != Particle.REDSTONE) { ++ @NotNull ++ public ParticleBuilder color(@Nullable Color color, float size) { ++ if (particle != Particle.REDSTONE && color != null) { + throw new IllegalStateException("Color may only be set on REDSTONE"); + } ++ ++ // We don't officially support reusing these objects, but here we go ++ if (color == null) { ++ if (data instanceof Particle.DustOptions) { ++ return data(null); ++ } else { ++ return this; ++ } ++ } ++ + return data(new Particle.DustOptions(color, size)); + } + @@ -426,12 +487,13 @@ index 00000000..50b52d6b + * @param b blue color component + * @return a reference to this object. + */ ++ @NotNull + public ParticleBuilder color(int r, int g, int b) { + return color(Color.fromRGB(r, g, b)); + } +} diff --git a/src/main/java/org/bukkit/Particle.java b/src/main/java/org/bukkit/Particle.java -index 4d0acaf5..827aa00c 100644 +index 3b2314a94..a919c6d5b 100644 --- a/src/main/java/org/bukkit/Particle.java +++ b/src/main/java/org/bukkit/Particle.java @@ -0,0 +0,0 @@ public enum Particle { @@ -444,6 +506,7 @@ index 4d0acaf5..827aa00c 100644 + * + * @return a {@link com.destroystokyo.paper.ParticleBuilder} for the particle + */ ++ @NotNull + public com.destroystokyo.paper.ParticleBuilder builder() { + return new com.destroystokyo.paper.ParticleBuilder(this); + } @@ -452,15 +515,15 @@ index 4d0acaf5..827aa00c 100644 * Options which can be applied to redstone dust particles - a particle * color and size. diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index bc6a51d7..6b7eeeac 100644 +index 0dcdbb59a..bec405feb 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable { * the type of this depends on {@link Particle#getDataType()} * @param Type */ -- public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data); -+ public default void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) { spawnParticle(particle, null, null, x, y, z, count, offsetX, offsetY, offsetZ, extra, data, true); }// Paper start - Expand Particle API +- public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data); ++ public default void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data) { spawnParticle(particle, null, null, x, y, z, count, offsetX, offsetY, offsetZ, extra, data, true); }// Paper start - Expand Particle API + /** + * Spawns the particle (the number of times specified by count) + * at the target location. The position of each particle will be @@ -483,7 +546,7 @@ index bc6a51d7..6b7eeeac 100644 + * the type of this depends on {@link Particle#getDataType()} + * @param Type + */ -+ public default void spawnParticle(Particle particle, List receivers, Player source, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) { spawnParticle(particle, receivers, source, x, y, z, count, offsetX, offsetY, offsetZ, extra, data, true); } ++ public default void spawnParticle(@NotNull Particle particle, @Nullable List receivers, @NotNull Player source, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data) { spawnParticle(particle, receivers, source, x, y, z, count, offsetX, offsetY, offsetZ, extra, data, true); } + /** + * Spawns the particle (the number of times specified by count) + * at the target location. The position of each particle will be @@ -508,7 +571,7 @@ index bc6a51d7..6b7eeeac 100644 + * @param force allows the particle to be seen further away from the player + * and shows to players using any vanilla client particle settings + */ -+ public void spawnParticle(Particle particle, List receivers, Player source, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force); ++ public void spawnParticle(@NotNull Particle particle, @Nullable List receivers, @Nullable Player source, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data, boolean force); + // Paper end + diff --git a/Spigot-API-Patches/ExperienceOrbMergeEvent.patch b/Spigot-API-Patches/ExperienceOrbMergeEvent.patch index 53af2d3144..3669af137e 100644 --- a/Spigot-API-Patches/ExperienceOrbMergeEvent.patch +++ b/Spigot-API-Patches/ExperienceOrbMergeEvent.patch @@ -9,7 +9,7 @@ metadata such as spawn reason, or conditionally move data from source to target. diff --git a/src/main/java/com/destroystokyo/paper/event/entity/ExperienceOrbMergeEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/ExperienceOrbMergeEvent.java new file mode 100644 -index 00000000..fb5b4b86 +index 000000000..0ce3e3977 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/ExperienceOrbMergeEvent.java @@ -0,0 +0,0 @@ @@ -42,15 +42,16 @@ index 00000000..fb5b4b86 +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.EntityEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired anytime the server is about to merge 2 experience orbs into one + */ +public class ExperienceOrbMergeEvent extends EntityEvent implements Cancellable { -+ private final ExperienceOrb mergeTarget; -+ private final ExperienceOrb mergeSource; ++ @NotNull private final ExperienceOrb mergeTarget; ++ @NotNull private final ExperienceOrb mergeSource; + -+ public ExperienceOrbMergeEvent(ExperienceOrb mergeTarget, ExperienceOrb mergeSource) { ++ public ExperienceOrbMergeEvent(@NotNull ExperienceOrb mergeTarget, @NotNull ExperienceOrb mergeSource) { + super(mergeTarget); + this.mergeTarget = mergeTarget; + this.mergeSource = mergeSource; @@ -59,6 +60,7 @@ index 00000000..fb5b4b86 + /** + * @return The orb that will absorb the other experience orb + */ ++ @NotNull + public ExperienceOrb getMergeTarget() { + return mergeTarget; + } @@ -66,16 +68,19 @@ index 00000000..fb5b4b86 + /** + * @return The orb that is subject to being removed and merged into the target orb + */ ++ @NotNull + public ExperienceOrb getMergeSource() { + return mergeSource; + } + + private static final HandlerList handlers = new HandlerList(); + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } diff --git a/Spigot-API-Patches/ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch b/Spigot-API-Patches/ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch index c4f10130ce..aabfdbe359 100644 --- a/Spigot-API-Patches/ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch +++ b/Spigot-API-Patches/ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch @@ -8,13 +8,14 @@ Adds lots of information about why this orb exists. Replaces isFromBottle() with logic that persists entity reloads too. diff --git a/src/main/java/org/bukkit/entity/ExperienceOrb.java b/src/main/java/org/bukkit/entity/ExperienceOrb.java -index c286edfd..f847543b 100644 +index c286edfd8..57029d9bc 100644 --- a/src/main/java/org/bukkit/entity/ExperienceOrb.java +++ b/src/main/java/org/bukkit/entity/ExperienceOrb.java @@ -0,0 +0,0 @@ package org.bukkit.entity; -+import javax.annotation.Nullable; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; // Paper + /** * Represents an Experience Orb. @@ -111,6 +112,7 @@ index c286edfd..f847543b 100644 + * do not know, such as orbs spawned before this API was added, UNKNOWN is returned. + * @return The reason for this orb being spawned. + */ ++ @NotNull + SpawnReason getSpawnReason(); + // Paper end } diff --git a/Spigot-API-Patches/Expose-WorldBorder-isInBounds-Location-check.patch b/Spigot-API-Patches/Expose-WorldBorder-isInBounds-Location-check.patch index b9bffe75b0..79ae3384e4 100644 --- a/Spigot-API-Patches/Expose-WorldBorder-isInBounds-Location-check.patch +++ b/Spigot-API-Patches/Expose-WorldBorder-isInBounds-Location-check.patch @@ -5,13 +5,13 @@ Subject: [PATCH] Expose WorldBorder#isInBounds(Location) check diff --git a/src/main/java/org/bukkit/WorldBorder.java b/src/main/java/org/bukkit/WorldBorder.java -index 4dc18edc..41b7fae6 100644 +index 7e8f5649..afb7b136 100644 --- a/src/main/java/org/bukkit/WorldBorder.java +++ b/src/main/java/org/bukkit/WorldBorder.java @@ -0,0 +0,0 @@ public interface WorldBorder { * @return if this location is inside the border or not */ - public boolean isInside(Location location); + public boolean isInside(@NotNull Location location); + + // Paper start + /** @@ -22,7 +22,7 @@ index 4dc18edc..41b7fae6 100644 + * @deprecated use {@link #isInside(Location)} for an upstream compatible replacement + */ + @Deprecated -+ public default boolean isInBounds(Location location) { ++ public default boolean isInBounds(@NotNull Location location) { + return this.isInside(location); + } + // Paper end diff --git a/Spigot-API-Patches/Expose-attack-cooldown-methods-for-Player.patch b/Spigot-API-Patches/Expose-attack-cooldown-methods-for-Player.patch deleted file mode 100644 index 3a4ab0bd70..0000000000 --- a/Spigot-API-Patches/Expose-attack-cooldown-methods-for-Player.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: BillyGalbreath -Date: Tue, 4 Sep 2018 15:01:54 -0500 -Subject: [PATCH] Expose attack cooldown methods for Player - - -diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index ddf226a4..db6bcae5 100644 ---- a/src/main/java/org/bukkit/entity/Player.java -+++ b/src/main/java/org/bukkit/entity/Player.java -@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM - * @param profile The new profile to use - */ - void setPlayerProfile(PlayerProfile profile); -+ -+ /** -+ * Returns the amount of ticks the current cooldown lasts -+ * -+ * @return Amount of ticks cooldown will last -+ */ -+ float getCooldownPeriod(); -+ -+ /** -+ * Returns the percentage of attack power available based on the cooldown (zero to one). -+ * -+ * @param adjustTicks Amount of ticks to add to cooldown counter for this calculation -+ * @return Percentage of attack power available -+ */ -+ float getCooledAttackStrength(float adjustTicks); -+ -+ /** -+ * Reset the cooldown counter to 0, effectively starting the cooldown period. -+ */ -+ void resetCooldown(); - // Paper end - - // Spigot start --- \ No newline at end of file diff --git a/Spigot-API-Patches/Expose-client-protocol-version-and-virtual-host.patch b/Spigot-API-Patches/Expose-client-protocol-version-and-virtual-host.patch index 9d3a36828f..9140cd23c8 100644 --- a/Spigot-API-Patches/Expose-client-protocol-version-and-virtual-host.patch +++ b/Spigot-API-Patches/Expose-client-protocol-version-and-virtual-host.patch @@ -11,7 +11,7 @@ Add a NetworkClient interface that provides access to: diff --git a/src/main/java/com/destroystokyo/paper/network/NetworkClient.java b/src/main/java/com/destroystokyo/paper/network/NetworkClient.java new file mode 100644 -index 00000000..9072e384 +index 000000000..7b2af1bd7 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/network/NetworkClient.java @@ -0,0 +0,0 @@ @@ -19,7 +19,8 @@ index 00000000..9072e384 + +import java.net.InetSocketAddress; + -+import javax.annotation.Nullable; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * Represents a client connected to the server. @@ -31,6 +32,7 @@ index 00000000..9072e384 + * + * @return The client's socket address + */ ++ @NotNull + InetSocketAddress getAddress(); + + /** @@ -55,10 +57,10 @@ index 00000000..9072e384 + +} diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index bf284f2c..5e65657a 100644 +index 4b59f8feb..eeed2e796 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -0,0 +0,0 @@ import org.bukkit.scoreboard.Scoreboard; +@@ -0,0 +0,0 @@ import org.jetbrains.annotations.Nullable; /** * Represents a player, connected or not */ diff --git a/Spigot-API-Patches/Expose-server-CommandMap.patch b/Spigot-API-Patches/Expose-server-CommandMap.patch index f520b7acfc..38dcd71406 100644 --- a/Spigot-API-Patches/Expose-server-CommandMap.patch +++ b/Spigot-API-Patches/Expose-server-CommandMap.patch @@ -5,29 +5,31 @@ Subject: [PATCH] Expose server CommandMap diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 6055c801..cb7dc068 100644 +index 2ad9a7d7f..3a80f2e29 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java @@ -0,0 +0,0 @@ public final class Bukkit { return server.getUnsafe(); } ++ + // Paper start + /** + * Gets the active {@link org.bukkit.command.CommandMap} + * + * @return the active command map + */ ++ @NotNull + public static org.bukkit.command.CommandMap getCommandMap() { + return server.getCommandMap(); + } + // Paper end + + @NotNull public static Server.Spigot spigot() { - return server.spigot(); diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 1632af18..c4dc1de2 100644 +index 3ad70b92f..4c3156071 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient { @@ -40,6 +42,7 @@ index 1632af18..c4dc1de2 100644 + * + * @return the active command map + */ ++ @NotNull + org.bukkit.command.CommandMap getCommandMap(); + /** diff --git a/Spigot-API-Patches/Fill-Profile-Property-Events.patch b/Spigot-API-Patches/Fill-Profile-Property-Events.patch index 2280ad6032..67c028fc69 100644 --- a/Spigot-API-Patches/Fill-Profile-Property-Events.patch +++ b/Spigot-API-Patches/Fill-Profile-Property-Events.patch @@ -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 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 properties) { ++ public void setProperties(@NotNull Collection properties) { + profile.setProperties(properties); + } + + private static final HandlerList handlers = new HandlerList(); + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } diff --git a/Spigot-API-Patches/Fireworks-API-s.patch b/Spigot-API-Patches/Fireworks-API-s.patch index 187260ad3f..18357b30d9 100644 --- a/Spigot-API-Patches/Fireworks-API-s.patch +++ b/Spigot-API-Patches/Fireworks-API-s.patch @@ -7,14 +7,15 @@ Get the Entity being boosted Get the firework launcher diff --git a/src/main/java/org/bukkit/entity/Firework.java b/src/main/java/org/bukkit/entity/Firework.java -index b8a8c075..8c087bb7 100644 +index 1c55f0338..7df26cf7f 100644 --- a/src/main/java/org/bukkit/entity/Firework.java +++ b/src/main/java/org/bukkit/entity/Firework.java @@ -0,0 +0,0 @@ package org.bukkit.entity; - import org.bukkit.inventory.meta.FireworkMeta; + import org.jetbrains.annotations.NotNull; +import java.util.UUID; ++import org.jetbrains.annotations.Nullable; + public interface Firework extends Entity { @@ -25,11 +26,13 @@ index b8a8c075..8c087bb7 100644 void detonate(); + + // Paper start ++ @Nullable + public UUID getSpawningEntity(); + /** + * If this firework is boosting an entity, return it + * @return The entity being boosted + */ ++ @Nullable + public LivingEntity getBoostedEntity(); + // Paper end } diff --git a/Spigot-API-Patches/Fix-ServerListPingEvent-flagging-as-Async.patch b/Spigot-API-Patches/Fix-ServerListPingEvent-flagging-as-Async.patch index f1d052943a..b964a35ad8 100644 --- a/Spigot-API-Patches/Fix-ServerListPingEvent-flagging-as-Async.patch +++ b/Spigot-API-Patches/Fix-ServerListPingEvent-flagging-as-Async.patch @@ -30,13 +30,13 @@ index eb00d6af..70416c81 100644 + // Paper end } diff --git a/src/main/java/org/bukkit/event/server/ServerListPingEvent.java b/src/main/java/org/bukkit/event/server/ServerListPingEvent.java -index 343f238f..3c38d857 100644 +index d873763d..b68d7b2f 100644 --- a/src/main/java/org/bukkit/event/server/ServerListPingEvent.java +++ b/src/main/java/org/bukkit/event/server/ServerListPingEvent.java @@ -0,0 +0,0 @@ public class ServerListPingEvent extends ServerEvent implements Iterable private int maxPlayers; - public ServerListPingEvent(final InetAddress address, final String motd, final int numPlayers, final int maxPlayers) { + public ServerListPingEvent(@NotNull final InetAddress address, @NotNull final String motd, final int numPlayers, final int maxPlayers) { + super(); // Paper - Is this event being fired async? Validate.isTrue(numPlayers >= 0, "Cannot have negative number of players online", numPlayers); this.address = address; @@ -44,7 +44,7 @@ index 343f238f..3c38d857 100644 @@ -0,0 +0,0 @@ public class ServerListPingEvent extends ServerEvent implements Iterable * @param maxPlayers the max number of players */ - protected ServerListPingEvent(final InetAddress address, final String motd, final int maxPlayers) { + protected ServerListPingEvent(@NotNull final InetAddress address, @NotNull final String motd, final int maxPlayers) { + super(); // Paper - Is this event being fired async? this.numPlayers = MAGIC_PLAYER_COUNT; this.address = address; diff --git a/Spigot-API-Patches/Fix-upstream-javadoc-warnings-and-errors.patch b/Spigot-API-Patches/Fix-upstream-javadoc-warnings-and-errors.patch index 0457d38dd5..a84d7d3212 100644 --- a/Spigot-API-Patches/Fix-upstream-javadoc-warnings-and-errors.patch +++ b/Spigot-API-Patches/Fix-upstream-javadoc-warnings-and-errors.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Fix upstream javadoc warnings and errors Upstream still refuses to use Java 8 with the API so they are likely unaware these are even issues. diff --git a/src/main/java/org/bukkit/NamespacedKey.java b/src/main/java/org/bukkit/NamespacedKey.java -index 43239f84..fe8d3468 100644 +index ffebffd8b..f5e3929aa 100644 --- a/src/main/java/org/bukkit/NamespacedKey.java +++ b/src/main/java/org/bukkit/NamespacedKey.java @@ -0,0 +0,0 @@ public final class NamespacedKey { @@ -21,7 +21,7 @@ index 43239f84..fe8d3468 100644 */ @Deprecated diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 8a0f992f..d499e41b 100644 +index 846b0619a..84abeb216 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable { @@ -30,7 +30,7 @@ index 8a0f992f..d499e41b 100644 * the type of this depends on {@link Particle#getDataType()} + * @param Type */ - public void spawnParticle(Particle particle, Location location, int count, T data); + public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, @Nullable T data); @@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param count the number of particles @@ -38,7 +38,7 @@ index 8a0f992f..d499e41b 100644 * the type of this depends on {@link Particle#getDataType()} + * @param Type */ - public void spawnParticle(Particle particle, double x, double y, double z, int count, T data); + public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, @Nullable T data); @@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param offsetZ the maximum random offset on the Z axis @@ -46,7 +46,7 @@ index 8a0f992f..d499e41b 100644 * the type of this depends on {@link Particle#getDataType()} + * @param Type */ - public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, T data); + public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, @Nullable T data); @@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param offsetZ the maximum random offset on the Z axis @@ -54,7 +54,7 @@ index 8a0f992f..d499e41b 100644 * the type of this depends on {@link Particle#getDataType()} + * @param Type */ - public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, T data); + public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, @Nullable T data); @@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable { * particle used (normally speed) @@ -62,7 +62,7 @@ index 8a0f992f..d499e41b 100644 * the type of this depends on {@link Particle#getDataType()} + * @param Type */ - public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data); + public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data); @@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable { * particle used (normally speed) @@ -70,7 +70,7 @@ index 8a0f992f..d499e41b 100644 * the type of this depends on {@link Particle#getDataType()} + * @param Type */ - public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data); + public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data); @@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param force whether to send the particle to players within an extended @@ -78,7 +78,7 @@ index 8a0f992f..d499e41b 100644 * settings + * @param Particle data type */ - public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force); + public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data, boolean force); @@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param force whether to send the particle to players within an extended @@ -86,10 +86,10 @@ index 8a0f992f..d499e41b 100644 * settings + * @param Particle data type */ - public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force); + public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data, boolean force); diff --git a/src/main/java/org/bukkit/entity/AbstractHorse.java b/src/main/java/org/bukkit/entity/AbstractHorse.java -index 10757454..6d5410ea 100644 +index 2f1956724..234aa9dd2 100644 --- a/src/main/java/org/bukkit/entity/AbstractHorse.java +++ b/src/main/java/org/bukkit/entity/AbstractHorse.java @@ -0,0 +0,0 @@ public interface AbstractHorse extends Animals, Vehicle, InventoryHolder, Tameab @@ -102,7 +102,7 @@ index 10757454..6d5410ea 100644 */ @Deprecated diff --git a/src/main/java/org/bukkit/entity/AreaEffectCloud.java b/src/main/java/org/bukkit/entity/AreaEffectCloud.java -index 9a569d3a..8c5efd17 100644 +index d258e734e..123d87954 100644 --- a/src/main/java/org/bukkit/entity/AreaEffectCloud.java +++ b/src/main/java/org/bukkit/entity/AreaEffectCloud.java @@ -0,0 +0,0 @@ public interface AreaEffectCloud extends Entity { @@ -111,10 +111,10 @@ index 9a569d3a..8c5efd17 100644 * the type of this depends on {@link Particle#getDataType()} + * @param the particle data type // Paper */ - void setParticle(Particle particle, T data); + void setParticle(@NotNull Particle particle, @Nullable T data); diff --git a/src/main/java/org/bukkit/entity/Guardian.java b/src/main/java/org/bukkit/entity/Guardian.java -index 98af0563..ec6890ae 100644 +index 98af0563c..ec6890ae6 100644 --- a/src/main/java/org/bukkit/entity/Guardian.java +++ b/src/main/java/org/bukkit/entity/Guardian.java @@ -0,0 +0,0 @@ public interface Guardian extends Monster { @@ -127,7 +127,7 @@ index 98af0563..ec6890ae 100644 */ @Deprecated diff --git a/src/main/java/org/bukkit/entity/Horse.java b/src/main/java/org/bukkit/entity/Horse.java -index cfce8fa5..8660070b 100644 +index 734f5ac7b..5efa4e606 100644 --- a/src/main/java/org/bukkit/entity/Horse.java +++ b/src/main/java/org/bukkit/entity/Horse.java @@ -0,0 +0,0 @@ public interface Horse extends AbstractHorse { @@ -140,7 +140,7 @@ index cfce8fa5..8660070b 100644 */ @Deprecated diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index d9965ddc..bf284f2c 100644 +index 219556ed5..c21785d58 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM @@ -151,7 +151,7 @@ index d9965ddc..bf284f2c 100644 + * @param alternateChar Alternate symbol such as '&' * @param message The message to send */ - public void sendActionBar(char alternateChar, String message); + public void sendActionBar(char alternateChar, @NotNull String message); @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM /** * Update the subtitle of titles displayed to the player @@ -190,7 +190,7 @@ index d9965ddc..bf284f2c 100644 * the type of this depends on {@link Particle#getDataType()} + * @param Type */ - public void spawnParticle(Particle particle, Location location, int count, T data); + public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, @Nullable T data); @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * @param count the number of particles @@ -198,7 +198,7 @@ index d9965ddc..bf284f2c 100644 * the type of this depends on {@link Particle#getDataType()} + * @param Type */ - public void spawnParticle(Particle particle, double x, double y, double z, int count, T data); + public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, @Nullable T data); @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * @param offsetZ the maximum random offset on the Z axis @@ -206,7 +206,7 @@ index d9965ddc..bf284f2c 100644 * the type of this depends on {@link Particle#getDataType()} + * @param Type */ - public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, T data); + public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, @Nullable T data); @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * @param offsetZ the maximum random offset on the Z axis @@ -214,7 +214,7 @@ index d9965ddc..bf284f2c 100644 * the type of this depends on {@link Particle#getDataType()} + * @param Type */ - public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, T data); + public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, @Nullable T data); @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * particle used (normally speed) @@ -222,7 +222,7 @@ index d9965ddc..bf284f2c 100644 * the type of this depends on {@link Particle#getDataType()} + * @param Type */ - public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data); + public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data); @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * particle used (normally speed) @@ -230,10 +230,10 @@ index d9965ddc..bf284f2c 100644 * the type of this depends on {@link Particle#getDataType()} + * @param Type */ - public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data); + public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data); diff --git a/src/main/java/org/bukkit/entity/Skeleton.java b/src/main/java/org/bukkit/entity/Skeleton.java -index 2a02ab85..e33d00b3 100644 +index 2a0b01097..2ac30c0f6 100644 --- a/src/main/java/org/bukkit/entity/Skeleton.java +++ b/src/main/java/org/bukkit/entity/Skeleton.java @@ -0,0 +0,0 @@ public interface Skeleton extends Monster { @@ -245,7 +245,7 @@ index 2a02ab85..e33d00b3 100644 */ @Deprecated diff --git a/src/main/java/org/bukkit/entity/Zombie.java b/src/main/java/org/bukkit/entity/Zombie.java -index bdc6206a..48034198 100644 +index 756f285eb..ee2e70c67 100644 --- a/src/main/java/org/bukkit/entity/Zombie.java +++ b/src/main/java/org/bukkit/entity/Zombie.java @@ -0,0 +0,0 @@ public interface Zombie extends Monster { @@ -257,6 +257,7 @@ index bdc6206a..48034198 100644 * @deprecated must spawn {@link ZombieVillager}. */ @Deprecated +@@ -0,0 +0,0 @@ public interface Zombie extends Monster { public void setVillager(boolean flag); /** @@ -266,7 +267,7 @@ index bdc6206a..48034198 100644 */ @Deprecated diff --git a/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java b/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java -index 6532c24f..ee0b1273 100644 +index 8d4c70031..b493173e2 100644 --- a/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java @@ -0,0 +0,0 @@ public class PlayerLoginEvent extends PlayerEvent { @@ -275,7 +276,7 @@ index 6532c24f..ee0b1273 100644 * timing issues + * @param realAddress The unspoofed, actual address, that the player used to connect */ - public PlayerLoginEvent(final Player player, final String hostname, final InetAddress address, final InetAddress realAddress) { // Spigot + public PlayerLoginEvent(@NotNull final Player player, @NotNull final String hostname, @NotNull final InetAddress address, final @NotNull InetAddress realAddress) { // Spigot super(player); @@ -0,0 +0,0 @@ public class PlayerLoginEvent extends PlayerEvent { * timing issues @@ -283,10 +284,10 @@ index 6532c24f..ee0b1273 100644 * @param message The message to be displayed if result denies login + * @param realAddress The unspoofed, actual address, that the player used to connect */ - public PlayerLoginEvent(final Player player, String hostname, final InetAddress address, final Result result, final String message, final InetAddress realAddress) { // Spigot + public PlayerLoginEvent(@NotNull final Player player, @NotNull String hostname, @NotNull final InetAddress address, @NotNull final Result result, @NotNull final String message, @NotNull final InetAddress realAddress) { // Spigot this(player, hostname, address, realAddress); // Spigot diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java -index 762c43d6..ec2b8b8e 100644 +index 07d2b4cfe..cbcbe8c8a 100644 --- a/src/main/java/org/bukkit/inventory/ItemFactory.java +++ b/src/main/java/org/bukkit/inventory/ItemFactory.java @@ -0,0 +0,0 @@ public interface ItemFactory { @@ -304,7 +305,7 @@ index 762c43d6..ec2b8b8e 100644 */ @Deprecated diff --git a/src/main/java/org/bukkit/inventory/Merchant.java b/src/main/java/org/bukkit/inventory/Merchant.java -index c8e68570..45431b36 100644 +index 668e91958..5ff1f93d1 100644 --- a/src/main/java/org/bukkit/inventory/Merchant.java +++ b/src/main/java/org/bukkit/inventory/Merchant.java @@ -0,0 +0,0 @@ public interface Merchant { @@ -314,8 +315,8 @@ index c8e68570..45431b36 100644 - * @throws IndexOutOfBoundsException + * @throws IndexOutOfBoundsException Throws when specified index is larger than Merchant's inventory */ + @NotNull MerchantRecipe getRecipe(int i) throws IndexOutOfBoundsException; - @@ -0,0 +0,0 @@ public interface Merchant { * * @param i the index @@ -323,10 +324,10 @@ index c8e68570..45431b36 100644 - * @throws IndexOutOfBoundsException + * @throws IndexOutOfBoundsException Throws when specified index is larger than Merchant's inventory */ - void setRecipe(int i, MerchantRecipe recipe) throws IndexOutOfBoundsException; + void setRecipe(int i, @NotNull MerchantRecipe recipe) throws IndexOutOfBoundsException; diff --git a/src/main/java/org/bukkit/potion/Potion.java b/src/main/java/org/bukkit/potion/Potion.java -index 1413b361..b4a8051c 100644 +index 63b7c70ce..a57f70ec6 100644 --- a/src/main/java/org/bukkit/potion/Potion.java +++ b/src/main/java/org/bukkit/potion/Potion.java @@ -0,0 +0,0 @@ public class Potion { @@ -338,7 +339,7 @@ index 1413b361..b4a8051c 100644 */ @Deprecated diff --git a/src/main/java/org/bukkit/potion/PotionBrewer.java b/src/main/java/org/bukkit/potion/PotionBrewer.java -index 40f8d12b..33d19228 100644 +index 9f913e1ee..254bd6f3e 100644 --- a/src/main/java/org/bukkit/potion/PotionBrewer.java +++ b/src/main/java/org/bukkit/potion/PotionBrewer.java @@ -0,0 +0,0 @@ public interface PotionBrewer { @@ -349,9 +350,9 @@ index 40f8d12b..33d19228 100644 + * @param extended Whether the potion is extended * @return The list of effects */ - public Collection getEffects(PotionType type, boolean upgraded, boolean extended); + @NotNull diff --git a/src/main/java/org/bukkit/potion/PotionType.java b/src/main/java/org/bukkit/potion/PotionType.java -index 034421a7..f1a54c23 100644 +index 9b0fcf2da..e83e4b4fd 100644 --- a/src/main/java/org/bukkit/potion/PotionType.java +++ b/src/main/java/org/bukkit/potion/PotionType.java @@ -0,0 +0,0 @@ public enum PotionType { @@ -380,17 +381,4 @@ index 034421a7..f1a54c23 100644 * @deprecated Misleading */ @Deprecated -diff --git a/src/main/java/org/bukkit/scoreboard/Team.java b/src/main/java/org/bukkit/scoreboard/Team.java -index ab71f3c3..358ea386 100644 ---- a/src/main/java/org/bukkit/scoreboard/Team.java -+++ b/src/main/java/org/bukkit/scoreboard/Team.java -@@ -0,0 +0,0 @@ public interface Team { - * names are handled by prefixes / suffixes. - * - * @return team color, defaults to {@link ChatColor#RESET} -- * @throws IllegalStateException -+ * @throws IllegalStateException if this team has been unregistered - */ - ChatColor getColor() throws IllegalStateException; - -- \ No newline at end of file diff --git a/Spigot-API-Patches/Graduate-bungeecord-chat-API-from-spigot-subclasses.patch b/Spigot-API-Patches/Graduate-bungeecord-chat-API-from-spigot-subclasses.patch index 103b4daeab..70b208f542 100644 --- a/Spigot-API-Patches/Graduate-bungeecord-chat-API-from-spigot-subclasses.patch +++ b/Spigot-API-Patches/Graduate-bungeecord-chat-API-from-spigot-subclasses.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Graduate bungeecord chat API from spigot subclasses Change Javadoc to be accurate diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index cb7dc068..22704949 100644 +index 3a80f2e29..e27bdb7bf 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java @@ -0,0 +0,0 @@ public final class Bukkit { @@ -19,7 +19,7 @@ index cb7dc068..22704949 100644 + * + * @param component the component to send + */ -+ public static void broadcast(net.md_5.bungee.api.chat.BaseComponent component) { ++ public static void broadcast(@NotNull net.md_5.bungee.api.chat.BaseComponent component) { + server.broadcast(component); + } + @@ -28,7 +28,7 @@ index cb7dc068..22704949 100644 + * + * @param components the components to send + */ -+ public static void broadcast(net.md_5.bungee.api.chat.BaseComponent... components) { ++ public static void broadcast(@NotNull net.md_5.bungee.api.chat.BaseComponent... components) { + server.broadcast(components); + } + // Paper end @@ -37,12 +37,12 @@ index cb7dc068..22704949 100644 * Gets the name of the update folder. The update folder is used to safely * update plugins at the right moment on a plugin load. diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index c4dc1de2..f4f4f291 100644 +index 4c3156071..ab0438b81 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient { */ - public int broadcastMessage(String message); + public int broadcastMessage(@NotNull String message); + // Paper start + /** @@ -50,7 +50,7 @@ index c4dc1de2..f4f4f291 100644 + * + * @param component the component to send + */ -+ public default void broadcast(net.md_5.bungee.api.chat.BaseComponent component) { ++ public default void broadcast(@NotNull net.md_5.bungee.api.chat.BaseComponent component) { + spigot().broadcast(component); + } + @@ -59,7 +59,7 @@ index c4dc1de2..f4f4f291 100644 + * + * @param components the components to send + */ -+ public default void broadcast(net.md_5.bungee.api.chat.BaseComponent... components) { ++ public default void broadcast(@NotNull net.md_5.bungee.api.chat.BaseComponent... components) { + spigot().broadcast(components); + } + // Paper end @@ -68,12 +68,12 @@ index c4dc1de2..f4f4f291 100644 * Gets the name of the update folder. The update folder is used to safely * update plugins at the right moment on a plugin load. diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index d72a7e3d..bf86eb67 100644 +index 51a145a4a..5a741b41e 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM */ - public void sendMap(MapView map); + public void sendMap(@NotNull MapView map); + // Paper start + /** @@ -81,7 +81,8 @@ index d72a7e3d..bf86eb67 100644 + * + * @param component the components to send + */ -+ public default void sendMessage(net.md_5.bungee.api.chat.BaseComponent component) { ++ @Override ++ public default void sendMessage(@NotNull net.md_5.bungee.api.chat.BaseComponent component) { + spigot().sendMessage(component); + } + @@ -90,7 +91,8 @@ index d72a7e3d..bf86eb67 100644 + * + * @param components the components to send + */ -+ public default void sendMessage(net.md_5.bungee.api.chat.BaseComponent... components) { ++ @Override ++ public default void sendMessage(@NotNull net.md_5.bungee.api.chat.BaseComponent... components) { + spigot().sendMessage(components); + } + diff --git a/Spigot-API-Patches/Handle-plugin-prefixes-in-implementation-logging-con.patch b/Spigot-API-Patches/Handle-plugin-prefixes-in-implementation-logging-con.patch index f623995bc2..4be76119f7 100644 --- a/Spigot-API-Patches/Handle-plugin-prefixes-in-implementation-logging-con.patch +++ b/Spigot-API-Patches/Handle-plugin-prefixes-in-implementation-logging-con.patch @@ -17,7 +17,7 @@ The implementation should handle plugin prefixes by displaying logger names when appropriate. diff --git a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java -index 67887806..a81dae43 100644 +index 7c934899..9a342788 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java @@ -0,0 +0,0 @@ public abstract class JavaPlugin extends PluginBase { diff --git a/Spigot-API-Patches/Here-s-Johnny.patch b/Spigot-API-Patches/Here-s-Johnny.patch index 57c1be6c4d..da750d1cc7 100644 --- a/Spigot-API-Patches/Here-s-Johnny.patch +++ b/Spigot-API-Patches/Here-s-Johnny.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Here's Johnny! diff --git a/src/main/java/org/bukkit/entity/Vindicator.java b/src/main/java/org/bukkit/entity/Vindicator.java -index b8ea68a8..c5d9e76a 100644 +index b8ea68a8f..c5d9e76a6 100644 --- a/src/main/java/org/bukkit/entity/Vindicator.java +++ b/src/main/java/org/bukkit/entity/Vindicator.java @@ -0,0 +0,0 @@ package org.bukkit.entity; diff --git a/Spigot-API-Patches/IllegalPacketEvent.patch b/Spigot-API-Patches/IllegalPacketEvent.patch index 1587aff8f0..a285d30972 100644 --- a/Spigot-API-Patches/IllegalPacketEvent.patch +++ b/Spigot-API-Patches/IllegalPacketEvent.patch @@ -9,7 +9,7 @@ Lets plugins change the kick message and if it should kick or not. diff --git a/src/main/java/com/destroystokyo/paper/event/player/IllegalPacketEvent.java b/src/main/java/com/destroystokyo/paper/event/player/IllegalPacketEvent.java new file mode 100644 -index 00000000..e11f74fc +index 000000000..37a17f0bb --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/player/IllegalPacketEvent.java @@ -0,0 +0,0 @@ @@ -19,14 +19,16 @@ index 00000000..e11f74fc +import org.bukkit.entity.Player; +import org.bukkit.event.HandlerList; +import org.bukkit.event.player.PlayerEvent; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +public class IllegalPacketEvent extends PlayerEvent { -+ private final String type; -+ private final String ex; -+ private String kickMessage; ++ @Nullable private final String type; ++ @Nullable private final String ex; ++ @Nullable private String kickMessage; + private boolean shouldKick = true; + -+ public IllegalPacketEvent(Player player, String type, String kickMessage, Exception e) { ++ public IllegalPacketEvent(@NotNull Player player, @Nullable String type, @Nullable String kickMessage, @NotNull Exception e) { + super(player); + this.type = type; + this.kickMessage = kickMessage; @@ -41,33 +43,38 @@ index 00000000..e11f74fc + this.shouldKick = shouldKick; + } + ++ @Nullable + public String getKickMessage() { + return kickMessage; + } + -+ public void setKickMessage(String kickMessage) { ++ public void setKickMessage(@Nullable String kickMessage) { + this.kickMessage = kickMessage; + } + ++ @Nullable + public String getType() { + return type; + } + ++ @Nullable + public String getExceptionMessage() { + return ex; + } + + private static final HandlerList handlers = new HandlerList(); + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } + -+ public static void process(Player player, String type, String kickMessage, Exception exception) { ++ public static void process(@NotNull Player player, @Nullable String type, @Nullable String kickMessage, @NotNull Exception exception) { + IllegalPacketEvent event = new IllegalPacketEvent(player, type, kickMessage, exception); + event.callEvent(); + if (event.shouldKick) { diff --git a/Spigot-API-Patches/Implement-furnace-cook-speed-multiplier-API.patch b/Spigot-API-Patches/Implement-furnace-cook-speed-multiplier-API.patch index bddb5b2bd5..5c8c108963 100644 --- a/Spigot-API-Patches/Implement-furnace-cook-speed-multiplier-API.patch +++ b/Spigot-API-Patches/Implement-furnace-cook-speed-multiplier-API.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Implement furnace cook speed multiplier API Signed-off-by: Tassu diff --git a/src/main/java/org/bukkit/block/Furnace.java b/src/main/java/org/bukkit/block/Furnace.java -index fb82104b..3df8dc6d 100644 +index db3d22fa9..97b25dbd9 100644 --- a/src/main/java/org/bukkit/block/Furnace.java +++ b/src/main/java/org/bukkit/block/Furnace.java @@ -0,0 +0,0 @@ public interface Furnace extends Container, Nameable { @@ -33,7 +33,7 @@ index fb82104b..3df8dc6d 100644 + public void setCookSpeedMultiplier(double multiplier); + // Paper end + + @NotNull @Override public FurnaceInventory getInventory(); - -- \ No newline at end of file diff --git a/Spigot-API-Patches/Implement-getters-and-setters-for-EntityItem-owner-a.patch b/Spigot-API-Patches/Implement-getters-and-setters-for-EntityItem-owner-a.patch index 5970bb3c19..e6ddc21c90 100644 --- a/Spigot-API-Patches/Implement-getters-and-setters-for-EntityItem-owner-a.patch +++ b/Spigot-API-Patches/Implement-getters-and-setters-for-EntityItem-owner-a.patch @@ -6,20 +6,19 @@ Subject: [PATCH] Implement getters and setters for EntityItem owner and diff --git a/src/main/java/org/bukkit/entity/Item.java b/src/main/java/org/bukkit/entity/Item.java -index 2e98e4f9..8049b36c 100644 +index cb9e9f369..a15f70ff4 100644 --- a/src/main/java/org/bukkit/entity/Item.java +++ b/src/main/java/org/bukkit/entity/Item.java -@@ -0,0 +0,0 @@ package org.bukkit.entity; - - import org.bukkit.inventory.ItemStack; +@@ -0,0 +0,0 @@ import org.bukkit.inventory.ItemStack; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; +// Paper start -+import javax.annotation.Nullable; +import java.util.UUID; +// Paper end + /** - * Represents an Item. + * Represents a dropped item. */ @@ -0,0 +0,0 @@ public interface Item extends Entity { * @param canMobPickup True to allow non-player entity pickup diff --git a/Spigot-API-Patches/Improve-death-events.patch b/Spigot-API-Patches/Improve-death-events.patch index 6d97ab5c07..a87546ccaa 100644 --- a/Spigot-API-Patches/Improve-death-events.patch +++ b/Spigot-API-Patches/Improve-death-events.patch @@ -15,10 +15,15 @@ items and experience which is otherwise only properly possible by using internal code. diff --git a/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java b/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java -index ab9e81fd..fef134c6 100644 +index a5984ab06..e19a3df9a 100644 --- a/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java -@@ -0,0 +0,0 @@ import org.bukkit.inventory.ItemStack; +@@ -0,0 +0,0 @@ import org.bukkit.entity.LivingEntity; + import org.bukkit.event.HandlerList; + import org.bukkit.inventory.ItemStack; + import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + /** * Thrown whenever a LivingEntity dies */ @@ -31,13 +36,13 @@ index ab9e81fd..fef134c6 100644 + private boolean cancelled; + private double reviveHealth = 0; + private boolean shouldPlayDeathSound; -+ private org.bukkit.Sound deathSound; -+ private org.bukkit.SoundCategory deathSoundCategory; ++ @Nullable private org.bukkit.Sound deathSound; ++ @Nullable private org.bukkit.SoundCategory deathSoundCategory; + private float deathSoundVolume; + private float deathSoundPitch; + // Paper end - public EntityDeathEvent(final LivingEntity entity, final List drops) { + public EntityDeathEvent(@NotNull final LivingEntity entity, @NotNull final List drops) { this(entity, drops, 0); @@ -0,0 +0,0 @@ public class EntityDeathEvent extends EntityEvent { public static HandlerList getHandlerList() { @@ -104,6 +109,7 @@ index ab9e81fd..fef134c6 100644 + * + * @return The sound that the entity makes + */ ++ @Nullable + public org.bukkit.Sound getDeathSound() { + return deathSound; + } @@ -113,7 +119,7 @@ index ab9e81fd..fef134c6 100644 + * + * @param sound The sound that the entity should make when dying + */ -+ public void setDeathSound(org.bukkit.Sound sound) { ++ public void setDeathSound(@Nullable org.bukkit.Sound sound) { + deathSound = sound; + } + @@ -122,6 +128,7 @@ index ab9e81fd..fef134c6 100644 + * + * @return The sound category + */ ++ @Nullable + public org.bukkit.SoundCategory getDeathSoundCategory() { + return deathSoundCategory; + } @@ -131,7 +138,7 @@ index ab9e81fd..fef134c6 100644 + * + * @param soundCategory The sound category + */ -+ public void setDeathSoundCategory(org.bukkit.SoundCategory soundCategory) { ++ public void setDeathSoundCategory(@Nullable org.bukkit.SoundCategory soundCategory) { + this.deathSoundCategory = soundCategory; + } + diff --git a/Spigot-API-Patches/Improve-the-Saddle-API-for-Horses.patch b/Spigot-API-Patches/Improve-the-Saddle-API-for-Horses.patch index 79c5bf4041..a56080fa52 100644 --- a/Spigot-API-Patches/Improve-the-Saddle-API-for-Horses.patch +++ b/Spigot-API-Patches/Improve-the-Saddle-API-for-Horses.patch @@ -8,12 +8,14 @@ and access their saddle state separately from an interface shared with Armor. diff --git a/src/main/java/org/bukkit/inventory/ArmoredHorseInventory.java b/src/main/java/org/bukkit/inventory/ArmoredHorseInventory.java new file mode 100644 -index 00000000..a39b9544 +index 000000000..163ffe8ff --- /dev/null +++ b/src/main/java/org/bukkit/inventory/ArmoredHorseInventory.java @@ -0,0 +0,0 @@ +package org.bukkit.inventory; + ++import org.jetbrains.annotations.Nullable; ++ +public interface ArmoredHorseInventory extends AbstractHorseInventory { + + /** @@ -21,6 +23,7 @@ index 00000000..a39b9544 + * + * @return the armor item + */ ++ @Nullable + ItemStack getArmor(); + + /** @@ -28,13 +31,13 @@ index 00000000..a39b9544 + * + * @param stack the new item + */ -+ void setArmor(ItemStack stack); ++ void setArmor(@Nullable ItemStack stack); +} diff --git a/src/main/java/org/bukkit/inventory/HorseInventory.java b/src/main/java/org/bukkit/inventory/HorseInventory.java -index a73c9850..e14c1277 100644 +index 608e99c42..53498debe 100644 --- a/src/main/java/org/bukkit/inventory/HorseInventory.java +++ b/src/main/java/org/bukkit/inventory/HorseInventory.java -@@ -0,0 +0,0 @@ package org.bukkit.inventory; +@@ -0,0 +0,0 @@ import org.jetbrains.annotations.Nullable; /** * An interface to the inventory of a Horse. */ @@ -45,6 +48,7 @@ index a73c9850..e14c1277 100644 - * - * @return the armor item - */ +- @Nullable - ItemStack getArmor(); - - /** @@ -52,25 +56,25 @@ index a73c9850..e14c1277 100644 - * - * @param stack the new item - */ -- void setArmor(ItemStack stack); +- void setArmor(@Nullable ItemStack stack); -} +public interface HorseInventory extends AbstractHorseInventory, ArmoredHorseInventory {} diff --git a/src/main/java/org/bukkit/inventory/LlamaInventory.java b/src/main/java/org/bukkit/inventory/LlamaInventory.java -index 9b3dcf3f..7856a7f2 100644 +index 2fa2c9d07..5ac1afb8a 100644 --- a/src/main/java/org/bukkit/inventory/LlamaInventory.java +++ b/src/main/java/org/bukkit/inventory/LlamaInventory.java -@@ -0,0 +0,0 @@ import org.bukkit.entity.Llama; +@@ -0,0 +0,0 @@ import org.jetbrains.annotations.Nullable; /** * An interface to the inventory of a {@link Llama}. */ -public interface LlamaInventory extends AbstractHorseInventory { +public interface LlamaInventory extends SaddledHorseInventory { - /* + /** * Gets the item in the llama's decor slot. diff --git a/src/main/java/org/bukkit/inventory/SaddledHorseInventory.java b/src/main/java/org/bukkit/inventory/SaddledHorseInventory.java new file mode 100644 -index 00000000..7944f26a +index 000000000..7944f26a3 --- /dev/null +++ b/src/main/java/org/bukkit/inventory/SaddledHorseInventory.java @@ -0,0 +0,0 @@ diff --git a/Spigot-API-Patches/Inventory-removeItemAnySlot.patch b/Spigot-API-Patches/Inventory-removeItemAnySlot.patch index 085cde7b8d..d46bf03936 100644 --- a/Spigot-API-Patches/Inventory-removeItemAnySlot.patch +++ b/Spigot-API-Patches/Inventory-removeItemAnySlot.patch @@ -5,12 +5,12 @@ Subject: [PATCH] Inventory#removeItemAnySlot diff --git a/src/main/java/org/bukkit/inventory/Inventory.java b/src/main/java/org/bukkit/inventory/Inventory.java -index bab561dc..9d0306c3 100644 +index 36e352917..a358e9014 100644 --- a/src/main/java/org/bukkit/inventory/Inventory.java +++ b/src/main/java/org/bukkit/inventory/Inventory.java @@ -0,0 +0,0 @@ public interface Inventory extends Iterable { - */ - public HashMap removeItem(ItemStack... items) throws IllegalArgumentException; + @NotNull + public HashMap removeItem(@NotNull ItemStack... items) throws IllegalArgumentException; + // Paper start + /** @@ -36,7 +36,8 @@ index bab561dc..9d0306c3 100644 + * @return A HashMap containing items that couldn't be removed. + * @throws IllegalArgumentException if items is null + */ -+ public HashMap removeItemAnySlot(ItemStack... items) throws IllegalArgumentException; ++ @NotNull ++ public HashMap removeItemAnySlot(@NotNull ItemStack... items) throws IllegalArgumentException; + // Paper end + /** diff --git a/Spigot-API-Patches/InventoryCloseEvent-Reason-API.patch b/Spigot-API-Patches/InventoryCloseEvent-Reason-API.patch index 79838cf69f..f4d3dc0fb2 100644 --- a/Spigot-API-Patches/InventoryCloseEvent-Reason-API.patch +++ b/Spigot-API-Patches/InventoryCloseEvent-Reason-API.patch @@ -7,7 +7,7 @@ Allows you to determine why an inventory was closed, enabling plugin developers to "confirm" things based on if it was player triggered close or not. diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java -index b5ed8447..74f5588e 100644 +index 04f0e08fd..a372c74b8 100644 --- a/src/main/java/org/bukkit/entity/HumanEntity.java +++ b/src/main/java/org/bukkit/entity/HumanEntity.java @@ -0,0 +0,0 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder @@ -20,22 +20,23 @@ index b5ed8447..74f5588e 100644 + * + * @param reason why the inventory is closing + */ -+ public void closeInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason reason); ++ public void closeInventory(@NotNull org.bukkit.event.inventory.InventoryCloseEvent.Reason reason); + // Paper end + /** * Returns the ItemStack currently in your hand, can be empty. * diff --git a/src/main/java/org/bukkit/event/inventory/InventoryCloseEvent.java b/src/main/java/org/bukkit/event/inventory/InventoryCloseEvent.java -index 19889b27..e6e45b93 100644 +index 5861247c1..21ad8888c 100644 --- a/src/main/java/org/bukkit/event/inventory/InventoryCloseEvent.java +++ b/src/main/java/org/bukkit/event/inventory/InventoryCloseEvent.java -@@ -0,0 +0,0 @@ import org.bukkit.inventory.InventoryView; +@@ -0,0 +0,0 @@ import org.jetbrains.annotations.NotNull; + */ public class InventoryCloseEvent extends InventoryEvent { private static final HandlerList handlers = new HandlerList(); - + // Paper start + private final Reason reason; ++ @NotNull + public Reason getReason() { + return reason; + } @@ -78,11 +79,12 @@ index 19889b27..e6e45b93 100644 + */ + PLUGIN, + } - public InventoryCloseEvent(InventoryView transaction) { + + public InventoryCloseEvent(@NotNull InventoryView transaction) { + this(transaction, Reason.UNKNOWN); + } + -+ public InventoryCloseEvent(InventoryView transaction, Reason reason) { ++ public InventoryCloseEvent(@NotNull InventoryView transaction, @NotNull Reason reason) { super(transaction); + this.reason = reason; + // Paper end diff --git a/Spigot-API-Patches/Item-canEntityPickup.patch b/Spigot-API-Patches/Item-canEntityPickup.patch index b61e4c2696..26c3c93710 100644 --- a/Spigot-API-Patches/Item-canEntityPickup.patch +++ b/Spigot-API-Patches/Item-canEntityPickup.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Item#canEntityPickup diff --git a/src/main/java/org/bukkit/entity/Item.java b/src/main/java/org/bukkit/entity/Item.java -index 90260b7e..2e98e4f9 100644 +index 00c58c1d..cb9e9f36 100644 --- a/src/main/java/org/bukkit/entity/Item.java +++ b/src/main/java/org/bukkit/entity/Item.java @@ -0,0 +0,0 @@ public interface Item extends Entity { diff --git a/Spigot-API-Patches/ItemStack-API-additions-for-quantity-flags-lore.patch b/Spigot-API-Patches/ItemStack-API-additions-for-quantity-flags-lore.patch index fbdd58514d..2af3e9a0af 100644 --- a/Spigot-API-Patches/ItemStack-API-additions-for-quantity-flags-lore.patch +++ b/Spigot-API-Patches/ItemStack-API-additions-for-quantity-flags-lore.patch @@ -5,7 +5,7 @@ Subject: [PATCH] ItemStack API additions for quantity/flags/lore diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java -index 26ab1278..fb47fc29 100644 +index 1c7bbbcef..845a9255d 100644 --- a/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java @@ -0,0 +0,0 @@ package org.bukkit.inventory; @@ -18,15 +18,6 @@ index 26ab1278..fb47fc29 100644 import org.apache.commons.lang.Validate; import org.bukkit.Bukkit; -@@ -0,0 +0,0 @@ import org.bukkit.inventory.meta.Damageable; - import org.bukkit.inventory.meta.ItemMeta; - import org.bukkit.material.MaterialData; - -+import javax.annotation.Nullable; -+ - /** - * Represents a stack of items - */ @@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { // Requires access to NMS return ensureServerConversions().getMaxItemUseDuration(); @@ -36,6 +27,7 @@ index 26ab1278..fb47fc29 100644 + * Clones the itemstack and returns it a single quantity. + * @return The new itemstack with 1 quantity + */ ++ @NotNull + public ItemStack asOne() { + return asQuantity(1); + } @@ -45,6 +37,7 @@ index 26ab1278..fb47fc29 100644 + * @param qty The quantity of the cloned item + * @return The new itemstack with specified quantity + */ ++ @NotNull + public ItemStack asQuantity(int qty) { + ItemStack clone = clone(); + clone.setAmount(qty); @@ -55,6 +48,7 @@ index 26ab1278..fb47fc29 100644 + * Adds 1 to this itemstack. Will not go over the items max stack size. + * @return The same item (not a clone) + */ ++ @NotNull + public ItemStack add() { + return add(1); + } @@ -65,6 +59,7 @@ index 26ab1278..fb47fc29 100644 + * @param qty The amount to add + * @return The same item (not a clone) + */ ++ @NotNull + public ItemStack add(int qty) { + setAmount(Math.min(getMaxStackSize(), getAmount() + qty)); + return this; @@ -74,6 +69,7 @@ index 26ab1278..fb47fc29 100644 + * Subtracts 1 to this itemstack. Going to 0 or less will invalidate the item. + * @return The same item (not a clone) + */ ++ @NotNull + public ItemStack subtract() { + return subtract(1); + } @@ -84,6 +80,7 @@ index 26ab1278..fb47fc29 100644 + * @param qty The amount to add + * @return The same item (not a clone) + */ ++ @NotNull + public ItemStack subtract(int qty) { + setAmount(Math.max(0, getAmount() - qty)); + return this; @@ -111,7 +108,7 @@ index 26ab1278..fb47fc29 100644 + * + * @param lore the lore that will be set + */ -+ public void setLore(List lore) { ++ public void setLore(@Nullable List lore) { + ItemMeta itemMeta = getItemMeta(); + itemMeta.setLore(lore); + setItemMeta(itemMeta); @@ -122,7 +119,7 @@ index 26ab1278..fb47fc29 100644 + * + * @param itemFlags The hideflags which shouldn't be rendered + */ -+ public void addItemFlags(ItemFlag... itemFlags) { ++ public void addItemFlags(@NotNull ItemFlag... itemFlags) { + ItemMeta itemMeta = getItemMeta(); + itemMeta.addItemFlags(itemFlags); + setItemMeta(itemMeta); @@ -133,7 +130,7 @@ index 26ab1278..fb47fc29 100644 + * + * @param itemFlags Hideflags which should be removed + */ -+ public void removeItemFlags(ItemFlag... itemFlags) { ++ public void removeItemFlags(@NotNull ItemFlag... itemFlags) { + ItemMeta itemMeta = getItemMeta(); + itemMeta.removeItemFlags(itemFlags); + setItemMeta(itemMeta); @@ -144,6 +141,7 @@ index 26ab1278..fb47fc29 100644 + * + * @return A set of all itemFlags set + */ ++ @NotNull + public Set getItemFlags() { + ItemMeta itemMeta = getItemMeta(); + return itemMeta.getItemFlags(); @@ -155,7 +153,7 @@ index 26ab1278..fb47fc29 100644 + * @param flag the flag to check + * @return if it is present + */ -+ public boolean hasItemFlag(ItemFlag flag) { ++ public boolean hasItemFlag(@NotNull ItemFlag flag) { + ItemMeta itemMeta = getItemMeta(); + return itemMeta.hasItemFlag(flag); + } diff --git a/Spigot-API-Patches/ItemStack-getMaxItemUseDuration.patch b/Spigot-API-Patches/ItemStack-getMaxItemUseDuration.patch index deb5fcc08f..b027c8ab4e 100644 --- a/Spigot-API-Patches/ItemStack-getMaxItemUseDuration.patch +++ b/Spigot-API-Patches/ItemStack-getMaxItemUseDuration.patch @@ -6,7 +6,7 @@ Subject: [PATCH] ItemStack#getMaxItemUseDuration Allows you to determine how long it takes to use a usable/consumable item diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java -index c3cb1247..26ab1278 100644 +index b1c02ac0d..1c7bbbcef 100644 --- a/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java @@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { diff --git a/Spigot-API-Patches/LivingEntity-Hand-Raised-Item-Use-API.patch b/Spigot-API-Patches/LivingEntity-Hand-Raised-Item-Use-API.patch index 288c68ed3c..2c661322cd 100644 --- a/Spigot-API-Patches/LivingEntity-Hand-Raised-Item-Use-API.patch +++ b/Spigot-API-Patches/LivingEntity-Hand-Raised-Item-Use-API.patch @@ -6,7 +6,7 @@ Subject: [PATCH] LivingEntity Hand Raised/Item Use API How long an entity has raised hands to charge an attack or use an item diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java -index 99845e67..e3bc04e1 100644 +index 2fc507052..863d727d0 100644 --- a/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java @@ -0,0 +0,0 @@ import org.bukkit.World; @@ -26,6 +26,7 @@ index 99845e67..e3bc04e1 100644 + * Get's the item being actively "used" or consumed. + * @return The item. Will be null if no active item. + */ ++ @Nullable + ItemStack getActiveItem(); + + /** diff --git a/Spigot-API-Patches/LivingEntity-setKiller.patch b/Spigot-API-Patches/LivingEntity-setKiller.patch index 0189eef40c..d5dff9fa0f 100644 --- a/Spigot-API-Patches/LivingEntity-setKiller.patch +++ b/Spigot-API-Patches/LivingEntity-setKiller.patch @@ -5,20 +5,11 @@ Subject: [PATCH] LivingEntity#setKiller diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java -index f67711fd..3f93b70c 100644 +index 1100e305..706d8f52 100644 --- a/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java -@@ -0,0 +0,0 @@ import org.bukkit.projectiles.ProjectileSource; - import org.bukkit.util.RayTraceResult; - import org.bukkit.util.Vector; - -+import javax.annotation.Nullable; -+ - /** - * Represents a living entity, such as a monster or player - */ @@ -0,0 +0,0 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource - */ + @Nullable public Player getKiller(); + // Paper start diff --git a/Spigot-API-Patches/Location.isChunkLoaded-API.patch b/Spigot-API-Patches/Location.isChunkLoaded-API.patch index 77562bf3ac..3cf88ccf42 100644 --- a/Spigot-API-Patches/Location.isChunkLoaded-API.patch +++ b/Spigot-API-Patches/Location.isChunkLoaded-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Location.isChunkLoaded() API diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java -index 5c3d42cc..1ddebf3c 100644 +index 6cffda15..a2dfad2f 100644 --- a/src/main/java/org/bukkit/Location.java +++ b/src/main/java/org/bukkit/Location.java @@ -0,0 +0,0 @@ public class Location implements Cloneable, ConfigurationSerializable { diff --git a/Spigot-API-Patches/Location.toBlockLocation-toCenterLocation.patch b/Spigot-API-Patches/Location.toBlockLocation-toCenterLocation.patch index dbf41ae19c..0c6cbc63ea 100644 --- a/Spigot-API-Patches/Location.toBlockLocation-toCenterLocation.patch +++ b/Spigot-API-Patches/Location.toBlockLocation-toCenterLocation.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Location.toBlockLocation/toCenterLocation() Convert location objects to their block coordinates, or the center of the block diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java -index 1ddebf3c..916238c4 100644 +index a2dfad2f4..3387fb477 100644 --- a/src/main/java/org/bukkit/Location.java +++ b/src/main/java/org/bukkit/Location.java @@ -0,0 +0,0 @@ public class Location implements Cloneable, ConfigurationSerializable { @@ -18,6 +18,7 @@ index 1ddebf3c..916238c4 100644 + /** + * @return A new location where X/Y/Z are on the Block location (integer value of X/Y/Z) + */ ++ @NotNull + public Location toBlockLocation() { + Location blockLoc = clone(); + blockLoc.setX(getBlockX()); @@ -28,6 +29,7 @@ index 1ddebf3c..916238c4 100644 + /** + * @return A new location where X/Y/Z are the center of the block + */ ++ @NotNull + public Location toCenterLocation() { + Location centerLoc = clone(); + centerLoc.setX(getBlockX() + 0.5); diff --git a/Spigot-API-Patches/LootTable-API.patch b/Spigot-API-Patches/LootTable-API.patch index 102b9cdbfb..8c44375581 100644 --- a/Spigot-API-Patches/LootTable-API.patch +++ b/Spigot-API-Patches/LootTable-API.patch @@ -12,13 +12,14 @@ Provides methods to determine players looted state for an object diff --git a/src/main/java/com/destroystokyo/paper/loottable/LootableBlockInventory.java b/src/main/java/com/destroystokyo/paper/loottable/LootableBlockInventory.java new file mode 100644 -index 00000000..9095df61 +index 000000000..92d7b853a --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/loottable/LootableBlockInventory.java @@ -0,0 +0,0 @@ +package com.destroystokyo.paper.loottable; + +import org.bukkit.block.Block; ++import org.jetbrains.annotations.NotNull; + +/** + * Represents an Inventory that can generate loot, such as Chests inside of Fortresses and Mineshafts @@ -29,17 +30,19 @@ index 00000000..9095df61 + * Gets the block that is lootable + * @return The Block + */ ++ @NotNull + Block getBlock(); +} diff --git a/src/main/java/com/destroystokyo/paper/loottable/LootableEntityInventory.java b/src/main/java/com/destroystokyo/paper/loottable/LootableEntityInventory.java new file mode 100644 -index 00000000..a389f74c +index 000000000..b387894fe --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/loottable/LootableEntityInventory.java @@ -0,0 +0,0 @@ +package com.destroystokyo.paper.loottable; + +import org.bukkit.entity.Entity; ++import org.jetbrains.annotations.NotNull; + +/** + * Represents an Inventory that can generate loot, such as Minecarts inside of Mineshafts @@ -50,11 +53,12 @@ index 00000000..a389f74c + * Gets the entity that is lootable + * @return The Entity + */ ++ @NotNull + Entity getEntity(); +} diff --git a/src/main/java/com/destroystokyo/paper/loottable/LootableInventory.java b/src/main/java/com/destroystokyo/paper/loottable/LootableInventory.java new file mode 100644 -index 00000000..2fc3e8a1 +index 000000000..97815eeb2 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/loottable/LootableInventory.java @@ -0,0 +0,0 @@ @@ -64,6 +68,8 @@ index 00000000..2fc3e8a1 +import org.bukkit.loot.Lootable; + +import java.util.UUID; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * Represents an Inventory that contains a Loot Table associated to it that will @@ -95,7 +101,7 @@ index 00000000..2fc3e8a1 + * @param player The player to check + * @return Whether or not this player has looted this block + */ -+ default boolean hasPlayerLooted(Player player) { ++ default boolean hasPlayerLooted(@NotNull Player player) { + return hasPlayerLooted(player.getUniqueId()); + } + @@ -104,7 +110,7 @@ index 00000000..2fc3e8a1 + * @param player The player to check + * @return Whether or not this player has looted this block + */ -+ boolean hasPlayerLooted(UUID player); ++ boolean hasPlayerLooted(@NotNull UUID player); + + /** + * Gets the timestamp, in milliseconds, of when the player last looted this object @@ -112,7 +118,8 @@ index 00000000..2fc3e8a1 + * @param player The player to check + * @return Timestamp last looted, or null if player has not looted this object + */ -+ default Long getLastLooted(Player player) { ++ @Nullable ++ default Long getLastLooted(@NotNull Player player) { + return getLastLooted(player.getUniqueId()); + } + @@ -122,7 +129,8 @@ index 00000000..2fc3e8a1 + * @param player The player to check + * @return Timestamp last looted, or null if player has not looted this object + */ -+ Long getLastLooted(UUID player); ++ @Nullable ++ Long getLastLooted(@NotNull UUID player); + + /** + * Change the state of whether or not a player has looted this block @@ -130,7 +138,7 @@ index 00000000..2fc3e8a1 + * @param looted true to add player to looted list, false to remove + * @return The previous state of whether the player had looted this or not + */ -+ default boolean setHasPlayerLooted(Player player, boolean looted) { ++ default boolean setHasPlayerLooted(@NotNull Player player, boolean looted) { + return setHasPlayerLooted(player.getUniqueId(), looted); + } + @@ -140,7 +148,7 @@ index 00000000..2fc3e8a1 + * @param looted true to add player to looted list, false to remove + * @return The previous state of whether the player had looted this or not + */ -+ boolean setHasPlayerLooted(UUID player, boolean looted); ++ boolean setHasPlayerLooted(@NotNull UUID player, boolean looted); + + /** + * Returns Whether or not this object has been filled and now has a pending refill @@ -172,7 +180,7 @@ index 00000000..2fc3e8a1 +} diff --git a/src/main/java/com/destroystokyo/paper/loottable/LootableInventoryReplenishEvent.java b/src/main/java/com/destroystokyo/paper/loottable/LootableInventoryReplenishEvent.java new file mode 100644 -index 00000000..2169493d +index 000000000..fd184f13f --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/loottable/LootableInventoryReplenishEvent.java @@ -0,0 +0,0 @@ @@ -182,25 +190,29 @@ index 00000000..2169493d +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.event.player.PlayerEvent; ++import org.jetbrains.annotations.NotNull; + +public class LootableInventoryReplenishEvent extends PlayerEvent implements Cancellable { -+ private final LootableInventory inventory; ++ @NotNull private final LootableInventory inventory; + -+ public LootableInventoryReplenishEvent(Player player, LootableInventory inventory) { ++ public LootableInventoryReplenishEvent(@NotNull Player player, @NotNull LootableInventory inventory) { + super(player); + this.inventory = inventory; + } + ++ @NotNull + public LootableInventory getInventory() { + return inventory; + } + + private static final HandlerList handlers = new HandlerList(); + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } @@ -218,7 +230,7 @@ index 00000000..2169493d + } +} diff --git a/src/main/java/org/bukkit/block/Chest.java b/src/main/java/org/bukkit/block/Chest.java -index 815d79a5..b68ab881 100644 +index c553891e0..eb475ec84 100644 --- a/src/main/java/org/bukkit/block/Chest.java +++ b/src/main/java/org/bukkit/block/Chest.java @@ -0,0 +0,0 @@ @@ -228,7 +240,7 @@ index 815d79a5..b68ab881 100644 import org.bukkit.Nameable; import org.bukkit.inventory.Inventory; import org.bukkit.loot.Lootable; -@@ -0,0 +0,0 @@ import org.bukkit.loot.Lootable; +@@ -0,0 +0,0 @@ import org.jetbrains.annotations.NotNull; /** * Represents a captured state of a chest. */ @@ -238,7 +250,7 @@ index 815d79a5..b68ab881 100644 /** * Gets the inventory of the chest block represented by this block state. diff --git a/src/main/java/org/bukkit/block/Dispenser.java b/src/main/java/org/bukkit/block/Dispenser.java -index 2741625d..6d180117 100644 +index 74cd194c9..07af1a3f0 100644 --- a/src/main/java/org/bukkit/block/Dispenser.java +++ b/src/main/java/org/bukkit/block/Dispenser.java @@ -0,0 +0,0 @@ @@ -248,7 +260,7 @@ index 2741625d..6d180117 100644 import org.bukkit.Nameable; import org.bukkit.loot.Lootable; import org.bukkit.projectiles.BlockProjectileSource; -@@ -0,0 +0,0 @@ import org.bukkit.projectiles.BlockProjectileSource; +@@ -0,0 +0,0 @@ import org.jetbrains.annotations.Nullable; /** * Represents a captured state of a dispenser. */ @@ -258,7 +270,7 @@ index 2741625d..6d180117 100644 /** * Gets the BlockProjectileSource object for the dispenser. diff --git a/src/main/java/org/bukkit/block/Dropper.java b/src/main/java/org/bukkit/block/Dropper.java -index 2e8c3f71..47737b59 100644 +index 2e8c3f711..47737b590 100644 --- a/src/main/java/org/bukkit/block/Dropper.java +++ b/src/main/java/org/bukkit/block/Dropper.java @@ -0,0 +0,0 @@ @@ -277,7 +289,7 @@ index 2e8c3f71..47737b59 100644 /** * Tries to drop a randomly selected item from the dropper's inventory, diff --git a/src/main/java/org/bukkit/block/Hopper.java b/src/main/java/org/bukkit/block/Hopper.java -index 73fce5f3..221123e8 100644 +index 73fce5f33..221123e8c 100644 --- a/src/main/java/org/bukkit/block/Hopper.java +++ b/src/main/java/org/bukkit/block/Hopper.java @@ -0,0 +0,0 @@ @@ -293,7 +305,7 @@ index 73fce5f3..221123e8 100644 -public interface Hopper extends Container, Nameable, Lootable { } +public interface Hopper extends Container, Nameable, LootableBlockInventory { } // Paper diff --git a/src/main/java/org/bukkit/block/ShulkerBox.java b/src/main/java/org/bukkit/block/ShulkerBox.java -index 8e061e4a..1c02c6e1 100644 +index 5a6bed64a..8c8811d4d 100644 --- a/src/main/java/org/bukkit/block/ShulkerBox.java +++ b/src/main/java/org/bukkit/block/ShulkerBox.java @@ -0,0 +0,0 @@ @@ -303,7 +315,7 @@ index 8e061e4a..1c02c6e1 100644 import org.bukkit.DyeColor; import org.bukkit.Nameable; import org.bukkit.loot.Lootable; -@@ -0,0 +0,0 @@ import org.bukkit.loot.Lootable; +@@ -0,0 +0,0 @@ import org.jetbrains.annotations.NotNull; /** * Represents a captured state of a ShulkerBox. */ @@ -313,7 +325,7 @@ index 8e061e4a..1c02c6e1 100644 /** * Get the {@link DyeColor} corresponding to this ShulkerBox diff --git a/src/main/java/org/bukkit/entity/minecart/HopperMinecart.java b/src/main/java/org/bukkit/entity/minecart/HopperMinecart.java -index 8ced5403..86588550 100644 +index 8ced54039..865885501 100644 --- a/src/main/java/org/bukkit/entity/minecart/HopperMinecart.java +++ b/src/main/java/org/bukkit/entity/minecart/HopperMinecart.java @@ -0,0 +0,0 @@ @@ -333,7 +345,7 @@ index 8ced5403..86588550 100644 /** * Checks whether or not this Minecart will pick up diff --git a/src/main/java/org/bukkit/entity/minecart/StorageMinecart.java b/src/main/java/org/bukkit/entity/minecart/StorageMinecart.java -index 9ea403e6..238d118f 100644 +index 9ea403e6f..238d118f7 100644 --- a/src/main/java/org/bukkit/entity/minecart/StorageMinecart.java +++ b/src/main/java/org/bukkit/entity/minecart/StorageMinecart.java @@ -0,0 +0,0 @@ @@ -351,11 +363,11 @@ index 9ea403e6..238d118f 100644 +public interface StorageMinecart extends Minecart, InventoryHolder, LootableEntityInventory { // Paper } diff --git a/src/main/java/org/bukkit/loot/Lootable.java b/src/main/java/org/bukkit/loot/Lootable.java -index f4b3d021..9f1c830f 100644 +index 24a3d989d..901db8524 100644 --- a/src/main/java/org/bukkit/loot/Lootable.java +++ b/src/main/java/org/bukkit/loot/Lootable.java @@ -0,0 +0,0 @@ public interface Lootable { - */ + @Nullable LootTable getLootTable(); + // Paper start @@ -365,7 +377,7 @@ index f4b3d021..9f1c830f 100644 + * @param table the Loot Table this {@link org.bukkit.block.Container} or {@link org.bukkit.entity.Mob} will have. + * @param seed the seed to used to generate loot. Default is 0. + */ -+ default void setLootTable(LootTable table, long seed) { ++ default void setLootTable(@Nullable LootTable table, long seed) { + setLootTable(table); + setSeed(seed); + } diff --git a/Spigot-API-Patches/Make-EnderDragon-extend-Mob.patch b/Spigot-API-Patches/Make-EnderDragon-extend-Mob.patch index 712468e682..19fb91c294 100644 --- a/Spigot-API-Patches/Make-EnderDragon-extend-Mob.patch +++ b/Spigot-API-Patches/Make-EnderDragon-extend-Mob.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Make EnderDragon extend Mob diff --git a/src/main/java/org/bukkit/entity/EnderDragon.java b/src/main/java/org/bukkit/entity/EnderDragon.java -index 7170d37a..3ba49208 100644 +index fa13b38d3..e800259a2 100644 --- a/src/main/java/org/bukkit/entity/EnderDragon.java +++ b/src/main/java/org/bukkit/entity/EnderDragon.java -@@ -0,0 +0,0 @@ package org.bukkit.entity; +@@ -0,0 +0,0 @@ import org.jetbrains.annotations.NotNull; /** * Represents an Ender Dragon */ diff --git a/Spigot-API-Patches/Make-plugins-list-alphabetical.patch b/Spigot-API-Patches/Make-plugins-list-alphabetical.patch index 441b749303..b01c171bae 100644 --- a/Spigot-API-Patches/Make-plugins-list-alphabetical.patch +++ b/Spigot-API-Patches/Make-plugins-list-alphabetical.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Make /plugins list alphabetical diff --git a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java -index e40b03a7..b1d384e8 100644 +index 6f95bf3c..d4e74d29 100644 --- a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java +++ b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java @@ -0,0 +0,0 @@ package org.bukkit.command.defaults; @@ -18,8 +18,8 @@ index e40b03a7..b1d384e8 100644 import org.bukkit.Bukkit; import org.bukkit.ChatColor; @@ -0,0 +0,0 @@ public class PluginsCommand extends BukkitCommand { - } + @NotNull private String getPluginList() { - StringBuilder pluginList = new StringBuilder(); - Plugin[] plugins = Bukkit.getPluginManager().getPlugins(); diff --git a/Spigot-API-Patches/Make-shield-blocking-delay-configurable.patch b/Spigot-API-Patches/Make-shield-blocking-delay-configurable.patch index 1a26d5371c..067824398a 100644 --- a/Spigot-API-Patches/Make-shield-blocking-delay-configurable.patch +++ b/Spigot-API-Patches/Make-shield-blocking-delay-configurable.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Make shield blocking delay configurable diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java -index 3f93b70c..99845e67 100644 +index 706d8f52..2fc50705 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 diff --git a/Spigot-API-Patches/Make-the-default-permission-message-configurable.patch b/Spigot-API-Patches/Make-the-default-permission-message-configurable.patch index eecda3b13b..3a49a86fe1 100644 --- a/Spigot-API-Patches/Make-the-default-permission-message-configurable.patch +++ b/Spigot-API-Patches/Make-the-default-permission-message-configurable.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Make the default permission message configurable diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index cbabd807..2ab73439 100644 +index 19fb0e5d2..6b0a09067 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java @@ -0,0 +0,0 @@ public final class Bukkit { @@ -16,6 +16,7 @@ index cbabd807..2ab73439 100644 + * + * @return the default no permission message used on the server + */ ++ @NotNull + public static String getPermissionMessage() { + return server.getPermissionMessage(); + } @@ -24,7 +25,7 @@ index cbabd807..2ab73439 100644 * Creates a PlayerProfile for the specified uuid, with name as null * @param uuid UUID to create profile for diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 9c5049cd..7c7725a7 100644 +index 1df58f72a..66d22ba79 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient { @@ -35,13 +36,14 @@ index 9c5049cd..7c7725a7 100644 + * + * @return the default no permission message used on the server + */ ++ @NotNull + String getPermissionMessage(); + /** * Creates a PlayerProfile for the specified uuid, with name as null * @param uuid UUID to create profile for diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java -index db7f4428..77171cd1 100644 +index 01ea1ca67..de016865f 100644 --- a/src/main/java/org/bukkit/command/Command.java +++ b/src/main/java/org/bukkit/command/Command.java @@ -0,0 +0,0 @@ public abstract class Command { diff --git a/Spigot-API-Patches/Material-API-additions.patch b/Spigot-API-Patches/Material-API-additions.patch index 55c4a28ab6..7b225fb99a 100644 --- a/Spigot-API-Patches/Material-API-additions.patch +++ b/Spigot-API-Patches/Material-API-additions.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Material API additions diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java -index 387a0d7c..df5b0d38 100644 +index 6120955b1..c628a9349 100644 --- a/src/main/java/org/bukkit/Material.java +++ b/src/main/java/org/bukkit/Material.java -@@ -0,0 +0,0 @@ import org.bukkit.material.MaterialData; +@@ -0,0 +0,0 @@ import org.jetbrains.annotations.Nullable; /** * An enum of all material IDs accepted by the official server and client */ diff --git a/Spigot-API-Patches/Misc-Utils.patch b/Spigot-API-Patches/Misc-Utils.patch index b1ce34469e..d5654b9dff 100644 --- a/Spigot-API-Patches/Misc-Utils.patch +++ b/Spigot-API-Patches/Misc-Utils.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Misc Utils diff --git a/src/main/java/com/destroystokyo/paper/utils/CachedSizeConcurrentLinkedQueue.java b/src/main/java/com/destroystokyo/paper/utils/CachedSizeConcurrentLinkedQueue.java new file mode 100644 -index 00000000..d60ecbb1 +index 000000000..5bb677ce5 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/utils/CachedSizeConcurrentLinkedQueue.java @@ -0,0 +0,0 @@ @@ -14,12 +14,14 @@ index 00000000..d60ecbb1 + +import java.util.concurrent.ConcurrentLinkedQueue; +import java.util.concurrent.atomic.LongAdder; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +public class CachedSizeConcurrentLinkedQueue extends ConcurrentLinkedQueue { + private final LongAdder cachedSize = new LongAdder(); + + @Override -+ public boolean add(E e) { ++ public boolean add(@NotNull E e) { + boolean result = super.add(e); + if (result) { + cachedSize.increment(); @@ -27,6 +29,7 @@ index 00000000..d60ecbb1 + return result; + } + ++ @Nullable + @Override + public E poll() { + E result = super.poll(); diff --git a/Spigot-API-Patches/Mob-Pathfinding-API.patch b/Spigot-API-Patches/Mob-Pathfinding-API.patch index 7013840e1c..406d364867 100644 --- a/Spigot-API-Patches/Mob-Pathfinding-API.patch +++ b/Spigot-API-Patches/Mob-Pathfinding-API.patch @@ -13,7 +13,7 @@ You can use EntityPathfindEvent to cancel new pathfinds from overriding your cur diff --git a/src/main/java/com/destroystokyo/paper/entity/Pathfinder.java b/src/main/java/com/destroystokyo/paper/entity/Pathfinder.java new file mode 100644 -index 00000000..d6953b39 +index 000000000..8b90a9053 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/entity/Pathfinder.java @@ -0,0 +0,0 @@ @@ -23,9 +23,9 @@ index 00000000..d6953b39 +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Mob; + -+import javax.annotation.Nonnull; -+import javax.annotation.Nullable; +import java.util.List; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * Handles pathfinding operations for an Entity @@ -36,6 +36,7 @@ index 00000000..d6953b39 + * + * @return The entity that is controlled by this pathfinder + */ ++ @NotNull + Mob getEntity(); + + /** @@ -52,7 +53,8 @@ index 00000000..d6953b39 + /** + * @return The location the entity is trying to navigate to, or null if there is no destination + */ -+ @Nullable PathResult getCurrentPath(); ++ @Nullable ++ PathResult getCurrentPath(); + + /** + * Calculates a destination for the Entity to navigate to, but does not set it @@ -60,7 +62,7 @@ index 00000000..d6953b39 + * @param loc Location to navigate to + * @return The closest Location the Entity can get to for this navigation, or null if no path could be calculated + */ -+ @Nullable PathResult findPath(Location loc); ++ @Nullable PathResult findPath(@NotNull Location loc); + + /** + * Calculates a destination for the Entity to navigate to to reach the target entity, @@ -75,7 +77,7 @@ index 00000000..d6953b39 + * @param target the Entity to navigate to + * @return The closest Location the Entity can get to for this navigation, or null if no path could be calculated + */ -+ @Nullable PathResult findPath(LivingEntity target); ++ @Nullable PathResult findPath(@NotNull LivingEntity target); + + /** + * Calculates a destination for the Entity to navigate to, and sets it with default speed @@ -83,7 +85,7 @@ index 00000000..d6953b39 + * @param loc Location to navigate to + * @return If the pathfinding was successfully started + */ -+ default boolean moveTo(@Nonnull Location loc) { ++ default boolean moveTo(@NotNull Location loc) { + return moveTo(loc, 1); + } + @@ -94,7 +96,7 @@ index 00000000..d6953b39 + * @param speed Speed multiplier to navigate at, where 1 is 'normal' + * @return If the pathfinding was successfully started + */ -+ default boolean moveTo(@Nonnull Location loc, double speed) { ++ default boolean moveTo(@NotNull Location loc, double speed) { + PathResult path = findPath(loc); + return path != null && moveTo(path, speed); + } @@ -111,7 +113,7 @@ index 00000000..d6953b39 + * @param target the Entity to navigate to + * @return If the pathfinding was successfully started + */ -+ default boolean moveTo(@Nonnull LivingEntity target) { ++ default boolean moveTo(@NotNull LivingEntity target) { + return moveTo(target, 1); + } + @@ -128,7 +130,7 @@ index 00000000..d6953b39 + * @param speed Speed multiplier to navigate at, where 1 is 'normal' + * @return If the pathfinding was successfully started + */ -+ default boolean moveTo(@Nonnull LivingEntity target, double speed) { ++ default boolean moveTo(@NotNull LivingEntity target, double speed) { + PathResult path = findPath(target); + return path != null && moveTo(path, speed); + } @@ -140,7 +142,7 @@ index 00000000..d6953b39 + * @param path The Path to start following + * @return If the pathfinding was successfully started + */ -+ default boolean moveTo(@Nonnull PathResult path) { ++ default boolean moveTo(@NotNull PathResult path) { + return moveTo(path, 1); + } + @@ -152,7 +154,7 @@ index 00000000..d6953b39 + * @param speed Speed multiplier to navigate at, where 1 is 'normal' + * @return If the pathfinding was successfully started + */ -+ boolean moveTo(@Nonnull PathResult path, double speed); ++ boolean moveTo(@NotNull PathResult path, double speed); + + /** + * Represents the result of a pathfinding calculation @@ -165,6 +167,7 @@ index 00000000..d6953b39 + * Will return points the entity has already moved past, see {@link #getNextPointIndex()} + * @return List of points + */ ++ @NotNull + List getPoints(); + + /** @@ -185,10 +188,18 @@ index 00000000..d6953b39 + } +} diff --git a/src/main/java/org/bukkit/entity/Mob.java b/src/main/java/org/bukkit/entity/Mob.java -index d029d34e..48eddcd3 100644 +index 838440ff8..afdc103fe 100644 --- a/src/main/java/org/bukkit/entity/Mob.java +++ b/src/main/java/org/bukkit/entity/Mob.java -@@ -0,0 +0,0 @@ import org.bukkit.loot.Lootable; +@@ -0,0 +0,0 @@ + package org.bukkit.entity; + + import org.bukkit.loot.Lootable; ++import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + + /** +@@ -0,0 +0,0 @@ import org.jetbrains.annotations.Nullable; */ public interface Mob extends LivingEntity, Lootable { @@ -197,6 +208,7 @@ index d029d34e..48eddcd3 100644 + * Enables access to control the pathing of an Entity + * @return Pathfinding Manager for this entity + */ ++ @NotNull + com.destroystokyo.paper.entity.Pathfinder getPathfinder(); + // Paper end + diff --git a/Spigot-API-Patches/Optimize-Hoppers.patch b/Spigot-API-Patches/Optimize-Hoppers.patch index 5b0aa4e706..fe66ae31ed 100644 --- a/Spigot-API-Patches/Optimize-Hoppers.patch +++ b/Spigot-API-Patches/Optimize-Hoppers.patch @@ -7,7 +7,7 @@ Adds data about what Item related methods were used in InventoryMoveItem event so that the server can improve the performance of this event. diff --git a/src/main/java/org/bukkit/event/inventory/InventoryMoveItemEvent.java b/src/main/java/org/bukkit/event/inventory/InventoryMoveItemEvent.java -index 06ec99ae..b44cc45b 100644 +index 2bb57d23..f0a16d3c 100644 --- a/src/main/java/org/bukkit/event/inventory/InventoryMoveItemEvent.java +++ b/src/main/java/org/bukkit/event/inventory/InventoryMoveItemEvent.java @@ -0,0 +0,0 @@ public class InventoryMoveItemEvent extends Event implements Cancellable { @@ -17,11 +17,11 @@ index 06ec99ae..b44cc45b 100644 + public boolean calledGetItem; // Paper + public boolean calledSetItem; // Paper - public InventoryMoveItemEvent(final Inventory sourceInventory, final ItemStack itemStack, final Inventory destinationInventory, final boolean didSourceInitiate) { + public InventoryMoveItemEvent(@NotNull final Inventory sourceInventory, @NotNull final ItemStack itemStack, @NotNull final Inventory destinationInventory, final boolean didSourceInitiate) { Validate.notNull(itemStack, "ItemStack cannot be null"); @@ -0,0 +0,0 @@ public class InventoryMoveItemEvent extends Event implements Cancellable { - * @return ItemStack */ + @NotNull public ItemStack getItem() { - return itemStack.clone(); + calledGetItem = true; // Paper - record this method was used for auto detection of mode @@ -31,7 +31,7 @@ index 06ec99ae..b44cc45b 100644 /** @@ -0,0 +0,0 @@ public class InventoryMoveItemEvent extends Event implements Cancellable { */ - public void setItem(ItemStack itemStack) { + public void setItem(@NotNull ItemStack itemStack) { Validate.notNull(itemStack, "ItemStack cannot be null. Cancel the event if you want nothing to be transferred."); + calledSetItem = true; // Paper - record this method was used for auto detection of mode this.itemStack = itemStack.clone(); diff --git a/Spigot-API-Patches/POM-changes.patch b/Spigot-API-Patches/POM-changes.patch index f2e7915107..1a143fd348 100644 --- a/Spigot-API-Patches/POM-changes.patch +++ b/Spigot-API-Patches/POM-changes.patch @@ -5,7 +5,7 @@ Subject: [PATCH] POM changes diff --git a/pom.xml b/pom.xml -index 23fde9622..a613cf963 100644 +index b3369ecf..c2ec40c7 100644 --- a/pom.xml +++ b/pom.xml @@ -0,0 +0,0 @@ diff --git a/Spigot-API-Patches/Paper-Utils.patch b/Spigot-API-Patches/Paper-Utils.patch index f27bbadf76..4f62a93ddc 100644 --- a/Spigot-API-Patches/Paper-Utils.patch +++ b/Spigot-API-Patches/Paper-Utils.patch @@ -6,20 +6,22 @@ Subject: [PATCH] Paper Utils diff --git a/src/main/java/com/destroystokyo/paper/util/SneakyThrow.java b/src/main/java/com/destroystokyo/paper/util/SneakyThrow.java new file mode 100644 -index 00000000..e5850967 +index 000000000..9db0056ab --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/util/SneakyThrow.java @@ -0,0 +0,0 @@ +package com.destroystokyo.paper.util; + ++import org.jetbrains.annotations.NotNull; ++ +public class SneakyThrow { + -+ public static void sneaky(Throwable exception) { ++ public static void sneaky(@NotNull Throwable exception) { + SneakyThrow.throwSneaky(exception); + } + + @SuppressWarnings("unchecked") -+ private static void throwSneaky(Throwable exception) throws T { ++ private static void throwSneaky(@NotNull Throwable exception) throws T { + throw (T) exception; + } + diff --git a/Spigot-API-Patches/Performance-Concurrency-Improvements-to-Permissions.patch b/Spigot-API-Patches/Performance-Concurrency-Improvements-to-Permissions.patch index 09c572f36d..4935c35ab2 100644 --- a/Spigot-API-Patches/Performance-Concurrency-Improvements-to-Permissions.patch +++ b/Spigot-API-Patches/Performance-Concurrency-Improvements-to-Permissions.patch @@ -18,7 +18,7 @@ Optimized it to simply be a single get call cutting permission map lookups in half. diff --git a/src/main/java/org/bukkit/permissions/PermissibleBase.java b/src/main/java/org/bukkit/permissions/PermissibleBase.java -index d4cb00a8..486f69f8 100644 +index 27c14c0f5..72fff64e0 100644 --- a/src/main/java/org/bukkit/permissions/PermissibleBase.java +++ b/src/main/java/org/bukkit/permissions/PermissibleBase.java @@ -0,0 +0,0 @@ public class PermissibleBase implements Permissible { @@ -50,17 +50,18 @@ index d4cb00a8..486f69f8 100644 return perm.getDefault().getValue(isOp()); } -- public PermissionAttachment addAttachment(Plugin plugin, String name, boolean value) { -+ public synchronized PermissionAttachment addAttachment(Plugin plugin, String name, boolean value) { // Paper - synchronized + @NotNull +- public PermissionAttachment addAttachment(@NotNull Plugin plugin, @NotNull String name, boolean value) { ++ public synchronized PermissionAttachment addAttachment(@NotNull Plugin plugin, @NotNull String name, boolean value) { // Paper - synchronized if (name == null) { throw new IllegalArgumentException("Permission name cannot be null"); } else if (plugin == null) { @@ -0,0 +0,0 @@ public class PermissibleBase implements Permissible { - return result; } -- public PermissionAttachment addAttachment(Plugin plugin) { -+ public synchronized PermissionAttachment addAttachment(Plugin plugin) { // Paper - synchronized + @NotNull +- public PermissionAttachment addAttachment(@NotNull Plugin plugin) { ++ public synchronized PermissionAttachment addAttachment(@NotNull Plugin plugin) { // Paper - synchronized if (plugin == null) { throw new IllegalArgumentException("Plugin cannot be null"); } else if (!plugin.isEnabled()) { @@ -68,8 +69,8 @@ index d4cb00a8..486f69f8 100644 return result; } -- public void removeAttachment(PermissionAttachment attachment) { -+ public synchronized void removeAttachment(PermissionAttachment attachment) { // Paper - synchronized +- public void removeAttachment(@NotNull PermissionAttachment attachment) { ++ public synchronized void removeAttachment(@NotNull PermissionAttachment attachment) { // Paper - synchronized if (attachment == null) { throw new IllegalArgumentException("Attachment cannot be null"); } @@ -83,27 +84,27 @@ index d4cb00a8..486f69f8 100644 Set defaults = Bukkit.getServer().getPluginManager().getDefaultPermissions(isOp()); Bukkit.getServer().getPluginManager().subscribeToDefaultPerms(isOp(), parent); @@ -0,0 +0,0 @@ public class PermissibleBase implements Permissible { - } } -- public PermissionAttachment addAttachment(Plugin plugin, String name, boolean value, int ticks) { -+ public synchronized PermissionAttachment addAttachment(Plugin plugin, String name, boolean value, int ticks) { // Paper - synchronized + @Nullable +- public PermissionAttachment addAttachment(@NotNull Plugin plugin, @NotNull String name, boolean value, int ticks) { ++ public synchronized PermissionAttachment addAttachment(@NotNull Plugin plugin, @NotNull String name, boolean value, int ticks) { // Paper if (name == null) { throw new IllegalArgumentException("Permission name cannot be null"); } else if (plugin == null) { @@ -0,0 +0,0 @@ public class PermissibleBase implements Permissible { - return result; } -- public PermissionAttachment addAttachment(Plugin plugin, int ticks) { -+ public synchronized PermissionAttachment addAttachment(Plugin plugin, int ticks) { // Paper - synchronized + @Nullable +- public PermissionAttachment addAttachment(@NotNull Plugin plugin, int ticks) { ++ public synchronized PermissionAttachment addAttachment(@NotNull Plugin plugin, int ticks) { // Paper - synchronized if (plugin == null) { throw new IllegalArgumentException("Plugin cannot be null"); } else if (!plugin.isEnabled()) { @@ -0,0 +0,0 @@ public class PermissibleBase implements Permissible { - } } + @NotNull - public Set getEffectivePermissions() { + public synchronized Set getEffectivePermissions() { // Paper - synchronized return new HashSet(permissions.values()); diff --git a/Spigot-API-Patches/Player-Tab-List-and-Title-APIs.patch b/Spigot-API-Patches/Player-Tab-List-and-Title-APIs.patch index 7e029dc54e..1a393ff747 100644 --- a/Spigot-API-Patches/Player-Tab-List-and-Title-APIs.patch +++ b/Spigot-API-Patches/Player-Tab-List-and-Title-APIs.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Player Tab List and Title APIs diff --git a/src/main/java/com/destroystokyo/paper/Title.java b/src/main/java/com/destroystokyo/paper/Title.java new file mode 100644 -index 00000000..3c2b63db +index 000000000..4fe18540f --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/Title.java @@ -0,0 +0,0 @@ @@ -16,6 +16,8 @@ index 00000000..3c2b63db +import net.md_5.bungee.api.chat.TextComponent; + +import org.bukkit.entity.Player; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkNotNull; @@ -55,7 +57,7 @@ index 00000000..3c2b63db + * @param title the main text of the title + * @throws NullPointerException if the title is null + */ -+ public Title(BaseComponent title) { ++ public Title(@NotNull BaseComponent title) { + this(title, null); + } + @@ -67,7 +69,7 @@ index 00000000..3c2b63db + * @param title the main text of the title + * @throws NullPointerException if the title is null + */ -+ public Title(BaseComponent[] title) { ++ public Title(@NotNull BaseComponent[] title) { + this(title, null); + } + @@ -79,7 +81,7 @@ index 00000000..3c2b63db + * @param title the main text of the title + * @throws NullPointerException if the title is null + */ -+ public Title(String title) { ++ public Title(@NotNull String title) { + this(title, null); + } + @@ -91,7 +93,7 @@ index 00000000..3c2b63db + * @param title the main text of the title + * @param subtitle the secondary text of the title + */ -+ public Title(BaseComponent title, BaseComponent subtitle) { ++ public Title(@NotNull BaseComponent title, @Nullable BaseComponent subtitle) { + this(title, subtitle, DEFAULT_FADE_IN, DEFAULT_STAY, DEFAULT_FADE_OUT); + } + @@ -103,7 +105,7 @@ index 00000000..3c2b63db + * @param title the main text of the title + * @param subtitle the secondary text of the title + */ -+ public Title(BaseComponent[] title, BaseComponent[] subtitle) { ++ public Title(@NotNull BaseComponent[] title, @Nullable BaseComponent[] subtitle) { + this(title, subtitle, DEFAULT_FADE_IN, DEFAULT_STAY, DEFAULT_FADE_OUT); + } + @@ -115,7 +117,7 @@ index 00000000..3c2b63db + * @param title the main text of the title + * @param subtitle the secondary text of the title + */ -+ public Title(String title, String subtitle) { ++ public Title(@NotNull String title, @Nullable String subtitle) { + this(title, subtitle, DEFAULT_FADE_IN, DEFAULT_STAY, DEFAULT_FADE_OUT); + } + @@ -129,7 +131,7 @@ index 00000000..3c2b63db + * @param fadeOut the number of ticks for the title to fade out + * @throws IllegalArgumentException if any of the times are negative + */ -+ public Title(BaseComponent title, BaseComponent subtitle, int fadeIn, int stay, int fadeOut) { ++ public Title(@NotNull BaseComponent title, @Nullable BaseComponent subtitle, int fadeIn, int stay, int fadeOut) { + this( + new BaseComponent[]{checkNotNull(title, "title")}, + subtitle == null ? null : new BaseComponent[]{subtitle}, @@ -149,7 +151,7 @@ index 00000000..3c2b63db + * @param fadeOut the number of ticks for the title to fade out + * @throws IllegalArgumentException if any of the times are negative + */ -+ public Title(BaseComponent[] title, BaseComponent[] subtitle, int fadeIn, int stay, int fadeOut) { ++ public Title(@Nullable BaseComponent[] title, @NotNull BaseComponent[] subtitle, int fadeIn, int stay, int fadeOut) { + checkArgument(fadeIn >= 0, "Negative fadeIn: %s", fadeIn); + checkArgument(stay >= 0, "Negative stay: %s", stay); + checkArgument(fadeOut >= 0, "Negative fadeOut: %s", fadeOut); @@ -171,7 +173,7 @@ index 00000000..3c2b63db + * @param stay the number of ticks for the title to stay on screen + * @param fadeOut the number of ticks for the title to fade out + */ -+ public Title(String title, String subtitle, int fadeIn, int stay, int fadeOut) { ++ public Title(@NotNull String title, @Nullable String subtitle, int fadeIn, int stay, int fadeOut) { + this( + TextComponent.fromLegacyText(checkNotNull(title, "title")), + subtitle == null ? null : TextComponent.fromLegacyText(subtitle), @@ -186,6 +188,7 @@ index 00000000..3c2b63db + * + * @return the text + */ ++ @NotNull + public BaseComponent[] getTitle() { + return this.title; + } @@ -195,6 +198,7 @@ index 00000000..3c2b63db + * + * @return the text + */ ++ @Nullable + public BaseComponent[] getSubtitle() { + return this.subtitle; + } @@ -232,6 +236,7 @@ index 00000000..3c2b63db + return this.fadeOut; + } + ++ @NotNull + public static Builder builder() { + return new Builder(); + } @@ -254,7 +259,8 @@ index 00000000..3c2b63db + * @return this builder instance + * @throws NullPointerException if the title is null + */ -+ public Builder title(BaseComponent title) { ++ @NotNull ++ public Builder title(@NotNull BaseComponent title) { + return this.title(new BaseComponent[]{checkNotNull(title, "title")}); + } + @@ -265,7 +271,8 @@ index 00000000..3c2b63db + * @return this builder instance + * @throws NullPointerException if the title is null + */ -+ public Builder title(BaseComponent[] title) { ++ @NotNull ++ public Builder title(@NotNull BaseComponent[] title) { + this.title = checkNotNull(title, "title"); + return this; + } @@ -279,7 +286,8 @@ index 00000000..3c2b63db + * @return this builder instance + * @throws NullPointerException if the title is null + */ -+ public Builder title(String title) { ++ @NotNull ++ public Builder title(@NotNull String title) { + return this.title(TextComponent.fromLegacyText(checkNotNull(title, "title"))); + } + @@ -289,7 +297,8 @@ index 00000000..3c2b63db + * @param subtitle the title text + * @return this builder instance + */ -+ public Builder subtitle(BaseComponent subtitle) { ++ @NotNull ++ public Builder subtitle(@Nullable BaseComponent subtitle) { + return this.subtitle(subtitle == null ? null : new BaseComponent[]{subtitle}); + } + @@ -299,7 +308,8 @@ index 00000000..3c2b63db + * @param subtitle the title text + * @return this builder instance + */ -+ public Builder subtitle(BaseComponent[] subtitle) { ++ @NotNull ++ public Builder subtitle(@Nullable BaseComponent[] subtitle) { + this.subtitle = subtitle; + return this; + } @@ -312,7 +322,8 @@ index 00000000..3c2b63db + * @param subtitle the title text + * @return this builder instance + */ -+ public Builder subtitle(String subtitle) { ++ @NotNull ++ public Builder subtitle(@Nullable String subtitle) { + return this.subtitle(subtitle == null ? null : TextComponent.fromLegacyText(subtitle)); + } + @@ -323,6 +334,7 @@ index 00000000..3c2b63db + * @return this builder instance + * @throws IllegalArgumentException if it is negative + */ ++ @NotNull + public Builder fadeIn(int fadeIn) { + checkArgument(fadeIn >= 0, "Negative fadeIn: %s", fadeIn); + this.fadeIn = fadeIn; @@ -337,6 +349,7 @@ index 00000000..3c2b63db + * @return this builder instance + * @throws IllegalArgumentException if it is negative + */ ++ @NotNull + public Builder stay(int stay) { + checkArgument(stay >= 0, "Negative stay: %s", stay); + this.stay = stay; @@ -350,6 +363,7 @@ index 00000000..3c2b63db + * @return this builder instance + * @throws IllegalArgumentException if it is negative + */ ++ @NotNull + public Builder fadeOut(int fadeOut) { + checkArgument(fadeOut >= 0, "Negative fadeOut: %s", fadeOut); + this.fadeOut = fadeOut; @@ -362,6 +376,7 @@ index 00000000..3c2b63db + * @return a title from the values in this builder + * @throws IllegalStateException if title isn't specified + */ ++ @NotNull + public Title build() { + checkState(title != null, "Title not specified"); + return new Title(this.title, this.subtitle, this.fadeIn, this.stay, this.fadeOut); @@ -369,7 +384,7 @@ index 00000000..3c2b63db + } +} diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index bf86eb67..959add05 100644 +index 5a741b41e..1de43bd33 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -0,0 +0,0 @@ package org.bukkit.entity; @@ -378,8 +393,8 @@ index bf86eb67..959add05 100644 +import com.destroystokyo.paper.Title; import org.bukkit.Achievement; - import org.bukkit.ChatColor; import org.bukkit.Effect; + import org.bukkit.GameMode; @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM public default void sendMessage(net.md_5.bungee.api.ChatMessageType position, net.md_5.bungee.api.chat.BaseComponent... components) { spigot().sendMessage(position, components); @@ -391,7 +406,7 @@ index bf86eb67..959add05 100644 + * @param header content for the top of the player list + * @param footer content for the bottom of the player list + */ -+ public void setPlayerListHeaderFooter(net.md_5.bungee.api.chat.BaseComponent[] header, net.md_5.bungee.api.chat.BaseComponent[] footer); ++ public void setPlayerListHeaderFooter(@Nullable net.md_5.bungee.api.chat.BaseComponent[] header, @Nullable net.md_5.bungee.api.chat.BaseComponent[] footer); + + /** + * Set the text displayed in the player list header and footer for this player @@ -399,7 +414,7 @@ index bf86eb67..959add05 100644 + * @param header content for the top of the player list + * @param footer content for the bottom of the player list + */ -+ public void setPlayerListHeaderFooter(net.md_5.bungee.api.chat.BaseComponent header, net.md_5.bungee.api.chat.BaseComponent footer); ++ public void setPlayerListHeaderFooter(@Nullable net.md_5.bungee.api.chat.BaseComponent header, @Nullable net.md_5.bungee.api.chat.BaseComponent footer); + + /** + * Update the times for titles displayed to the player @@ -434,7 +449,7 @@ index bf86eb67..959add05 100644 + * @deprecated Use {@link #sendTitle(Title)} or {@link #updateTitle(Title)} + */ + @Deprecated -+ public void showTitle(net.md_5.bungee.api.chat.BaseComponent[] title); ++ public void showTitle(@Nullable net.md_5.bungee.api.chat.BaseComponent[] title); + + /** + * Show the given title to the player, along with the last subtitle set, using the last set times @@ -442,7 +457,7 @@ index bf86eb67..959add05 100644 + * @deprecated Use {@link #sendTitle(Title)} or {@link #updateTitle(Title)} + */ + @Deprecated -+ public void showTitle(net.md_5.bungee.api.chat.BaseComponent title); ++ public void showTitle(@Nullable net.md_5.bungee.api.chat.BaseComponent title); + + /** + * Show the given title and subtitle to the player using the given times @@ -455,7 +470,7 @@ index bf86eb67..959add05 100644 + * @deprecated Use {@link #sendTitle(Title)} or {@link #updateTitle(Title)} + */ + @Deprecated -+ public void showTitle(net.md_5.bungee.api.chat.BaseComponent[] title, net.md_5.bungee.api.chat.BaseComponent[] subtitle, int fadeInTicks, int stayTicks, int fadeOutTicks); ++ public void showTitle(@Nullable net.md_5.bungee.api.chat.BaseComponent[] title, @Nullable net.md_5.bungee.api.chat.BaseComponent[] subtitle, int fadeInTicks, int stayTicks, int fadeOutTicks); + + /** + * Show the given title and subtitle to the player using the given times @@ -468,7 +483,7 @@ index bf86eb67..959add05 100644 + * @deprecated Use {@link #sendTitle(Title)} or {@link #updateTitle(Title)} + */ + @Deprecated -+ public void showTitle(net.md_5.bungee.api.chat.BaseComponent title, net.md_5.bungee.api.chat.BaseComponent subtitle, int fadeInTicks, int stayTicks, int fadeOutTicks); ++ public void showTitle(@Nullable net.md_5.bungee.api.chat.BaseComponent title, @Nullable net.md_5.bungee.api.chat.BaseComponent subtitle, int fadeInTicks, int stayTicks, int fadeOutTicks); + + /** + * Show the title to the player, overriding any previously displayed title. @@ -478,7 +493,7 @@ index bf86eb67..959add05 100644 + * @param title the title to send + * @throws NullPointerException if the title is null + */ -+ void sendTitle(Title title); ++ void sendTitle(@NotNull Title title); + + /** + * Show the title to the player, overriding any previously displayed title. @@ -488,7 +503,7 @@ index bf86eb67..959add05 100644 + * @param title the title to send + * @throws NullPointerException if title is null + */ -+ void updateTitle(Title title); ++ void updateTitle(@NotNull Title title); + + /** + * Hide any title that is currently visible to the player diff --git a/Spigot-API-Patches/Player-affects-spawning-API.patch b/Spigot-API-Patches/Player-affects-spawning-API.patch index 28d709a771..c99dc870e2 100644 --- a/Spigot-API-Patches/Player-affects-spawning-API.patch +++ b/Spigot-API-Patches/Player-affects-spawning-API.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Player affects spawning API diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 75f21146..694254f1 100644 +index 777994f7..95ebf016 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM - */ + @NotNull public String getLocale(); + // Paper start diff --git a/Spigot-API-Patches/Player.setPlayerProfile-API.patch b/Spigot-API-Patches/Player.setPlayerProfile-API.patch index 2ebc669c53..8c0ae4bd38 100644 --- a/Spigot-API-Patches/Player.setPlayerProfile-API.patch +++ b/Spigot-API-Patches/Player.setPlayerProfile-API.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Player.setPlayerProfile API This can be useful for changing name or skins after a player has logged in. diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index c273b9dc..5dc04f47 100644 +index c7bc13e7d..06154a5c5 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -0,0 +0,0 @@ package org.bukkit.entity; @@ -15,8 +15,8 @@ index c273b9dc..5dc04f47 100644 import com.destroystokyo.paper.Title; +import com.destroystokyo.paper.profile.PlayerProfile; import org.bukkit.Achievement; - import org.bukkit.ChatColor; import org.bukkit.Effect; + import org.bukkit.GameMode; @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * was {@link org.bukkit.event.player.PlayerResourcePackStatusEvent.Status#SUCCESSFULLY_LOADED} */ @@ -26,6 +26,7 @@ index c273b9dc..5dc04f47 100644 + * Gets a copy of this players profile + * @return The players profile object + */ ++ @NotNull + PlayerProfile getPlayerProfile(); + + /** @@ -33,7 +34,7 @@ index c273b9dc..5dc04f47 100644 + * to be reregistered to all clients that can currently see this player + * @param profile The new profile to use + */ -+ void setPlayerProfile(PlayerProfile profile); ++ void setPlayerProfile(@NotNull PlayerProfile profile); // Paper end // Spigot start diff --git a/Spigot-API-Patches/PlayerAdvancementCriterionGrantEvent.patch b/Spigot-API-Patches/PlayerAdvancementCriterionGrantEvent.patch index d75286d59a..92a0b1d9d3 100644 --- a/Spigot-API-Patches/PlayerAdvancementCriterionGrantEvent.patch +++ b/Spigot-API-Patches/PlayerAdvancementCriterionGrantEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] PlayerAdvancementCriterionGrantEvent diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerAdvancementCriterionGrantEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerAdvancementCriterionGrantEvent.java new file mode 100644 -index 00000000..b65ee9e5 +index 000000000..bb8d7c959 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerAdvancementCriterionGrantEvent.java @@ -0,0 +0,0 @@ @@ -17,17 +17,18 @@ index 00000000..b65ee9e5 +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.event.player.PlayerEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Called when a player is granted a criteria in an advancement. + */ +public class PlayerAdvancementCriterionGrantEvent extends PlayerEvent implements Cancellable { + private static final HandlerList handlers = new HandlerList(); -+ private final Advancement advancement; -+ private final String criterion; ++ @NotNull private final Advancement advancement; ++ @NotNull private final String criterion; + private boolean cancel = false; + -+ public PlayerAdvancementCriterionGrantEvent(Player who, Advancement advancement, String criterion) { ++ public PlayerAdvancementCriterionGrantEvent(@NotNull Player who, @NotNull Advancement advancement, @NotNull String criterion) { + super(who); + this.advancement = advancement; + this.criterion = criterion; @@ -38,6 +39,7 @@ index 00000000..b65ee9e5 + * + * @return affected advancement + */ ++ @NotNull + public Advancement getAdvancement() { + return advancement; + } @@ -47,6 +49,7 @@ index 00000000..b65ee9e5 + * + * @return granted criterion + */ ++ @NotNull + public String getCriterion() { + return criterion; + } @@ -59,11 +62,13 @@ index 00000000..b65ee9e5 + this.cancel = cancel; + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } diff --git a/Spigot-API-Patches/PlayerAttemptPickupItemEvent.patch b/Spigot-API-Patches/PlayerAttemptPickupItemEvent.patch index 475590e481..0c73ba68d6 100644 --- a/Spigot-API-Patches/PlayerAttemptPickupItemEvent.patch +++ b/Spigot-API-Patches/PlayerAttemptPickupItemEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] PlayerAttemptPickupItemEvent diff --git a/src/main/java/org/bukkit/event/player/PlayerAttemptPickupItemEvent.java b/src/main/java/org/bukkit/event/player/PlayerAttemptPickupItemEvent.java new file mode 100644 -index 00000000..480293e9 +index 000000000..fb5cb3dc4 --- /dev/null +++ b/src/main/java/org/bukkit/event/player/PlayerAttemptPickupItemEvent.java @@ -0,0 +0,0 @@ @@ -16,23 +16,24 @@ index 00000000..480293e9 +import org.bukkit.entity.Player; +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; ++import org.jetbrains.annotations.NotNull; + +/** + * Thrown when a player attempts to pick an item up from the ground + */ +public class PlayerAttemptPickupItemEvent extends PlayerEvent implements Cancellable { + private static final HandlerList handlers = new HandlerList(); -+ private final Item item; ++ @NotNull private final Item item; + private final int remaining; + private boolean flyAtPlayer = true; + private boolean isCancelled = false; + -+ @Deprecated // Remove in 1.13 -+ public PlayerAttemptPickupItemEvent(final Player player, final Item item) { ++ @Deprecated // Remove in 1.13 // Remove in 1.14? ++ public PlayerAttemptPickupItemEvent(@NotNull final Player player, @NotNull final Item item) { + this(player, item, 0); + } + -+ public PlayerAttemptPickupItemEvent(final Player player, final Item item, final int remaining) { ++ public PlayerAttemptPickupItemEvent(@NotNull final Player player, @NotNull final Item item, final int remaining) { + super(player); + this.item = item; + this.remaining = remaining; @@ -43,6 +44,7 @@ index 00000000..480293e9 + * + * @return Item + */ ++ @NotNull + public Item getItem() { + return item; + } @@ -86,11 +88,13 @@ index 00000000..480293e9 + this.isCancelled = cancel; + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } diff --git a/Spigot-API-Patches/PlayerElytraBoostEvent.patch b/Spigot-API-Patches/PlayerElytraBoostEvent.patch index a0079e2839..eb1cd5ab05 100644 --- a/Spigot-API-Patches/PlayerElytraBoostEvent.patch +++ b/Spigot-API-Patches/PlayerElytraBoostEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] PlayerElytraBoostEvent diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerElytraBoostEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerElytraBoostEvent.java new file mode 100644 -index 00000000..cecb2182 +index 000000000..e9a76a25f --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerElytraBoostEvent.java @@ -0,0 +0,0 @@ @@ -18,6 +18,7 @@ index 00000000..cecb2182 +import org.bukkit.event.HandlerList; +import org.bukkit.event.player.PlayerEvent; +import org.bukkit.inventory.ItemStack; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired when a player boosts elytra flight with a firework @@ -25,11 +26,11 @@ index 00000000..cecb2182 +public class PlayerElytraBoostEvent extends PlayerEvent implements Cancellable { + private static final HandlerList handlers = new HandlerList(); + private boolean cancelled = false; -+ private final ItemStack itemStack; -+ private Firework firework; ++ @NotNull private final ItemStack itemStack; ++ @NotNull private Firework firework; + private boolean consume = true; + -+ public PlayerElytraBoostEvent(Player player, ItemStack itemStack, Firework firework) { ++ public PlayerElytraBoostEvent(@NotNull Player player, @NotNull ItemStack itemStack, @NotNull Firework firework) { + super(player); + this.itemStack = itemStack; + this.firework = firework; @@ -40,6 +41,7 @@ index 00000000..cecb2182 + * + * @return ItemStack of firework + */ ++ @NotNull + public ItemStack getItemStack() { + return itemStack; + } @@ -49,6 +51,7 @@ index 00000000..cecb2182 + * + * @return Firework entity + */ ++ @NotNull + public Firework getFirework() { + return firework; + } @@ -71,11 +74,13 @@ index 00000000..cecb2182 + this.consume = consume; + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } diff --git a/Spigot-API-Patches/PlayerLaunchProjectileEvent.patch b/Spigot-API-Patches/PlayerLaunchProjectileEvent.patch index 2fc6099b14..a07118f13b 100644 --- a/Spigot-API-Patches/PlayerLaunchProjectileEvent.patch +++ b/Spigot-API-Patches/PlayerLaunchProjectileEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] PlayerLaunchProjectileEvent diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerLaunchProjectileEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerLaunchProjectileEvent.java new file mode 100644 -index 00000000..d2b244a4 +index 000000000..9074b2ede --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerLaunchProjectileEvent.java @@ -0,0 +0,0 @@ @@ -18,18 +18,19 @@ index 00000000..d2b244a4 +import org.bukkit.event.HandlerList; +import org.bukkit.event.player.PlayerEvent; +import org.bukkit.inventory.ItemStack; ++import org.jetbrains.annotations.NotNull; + +/** + * Called when a player shoots a projectile + */ +public class PlayerLaunchProjectileEvent extends PlayerEvent implements Cancellable { + private static final HandlerList handlers = new HandlerList(); -+ private final Projectile projectile; -+ private final ItemStack itemStack; ++ @NotNull private final Projectile projectile; ++ @NotNull private final ItemStack itemStack; + private boolean consumeItem = true; + private boolean cancelled; + -+ public PlayerLaunchProjectileEvent(Player shooter, ItemStack itemStack, Projectile projectile) { ++ public PlayerLaunchProjectileEvent(@NotNull Player shooter, @NotNull ItemStack itemStack, @NotNull Projectile projectile) { + super(shooter); + this.itemStack = itemStack; + this.projectile = projectile; @@ -40,6 +41,7 @@ index 00000000..d2b244a4 + * + * @return the launched projectile + */ ++ @NotNull + public Projectile getProjectile() { + return projectile; + } @@ -49,6 +51,7 @@ index 00000000..d2b244a4 + * + * @return The ItemStack used + */ ++ @NotNull + public ItemStack getItemStack() { + return itemStack; + } @@ -79,11 +82,13 @@ index 00000000..d2b244a4 + cancelled = cancel; + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } diff --git a/Spigot-API-Patches/PlayerNaturallySpawnCreaturesEvent.patch b/Spigot-API-Patches/PlayerNaturallySpawnCreaturesEvent.patch index cd1e9e3b29..0cc617ffd3 100644 --- a/Spigot-API-Patches/PlayerNaturallySpawnCreaturesEvent.patch +++ b/Spigot-API-Patches/PlayerNaturallySpawnCreaturesEvent.patch @@ -10,7 +10,7 @@ Also a highly more effecient way to blanket block spawns in a world diff --git a/src/main/java/com/destroystokyo/paper/event/entity/PlayerNaturallySpawnCreaturesEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/PlayerNaturallySpawnCreaturesEvent.java new file mode 100644 -index 00000000..7c6953a7 +index 000000000..112a0dbf5 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/PlayerNaturallySpawnCreaturesEvent.java @@ -0,0 +0,0 @@ @@ -21,6 +21,7 @@ index 00000000..7c6953a7 +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; +import org.bukkit.event.player.PlayerEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired when the server is calculating what chunks to try to spawn monsters in every Monster Spawn Tick event @@ -28,7 +29,7 @@ index 00000000..7c6953a7 +public class PlayerNaturallySpawnCreaturesEvent extends PlayerEvent implements Cancellable { + private byte radius; + -+ public PlayerNaturallySpawnCreaturesEvent(Player player, byte radius) { ++ public PlayerNaturallySpawnCreaturesEvent(@NotNull Player player, byte radius) { + super(player); + this.radius = radius; + } @@ -49,10 +50,12 @@ index 00000000..7c6953a7 + + private static final HandlerList handlers = new HandlerList(); + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } diff --git a/Spigot-API-Patches/PlayerPickupExperienceEvent.patch b/Spigot-API-Patches/PlayerPickupExperienceEvent.patch index 4ec22d72e9..4e0660c05c 100644 --- a/Spigot-API-Patches/PlayerPickupExperienceEvent.patch +++ b/Spigot-API-Patches/PlayerPickupExperienceEvent.patch @@ -7,7 +7,7 @@ Allows plugins to cancel a player picking up an experience orb diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerPickupExperienceEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerPickupExperienceEvent.java new file mode 100644 -index 00000000..f9ef95cd +index 000000000..f7beb22d5 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerPickupExperienceEvent.java @@ -0,0 +0,0 @@ @@ -42,14 +42,15 @@ index 00000000..f9ef95cd +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; +import org.bukkit.event.player.PlayerEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired when a player is attempting to pick up an experience orb + */ +public class PlayerPickupExperienceEvent extends PlayerEvent implements Cancellable { -+ private final ExperienceOrb experienceOrb; ++ @NotNull private final ExperienceOrb experienceOrb; + -+ public PlayerPickupExperienceEvent(Player player, ExperienceOrb experienceOrb) { ++ public PlayerPickupExperienceEvent(@NotNull Player player, @NotNull ExperienceOrb experienceOrb) { + super(player); + this.experienceOrb = experienceOrb; + } @@ -57,16 +58,19 @@ index 00000000..f9ef95cd + /** + * @return Returns the Orb that the player is picking up + */ ++ @NotNull + public ExperienceOrb getExperienceOrb() { + return experienceOrb; + } + + private static final HandlerList handlers = new HandlerList(); + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } diff --git a/Spigot-API-Patches/PlayerPickupItemEvent-setFlyAtPlayer.patch b/Spigot-API-Patches/PlayerPickupItemEvent-setFlyAtPlayer.patch index 015e5782fc..be5a743cd6 100644 --- a/Spigot-API-Patches/PlayerPickupItemEvent-setFlyAtPlayer.patch +++ b/Spigot-API-Patches/PlayerPickupItemEvent-setFlyAtPlayer.patch @@ -5,10 +5,10 @@ Subject: [PATCH] PlayerPickupItemEvent#setFlyAtPlayer diff --git a/src/main/java/org/bukkit/event/player/PlayerPickupItemEvent.java b/src/main/java/org/bukkit/event/player/PlayerPickupItemEvent.java -index c76f423e..46c6d519 100644 +index c7599116..5777d380 100644 --- a/src/main/java/org/bukkit/event/player/PlayerPickupItemEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerPickupItemEvent.java -@@ -0,0 +0,0 @@ import org.bukkit.event.entity.EntityPickupItemEvent; +@@ -0,0 +0,0 @@ import org.jetbrains.annotations.NotNull; public class PlayerPickupItemEvent extends PlayerEvent implements Cancellable { private static final HandlerList handlers = new HandlerList(); private final Item item; @@ -50,5 +50,5 @@ index c76f423e..46c6d519 100644 + this.flyAtPlayer = !cancel; // Paper } - @Override + @NotNull -- \ No newline at end of file diff --git a/Spigot-API-Patches/PlayerReadyArrowEvent.patch b/Spigot-API-Patches/PlayerReadyArrowEvent.patch index b463ba3148..8027d31fab 100644 --- a/Spigot-API-Patches/PlayerReadyArrowEvent.patch +++ b/Spigot-API-Patches/PlayerReadyArrowEvent.patch @@ -8,7 +8,7 @@ Plugins can skip selection of certain arrows and control which is used. diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerReadyArrowEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerReadyArrowEvent.java new file mode 100644 -index 00000000..6fde1e97 +index 000000000..5d04a22fd --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerReadyArrowEvent.java @@ -0,0 +0,0 @@ @@ -43,15 +43,16 @@ index 00000000..6fde1e97 +import org.bukkit.event.HandlerList; +import org.bukkit.event.player.PlayerEvent; +import org.bukkit.inventory.ItemStack; ++import org.jetbrains.annotations.NotNull; + +/** + * Called when a player is firing a bow and the server is choosing an arrow to use. + */ +public class PlayerReadyArrowEvent extends PlayerEvent implements Cancellable { -+ private final ItemStack bow; -+ private final ItemStack arrow; ++ @NotNull private final ItemStack bow; ++ @NotNull private final ItemStack arrow; + -+ public PlayerReadyArrowEvent(Player player, ItemStack bow, ItemStack arrow) { ++ public PlayerReadyArrowEvent(@NotNull Player player, @NotNull ItemStack bow, @NotNull ItemStack arrow) { + super(player); + this.bow = bow; + this.arrow = arrow; @@ -60,6 +61,7 @@ index 00000000..6fde1e97 + /** + * @return the player is using to fire the arrow + */ ++ @NotNull + public ItemStack getBow() { + return bow; + } @@ -67,16 +69,19 @@ index 00000000..6fde1e97 + /** + * @return the arrow that is attempting to be used + */ ++ @NotNull + public ItemStack getArrow() { + return arrow; + } + + private static final HandlerList handlers = new HandlerList(); + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } diff --git a/Spigot-API-Patches/PlayerTeleportEndGatewayEvent.patch b/Spigot-API-Patches/PlayerTeleportEndGatewayEvent.patch index 1be689601c..bfcce1bfbf 100644 --- a/Spigot-API-Patches/PlayerTeleportEndGatewayEvent.patch +++ b/Spigot-API-Patches/PlayerTeleportEndGatewayEvent.patch @@ -7,7 +7,7 @@ Allows you to access the Gateway being used in a teleport event diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerTeleportEndGatewayEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerTeleportEndGatewayEvent.java new file mode 100644 -index 00000000..bdefbc9f +index 000000000..b64ab6eec --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerTeleportEndGatewayEvent.java @@ -0,0 +0,0 @@ @@ -17,14 +17,15 @@ index 00000000..bdefbc9f +import org.bukkit.block.EndGateway; +import org.bukkit.entity.Player; +import org.bukkit.event.player.PlayerTeleportEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired when a teleport is triggered for an End Gateway + */ +public class PlayerTeleportEndGatewayEvent extends PlayerTeleportEvent { -+ private final EndGateway gateway; ++ @NotNull private final EndGateway gateway; + -+ public PlayerTeleportEndGatewayEvent(Player player, Location from, Location to, EndGateway gateway) { ++ public PlayerTeleportEndGatewayEvent(@NotNull Player player, @NotNull Location from, @NotNull Location to, @NotNull EndGateway gateway) { + super(player, from, to, PlayerTeleportEvent.TeleportCause.END_GATEWAY); + this.gateway = gateway; + } @@ -34,6 +35,7 @@ index 00000000..bdefbc9f + * + * @return EndGateway used + */ ++ @NotNull + public EndGateway getGateway() { + return gateway; + } diff --git a/Spigot-API-Patches/PotionEffect-clone-methods.patch b/Spigot-API-Patches/PotionEffect-clone-methods.patch index 55f53a0377..4d7bc5d1ba 100644 --- a/Spigot-API-Patches/PotionEffect-clone-methods.patch +++ b/Spigot-API-Patches/PotionEffect-clone-methods.patch @@ -5,7 +5,7 @@ Subject: [PATCH] PotionEffect clone methods diff --git a/src/main/java/org/bukkit/potion/PotionEffect.java b/src/main/java/org/bukkit/potion/PotionEffect.java -index 86616f1b..efb55d29 100644 +index d57450c95..4125a024e 100644 --- a/src/main/java/org/bukkit/potion/PotionEffect.java +++ b/src/main/java/org/bukkit/potion/PotionEffect.java @@ -0,0 +0,0 @@ public class PotionEffect implements ConfigurationSerializable { @@ -13,27 +13,33 @@ index 86616f1b..efb55d29 100644 } + // Paper start -+ public PotionEffect withType(PotionEffectType type) { ++ @NotNull ++ public PotionEffect withType(@NotNull PotionEffectType type) { + return new PotionEffect(type, duration, amplifier, ambient, particles, icon); + } ++ @NotNull + public PotionEffect withDuration(int duration) { + return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon); + } ++ @NotNull + public PotionEffect withAmplifier(int amplifier) { + return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon); + } ++ @NotNull + public PotionEffect withAmbient(boolean ambient) { + return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon); + } ++ @NotNull + public PotionEffect withParticles(boolean particles) { + return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon); + } ++ @NotNull + public PotionEffect withIcon(boolean icon) { + return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon); + } + // Paper end + - private static PotionEffectType getEffectType(Map map) { + @NotNull + private static PotionEffectType getEffectType(@NotNull Map map) { int type = getInt(map, TYPE); - PotionEffectType effect = PotionEffectType.getById(type); -- \ No newline at end of file diff --git a/Spigot-API-Patches/PreCreatureSpawnEvent.patch b/Spigot-API-Patches/PreCreatureSpawnEvent.patch index 17abb6fcbb..40602bddb6 100644 --- a/Spigot-API-Patches/PreCreatureSpawnEvent.patch +++ b/Spigot-API-Patches/PreCreatureSpawnEvent.patch @@ -16,7 +16,7 @@ See: https://github.com/PaperMC/Paper/issues/917 diff --git a/src/main/java/com/destroystokyo/paper/event/entity/PreCreatureSpawnEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/PreCreatureSpawnEvent.java new file mode 100644 -index 00000000..bac1cef3 +index 000000000..d5edde9cd --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/PreCreatureSpawnEvent.java @@ -0,0 +0,0 @@ @@ -29,6 +29,7 @@ index 00000000..bac1cef3 +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.CreatureSpawnEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * WARNING: This event only fires for a limited number of cases, and not for every case that CreatureSpawnEvent does. @@ -40,12 +41,12 @@ index 00000000..bac1cef3 + * Also, Plugins that replace Entity Registrations with their own custom entities might not fire this event. + */ +public class PreCreatureSpawnEvent extends Event implements Cancellable { -+ private final Location location; -+ private final EntityType type; -+ private final CreatureSpawnEvent.SpawnReason reason; ++ @NotNull private final Location location; ++ @NotNull private final EntityType type; ++ @NotNull private final CreatureSpawnEvent.SpawnReason reason; + private boolean shouldAbortSpawn; + -+ public PreCreatureSpawnEvent(Location location, EntityType type, CreatureSpawnEvent.SpawnReason reason) { ++ public PreCreatureSpawnEvent(@NotNull Location location, @NotNull EntityType type, @NotNull CreatureSpawnEvent.SpawnReason reason) { + this.location = Preconditions.checkNotNull(location, "Location may not be null").clone(); + this.type = Preconditions.checkNotNull(type, "Type may not be null"); + this.reason = Preconditions.checkNotNull(reason, "Reason may not be null"); @@ -54,6 +55,7 @@ index 00000000..bac1cef3 + /** + * @return The location this creature is being spawned at + */ ++ @NotNull + public Location getSpawnLocation() { + return location; + } @@ -61,6 +63,7 @@ index 00000000..bac1cef3 + /** + * @return The type of creature being spawned + */ ++ @NotNull + public EntityType getType() { + return type; + } @@ -68,6 +71,7 @@ index 00000000..bac1cef3 + /** + * @return Reason this creature is spawning (ie, NATURAL vs SPAWNER) + */ ++ @NotNull + public CreatureSpawnEvent.SpawnReason getReason() { + return reason; + } @@ -91,10 +95,12 @@ index 00000000..bac1cef3 + + private static final HandlerList handlers = new HandlerList(); + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } diff --git a/Spigot-API-Patches/PreSpawnerSpawnEvent.patch b/Spigot-API-Patches/PreSpawnerSpawnEvent.patch index 7619c3d308..c09359cd7f 100644 --- a/Spigot-API-Patches/PreSpawnerSpawnEvent.patch +++ b/Spigot-API-Patches/PreSpawnerSpawnEvent.patch @@ -10,7 +10,7 @@ spawners. diff --git a/src/main/java/com/destroystokyo/paper/event/entity/PreSpawnerSpawnEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/PreSpawnerSpawnEvent.java new file mode 100644 -index 00000000..d7221210 +index 000000000..48cff0635 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/PreSpawnerSpawnEvent.java @@ -0,0 +0,0 @@ @@ -21,6 +21,7 @@ index 00000000..d7221210 +import org.bukkit.Location; +import org.bukkit.entity.EntityType; +import org.bukkit.event.entity.CreatureSpawnEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Called before an entity is spawned into a world by a spawner. @@ -30,13 +31,14 @@ index 00000000..d7221210 + */ + +public class PreSpawnerSpawnEvent extends PreCreatureSpawnEvent { -+ private final Location spawnerLocation; ++ @NotNull private final Location spawnerLocation; + -+ public PreSpawnerSpawnEvent(Location location, EntityType type, Location spawnerLocation) { ++ public PreSpawnerSpawnEvent(@NotNull Location location, @NotNull EntityType type, @NotNull Location spawnerLocation) { + super(location, type, CreatureSpawnEvent.SpawnReason.SPAWNER); + this.spawnerLocation = Preconditions.checkNotNull(spawnerLocation, "Spawner location may not be null"); + } + ++ @NotNull + public Location getSpawnerLocation() { + return spawnerLocation; + } diff --git a/Spigot-API-Patches/Profile-Lookup-Events.patch b/Spigot-API-Patches/Profile-Lookup-Events.patch index bd5bd6f936..3ddb0eb2f9 100644 --- a/Spigot-API-Patches/Profile-Lookup-Events.patch +++ b/Spigot-API-Patches/Profile-Lookup-Events.patch @@ -8,7 +8,7 @@ profiles that had to be looked up. diff --git a/src/main/java/com/destroystokyo/paper/event/profile/LookupProfileEvent.java b/src/main/java/com/destroystokyo/paper/event/profile/LookupProfileEvent.java new file mode 100644 -index 00000000..160c98fe +index 000000000..8df37c07c --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/profile/LookupProfileEvent.java @@ -0,0 +0,0 @@ @@ -19,7 +19,7 @@ index 00000000..160c98fe +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; + -+import javax.annotation.Nonnull; ++import org.jetbrains.annotations.NotNull; + +/** + * Allows a plugin to be notified anytime AFTER a Profile has been looked up from the Mojang API @@ -32,9 +32,9 @@ index 00000000..160c98fe + + private static final HandlerList handlers = new HandlerList(); + -+ private final PlayerProfile profile; ++ @NotNull private final PlayerProfile profile; + -+ public LookupProfileEvent(@Nonnull PlayerProfile profile) { ++ public LookupProfileEvent(@NotNull PlayerProfile profile) { + super(!Bukkit.isPrimaryThread()); + this.profile = profile; + } @@ -42,23 +42,25 @@ index 00000000..160c98fe + /** + * @return The profile that was recently looked up. This profile can be mutated + */ -+ @Nonnull ++ @NotNull + public PlayerProfile getPlayerProfile() { + return profile; + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } +} diff --git a/src/main/java/com/destroystokyo/paper/event/profile/PreLookupProfileEvent.java b/src/main/java/com/destroystokyo/paper/event/profile/PreLookupProfileEvent.java new file mode 100644 -index 00000000..e5a5986a +index 000000000..4dcf6242c --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/profile/PreLookupProfileEvent.java @@ -0,0 +0,0 @@ @@ -71,11 +73,11 @@ index 00000000..e5a5986a +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; + -+import javax.annotation.Nonnull; -+import javax.annotation.Nullable; +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * Allows a plugin to intercept a Profile Lookup for a Profile by name @@ -90,11 +92,11 @@ index 00000000..e5a5986a +public class PreLookupProfileEvent extends Event { + + private static final HandlerList handlers = new HandlerList(); -+ private final String name; ++ @NotNull private final String name; + private UUID uuid; -+ private Set properties = new HashSet<>(); ++ @NotNull private Set properties = new HashSet<>(); + -+ public PreLookupProfileEvent(@Nonnull String name) { ++ public PreLookupProfileEvent(@NotNull String name) { + super(!Bukkit.isPrimaryThread()); + this.name = name; + } @@ -102,7 +104,7 @@ index 00000000..e5a5986a + /** + * @return Name of the profile + */ -+ @Nonnull ++ @NotNull + public String getName() { + return name; + } @@ -134,6 +136,7 @@ index 00000000..e5a5986a + * @return The currently pending prepopulated properties. + * Any property in this Set will be automatically prefilled on this Profile + */ ++ @NotNull + public Set getProfileProperties() { + return this.properties; + } @@ -143,7 +146,7 @@ index 00000000..e5a5986a + * Any property in this Set will be automatically prefilled on this Profile + * @param properties The properties to add + */ -+ public void setProfileProperties(Set properties) { ++ public void setProfileProperties(@NotNull Set properties) { + this.properties = new HashSet<>(); + this.properties.addAll(properties); + } @@ -153,15 +156,17 @@ index 00000000..e5a5986a + * Any property in this Set will be automatically prefilled on this Profile + * @param properties The properties to add + */ -+ public void addProfileProperties(Set properties) { ++ public void addProfileProperties(@NotNull Set properties) { + this.properties.addAll(properties); + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } diff --git a/Spigot-API-Patches/ProfileWhitelistVerifyEvent.patch b/Spigot-API-Patches/ProfileWhitelistVerifyEvent.patch index cf3d056206..f3cb8f2ac2 100644 --- a/Spigot-API-Patches/ProfileWhitelistVerifyEvent.patch +++ b/Spigot-API-Patches/ProfileWhitelistVerifyEvent.patch @@ -9,7 +9,7 @@ Allows you to do dynamic whitelisting and change of kick message diff --git a/src/main/java/com/destroystokyo/paper/event/profile/ProfileWhitelistVerifyEvent.java b/src/main/java/com/destroystokyo/paper/event/profile/ProfileWhitelistVerifyEvent.java new file mode 100644 -index 00000000..b57fff9f +index 000000000..b10176289 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/profile/ProfileWhitelistVerifyEvent.java @@ -0,0 +0,0 @@ @@ -41,6 +41,8 @@ index 00000000..b57fff9f +import com.destroystokyo.paper.profile.PlayerProfile; +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * Fires when the server needs to verify if a player is whitelisted. @@ -51,13 +53,13 @@ index 00000000..b57fff9f + */ +public class ProfileWhitelistVerifyEvent extends Event { + private static final HandlerList handlers = new HandlerList(); -+ private final PlayerProfile profile; ++ @NotNull private final PlayerProfile profile; + private final boolean whitelistEnabled; + private boolean whitelisted; + private final boolean isOp; -+ private String kickMessage; ++ @Nullable private String kickMessage; + -+ public ProfileWhitelistVerifyEvent(final PlayerProfile profile, boolean whitelistEnabled, boolean whitelisted, boolean isOp, String kickMessage) { ++ public ProfileWhitelistVerifyEvent(@NotNull final PlayerProfile profile, boolean whitelistEnabled, boolean whitelisted, boolean isOp, @Nullable String kickMessage) { + this.profile = profile; + this.whitelistEnabled = whitelistEnabled; + this.whitelisted = whitelisted; @@ -68,6 +70,7 @@ index 00000000..b57fff9f + /** + * @return the currently planned message to send to the user if they are not whitelisted + */ ++ @Nullable + public String getKickMessage() { + return kickMessage; + } @@ -75,13 +78,14 @@ index 00000000..b57fff9f + /** + * @param kickMessage The message to send to the player on kick if not whitelisted. May set to null to use the server configured default + */ -+ public void setKickMessage(String kickMessage) { ++ public void setKickMessage(@Nullable String kickMessage) { + this.kickMessage = kickMessage; + } + + /** + * @return The profile of the player trying to connect + */ ++ @NotNull + public PlayerProfile getPlayerProfile() { + return profile; + } @@ -115,11 +119,13 @@ index 00000000..b57fff9f + return whitelistEnabled; + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } diff --git a/Spigot-API-Patches/Provide-Chunk-Coordinates-as-a-Long-API.patch b/Spigot-API-Patches/Provide-Chunk-Coordinates-as-a-Long-API.patch index 49ad5a7e91..a2cf6935ef 100644 --- a/Spigot-API-Patches/Provide-Chunk-Coordinates-as-a-Long-API.patch +++ b/Spigot-API-Patches/Provide-Chunk-Coordinates-as-a-Long-API.patch @@ -7,7 +7,7 @@ Allows you to easily access the chunks X/z as a long, and a method to look up by the long key too. diff --git a/src/main/java/org/bukkit/Chunk.java b/src/main/java/org/bukkit/Chunk.java -index 441ed7ad..33cd0ea0 100644 +index 661ebd1fa..893300a77 100644 --- a/src/main/java/org/bukkit/Chunk.java +++ b/src/main/java/org/bukkit/Chunk.java @@ -0,0 +0,0 @@ public interface Chunk { @@ -26,7 +26,7 @@ index 441ed7ad..33cd0ea0 100644 + * @param loc Location to get chunk key + * @return Location's chunk coordinates packed into a long + */ -+ static long getChunkKey(Location loc) { ++ static long getChunkKey(@NotNull Location loc) { + return getChunkKey((int) Math.floor(loc.getX()) << 4, (int) Math.floor(loc.getZ()) << 4); + } + @@ -44,12 +44,12 @@ index 441ed7ad..33cd0ea0 100644 * Gets the world containing this chunk * diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index e424ed4e..807bd7fc 100644 +index 5ccd8500d..c5da4d387 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable { - */ - public Chunk getChunkAt(Block block); + @NotNull + public Chunk getChunkAt(@NotNull Block block); + // Paper start + /** @@ -61,6 +61,7 @@ index e424ed4e..807bd7fc 100644 + * @param chunkKey The Chunk Key to look up the chunk by + * @return The chunk at the specified key + */ ++ @NotNull + public default Chunk getChunkAt(long chunkKey) { + return getChunkAt((int) chunkKey, (int) (chunkKey >> 32)); + } diff --git a/Spigot-API-Patches/Provide-E-TE-Chunk-count-stat-methods.patch b/Spigot-API-Patches/Provide-E-TE-Chunk-count-stat-methods.patch index 02b0c87be5..85e329fd8b 100644 --- a/Spigot-API-Patches/Provide-E-TE-Chunk-count-stat-methods.patch +++ b/Spigot-API-Patches/Provide-E-TE-Chunk-count-stat-methods.patch @@ -7,10 +7,10 @@ Provides counts without the ineffeciency of using .getEntities().size() which creates copy of the collections. diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index d62277de..8a0f992f 100644 +index ffae53d6..846b0619 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java -@@ -0,0 +0,0 @@ import org.bukkit.util.Vector; +@@ -0,0 +0,0 @@ import org.jetbrains.annotations.Nullable; */ public interface World extends PluginMessageRecipient, Metadatable { diff --git a/Spigot-API-Patches/RangedEntity-API.patch b/Spigot-API-Patches/RangedEntity-API.patch index 8dfc492178..2704b5d892 100644 --- a/Spigot-API-Patches/RangedEntity-API.patch +++ b/Spigot-API-Patches/RangedEntity-API.patch @@ -8,7 +8,7 @@ and to perform an attack. diff --git a/src/main/java/com/destroystokyo/paper/entity/RangedEntity.java b/src/main/java/com/destroystokyo/paper/entity/RangedEntity.java new file mode 100644 -index 00000000..8234de28 +index 000000000..f2e3233a3 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/entity/RangedEntity.java @@ -0,0 +0,0 @@ @@ -16,6 +16,7 @@ index 00000000..8234de28 + +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Mob; ++import org.jetbrains.annotations.NotNull; + +public interface RangedEntity extends Mob { + /** @@ -25,7 +26,7 @@ index 00000000..8234de28 + * @param charge How "charged" the attack is (how far back the bow was pulled for Bow attacks). + * This should be a value between 0 and 1, represented as targetDistance/maxDistance. + */ -+ void rangedAttack(LivingEntity target, float charge); ++ void rangedAttack(@NotNull LivingEntity target, float charge); + + /** + * Sets that the Entity is "charging" up an attack, by raising its hands @@ -43,7 +44,7 @@ index 00000000..8234de28 + } +} diff --git a/src/main/java/org/bukkit/entity/Illusioner.java b/src/main/java/org/bukkit/entity/Illusioner.java -index 7c92c431..14e6c5ee 100644 +index 7c92c431b..14e6c5ee0 100644 --- a/src/main/java/org/bukkit/entity/Illusioner.java +++ b/src/main/java/org/bukkit/entity/Illusioner.java @@ -0,0 +0,0 @@ @@ -59,7 +60,7 @@ index 7c92c431..14e6c5ee 100644 + +} diff --git a/src/main/java/org/bukkit/entity/Llama.java b/src/main/java/org/bukkit/entity/Llama.java -index 9422d56c..92c30ed5 100644 +index c43854298..d23226ccb 100644 --- a/src/main/java/org/bukkit/entity/Llama.java +++ b/src/main/java/org/bukkit/entity/Llama.java @@ -0,0 +0,0 @@ @@ -67,6 +68,7 @@ index 9422d56c..92c30ed5 100644 +import com.destroystokyo.paper.entity.RangedEntity; import org.bukkit.inventory.LlamaInventory; + import org.jetbrains.annotations.NotNull; /** * Represents a Llama. @@ -77,14 +79,15 @@ index 9422d56c..92c30ed5 100644 /** * Represents the base color that the llama has. diff --git a/src/main/java/org/bukkit/entity/Skeleton.java b/src/main/java/org/bukkit/entity/Skeleton.java -index e33d00b3..40157bef 100644 +index 2ac30c0f6..d42a4e12c 100644 --- a/src/main/java/org/bukkit/entity/Skeleton.java +++ b/src/main/java/org/bukkit/entity/Skeleton.java -@@ -0,0 +0,0 @@ - package org.bukkit.entity; +@@ -0,0 +0,0 @@ package org.bukkit.entity; + import org.jetbrains.annotations.Contract; + import org.jetbrains.annotations.NotNull; +import com.destroystokyo.paper.entity.RangedEntity; -+ + /** * Represents a Skeleton. */ @@ -94,7 +97,7 @@ index e33d00b3..40157bef 100644 /** * Gets the current type of this skeleton. diff --git a/src/main/java/org/bukkit/entity/Snowman.java b/src/main/java/org/bukkit/entity/Snowman.java -index 818efe2a..10f8f6d4 100644 +index 818efe2a4..10f8f6d45 100644 --- a/src/main/java/org/bukkit/entity/Snowman.java +++ b/src/main/java/org/bukkit/entity/Snowman.java @@ -0,0 +0,0 @@ @@ -111,7 +114,7 @@ index 818efe2a..10f8f6d4 100644 /** * Gets whether this snowman is in "derp mode", meaning it is not wearing a diff --git a/src/main/java/org/bukkit/entity/Witch.java b/src/main/java/org/bukkit/entity/Witch.java -index 9c5dc1f9..4b27f689 100644 +index 9c5dc1f97..4b27f6890 100644 --- a/src/main/java/org/bukkit/entity/Witch.java +++ b/src/main/java/org/bukkit/entity/Witch.java @@ -0,0 +0,0 @@ @@ -126,7 +129,7 @@ index 9c5dc1f9..4b27f689 100644 +public interface Witch extends Monster, RangedEntity { // Paper } diff --git a/src/main/java/org/bukkit/entity/Wither.java b/src/main/java/org/bukkit/entity/Wither.java -index 3bc332ee..426d3693 100644 +index 3bc332ee7..426d36933 100644 --- a/src/main/java/org/bukkit/entity/Wither.java +++ b/src/main/java/org/bukkit/entity/Wither.java @@ -0,0 +0,0 @@ diff --git a/Spigot-API-Patches/Reduce-thread-synchronization-in-MetadataStoreBase.patch b/Spigot-API-Patches/Reduce-thread-synchronization-in-MetadataStoreBase.patch index 18652a39c3..3b057e00f9 100644 --- a/Spigot-API-Patches/Reduce-thread-synchronization-in-MetadataStoreBase.patch +++ b/Spigot-API-Patches/Reduce-thread-synchronization-in-MetadataStoreBase.patch @@ -8,30 +8,21 @@ limited synchronized portions to allow much higher concurrency in MetadataStore as well as far less locking, especially on reads diff --git a/src/main/java/org/bukkit/metadata/MetadataStoreBase.java b/src/main/java/org/bukkit/metadata/MetadataStoreBase.java -index 093c1445..64c0f0a7 100644 +index 9dbc32d8..32728628 100644 --- a/src/main/java/org/bukkit/metadata/MetadataStoreBase.java +++ b/src/main/java/org/bukkit/metadata/MetadataStoreBase.java -@@ -0,0 +0,0 @@ import org.apache.commons.lang.Validate; - import org.bukkit.plugin.Plugin; +@@ -0,0 +0,0 @@ import org.bukkit.plugin.Plugin; + import org.jetbrains.annotations.NotNull; import java.util.*; +import java.util.concurrent.ConcurrentHashMap; public abstract class MetadataStoreBase { - private Map> metadataMap = new HashMap>(); -+ private Map> metadataMap = new ConcurrentHashMap>(); ++ private Map> metadataMap = new ConcurrentHashMap>(); // Paper /** * Adds a metadata value to an object. Each metadata value is owned by a -@@ -0,0 +0,0 @@ public abstract class MetadataStoreBase { - * @throws IllegalArgumentException If value is null, or the owning plugin - * is null - */ -- public synchronized void setMetadata(T subject, String metadataKey, MetadataValue newMetadataValue) { -+ public void setMetadata(T subject, String metadataKey, MetadataValue newMetadataValue) { - Validate.notNull(newMetadataValue, "Value cannot be null"); - Plugin owningPlugin = newMetadataValue.getOwningPlugin(); - Validate.notNull(owningPlugin, "Plugin cannot be null"); @@ -0,0 +0,0 @@ public abstract class MetadataStoreBase { entry = new WeakHashMap(1); metadataMap.put(key, entry); @@ -44,11 +35,11 @@ index 093c1445..64c0f0a7 100644 /** @@ -0,0 +0,0 @@ public abstract class MetadataStoreBase { - * requested value. * @see MetadataStore#getMetadata(Object, String) */ -- public synchronized List getMetadata(T subject, String metadataKey) { -+ public List getMetadata(T subject, String metadataKey) { + @NotNull +- public synchronized List getMetadata(@NotNull T subject, @NotNull String metadataKey) { ++ public List getMetadata(@NotNull T subject, @NotNull String metadataKey) { // Paper String key = disambiguate(subject, metadataKey); - if (metadataMap.containsKey(key)) { - Collection values = metadataMap.get(key).values(); @@ -62,8 +53,8 @@ index 093c1445..64c0f0a7 100644 * @param metadataKey the unique metadata key being queried. * @return the existence of the metadataKey within subject. */ -- public synchronized boolean hasMetadata(T subject, String metadataKey) { -+ public boolean hasMetadata(T subject, String metadataKey) { +- public synchronized boolean hasMetadata(@NotNull T subject, @NotNull String metadataKey) { ++ public boolean hasMetadata(@NotNull T subject, @NotNull String metadataKey) { // Paper String key = disambiguate(subject, metadataKey); return metadataMap.containsKey(key); } @@ -71,8 +62,8 @@ index 093c1445..64c0f0a7 100644 * org.bukkit.plugin.Plugin) * @throws IllegalArgumentException If plugin is null */ -- public synchronized void removeMetadata(T subject, String metadataKey, Plugin owningPlugin) { -+ public void removeMetadata(T subject, String metadataKey, Plugin owningPlugin) { +- public synchronized void removeMetadata(@NotNull T subject, @NotNull String metadataKey, @NotNull Plugin owningPlugin) { ++ public void removeMetadata(@NotNull T subject, @NotNull String metadataKey, @NotNull Plugin owningPlugin) { // Paper Validate.notNull(owningPlugin, "Plugin cannot be null"); String key = disambiguate(subject, metadataKey); Map entry = metadataMap.get(key); @@ -95,8 +86,8 @@ index 093c1445..64c0f0a7 100644 * @see MetadataStore#invalidateAll(org.bukkit.plugin.Plugin) * @throws IllegalArgumentException If plugin is null */ -- public synchronized void invalidateAll(Plugin owningPlugin) { -+ public void invalidateAll(Plugin owningPlugin) { +- public synchronized void invalidateAll(@NotNull Plugin owningPlugin) { ++ public void invalidateAll(@NotNull Plugin owningPlugin) { // Paper Validate.notNull(owningPlugin, "Plugin cannot be null"); for (Map values : metadataMap.values()) { if (values.containsKey(owningPlugin)) { diff --git a/Spigot-API-Patches/Remove-Precondition-on-name-for-AttributeModifier.patch b/Spigot-API-Patches/Remove-Precondition-on-name-for-AttributeModifier.patch index 13afe60486..95396d6c8a 100644 --- a/Spigot-API-Patches/Remove-Precondition-on-name-for-AttributeModifier.patch +++ b/Spigot-API-Patches/Remove-Precondition-on-name-for-AttributeModifier.patch @@ -6,12 +6,12 @@ Subject: [PATCH] Remove Precondition on name for AttributeModifier Vanilla allows empty names diff --git a/src/main/java/org/bukkit/attribute/AttributeModifier.java b/src/main/java/org/bukkit/attribute/AttributeModifier.java -index 2bc9878f..0943eee4 100644 +index a97631474..f0dff145a 100644 --- a/src/main/java/org/bukkit/attribute/AttributeModifier.java +++ b/src/main/java/org/bukkit/attribute/AttributeModifier.java @@ -0,0 +0,0 @@ public class AttributeModifier implements ConfigurationSerializable { - public AttributeModifier(UUID uuid, String name, double amount, Operation operation, EquipmentSlot slot) { + public AttributeModifier(@NotNull UUID uuid, @NotNull String name, double amount, @NotNull Operation operation, @Nullable EquipmentSlot slot) { Validate.notNull(uuid, "UUID cannot be null"); - Validate.notEmpty(name, "Name cannot be empty"); + //Validate.notEmpty(name, "Name cannot be empty"); // Paper diff --git a/Spigot-API-Patches/Remove-deadlock-risk-in-firing-async-events.patch b/Spigot-API-Patches/Remove-deadlock-risk-in-firing-async-events.patch index 77718bc79a..aae9617f46 100644 --- a/Spigot-API-Patches/Remove-deadlock-risk-in-firing-async-events.patch +++ b/Spigot-API-Patches/Remove-deadlock-risk-in-firing-async-events.patch @@ -16,15 +16,15 @@ which results in a hard crash. This change removes the synchronize and adds some protection around enable/disable diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java -index d925423d..59c70b8a 100644 +index 7d4ca43b5..9ec042fd7 100644 --- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java +++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java @@ -0,0 +0,0 @@ public final class SimplePluginManager implements PluginManager { * @param plugin Plugin to check * @return true if the plugin is enabled, otherwise false */ -- public boolean isPluginEnabled(Plugin plugin) { -+ public synchronized boolean isPluginEnabled(Plugin plugin) { // Paper - synchronize +- public boolean isPluginEnabled(@Nullable Plugin plugin) { ++ public synchronized boolean isPluginEnabled(@Nullable Plugin plugin) { // Paper - synchronize if ((plugin != null) && (plugins.contains(plugin))) { return plugin.isEnabled(); } else { @@ -32,8 +32,8 @@ index d925423d..59c70b8a 100644 } } -- public void enablePlugin(final Plugin plugin) { -+ public synchronized void enablePlugin(final Plugin plugin) { // Paper - synchronize +- public void enablePlugin(@NotNull final Plugin plugin) { ++ public synchronized void enablePlugin(@NotNull final Plugin plugin) { // Paper - synchronize if (!plugin.isEnabled()) { List pluginCommands = PluginCommandYamlParser.parse(plugin); @@ -41,8 +41,8 @@ index d925423d..59c70b8a 100644 disablePlugin(plugin, false); } -- public void disablePlugin(final Plugin plugin, boolean closeClassloader) { -+ public synchronized void disablePlugin(final Plugin plugin, boolean closeClassloader) { // Paper - synchronize +- public void disablePlugin(@NotNull final Plugin plugin, boolean closeClassloader) { ++ public synchronized void disablePlugin(@NotNull final Plugin plugin, boolean closeClassloader) { // Paper - synchronize // Paper end - close Classloader on disable if (plugin.isEnabled()) { try { @@ -57,7 +57,7 @@ index d925423d..59c70b8a 100644 @@ -0,0 +0,0 @@ public final class SimplePluginManager implements PluginManager { * @param event Event details */ - public void callEvent(Event event) { + public void callEvent(@NotNull Event event) { - if (event.isAsynchronous()) { - if (Thread.holdsLock(this)) { - throw new IllegalStateException(event.getEventName() + " cannot be triggered asynchronously from inside synchronized code."); @@ -73,13 +73,13 @@ index d925423d..59c70b8a 100644 - } - } - -- private void fireEvent(Event event) { +- private void fireEvent(@NotNull Event event) { + // Paper - replace callEvent by merging to below method HandlerList handlers = event.getHandlers(); RegisteredListener[] listeners = handlers.getRegisteredListeners(); diff --git a/src/test/java/org/bukkit/plugin/PluginManagerTest.java b/src/test/java/org/bukkit/plugin/PluginManagerTest.java -index 6b86128e..56308c0c 100644 +index 6b86128e1..56308c0c6 100644 --- a/src/test/java/org/bukkit/plugin/PluginManagerTest.java +++ b/src/test/java/org/bukkit/plugin/PluginManagerTest.java @@ -0,0 +0,0 @@ public class PluginManagerTest { diff --git a/Spigot-API-Patches/Shoulder-Entities-Release-API.patch b/Spigot-API-Patches/Shoulder-Entities-Release-API.patch index 72c615692c..1cd7f6e816 100644 --- a/Spigot-API-Patches/Shoulder-Entities-Release-API.patch +++ b/Spigot-API-Patches/Shoulder-Entities-Release-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Shoulder Entities Release API diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java -index 8fc5c83c..040562eb 100644 +index f76bc85c4..037e23930 100644 --- a/src/main/java/org/bukkit/entity/HumanEntity.java +++ b/src/main/java/org/bukkit/entity/HumanEntity.java @@ -0,0 +0,0 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder @@ -19,6 +19,7 @@ index 8fc5c83c..040562eb 100644 + * + * @return The released entity, or null + */ ++ @Nullable + public Entity releaseLeftShoulderEntity(); + + /** @@ -27,6 +28,7 @@ index 8fc5c83c..040562eb 100644 + * + * @return The released entity, or null + */ ++ @Nullable + public Entity releaseRightShoulderEntity(); + // Paper end + diff --git a/Spigot-API-Patches/SkeletonHorse-Additions.patch b/Spigot-API-Patches/SkeletonHorse-Additions.patch index 718d5499b6..9cb5338689 100644 --- a/Spigot-API-Patches/SkeletonHorse-Additions.patch +++ b/Spigot-API-Patches/SkeletonHorse-Additions.patch @@ -6,7 +6,7 @@ Subject: [PATCH] SkeletonHorse Additions diff --git a/src/main/java/com/destroystokyo/paper/event/entity/SkeletonHorseTrapEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/SkeletonHorseTrapEvent.java new file mode 100644 -index 00000000..55bae018 +index 000000000..d79dbcd68 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/SkeletonHorseTrapEvent.java @@ -0,0 +0,0 @@ @@ -16,6 +16,7 @@ index 00000000..55bae018 +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.EntityEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Event called when a player gets close to a skeleton horse and triggers the lightning trap @@ -24,10 +25,11 @@ index 00000000..55bae018 + private static final HandlerList handlers = new HandlerList(); + private boolean cancelled; + -+ public SkeletonHorseTrapEvent(SkeletonHorse horse) { ++ public SkeletonHorseTrapEvent(@NotNull SkeletonHorse horse) { + super(horse); + } + ++ @NotNull + @Override + public SkeletonHorse getEntity() { + return (SkeletonHorse) super.getEntity(); @@ -43,18 +45,20 @@ index 00000000..55bae018 + this.cancelled = cancel; + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } +} + diff --git a/src/main/java/org/bukkit/entity/SkeletonHorse.java b/src/main/java/org/bukkit/entity/SkeletonHorse.java -index b2c6b6a8..ba998346 100644 +index b2c6b6a86..ba9983463 100644 --- a/src/main/java/org/bukkit/entity/SkeletonHorse.java +++ b/src/main/java/org/bukkit/entity/SkeletonHorse.java @@ -0,0 +0,0 @@ package org.bukkit.entity; diff --git a/Spigot-API-Patches/Slime-Pathfinder-Events.patch b/Spigot-API-Patches/Slime-Pathfinder-Events.patch index e50e091f13..ae471656fa 100644 --- a/Spigot-API-Patches/Slime-Pathfinder-Events.patch +++ b/Spigot-API-Patches/Slime-Pathfinder-Events.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Slime Pathfinder Events diff --git a/src/main/java/com/destroystokyo/paper/event/entity/SlimeChangeDirectionEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/SlimeChangeDirectionEvent.java new file mode 100644 -index 00000000..f5a3ca3b +index 000000000..2638bbd3e --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/SlimeChangeDirectionEvent.java @@ -0,0 +0,0 @@ @@ -14,6 +14,7 @@ index 00000000..f5a3ca3b + +import org.bukkit.entity.Slime; +import org.bukkit.event.Cancellable; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired when a Slime decides to change it's facing direction. @@ -24,7 +25,7 @@ index 00000000..f5a3ca3b +public class SlimeChangeDirectionEvent extends SlimePathfindEvent implements Cancellable { + private float yaw; + -+ public SlimeChangeDirectionEvent(Slime slime, float yaw) { ++ public SlimeChangeDirectionEvent(@NotNull Slime slime, float yaw) { + super(slime); + this.yaw = yaw; + } @@ -49,7 +50,7 @@ index 00000000..f5a3ca3b +} diff --git a/src/main/java/com/destroystokyo/paper/event/entity/SlimePathfindEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/SlimePathfindEvent.java new file mode 100644 -index 00000000..356bcca8 +index 000000000..14b67da10 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/SlimePathfindEvent.java @@ -0,0 +0,0 @@ @@ -59,6 +60,7 @@ index 00000000..356bcca8 +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.EntityEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired when a Slime decides to start pathfinding. @@ -67,7 +69,7 @@ index 00000000..356bcca8 + * is choosing to start moving. + */ +public class SlimePathfindEvent extends EntityEvent implements Cancellable { -+ public SlimePathfindEvent(Slime slime) { ++ public SlimePathfindEvent(@NotNull Slime slime) { + super(slime); + } + @@ -76,16 +78,19 @@ index 00000000..356bcca8 + * + * @return The Slime that is pathfinding. + */ ++ @NotNull + public Slime getEntity() { + return (Slime) entity; + } + + private static final HandlerList handlers = new HandlerList(); + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } @@ -104,7 +109,7 @@ index 00000000..356bcca8 +} diff --git a/src/main/java/com/destroystokyo/paper/event/entity/SlimeSwimEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/SlimeSwimEvent.java new file mode 100644 -index 00000000..7c99fb53 +index 000000000..c8dd49d11 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/SlimeSwimEvent.java @@ -0,0 +0,0 @@ @@ -112,6 +117,7 @@ index 00000000..7c99fb53 + +import org.bukkit.entity.Slime; +import org.bukkit.event.Cancellable; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired when a Slime decides to start jumping while swimming in water/lava. @@ -120,13 +126,13 @@ index 00000000..7c99fb53 + * is choosing to start jumping. + */ +public class SlimeSwimEvent extends SlimeWanderEvent implements Cancellable { -+ public SlimeSwimEvent(Slime slime) { ++ public SlimeSwimEvent(@NotNull Slime slime) { + super(slime); + } +} diff --git a/src/main/java/com/destroystokyo/paper/event/entity/SlimeTargetLivingEntityEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/SlimeTargetLivingEntityEvent.java new file mode 100644 -index 00000000..7c96e326 +index 000000000..e9ba32799 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/SlimeTargetLivingEntityEvent.java @@ -0,0 +0,0 @@ @@ -135,6 +141,7 @@ index 00000000..7c96e326 +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Slime; +import org.bukkit.event.Cancellable; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired when a Slime decides to change direction to target a LivingEntity. @@ -143,9 +150,9 @@ index 00000000..7c96e326 + * is choosing to start moving. + */ +public class SlimeTargetLivingEntityEvent extends SlimePathfindEvent implements Cancellable { -+ private final LivingEntity target; ++ @NotNull private final LivingEntity target; + -+ public SlimeTargetLivingEntityEvent(Slime slime, LivingEntity target) { ++ public SlimeTargetLivingEntityEvent(@NotNull Slime slime, @NotNull LivingEntity target) { + super(slime); + this.target = target; + } @@ -155,13 +162,14 @@ index 00000000..7c96e326 + * + * @return Targeted entity + */ ++ @NotNull + public LivingEntity getTarget() { + return target; + } +} diff --git a/src/main/java/com/destroystokyo/paper/event/entity/SlimeWanderEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/SlimeWanderEvent.java new file mode 100644 -index 00000000..e55d208c +index 000000000..4683a7237 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/SlimeWanderEvent.java @@ -0,0 +0,0 @@ @@ -169,6 +177,7 @@ index 00000000..e55d208c + +import org.bukkit.entity.Slime; +import org.bukkit.event.Cancellable; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired when a Slime decides to start wandering. @@ -177,12 +186,12 @@ index 00000000..e55d208c + * is choosing to start moving. + */ +public class SlimeWanderEvent extends SlimePathfindEvent implements Cancellable { -+ public SlimeWanderEvent(Slime slime) { ++ public SlimeWanderEvent(@NotNull Slime slime) { + super(slime); + } +} diff --git a/src/main/java/org/bukkit/entity/Slime.java b/src/main/java/org/bukkit/entity/Slime.java -index 1119e26e..c4791f95 100644 +index 1119e26e2..c4791f95d 100644 --- a/src/main/java/org/bukkit/entity/Slime.java +++ b/src/main/java/org/bukkit/entity/Slime.java @@ -0,0 +0,0 @@ public interface Slime extends Mob { diff --git a/Spigot-API-Patches/Support-cancellation-supression-of-EntityDismount-Ve.patch b/Spigot-API-Patches/Support-cancellation-supression-of-EntityDismount-Ve.patch index 86eba76ae6..60f5475d71 100644 --- a/Spigot-API-Patches/Support-cancellation-supression-of-EntityDismount-Ve.patch +++ b/Spigot-API-Patches/Support-cancellation-supression-of-EntityDismount-Ve.patch @@ -21,7 +21,7 @@ this is going to be the best soultion all around. Improvements/suggestions welcome! diff --git a/src/main/java/org/bukkit/event/vehicle/VehicleExitEvent.java b/src/main/java/org/bukkit/event/vehicle/VehicleExitEvent.java -index 364451b5..b3269db2 100644 +index 69c9e499a..f0c0bae56 100644 --- a/src/main/java/org/bukkit/event/vehicle/VehicleExitEvent.java +++ b/src/main/java/org/bukkit/event/vehicle/VehicleExitEvent.java @@ -0,0 +0,0 @@ public class VehicleExitEvent extends VehicleEvent implements Cancellable { @@ -30,15 +30,15 @@ index 364451b5..b3269db2 100644 private final LivingEntity exited; + private final boolean isCancellable; // Paper -- public VehicleExitEvent(final Vehicle vehicle, final LivingEntity exited) { -+ public VehicleExitEvent(Vehicle vehicle, LivingEntity exited, boolean isCancellable) { // Paper +- public VehicleExitEvent(@NotNull final Vehicle vehicle, @NotNull final LivingEntity exited) { ++ public VehicleExitEvent(@NotNull final Vehicle vehicle, @NotNull final LivingEntity exited, boolean isCancellable) { // Paper super(vehicle); this.exited = exited; + // Paper start + this.isCancellable = isCancellable; + } + -+ public VehicleExitEvent(final Vehicle vehicle, final LivingEntity exited) { ++ public VehicleExitEvent(@NotNull final Vehicle vehicle, @NotNull final LivingEntity exited) { + this(vehicle, exited, true); + // Paper end } @@ -60,11 +60,11 @@ index 364451b5..b3269db2 100644 + // paper end + } + + @NotNull @Override public HandlerList getHandlers() { - return handlers; diff --git a/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java b/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java -index 4110d3bb..555899ef 100644 +index a473b2c6e..a5b4aed52 100644 --- a/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java +++ b/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java @@ -0,0 +0,0 @@ public class EntityDismountEvent extends EntityEvent implements Cancellable @@ -73,13 +73,13 @@ index 4110d3bb..555899ef 100644 private final Entity dismounted; + private final boolean isCancellable; // Paper - public EntityDismountEvent(Entity what, Entity dismounted) + public EntityDismountEvent(@NotNull Entity what, @NotNull Entity dismounted) { + // Paper start + this(what, dismounted, true); + } + -+ public EntityDismountEvent(Entity what, Entity dismounted, boolean isCancellable) ++ public EntityDismountEvent(@NotNull Entity what, @NotNull Entity dismounted, boolean isCancellable) + { + // Paper end super( what ); @@ -87,7 +87,7 @@ index 4110d3bb..555899ef 100644 + this.isCancellable = isCancellable; // Paper } - public Entity getDismounted() + @NotNull @@ -0,0 +0,0 @@ public class EntityDismountEvent extends EntityEvent implements Cancellable @Override public void setCancelled(boolean cancel) @@ -104,7 +104,7 @@ index 4110d3bb..555899ef 100644 + // Paper end + } + + @NotNull @Override public HandlerList getHandlers() - { -- \ No newline at end of file diff --git a/Spigot-API-Patches/Tameable-getOwnerUniqueId-API.patch b/Spigot-API-Patches/Tameable-getOwnerUniqueId-API.patch index 43e11560e7..a99cfc4288 100644 --- a/Spigot-API-Patches/Tameable-getOwnerUniqueId-API.patch +++ b/Spigot-API-Patches/Tameable-getOwnerUniqueId-API.patch @@ -7,9 +7,16 @@ This is faster if all you need is the UUID, as .getOwner() will cause an OfflinePlayer to be loaded from disk. diff --git a/src/main/java/org/bukkit/entity/Tameable.java b/src/main/java/org/bukkit/entity/Tameable.java -index 44497aa3..0987c1e8 100644 +index 0c066bdfc..be436f8df 100644 --- a/src/main/java/org/bukkit/entity/Tameable.java +++ b/src/main/java/org/bukkit/entity/Tameable.java +@@ -0,0 +0,0 @@ + package org.bukkit.entity; + ++import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + + public interface Tameable extends Entity { @@ -0,0 +0,0 @@ public interface Tameable extends Entity { */ public void setTamed(boolean tame); @@ -20,6 +27,7 @@ index 44497aa3..0987c1e8 100644 + * + * @return the owners UUID, or null if not owned + */ ++ @NotNull + public java.util.UUID getOwnerUniqueId(); + // Paper end + @@ -31,5 +39,5 @@ index 44497aa3..0987c1e8 100644 + * * @return the owning AnimalTamer, or null if not owned */ - public AnimalTamer getOwner(); + @Nullable -- \ No newline at end of file diff --git a/Spigot-API-Patches/Timings-v2.patch b/Spigot-API-Patches/Timings-v2.patch index 12d859ca2c..739af6e982 100644 --- a/Spigot-API-Patches/Timings-v2.patch +++ b/Spigot-API-Patches/Timings-v2.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Timings v2 diff --git a/src/main/java/co/aikar/timings/FullServerTickHandler.java b/src/main/java/co/aikar/timings/FullServerTickHandler.java new file mode 100644 -index 00000000..98079dc0 +index 000000000..f6d616732 --- /dev/null +++ b/src/main/java/co/aikar/timings/FullServerTickHandler.java @@ -0,0 +0,0 @@ @@ -14,6 +14,8 @@ index 00000000..98079dc0 + +import static co.aikar.timings.TimingsManager.*; + ++import org.jetbrains.annotations.NotNull; ++ +public class FullServerTickHandler extends TimingHandler { + private static final TimingIdentifier IDENTITY = new TimingIdentifier("Minecraft", "Full Server Tick", null); + final TimingData minuteData; @@ -26,6 +28,7 @@ index 00000000..98079dc0 + TIMING_MAP.put(IDENTITY, this); + } + ++ @NotNull + @Override + public Timing startTiming() { + if (TimingsManager.needsFullReset) { @@ -94,7 +97,7 @@ index 00000000..98079dc0 +} diff --git a/src/main/java/co/aikar/timings/NullTimingHandler.java b/src/main/java/co/aikar/timings/NullTimingHandler.java new file mode 100644 -index 00000000..8c43e206 +index 000000000..8e0cd40e8 --- /dev/null +++ b/src/main/java/co/aikar/timings/NullTimingHandler.java @@ -0,0 +0,0 @@ @@ -123,7 +126,11 @@ index 00000000..8c43e206 + */ +package co.aikar.timings; + ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; ++ +public final class NullTimingHandler implements Timing { ++ @NotNull + @Override + public Timing startTiming() { + return this; @@ -134,6 +141,7 @@ index 00000000..8c43e206 + + } + ++ @NotNull + @Override + public Timing startTimingIfSync() { + return this; @@ -149,6 +157,7 @@ index 00000000..8c43e206 + + } + ++ @Nullable + @Override + public TimingHandler getTimingHandler() { + return null; @@ -161,7 +170,7 @@ index 00000000..8c43e206 +} diff --git a/src/main/java/co/aikar/timings/TimedEventExecutor.java b/src/main/java/co/aikar/timings/TimedEventExecutor.java new file mode 100644 -index 00000000..feddcdbd +index 000000000..68f7866e1 --- /dev/null +++ b/src/main/java/co/aikar/timings/TimedEventExecutor.java @@ -0,0 +0,0 @@ @@ -198,6 +207,8 @@ index 00000000..feddcdbd +import org.bukkit.plugin.Plugin; + +import java.lang.reflect.Method; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +public class TimedEventExecutor implements EventExecutor { + @@ -212,7 +223,7 @@ index 00000000..feddcdbd + * @param method EventHandler method + * @param eventClass Owning class + */ -+ public TimedEventExecutor(EventExecutor executor, Plugin plugin, Method method, Class eventClass) { ++ public TimedEventExecutor(@NotNull EventExecutor executor, @NotNull Plugin plugin, @Nullable Method method, @NotNull Class eventClass) { + this.executor = executor; + String id; + @@ -236,7 +247,7 @@ index 00000000..feddcdbd + } + + @Override -+ public void execute(Listener listener, Event event) throws EventException { ++ public void execute(@NotNull Listener listener, @NotNull Event event) throws EventException { + if (event.isAsynchronous() || !Timings.timingsEnabled || !Bukkit.isPrimaryThread()) { + executor.execute(listener, event); + return; @@ -248,7 +259,7 @@ index 00000000..feddcdbd +} diff --git a/src/main/java/co/aikar/timings/Timing.java b/src/main/java/co/aikar/timings/Timing.java new file mode 100644 -index 00000000..b2260104 +index 000000000..a562796ce --- /dev/null +++ b/src/main/java/co/aikar/timings/Timing.java @@ -0,0 +0,0 @@ @@ -277,6 +288,9 @@ index 00000000..b2260104 + */ +package co.aikar.timings; + ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; ++ +/** + * Provides an ability to time sections of code within the Minecraft Server + */ @@ -286,6 +300,7 @@ index 00000000..b2260104 + * + * @return Timing + */ ++ @NotNull + Timing startTiming(); + + /** @@ -302,6 +317,7 @@ index 00000000..b2260104 + * + * @return Timing + */ ++ @NotNull + Timing startTimingIfSync(); + + /** @@ -323,6 +339,7 @@ index 00000000..b2260104 + * + * @return TimingHandler + */ ++ @Nullable + TimingHandler getTimingHandler(); + + @Override @@ -330,7 +347,7 @@ index 00000000..b2260104 +} diff --git a/src/main/java/co/aikar/timings/TimingData.java b/src/main/java/co/aikar/timings/TimingData.java new file mode 100644 -index 00000000..f222d6b7 +index 000000000..a5d13a1e4 --- /dev/null +++ b/src/main/java/co/aikar/timings/TimingData.java @@ -0,0 +0,0 @@ @@ -360,6 +377,7 @@ index 00000000..f222d6b7 +package co.aikar.timings; + +import java.util.List; ++import org.jetbrains.annotations.NotNull; + +import static co.aikar.util.JSONUtil.toArray; + @@ -418,6 +436,7 @@ index 00000000..f222d6b7 + return new TimingData(this); + } + ++ @NotNull + List export() { + List list = toArray( + id, @@ -456,7 +475,7 @@ index 00000000..f222d6b7 +} diff --git a/src/main/java/co/aikar/timings/TimingHandler.java b/src/main/java/co/aikar/timings/TimingHandler.java new file mode 100644 -index 00000000..521c985e +index 000000000..6bf8cb688 --- /dev/null +++ b/src/main/java/co/aikar/timings/TimingHandler.java @@ -0,0 +0,0 @@ @@ -487,10 +506,9 @@ index 00000000..521c985e + +import co.aikar.util.LoadingIntMap; +import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; -+import org.bukkit.Bukkit; -+ +import java.util.concurrent.atomic.AtomicInteger; -+import java.util.logging.Level; ++import org.bukkit.Bukkit; ++import org.jetbrains.annotations.NotNull; + +class TimingHandler implements Timing { + @@ -512,7 +530,7 @@ index 00000000..521c985e + private boolean enabled; + private TimingHandler parent; + -+ TimingHandler(TimingIdentifier id) { ++ TimingHandler(@NotNull TimingIdentifier id) { + if (id.name.startsWith("##")) { + verbose = true; + this.name = id.name.substring(3); @@ -545,6 +563,7 @@ index 00000000..521c985e + } + } + ++ @NotNull + @Override + public Timing startTimingIfSync() { + startTiming(); @@ -556,6 +575,7 @@ index 00000000..521c985e + stopTiming(); + } + ++ @NotNull + public Timing startTiming() { + if (enabled && Bukkit.isPrimaryThread() && ++timingDepth == 1) { + start = System.nanoTime(); @@ -600,8 +620,6 @@ index 00000000..521c985e + + /** + * Reset this timer, setting all values to zero. -+ * -+ * @param full + */ + void reset(boolean full) { + record.reset(); @@ -615,6 +633,7 @@ index 00000000..521c985e + checkEnabled(); + } + ++ @NotNull + @Override + public TimingHandler getTimingHandler() { + return this; @@ -631,8 +650,7 @@ index 00000000..521c985e + } + + /** -+ * This is simply for the Closeable interface so it can be used with -+ * try-with-resources () ++ * This is simply for the Closeable interface so it can be used with try-with-resources () + */ + @Override + public void close() { @@ -651,6 +669,7 @@ index 00000000..521c985e + return enabled; + } + ++ @NotNull + TimingData[] cloneChildren() { + final TimingData[] clonedChildren = new TimingData[children.size()]; + int i = 0; @@ -662,7 +681,7 @@ index 00000000..521c985e +} diff --git a/src/main/java/co/aikar/timings/TimingHistory.java b/src/main/java/co/aikar/timings/TimingHistory.java new file mode 100644 -index 00000000..e08a25f5 +index 000000000..8726bb9a2 --- /dev/null +++ b/src/main/java/co/aikar/timings/TimingHistory.java @@ -0,0 +0,0 @@ @@ -711,6 +730,8 @@ index 00000000..e08a25f5 +import java.util.List; +import java.util.Map; +import java.util.Set; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +import static co.aikar.timings.TimingsManager.FULL_SERVER_TICK; +import static co.aikar.timings.TimingsManager.MINUTE_REPORTS; @@ -726,8 +747,9 @@ index 00000000..e08a25f5 + public static long activatedEntityTicks; + private static int worldIdPool = 1; + static Map worldMap = LoadingMap.newHashMap(new Function() { ++ @NotNull + @Override -+ public Integer apply(String input) { ++ public Integer apply(@Nullable String input) { + return worldIdPool++; + } + }); @@ -770,6 +792,7 @@ index 00000000..e08a25f5 + // Information about all loaded chunks/entities + //noinspection unchecked + this.worlds = toObjectMapper(Bukkit.getWorlds(), new Function() { ++ @NotNull + @Override + public JSONPair apply(World world) { + Map regions = LoadingMap.newHashMap(RegionData.LOADER); @@ -798,6 +821,7 @@ index 00000000..e08a25f5 + return pair( + worldMap.get(world.getName()), + toArrayMapper(regions.values(),new Function() { ++ @NotNull + @Override + public Object apply(RegionData input) { + return toArray( @@ -805,6 +829,7 @@ index 00000000..e08a25f5 + input.regionId.z, + toObjectMapper(input.entityCounts.entrySet(), + new Function, JSONPair>() { ++ @NotNull + @Override + public JSONPair apply(Map.Entry entry) { + entityTypeSet.add(entry.getKey()); @@ -817,6 +842,7 @@ index 00000000..e08a25f5 + ), + toObjectMapper(input.tileEntityCounts.entrySet(), + new Function, JSONPair>() { ++ @NotNull + @Override + public JSONPair apply(Map.Entry entry) { + tileEntityTypeSet.add(entry.getKey()); @@ -838,12 +864,13 @@ index 00000000..e08a25f5 + final RegionId regionId; + @SuppressWarnings("Guava") + static Function LOADER = new Function() { ++ @NotNull + @Override -+ public RegionData apply(RegionId id) { ++ public RegionData apply(@NotNull RegionId id) { + return new RegionData(id); + } + }; -+ RegionData(RegionId id) { ++ RegionData(@NotNull RegionId id) { + this.regionId = id; + } + @@ -914,6 +941,7 @@ index 00000000..e08a25f5 + activatedEntityTicks = 0; + } + ++ @NotNull + Object export() { + return createObject( + pair("s", startTime), @@ -922,6 +950,7 @@ index 00000000..e08a25f5 + pair("tm", totalTime), + pair("w", worlds), + pair("h", toArrayMapper(entries, new Function() { ++ @Nullable + @Override + public Object apply(TimingHistoryEntry entry) { + TimingData record = entry.data; @@ -932,6 +961,7 @@ index 00000000..e08a25f5 + } + })), + pair("mp", toArrayMapper(minuteReports, new Function() { ++ @NotNull + @Override + public Object apply(MinuteReport input) { + return input.export(); @@ -951,6 +981,7 @@ index 00000000..e08a25f5 + final double freeMemory = TimingsManager.FULL_SERVER_TICK.avgFreeMemory; + final double loadAvg = ManagementFactory.getOperatingSystemMXBean().getSystemLoadAverage(); + ++ @NotNull + List export() { + return toArray( + time, @@ -1013,7 +1044,7 @@ index 00000000..e08a25f5 +} diff --git a/src/main/java/co/aikar/timings/TimingHistoryEntry.java b/src/main/java/co/aikar/timings/TimingHistoryEntry.java new file mode 100644 -index 00000000..0e114eb3 +index 000000000..86d5ac6bd --- /dev/null +++ b/src/main/java/co/aikar/timings/TimingHistoryEntry.java @@ -0,0 +0,0 @@ @@ -1045,6 +1076,7 @@ index 00000000..0e114eb3 +import com.google.common.base.Function; + +import java.util.List; ++import org.jetbrains.annotations.NotNull; + +import static co.aikar.util.JSONUtil.toArrayMapper; + @@ -1052,16 +1084,18 @@ index 00000000..0e114eb3 + final TimingData data; + private final TimingData[] children; + -+ TimingHistoryEntry(TimingHandler handler) { ++ TimingHistoryEntry(@NotNull TimingHandler handler) { + this.data = handler.record.clone(); + children = handler.cloneChildren(); + } + ++ @NotNull + List export() { + List result = data.export(); + if (children.length > 0) { + result.add( + toArrayMapper(children, new Function() { ++ @NotNull + @Override + public Object apply(TimingData child) { + return child.export(); @@ -1074,7 +1108,7 @@ index 00000000..0e114eb3 +} diff --git a/src/main/java/co/aikar/timings/TimingIdentifier.java b/src/main/java/co/aikar/timings/TimingIdentifier.java new file mode 100644 -index 00000000..d3258a09 +index 000000000..4d140f344 --- /dev/null +++ b/src/main/java/co/aikar/timings/TimingIdentifier.java @@ -0,0 +0,0 @@ @@ -1112,6 +1146,8 @@ index 00000000..d3258a09 +import java.util.Objects; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicInteger; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + *

Used as a basis for fast HashMap key comparisons for the Timing Map.

@@ -1129,15 +1165,17 @@ index 00000000..d3258a09 + final TimingHandler groupHandler; + private final int hashCode; + -+ TimingIdentifier(String group, String name, Timing groupHandler) { ++ TimingIdentifier(@Nullable String group, @NotNull String name, @Nullable Timing groupHandler) { + this.group = group != null ? group: DEFAULT_GROUP.name; + this.name = name; + this.groupHandler = groupHandler != null ? groupHandler.getTimingHandler() : null; + this.hashCode = (31 * this.group.hashCode()) + this.name.hashCode(); + } + -+ static TimingGroup getGroup(String groupName) { ++ @NotNull ++ static TimingGroup getGroup(@Nullable String groupName) { + if (groupName == null) { ++ //noinspection ConstantConditions + return DEFAULT_GROUP; + } + @@ -1187,7 +1225,7 @@ index 00000000..d3258a09 +} diff --git a/src/main/java/co/aikar/timings/Timings.java b/src/main/java/co/aikar/timings/Timings.java new file mode 100644 -index 00000000..f907649b +index 000000000..0b34e0d01 --- /dev/null +++ b/src/main/java/co/aikar/timings/Timings.java @@ -0,0 +0,0 @@ @@ -1225,6 +1263,8 @@ index 00000000..f907649b + +import java.util.Queue; +import java.util.logging.Level; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +@SuppressWarnings({"UnusedDeclaration", "WeakerAccess", "SameParameterValue"}) +public final class Timings { @@ -1245,7 +1285,8 @@ index 00000000..f907649b + * @param name Name of Timing + * @return Handler + */ -+ public static Timing of(Plugin plugin, String name) { ++ @NotNull ++ public static Timing of(@NotNull Plugin plugin, @NotNull String name) { + Timing pluginHandler = null; + if (plugin != null) { + pluginHandler = ofSafe(plugin.getName(), "Combined Total", TimingsManager.PLUGIN_GROUP_HANDLER); @@ -1265,7 +1306,8 @@ index 00000000..f907649b + * @param groupHandler Parent handler to mirror .start/stop calls to + * @return Timing Handler + */ -+ public static Timing of(Plugin plugin, String name, Timing groupHandler) { ++ @NotNull ++ public static Timing of(@NotNull Plugin plugin, @NotNull String name, @Nullable Timing groupHandler) { + Preconditions.checkNotNull(plugin, "Plugin can not be null"); + return TimingsManager.getHandler(plugin.getName(), name, groupHandler); + } @@ -1281,7 +1323,8 @@ index 00000000..f907649b + * @param name Name of Timing + * @return Timing Handler + */ -+ public static Timing ofStart(Plugin plugin, String name) { ++ @NotNull ++ public static Timing ofStart(@NotNull Plugin plugin, @NotNull String name) { + return ofStart(plugin, name, null); + } + @@ -1297,7 +1340,8 @@ index 00000000..f907649b + * @param groupHandler Parent handler to mirror .start/stop calls to + * @return Timing Handler + */ -+ public static Timing ofStart(Plugin plugin, String name, Timing groupHandler) { ++ @NotNull ++ public static Timing ofStart(@NotNull Plugin plugin, @NotNull String name, @Nullable Timing groupHandler) { + Timing timing = of(plugin, name, groupHandler); + timing.startTiming(); + return timing; @@ -1431,7 +1475,7 @@ index 00000000..f907649b + * If sender is null, ConsoleCommandSender will be used. + * @param sender The sender to send to, or null to use the ConsoleCommandSender + */ -+ public static void generateReport(CommandSender sender) { ++ public static void generateReport(@Nullable CommandSender sender) { + if (sender == null) { + sender = Bukkit.getConsoleSender(); + } @@ -1443,7 +1487,7 @@ index 00000000..f907649b + * Use with {@link org.bukkit.command.BufferedCommandSender} to get full response when done! + * @param sender The listener to send responses too. + */ -+ public static void generateReport(TimingsReportListener sender) { ++ public static void generateReport(@NotNull TimingsReportListener sender) { + Validate.notNull(sender); + TimingsExport.requestingReport.add(sender); + } @@ -1454,12 +1498,13 @@ index 00000000..f907649b + These do not have isPrimaryThread() checks in the startTiming/stopTiming + ================= + */ -+ -+ static TimingHandler ofSafe(String name) { ++ @NotNull ++ static TimingHandler ofSafe(@NotNull String name) { + return ofSafe(null, name, null); + } + -+ static Timing ofSafe(Plugin plugin, String name) { ++ @NotNull ++ static Timing ofSafe(@Nullable Plugin plugin, @NotNull String name) { + Timing pluginHandler = null; + if (plugin != null) { + pluginHandler = ofSafe(plugin.getName(), "Combined Total", TimingsManager.PLUGIN_GROUP_HANDLER); @@ -1467,17 +1512,19 @@ index 00000000..f907649b + return ofSafe(plugin != null ? plugin.getName() : "Minecraft - Invalid Plugin", name, pluginHandler); + } + -+ static TimingHandler ofSafe(String name, Timing groupHandler) { ++ @NotNull ++ static TimingHandler ofSafe(@NotNull String name, @Nullable Timing groupHandler) { + return ofSafe(null, name, groupHandler); + } + -+ static TimingHandler ofSafe(String groupName, String name, Timing groupHandler) { ++ @NotNull ++ static TimingHandler ofSafe(@Nullable String groupName, @NotNull String name, @Nullable Timing groupHandler) { + return TimingsManager.getHandler(groupName, name, groupHandler); + } +} diff --git a/src/main/java/co/aikar/timings/TimingsCommand.java b/src/main/java/co/aikar/timings/TimingsCommand.java new file mode 100644 -index 00000000..56b10e89 +index 000000000..c0d8f2016 --- /dev/null +++ b/src/main/java/co/aikar/timings/TimingsCommand.java @@ -0,0 +0,0 @@ @@ -1515,13 +1562,15 @@ index 00000000..56b10e89 + +import java.util.ArrayList; +import java.util.List; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + + +public class TimingsCommand extends BukkitCommand { + private static final List TIMINGS_SUBCOMMANDS = ImmutableList.of("report", "reset", "on", "off", "paste", "verbon", "verboff"); + private long lastResetAttempt = 0; + -+ public TimingsCommand(String name) { ++ public TimingsCommand(@NotNull String name) { + super(name); + this.description = "Manages Spigot Timings data to see performance of the server."; + this.usageMessage = "/timings "; @@ -1529,7 +1578,7 @@ index 00000000..56b10e89 + } + + @Override -+ public boolean execute(CommandSender sender, String currentAlias, String[] args) { ++ public boolean execute(@NotNull CommandSender sender, @NotNull String currentAlias, @NotNull String[] args) { + if (!testPermission(sender)) { + return true; + } @@ -1587,8 +1636,9 @@ index 00000000..56b10e89 + return true; + } + ++ @NotNull + @Override -+ public List tabComplete(CommandSender sender, String alias, String[] args) { ++ public List tabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) { + Validate.notNull(sender, "Sender cannot be null"); + Validate.notNull(args, "Arguments cannot be null"); + Validate.notNull(alias, "Alias cannot be null"); @@ -1602,7 +1652,7 @@ index 00000000..56b10e89 +} diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java new file mode 100644 -index 00000000..4a69074a +index 000000000..4a69074a8 --- /dev/null +++ b/src/main/java/co/aikar/timings/TimingsExport.java @@ -0,0 +0,0 @@ @@ -1958,7 +2008,7 @@ index 00000000..4a69074a +} diff --git a/src/main/java/co/aikar/timings/TimingsManager.java b/src/main/java/co/aikar/timings/TimingsManager.java new file mode 100644 -index 00000000..127651ff +index 000000000..0109065d3 --- /dev/null +++ b/src/main/java/co/aikar/timings/TimingsManager.java @@ -0,0 +0,0 @@ @@ -1995,13 +2045,14 @@ index 00000000..127651ff +import org.bukkit.plugin.Plugin; +import org.bukkit.plugin.java.PluginClassLoader; + -+import javax.annotation.Nullable; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.logging.Level; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +public final class TimingsManager { + static final Map TIMING_MAP = LoadingMap.of( @@ -2098,7 +2149,8 @@ index 00000000..127651ff + historyStart = System.currentTimeMillis(); + } + -+ static TimingHandler getHandler(String group, String name, Timing parent) { ++ @NotNull ++ static TimingHandler getHandler(@Nullable String group, @NotNull String name, @Nullable Timing parent) { + return TIMING_MAP.get(new TimingIdentifier(group, name, parent)); + } + @@ -2112,7 +2164,8 @@ index 00000000..127651ff + * @param command Command to get timings for + * @return TimingHandler + */ -+ public static Timing getCommandTiming(String pluginName, Command command) { ++ @NotNull ++ public static Timing getCommandTiming(@Nullable String pluginName, @NotNull Command command) { + Plugin plugin = null; + final Server server = Bukkit.getServer(); + if (!( server == null || pluginName == null || @@ -2139,6 +2192,7 @@ index 00000000..127651ff + * @param clazz Class to check + * @return Plugin if created by a plugin + */ ++ @Nullable + public static Plugin getPluginByClassloader(@Nullable Class clazz) { + if (clazz == null) { + return null; @@ -2153,7 +2207,7 @@ index 00000000..127651ff +} diff --git a/src/main/java/co/aikar/timings/TimingsReportListener.java b/src/main/java/co/aikar/timings/TimingsReportListener.java new file mode 100644 -index 00000000..e7c389c0 +index 000000000..bf3e059fe --- /dev/null +++ b/src/main/java/co/aikar/timings/TimingsReportListener.java @@ -0,0 +0,0 @@ @@ -2168,6 +2222,8 @@ index 00000000..e7c389c0 +import org.bukkit.command.RemoteConsoleCommandSender; + +import java.util.List; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +@SuppressWarnings("WeakerAccess") +public class TimingsReportListener implements MessageCommandSender { @@ -2175,16 +2231,16 @@ index 00000000..e7c389c0 + private final Runnable onDone; + private String timingsURL; + -+ public TimingsReportListener(CommandSender senders) { ++ public TimingsReportListener(@NotNull CommandSender senders) { + this(senders, null); + } -+ public TimingsReportListener(CommandSender sender, Runnable onDone) { ++ public TimingsReportListener(@NotNull CommandSender sender, @Nullable Runnable onDone) { + this(Lists.newArrayList(sender), onDone); + } -+ public TimingsReportListener(List senders) { ++ public TimingsReportListener(@NotNull List senders) { + this(senders, null); + } -+ public TimingsReportListener(List senders, Runnable onDone) { ++ public TimingsReportListener(@NotNull List senders, @Nullable Runnable onDone) { + Validate.notNull(senders); + Validate.notEmpty(senders); + @@ -2192,6 +2248,7 @@ index 00000000..e7c389c0 + this.onDone = onDone; + } + ++ @Nullable + public String getTimingsURL() { + return timingsURL; + } @@ -2200,7 +2257,7 @@ index 00000000..e7c389c0 + done(null); + } + -+ public void done(String url) { ++ public void done(@Nullable String url) { + this.timingsURL = url; + if (onDone != null) { + onDone.run(); @@ -2213,7 +2270,7 @@ index 00000000..e7c389c0 + } + + @Override -+ public void sendMessage(String message) { ++ public void sendMessage(@NotNull String message) { + senders.forEach((sender) -> sender.sendMessage(message)); + } + @@ -2231,7 +2288,7 @@ index 00000000..e7c389c0 +} diff --git a/src/main/java/co/aikar/timings/UnsafeTimingHandler.java b/src/main/java/co/aikar/timings/UnsafeTimingHandler.java new file mode 100644 -index 00000000..5edaba12 +index 000000000..632c49615 --- /dev/null +++ b/src/main/java/co/aikar/timings/UnsafeTimingHandler.java @@ -0,0 +0,0 @@ @@ -2261,10 +2318,11 @@ index 00000000..5edaba12 +package co.aikar.timings; + +import org.bukkit.Bukkit; ++import org.jetbrains.annotations.NotNull; + +class UnsafeTimingHandler extends TimingHandler { + -+ UnsafeTimingHandler(TimingIdentifier id) { ++ UnsafeTimingHandler(@NotNull TimingIdentifier id) { + super(id); + } + @@ -2274,6 +2332,7 @@ index 00000000..5edaba12 + } + } + ++ @NotNull + @Override + public Timing startTiming() { + checkThread(); @@ -2288,7 +2347,7 @@ index 00000000..5edaba12 +} diff --git a/src/main/java/co/aikar/util/Counter.java b/src/main/java/co/aikar/util/Counter.java new file mode 100644 -index 00000000..23ac07f2 +index 000000000..80155072d --- /dev/null +++ b/src/main/java/co/aikar/util/Counter.java @@ -0,0 +0,0 @@ @@ -2298,30 +2357,33 @@ index 00000000..23ac07f2 + +import java.util.HashMap; +import java.util.Map; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +public class Counter extends ForwardingMap { + private final Map counts = new HashMap<>(); + -+ public long decrement(T key) { ++ public long decrement(@Nullable T key) { + return increment(key, -1); + } -+ public long increment(T key) { ++ public long increment(@Nullable T key) { + return increment(key, 1); + } -+ public long decrement(T key, long amount) { ++ public long decrement(@Nullable T key, long amount) { + return decrement(key, -amount); + } -+ public long increment(T key, long amount) { ++ public long increment(@Nullable T key, long amount) { + Long count = this.getCount(key); + count += amount; + this.counts.put(key, count); + return count; + } + -+ public long getCount(T key) { ++ public long getCount(@Nullable T key) { + return this.counts.getOrDefault(key, 0L); + } + ++ @NotNull + @Override + protected Map delegate() { + return this.counts; @@ -2329,7 +2391,7 @@ index 00000000..23ac07f2 +} diff --git a/src/main/java/co/aikar/util/JSONUtil.java b/src/main/java/co/aikar/util/JSONUtil.java new file mode 100644 -index 00000000..96274975 +index 000000000..e43599b47 --- /dev/null +++ b/src/main/java/co/aikar/util/JSONUtil.java @@ -0,0 +0,0 @@ @@ -2338,6 +2400,8 @@ index 00000000..96274975 +import com.google.common.base.Function; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; +import org.json.simple.JSONArray; +import org.json.simple.JSONObject; + @@ -2360,11 +2424,13 @@ index 00000000..96274975 + * @param obj Value to use + * @return JSONPair + */ -+ public static JSONPair pair(String key, Object obj) { ++ @NotNull ++ public static JSONPair pair(@NotNull String key, @Nullable Object obj) { + return new JSONPair(key, obj); + } + -+ public static JSONPair pair(long key, Object obj) { ++ @NotNull ++ public static JSONPair pair(long key, @Nullable Object obj) { + return new JSONPair(String.valueOf(key), obj); + } + @@ -2374,7 +2440,8 @@ index 00000000..96274975 + * @param data JSONPairs + * @return Map + */ -+ public static Map createObject(JSONPair... data) { ++ @NotNull ++ public static Map createObject(@NotNull JSONPair... data) { + return appendObjectData(new LinkedHashMap(), data); + } + @@ -2385,7 +2452,8 @@ index 00000000..96274975 + * @param data Data to append + * @return Map + */ -+ public static Map appendObjectData(Map parent, JSONPair... data) { ++ @NotNull ++ public static Map appendObjectData(@NotNull Map parent, @NotNull JSONPair... data) { + for (JSONPair JSONPair : data) { + parent.put(JSONPair.key, JSONPair.val); + } @@ -2398,7 +2466,8 @@ index 00000000..96274975 + * @param data Data to build JSON array from + * @return List + */ -+ public static List toArray(Object... data) { ++ @NotNull ++ public static List toArray(@NotNull Object... data) { + return Lists.newArrayList(data); + } + @@ -2410,11 +2479,13 @@ index 00000000..96274975 + * @param Element Type + * @return List + */ -+ public static List toArrayMapper(E[] collection, Function mapper) { ++ @NotNull ++ public static List toArrayMapper(@NotNull E[] collection, @NotNull Function mapper) { + return toArrayMapper(Lists.newArrayList(collection), mapper); + } + -+ public static List toArrayMapper(Iterable collection, Function mapper) { ++ @NotNull ++ public static List toArrayMapper(@NotNull Iterable collection, @NotNull Function mapper) { + List array = Lists.newArrayList(); + for (E e : collection) { + Object object = mapper.apply(e); @@ -2433,11 +2504,13 @@ index 00000000..96274975 + * @param Element Type + * @return Map + */ -+ public static Map toObjectMapper(E[] collection, Function mapper) { ++ @NotNull ++ public static Map toObjectMapper(@NotNull E[] collection, @NotNull Function mapper) { + return toObjectMapper(Lists.newArrayList(collection), mapper); + } + -+ public static Map toObjectMapper(Iterable collection, Function mapper) { ++ @NotNull ++ public static Map toObjectMapper(@NotNull Iterable collection, @NotNull Function mapper) { + Map object = Maps.newLinkedHashMap(); + for (E e : collection) { + JSONPair JSONPair = mapper.apply(e); @@ -2456,7 +2529,7 @@ index 00000000..96274975 + final String key; + final Object val; + -+ JSONPair(String key, Object val) { ++ JSONPair(@NotNull String key, @NotNull Object val) { + this.key = key; + this.val = val; + } @@ -2464,7 +2537,7 @@ index 00000000..96274975 +} diff --git a/src/main/java/co/aikar/util/LoadingIntMap.java b/src/main/java/co/aikar/util/LoadingIntMap.java new file mode 100644 -index 00000000..24eae4be +index 000000000..63a899c7d --- /dev/null +++ b/src/main/java/co/aikar/util/LoadingIntMap.java @@ -0,0 +0,0 @@ @@ -2479,6 +2552,8 @@ index 00000000..24eae4be + +import com.google.common.base.Function; +import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * Allows you to pass a Loader function that when a key is accessed that doesn't exist, @@ -2497,22 +2572,23 @@ index 00000000..24eae4be +public class LoadingIntMap extends Int2ObjectOpenHashMap { + private final Function loader; + -+ public LoadingIntMap(Function loader) { ++ public LoadingIntMap(@NotNull Function loader) { + super(); + this.loader = loader; + } + -+ public LoadingIntMap(int expectedSize, Function loader) { ++ public LoadingIntMap(int expectedSize, @NotNull Function loader) { + super(expectedSize); + this.loader = loader; + } + -+ public LoadingIntMap(int expectedSize, float loadFactor, Function loader) { ++ public LoadingIntMap(int expectedSize, float loadFactor, @NotNull Function loader) { + super(expectedSize, loadFactor); + this.loader = loader; + } + + ++ @Nullable + @Override + public V get(int key) { + V res = super.get(key); @@ -2531,17 +2607,19 @@ index 00000000..24eae4be + * @param Type + */ + public abstract static class Feeder implements Function { ++ @Nullable + @Override -+ public T apply(Object input) { ++ public T apply(@Nullable Object input) { + return apply(); + } + ++ @Nullable + public abstract T apply(); + } +} diff --git a/src/main/java/co/aikar/util/LoadingMap.java b/src/main/java/co/aikar/util/LoadingMap.java new file mode 100644 -index 00000000..dfefda35 +index 000000000..aedbb0332 --- /dev/null +++ b/src/main/java/co/aikar/util/LoadingMap.java @@ -0,0 +0,0 @@ @@ -2570,6 +2648,7 @@ index 00000000..dfefda35 + */ +package co.aikar.util; + ++import com.google.common.base.Preconditions; +import java.lang.reflect.Constructor; +import java.util.AbstractMap; +import java.util.Collection; @@ -2578,6 +2657,8 @@ index 00000000..dfefda35 +import java.util.Map; +import java.util.Set; +import java.util.function.Function; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * Allows you to pass a Loader function that when a key is accessed that doesn't exists, @@ -2603,7 +2684,7 @@ index 00000000..dfefda35 + * @param backingMap Map to wrap + * @param loader Loader + */ -+ public LoadingMap(Map backingMap, java.util.function.Function loader) { ++ public LoadingMap(@NotNull Map backingMap, @NotNull java.util.function.Function loader) { + this.backingMap = backingMap; + this.loader = loader; + } @@ -2617,7 +2698,8 @@ index 00000000..dfefda35 + * @param Value Type of the Map + * @return Map + */ -+ public static Map of(Map backingMap, Function loader) { ++ @NotNull ++ public static Map of(@NotNull Map backingMap, @NotNull Function loader) { + return new LoadingMap<>(backingMap, loader); + } + @@ -2636,8 +2718,9 @@ index 00000000..dfefda35 + * @param Value Type of the Map + * @return Map that auto instantiates on .get() + */ -+ public static Map newAutoMap(Map backingMap, final Class keyClass, -+ final Class valueClass) { ++ @NotNull ++ public static Map newAutoMap(@NotNull Map backingMap, @Nullable final Class keyClass, ++ @NotNull final Class valueClass) { + return new LoadingMap<>(backingMap, new AutoInstantiatingLoader<>(keyClass, valueClass)); + } + /** @@ -2654,8 +2737,9 @@ index 00000000..dfefda35 + * @param Value Type of the Map + * @return Map that auto instantiates on .get() + */ -+ public static Map newAutoMap(Map backingMap, -+ final Class valueClass) { ++ @NotNull ++ public static Map newAutoMap(@NotNull Map backingMap, ++ @NotNull final Class valueClass) { + return newAutoMap(backingMap, null, valueClass); + } + @@ -2670,7 +2754,8 @@ index 00000000..dfefda35 + * @param Value Type of the Map + * @return Map that auto instantiates on .get() + */ -+ public static Map newHashAutoMap(final Class keyClass, final Class valueClass) { ++ @NotNull ++ public static Map newHashAutoMap(@Nullable final Class keyClass, @NotNull final Class valueClass) { + return newAutoMap(new HashMap<>(), keyClass, valueClass); + } + @@ -2684,7 +2769,8 @@ index 00000000..dfefda35 + * @param Value Type of the Map + * @return Map that auto instantiates on .get() + */ -+ public static Map newHashAutoMap(final Class valueClass) { ++ @NotNull ++ public static Map newHashAutoMap(@NotNull final Class valueClass) { + return newHashAutoMap(null, valueClass); + } + @@ -2701,7 +2787,8 @@ index 00000000..dfefda35 + * @param Value Type of the Map + * @return Map that auto instantiates on .get() + */ -+ public static Map newHashAutoMap(final Class keyClass, final Class valueClass, int initialCapacity, float loadFactor) { ++ @NotNull ++ public static Map newHashAutoMap(@Nullable final Class keyClass, @NotNull final Class valueClass, int initialCapacity, float loadFactor) { + return newAutoMap(new HashMap<>(initialCapacity, loadFactor), keyClass, valueClass); + } + @@ -2717,7 +2804,8 @@ index 00000000..dfefda35 + * @param Value Type of the Map + * @return Map that auto instantiates on .get() + */ -+ public static Map newHashAutoMap(final Class valueClass, int initialCapacity, float loadFactor) { ++ @NotNull ++ public static Map newHashAutoMap(@NotNull final Class valueClass, int initialCapacity, float loadFactor) { + return newHashAutoMap(null, valueClass, initialCapacity, loadFactor); + } + @@ -2729,7 +2817,8 @@ index 00000000..dfefda35 + * @param Value Type of the Map + * @return Map + */ -+ public static Map newHashMap(Function loader) { ++ @NotNull ++ public static Map newHashMap(@NotNull Function loader) { + return new LoadingMap<>(new HashMap<>(), loader); + } + @@ -2742,7 +2831,8 @@ index 00000000..dfefda35 + * @param Value Type of the Map + * @return Map + */ -+ public static Map newHashMap(Function loader, int initialCapacity) { ++ @NotNull ++ public static Map newHashMap(@NotNull Function loader, int initialCapacity) { + return new LoadingMap<>(new HashMap<>(initialCapacity), loader); + } + /** @@ -2755,7 +2845,8 @@ index 00000000..dfefda35 + * @param Value Type of the Map + * @return Map + */ -+ public static Map newHashMap(Function loader, int initialCapacity, float loadFactor) { ++ @NotNull ++ public static Map newHashMap(@NotNull Function loader, int initialCapacity, float loadFactor) { + return new LoadingMap<>(new HashMap<>(initialCapacity, loadFactor), loader); + } + @@ -2767,7 +2858,8 @@ index 00000000..dfefda35 + * @param Value Type of the Map + * @return Map + */ -+ public static Map newIdentityHashMap(Function loader) { ++ @NotNull ++ public static Map newIdentityHashMap(@NotNull Function loader) { + return new LoadingMap<>(new IdentityHashMap<>(), loader); + } + @@ -2780,7 +2872,8 @@ index 00000000..dfefda35 + * @param Value Type of the Map + * @return Map + */ -+ public static Map newIdentityHashMap(Function loader, int initialCapacity) { ++ @NotNull ++ public static Map newIdentityHashMap(@NotNull Function loader, int initialCapacity) { + return new LoadingMap<>(new IdentityHashMap<>(initialCapacity), loader); + } + @@ -2791,13 +2884,14 @@ index 00000000..dfefda35 + public boolean isEmpty() {return backingMap.isEmpty();} + + @Override -+ public boolean containsKey(Object key) {return backingMap.containsKey(key);} ++ public boolean containsKey(@Nullable Object key) {return backingMap.containsKey(key);} + + @Override -+ public boolean containsValue(Object value) {return backingMap.containsValue(value);} ++ public boolean containsValue(@Nullable Object value) {return backingMap.containsValue(value);} + ++ @Nullable + @Override -+ public V get(Object key) { ++ public V get(@Nullable Object key) { + V v = backingMap.get(key); + if (v != null) { + return v; @@ -2805,33 +2899,39 @@ index 00000000..dfefda35 + return backingMap.computeIfAbsent((K) key, loader); + } + -+ public V put(K key, V value) {return backingMap.put(key, value);} ++ @Nullable ++ public V put(@Nullable K key, @Nullable V value) {return backingMap.put(key, value);} + ++ @Nullable + @Override -+ public V remove(Object key) {return backingMap.remove(key);} ++ public V remove(@Nullable Object key) {return backingMap.remove(key);} + -+ public void putAll(Map m) {backingMap.putAll(m);} ++ public void putAll(@NotNull Map m) {backingMap.putAll(m);} + + @Override + public void clear() {backingMap.clear();} + ++ @NotNull + @Override + public Set keySet() {return backingMap.keySet();} + ++ @NotNull + @Override + public Collection values() {return backingMap.values();} + + @Override -+ public boolean equals(Object o) {return backingMap.equals(o);} ++ public boolean equals(@Nullable Object o) {return backingMap.equals(o);} + + @Override + public int hashCode() {return backingMap.hashCode();} + ++ @NotNull + @Override + public Set> entrySet() { + return backingMap.entrySet(); + } + ++ @NotNull + public LoadingMap clone() { + return new LoadingMap<>(backingMap, loader); + } @@ -2840,7 +2940,7 @@ index 00000000..dfefda35 + final Constructor constructor; + private final Class valueClass; + -+ AutoInstantiatingLoader(Class keyClass, Class valueClass) { ++ AutoInstantiatingLoader(@Nullable Class keyClass, @NotNull Class valueClass) { + try { + this.valueClass = valueClass; + if (keyClass != null) { @@ -2854,8 +2954,9 @@ index 00000000..dfefda35 + } + } + ++ @NotNull + @Override -+ public V apply(K input) { ++ public V apply(@Nullable K input) { + try { + return (constructor != null ? constructor.newInstance(input) : valueClass.newInstance()); + } catch (Exception e) { @@ -2880,17 +2981,19 @@ index 00000000..dfefda35 + * @param Type + */ + public abstract static class Feeder implements Function { ++ @Nullable + @Override -+ public T apply(Object input) { ++ public T apply(@Nullable Object input) { + return apply(); + } + ++ @Nullable + public abstract T apply(); + } +} diff --git a/src/main/java/co/aikar/util/MRUMapCache.java b/src/main/java/co/aikar/util/MRUMapCache.java new file mode 100644 -index 00000000..df592d85 +index 000000000..5989ee212 --- /dev/null +++ b/src/main/java/co/aikar/util/MRUMapCache.java @@ -0,0 +0,0 @@ @@ -2923,6 +3026,8 @@ index 00000000..df592d85 +import java.util.Collection; +import java.util.Map; +import java.util.Set; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * Implements a Most Recently Used cache in front of a backing map, to quickly access the last accessed result. @@ -2934,7 +3039,7 @@ index 00000000..df592d85 + final Map backingMap; + Object cacheKey; + V cacheValue; -+ public MRUMapCache(final Map backingMap) { ++ public MRUMapCache(@NotNull final Map backingMap) { + this.backingMap = backingMap; + } + @@ -2942,15 +3047,16 @@ index 00000000..df592d85 + + public boolean isEmpty() {return backingMap.isEmpty();} + -+ public boolean containsKey(Object key) { ++ public boolean containsKey(@Nullable Object key) { + return key != null && key.equals(cacheKey) || backingMap.containsKey(key); + } + -+ public boolean containsValue(Object value) { ++ public boolean containsValue(@Nullable Object value) { + return value != null && value == cacheValue || backingMap.containsValue(value); + } + -+ public V get(Object key) { ++ @Nullable ++ public V get(@Nullable Object key) { + if (cacheKey != null && cacheKey.equals(key)) { + return cacheValue; + } @@ -2958,19 +3064,21 @@ index 00000000..df592d85 + return cacheValue = backingMap.get(key); + } + -+ public V put(K key, V value) { ++ @Nullable ++ public V put(@Nullable K key, @Nullable V value) { + cacheKey = key; + return cacheValue = backingMap.put(key, value); + } + -+ public V remove(Object key) { ++ @Nullable ++ public V remove(@Nullable Object key) { + if (key != null && key.equals(cacheKey)) { + cacheKey = null; + } + return backingMap.remove(key); + } + -+ public void putAll(Map m) {backingMap.putAll(m);} ++ public void putAll(@NotNull Map m) {backingMap.putAll(m);} + + public void clear() { + cacheKey = null; @@ -2978,10 +3086,13 @@ index 00000000..df592d85 + backingMap.clear(); + } + ++ @NotNull + public Set keySet() {return backingMap.keySet();} + ++ @NotNull + public Collection values() {return backingMap.values();} + ++ @NotNull + public Set> entrySet() {return backingMap.entrySet();} + + /** @@ -2992,12 +3103,13 @@ index 00000000..df592d85 + * @param Value Type of the Map + * @return Map + */ -+ public static Map of(Map map) { ++ @NotNull ++ public static Map of(@NotNull Map map) { + return new MRUMapCache(map); + } +} diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index d8014f14..14e425d1 100644 +index 27988a66b..cffa0c65f 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java @@ -0,0 +0,0 @@ public final class Bukkit { @@ -3009,54 +3121,55 @@ index d8014f14..14e425d1 100644 /** diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index fac90a48..9d2326ca 100644 +index 12660040b..9f7f760af 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient { - // Spigot start - public class Spigot - { -- -+ @Deprecated - public org.bukkit.configuration.file.YamlConfiguration getConfig() - { throw new UnsupportedOperationException( "Not supported yet." ); } ++ // Paper start ++ @NotNull + public org.bukkit.configuration.file.YamlConfiguration getBukkitConfig() + { + throw new UnsupportedOperationException( "Not supported yet." ); + } + ++ @NotNull + public org.bukkit.configuration.file.YamlConfiguration getSpigotConfig() + { + throw new UnsupportedOperationException("Not supported yet."); + } + ++ @NotNull + public org.bukkit.configuration.file.YamlConfiguration getPaperConfig() + { + throw new UnsupportedOperationException("Not supported yet."); + } ++ // Paper end + /** * Sends the component to the player * diff --git a/src/main/java/org/bukkit/command/BufferedCommandSender.java b/src/main/java/org/bukkit/command/BufferedCommandSender.java new file mode 100644 -index 00000000..fd452bce +index 000000000..f9a00aecc --- /dev/null +++ b/src/main/java/org/bukkit/command/BufferedCommandSender.java @@ -0,0 +0,0 @@ +package org.bukkit.command; + ++import org.jetbrains.annotations.NotNull; ++ +public class BufferedCommandSender implements MessageCommandSender { + private final StringBuffer buffer = new StringBuffer(); + @Override -+ public void sendMessage(String message) { ++ public void sendMessage(@NotNull String message) { + buffer.append(message); + buffer.append("\n"); + } + ++ @NotNull + public String getBuffer() { + return buffer.toString(); + } @@ -3066,7 +3179,7 @@ index 00000000..fd452bce + } +} diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java -index 33e8681d..db7f4428 100644 +index b354b617f..01ea1ca67 100644 --- a/src/main/java/org/bukkit/command/Command.java +++ b/src/main/java/org/bukkit/command/Command.java @@ -0,0 +0,0 @@ public abstract class Command { @@ -3074,13 +3187,13 @@ index 33e8681d..db7f4428 100644 private String permission; private String permissionMessage; - public org.spigotmc.CustomTimingsHandler timings; // Spigot -+ public co.aikar.timings.Timing timings; // Spigot -+ public String getTimingName() {return getName();} // Spigot ++ public co.aikar.timings.Timing timings; // Paper ++ @NotNull public String getTimingName() {return getName();} // Paper - protected Command(String name) { + protected Command(@NotNull String name) { this(name, "", "/" + name, new ArrayList()); @@ -0,0 +0,0 @@ public abstract class Command { - this.usageMessage = usageMessage; + this.usageMessage = (usageMessage == null) ? "/" + name : usageMessage; this.aliases = aliases; this.activeAliases = new ArrayList(aliases); - this.timings = new org.spigotmc.CustomTimingsHandler("** Command: " + name); // Spigot @@ -3088,7 +3201,7 @@ index 33e8681d..db7f4428 100644 /** @@ -0,0 +0,0 @@ public abstract class Command { - public boolean setLabel(String name) { + } this.nextLabel = name; if (!isRegistered()) { - this.timings = new org.spigotmc.CustomTimingsHandler("** Command: " + name); // Spigot @@ -3096,12 +3209,12 @@ index 33e8681d..db7f4428 100644 return true; } diff --git a/src/main/java/org/bukkit/command/FormattedCommandAlias.java b/src/main/java/org/bukkit/command/FormattedCommandAlias.java -index 50257883..9c80f464 100644 +index 2035880ee..b8c97a4bf 100644 --- a/src/main/java/org/bukkit/command/FormattedCommandAlias.java +++ b/src/main/java/org/bukkit/command/FormattedCommandAlias.java @@ -0,0 +0,0 @@ public class FormattedCommandAlias extends Command { - public FormattedCommandAlias(String alias, String[] formatStrings) { + public FormattedCommandAlias(@NotNull String alias, @NotNull String[] formatStrings) { super(alias); + timings = co.aikar.timings.TimingsManager.getCommandTiming("minecraft", this); // Spigot this.formatStrings = formatStrings; @@ -3111,15 +3224,16 @@ index 50257883..9c80f464 100644 return formatString; } -+ @Override // Spigot -+ public String getTimingName() {return "Command Forwarder - " + super.getTimingName();} // Spigot ++ @NotNull ++ @Override // Paper ++ public String getTimingName() {return "Command Forwarder - " + super.getTimingName();} // Paper + private static boolean inRange(int i, int j, int k) { return i >= j && i <= k; } diff --git a/src/main/java/org/bukkit/command/MessageCommandSender.java b/src/main/java/org/bukkit/command/MessageCommandSender.java new file mode 100644 -index 00000000..5527e7c8 +index 000000000..ca1893e9f --- /dev/null +++ b/src/main/java/org/bukkit/command/MessageCommandSender.java @@ -0,0 +0,0 @@ @@ -3134,6 +3248,7 @@ index 00000000..5527e7c8 +import org.bukkit.plugin.Plugin; + +import java.util.Set; ++import org.jetbrains.annotations.NotNull; + +/** + * For when all you care about is just messaging @@ -3141,17 +3256,19 @@ index 00000000..5527e7c8 +public interface MessageCommandSender extends CommandSender { + + @Override -+ default void sendMessage(String[] messages) { ++ default void sendMessage(@NotNull String[] messages) { + for (String message : messages) { + sendMessage(message); + } + } + ++ @NotNull + @Override + default Server getServer() { + return Bukkit.getServer(); + } + ++ @NotNull + @Override + default String getName() { + throw new NotImplementedException(); @@ -3168,47 +3285,51 @@ index 00000000..5527e7c8 + } + + @Override -+ default boolean isPermissionSet(String name) { ++ default boolean isPermissionSet(@NotNull String name) { + throw new NotImplementedException(); + } + + @Override -+ default boolean isPermissionSet(Permission perm) { ++ default boolean isPermissionSet(@NotNull Permission perm) { + throw new NotImplementedException(); + } + + @Override -+ default boolean hasPermission(String name) { ++ default boolean hasPermission(@NotNull String name) { + throw new NotImplementedException(); + } + + @Override -+ default boolean hasPermission(Permission perm) { ++ default boolean hasPermission(@NotNull Permission perm) { ++ throw new NotImplementedException(); ++ } ++ ++ @NotNull ++ @Override ++ default PermissionAttachment addAttachment(@NotNull Plugin plugin, @NotNull String name, boolean value) { ++ throw new NotImplementedException(); ++ } ++ ++ @NotNull ++ @Override ++ default PermissionAttachment addAttachment(@NotNull Plugin plugin) { ++ throw new NotImplementedException(); ++ } ++ ++ @NotNull ++ @Override ++ default PermissionAttachment addAttachment(@NotNull Plugin plugin, @NotNull String name, boolean value, int ticks) { ++ throw new NotImplementedException(); ++ } ++ ++ @NotNull ++ @Override ++ default PermissionAttachment addAttachment(@NotNull Plugin plugin, int ticks) { + throw new NotImplementedException(); + } + + @Override -+ default PermissionAttachment addAttachment(Plugin plugin, String name, boolean value) { -+ throw new NotImplementedException(); -+ } -+ -+ @Override -+ default PermissionAttachment addAttachment(Plugin plugin) { -+ throw new NotImplementedException(); -+ } -+ -+ @Override -+ default PermissionAttachment addAttachment(Plugin plugin, String name, boolean value, int ticks) { -+ throw new NotImplementedException(); -+ } -+ -+ @Override -+ default PermissionAttachment addAttachment(Plugin plugin, int ticks) { -+ throw new NotImplementedException(); -+ } -+ -+ @Override -+ default void removeAttachment(PermissionAttachment attachment) { ++ default void removeAttachment(@NotNull PermissionAttachment attachment) { + throw new NotImplementedException(); + } + @@ -3217,11 +3338,13 @@ index 00000000..5527e7c8 + throw new NotImplementedException(); + } + ++ @NotNull + @Override + default Set getEffectivePermissions() { + throw new NotImplementedException(); + } + ++ @NotNull + @Override + default Spigot spigot() { + throw new NotImplementedException(); @@ -3229,7 +3352,7 @@ index 00000000..5527e7c8 + +} diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java -index d9183db2..43e52a77 100644 +index 1586f6480..f7ec2e55f 100644 --- a/src/main/java/org/bukkit/command/SimpleCommandMap.java +++ b/src/main/java/org/bukkit/command/SimpleCommandMap.java @@ -0,0 +0,0 @@ public class SimpleCommandMap implements CommandMap { @@ -3237,15 +3360,15 @@ index d9183db2..43e52a77 100644 register("bukkit", new ReloadCommand("reload")); register("bukkit", new PluginsCommand("plugins")); - register("bukkit", new TimingsCommand("timings")); -+ register("bukkit", new co.aikar.timings.TimingsCommand("timings")); // Spigot ++ register("bukkit", new co.aikar.timings.TimingsCommand("timings")); // Paper } public void setFallbackCommands() { @@ -0,0 +0,0 @@ public class SimpleCommandMap implements CommandMap { * {@inheritDoc} */ - public boolean register(String label, String fallbackPrefix, Command command) { -+ command.timings = co.aikar.timings.TimingsManager.getCommandTiming(fallbackPrefix, command); // Spigot + public boolean register(@NotNull String label, @NotNull String fallbackPrefix, @NotNull Command command) { ++ command.timings = co.aikar.timings.TimingsManager.getCommandTiming(fallbackPrefix, command); // Paper label = label.toLowerCase(java.util.Locale.ENGLISH).trim(); fallbackPrefix = fallbackPrefix.toLowerCase(java.util.Locale.ENGLISH).trim(); boolean registered = register(label, command, false, fallbackPrefix); @@ -3264,7 +3387,7 @@ index d9183db2..43e52a77 100644 // Note: we don't return the result of target.execute as thats success / failure, we return handled (true) or not handled (false) diff --git a/src/main/java/org/bukkit/command/defaults/TimingsCommand.java b/src/main/java/org/bukkit/command/defaults/TimingsCommand.java deleted file mode 100644 -index bba914d7..00000000 +index 1e6e7033d..000000000 --- a/src/main/java/org/bukkit/command/defaults/TimingsCommand.java +++ /dev/null @@ -0,0 +0,0 @@ @@ -3288,6 +3411,7 @@ index bba914d7..00000000 -import org.bukkit.util.StringUtil; - -import com.google.common.collect.ImmutableList; +-import org.jetbrains.annotations.NotNull; - -// Spigot start -import java.io.ByteArrayOutputStream; @@ -3306,7 +3430,7 @@ index bba914d7..00000000 - private static final List TIMINGS_SUBCOMMANDS = ImmutableList.of("report", "reset", "on", "off", "paste"); // Spigot - public static long timingStart = 0; // Spigot - -- public TimingsCommand(String name) { +- public TimingsCommand(@NotNull String name) { - super(name); - this.description = "Manages Spigot Timings data to see performance of the server."; // Spigot - this.usageMessage = "/timings "; // Spigot @@ -3314,7 +3438,7 @@ index bba914d7..00000000 - } - - // Spigot start - redesigned Timings Command -- public void executeSpigotTimings(CommandSender sender, String[] args) { +- public void executeSpigotTimings(@NotNull CommandSender sender, @NotNull String[] args) { - if ( "on".equals( args[0] ) ) - { - ( (SimplePluginManager) Bukkit.getPluginManager() ).useTimings( true ); @@ -3377,7 +3501,7 @@ index bba914d7..00000000 - // Spigot end - - @Override -- public boolean execute(CommandSender sender, String currentAlias, String[] args) { +- public boolean execute(@NotNull CommandSender sender, @NotNull String currentAlias, @NotNull String[] args) { - if (!testPermission(sender)) return true; - if (args.length < 1) { // Spigot - sender.sendMessage(ChatColor.RED + "Usage: " + usageMessage); @@ -3458,8 +3582,9 @@ index bba914d7..00000000 - return true; - } - +- @NotNull - @Override -- public List tabComplete(CommandSender sender, String alias, String[] args) { +- public List tabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) { - Validate.notNull(sender, "Sender cannot be null"); - Validate.notNull(args, "Arguments cannot be null"); - Validate.notNull(alias, "Alias cannot be null"); @@ -3477,7 +3602,7 @@ index bba914d7..00000000 - private final CommandSender sender; - private final ByteArrayOutputStream bout; - -- public PasteThread(CommandSender sender, ByteArrayOutputStream bout) +- public PasteThread(@NotNull CommandSender sender, @NotNull ByteArrayOutputStream bout) - { - super( "Timings paste thread" ); - this.sender = sender; @@ -3522,11 +3647,11 @@ index bba914d7..00000000 - // Spigot end -} diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 71fe947b..75f21146 100644 +index 97504e6f9..777994f7a 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM - public void sendMessage(net.md_5.bungee.api.ChatMessageType position, net.md_5.bungee.api.chat.BaseComponent... components) { + public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @NotNull net.md_5.bungee.api.chat.BaseComponent... components) { throw new UnsupportedOperationException("Not supported yet."); } + @@ -3536,9 +3661,9 @@ index 71fe947b..75f21146 100644 + } } - @Override + @NotNull diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java -index 92db0663..0185934b 100644 +index 76137a800..fe5725519 100644 --- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java +++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java @@ -0,0 +0,0 @@ public final class SimplePluginManager implements PluginManager { @@ -3554,26 +3679,26 @@ index 92db0663..0185934b 100644 if (result != null) { plugins.add(result); - lookupNames.put(result.getDescription().getName(), result); -+ lookupNames.put(result.getDescription().getName().toLowerCase(java.util.Locale.ENGLISH), result); // Spigot ++ lookupNames.put(result.getDescription().getName().toLowerCase(java.util.Locale.ENGLISH), result); // Paper } return result; @@ -0,0 +0,0 @@ public final class SimplePluginManager implements PluginManager { - * @return Plugin if it exists, otherwise null */ - public synchronized Plugin getPlugin(String name) { + @Nullable + public synchronized Plugin getPlugin(@NotNull String name) { - return lookupNames.get(name.replace(' ', '_')); -+ return lookupNames.get(name.replace(' ', '_').toLowerCase(java.util.Locale.ENGLISH)); // Spigot ++ return lookupNames.get(name.replace(' ', '_').toLowerCase(java.util.Locale.ENGLISH)); // Paper } - public synchronized Plugin[] getPlugins() { + @NotNull @@ -0,0 +0,0 @@ public final class SimplePluginManager implements PluginManager { throw new IllegalPluginAccessException("Plugin attempted to register " + event + " while not enabled"); } - if (useTimings) { -+ executor = new co.aikar.timings.TimedEventExecutor(executor, plugin, null, event); // Spigot -+ if (false) { // Spigot - RL handles useTimings check now ++ executor = new co.aikar.timings.TimedEventExecutor(executor, plugin, null, event); // Paper ++ if (false) { // Spigot - RL handles useTimings check now // Paper getEventListeners(event).register(new TimedRegisteredListener(listener, executor, priority, plugin, ignoreCancelled)); } else { getEventListeners(event).register(new RegisteredListener(listener, executor, priority, plugin, ignoreCancelled)); @@ -3591,21 +3716,13 @@ index 92db0663..0185934b 100644 */ public void useTimings(boolean use) { - useTimings = use; -+ co.aikar.timings.Timings.setTimingsEnabled(use); // Spigot ++ co.aikar.timings.Timings.setTimingsEnabled(use); // Paper } } diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -index 2d4c75ab..54594546 100644 +index 56f933360..5b29076fe 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -@@ -0,0 +0,0 @@ import org.bukkit.plugin.PluginLoader; - import org.bukkit.plugin.RegisteredListener; - import org.bukkit.plugin.TimedRegisteredListener; - import org.bukkit.plugin.UnknownDependencyException; --import org.spigotmc.CustomTimingsHandler; // Spigot - import org.yaml.snakeyaml.error.YAMLException; - - /** @@ -0,0 +0,0 @@ public final class JavaPluginLoader implements PluginLoader { private final Pattern[] fileFilters = new Pattern[] { Pattern.compile("\\.jar$"), }; private final Map> classes = new ConcurrentHashMap>(); @@ -3620,8 +3737,9 @@ index 2d4c75ab..54594546 100644 - final CustomTimingsHandler timings = new CustomTimingsHandler("Plugin: " + plugin.getDescription().getFullName() + " Event: " + listener.getClass().getName() + "::" + method.getName()+"("+eventClass.getSimpleName()+")", pluginParentTimer); // Spigot - EventExecutor executor = new EventExecutor() { -+ EventExecutor executor = new co.aikar.timings.TimedEventExecutor(new EventExecutor() { // Spigot - public void execute(Listener listener, Event event) throws EventException { +- public void execute(@NotNull Listener listener, @NotNull Event event) throws EventException { ++ EventExecutor executor = new co.aikar.timings.TimedEventExecutor(new EventExecutor() { // Paper ++ public void execute(@NotNull Listener listener, @NotNull Event event) throws EventException { // Paper try { if (!eventClass.isAssignableFrom(event.getClass())) { return; @@ -3639,15 +3757,15 @@ index 2d4c75ab..54594546 100644 } } - }; -+ }, plugin, method, eventClass); // Spigot ++ }, plugin, method, eventClass); // Paper if (false) { // Spigot - RL handles useTimings check now eventSet.add(new TimedRegisteredListener(listener, executor, eh.priority(), plugin, eh.ignoreCancelled())); } else { diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java -index 7a8abe75..bc33ff33 100644 +index 541d8ee6b..c39fcac5a 100644 --- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java +++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java -@@ -0,0 +0,0 @@ import org.bukkit.plugin.PluginDescriptionFile; +@@ -0,0 +0,0 @@ import org.jetbrains.annotations.Nullable; /** * A ClassLoader for plugins, to allow shared classes across multiple plugins */ @@ -3658,19 +3776,30 @@ index 7a8abe75..bc33ff33 100644 private final Map> classes = new ConcurrentHashMap>(); private final PluginDescriptionFile description; diff --git a/src/main/java/org/bukkit/util/CachedServerIcon.java b/src/main/java/org/bukkit/util/CachedServerIcon.java -index 5ca863b3..04804706 100644 +index 5ca863b36..612958a33 100644 --- a/src/main/java/org/bukkit/util/CachedServerIcon.java +++ b/src/main/java/org/bukkit/util/CachedServerIcon.java +@@ -0,0 +0,0 @@ package org.bukkit.util; + + import org.bukkit.Server; + import org.bukkit.event.server.ServerListPingEvent; ++import org.jetbrains.annotations.Nullable; + + /** + * This is a cached version of a server-icon. It's internal representation @@ -0,0 +0,0 @@ import org.bukkit.event.server.ServerListPingEvent; * @see Server#loadServerIcon(java.io.File) * @see ServerListPingEvent#setServerIcon(CachedServerIcon) */ -public interface CachedServerIcon {} +public interface CachedServerIcon { -+ public String getData(); // Spigot ++ ++ @Nullable ++ public String getData(); // Paper ++ +} diff --git a/src/main/java/org/spigotmc/CustomTimingsHandler.java b/src/main/java/org/spigotmc/CustomTimingsHandler.java -index 8d982974..e9f76006 100644 +index 6a8f7f551..3cbe5c2bb 100644 --- a/src/main/java/org/spigotmc/CustomTimingsHandler.java +++ b/src/main/java/org/spigotmc/CustomTimingsHandler.java @@ -0,0 +0,0 @@ @@ -3699,25 +3828,20 @@ index 8d982974..e9f76006 100644 + */ package org.spigotmc; + import java.io.PrintStream; +@@ -0,0 +0,0 @@ import java.util.Queue; + import java.util.concurrent.ConcurrentLinkedQueue; + import org.bukkit.Bukkit; + import org.bukkit.World; -import org.bukkit.command.defaults.TimingsCommand; --import org.bukkit.event.HandlerList; -+import org.bukkit.Bukkit; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; +import org.bukkit.plugin.AuthorNagException; - import org.bukkit.plugin.Plugin; --import org.bukkit.plugin.RegisteredListener; --import org.bukkit.plugin.TimedRegisteredListener; --import java.io.PrintStream; --import java.util.Collection; --import java.util.HashSet; --import java.util.List; --import java.util.Queue; --import java.util.concurrent.ConcurrentLinkedQueue; ++import org.bukkit.plugin.Plugin; +import co.aikar.timings.Timing; +import co.aikar.timings.Timings; +import co.aikar.timings.TimingsManager; - --import org.bukkit.Bukkit; --import org.bukkit.World; ++ +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.logging.Level; @@ -3749,17 +3873,17 @@ index 8d982974..e9f76006 100644 - private long totalTime = 0; - private long curTickTotal = 0; - private long violations = 0; -+ public CustomTimingsHandler(String name) { ++ public CustomTimingsHandler(@NotNull String name) { + if (sunReflectAvailable == null) { + String javaVer = System.getProperty("java.version"); + String[] elements = javaVer.split("\\."); -- public CustomTimingsHandler(String name) +- public CustomTimingsHandler(@NotNull String name) - { - this( name, null ); - } - -- public CustomTimingsHandler(String name, CustomTimingsHandler parent) +- public CustomTimingsHandler(@NotNull String name, @Nullable CustomTimingsHandler parent) - { - this.name = name; - this.parent = parent; @@ -3774,7 +3898,7 @@ index 8d982974..e9f76006 100644 - * - * @param printStream - */ -- public static void printTimings(PrintStream printStream) +- public static void printTimings(@NotNull PrintStream printStream) - { - printStream.println( "Minecraft" ); - for ( CustomTimingsHandler timings : HANDLERS ) diff --git a/Spigot-API-Patches/Turtle-API.patch b/Spigot-API-Patches/Turtle-API.patch index e67e730649..f8ce1cee56 100644 --- a/Spigot-API-Patches/Turtle-API.patch +++ b/Spigot-API-Patches/Turtle-API.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Turtle API diff --git a/src/main/java/com/destroystokyo/paper/event/entity/TurtleGoHomeEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/TurtleGoHomeEvent.java new file mode 100644 -index 00000000..11248ee9 +index 000000000..021356d15 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/TurtleGoHomeEvent.java @@ -0,0 +0,0 @@ @@ -16,6 +16,7 @@ index 00000000..11248ee9 +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.EntityEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired when a Turtle decides to go home @@ -24,7 +25,7 @@ index 00000000..11248ee9 + private static final HandlerList handlers = new HandlerList(); + private boolean cancelled = false; + -+ public TurtleGoHomeEvent(Turtle turtle) { ++ public TurtleGoHomeEvent(@NotNull Turtle turtle) { + super(turtle); + } + @@ -33,6 +34,7 @@ index 00000000..11248ee9 + * + * @return The turtle + */ ++ @NotNull + public Turtle getEntity() { + return (Turtle) entity; + } @@ -47,17 +49,19 @@ index 00000000..11248ee9 + cancelled = cancel; + } + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } +} diff --git a/src/main/java/com/destroystokyo/paper/event/entity/TurtleLayEggEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/TurtleLayEggEvent.java new file mode 100644 -index 00000000..7cb00f78 +index 000000000..a315c5185 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/TurtleLayEggEvent.java @@ -0,0 +0,0 @@ @@ -68,6 +72,7 @@ index 00000000..7cb00f78 +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.EntityEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired when a Turtle lays eggs @@ -75,10 +80,11 @@ index 00000000..7cb00f78 +public class TurtleLayEggEvent extends EntityEvent implements Cancellable { + private static final HandlerList handlers = new HandlerList(); + private boolean cancelled = false; ++ @NotNull + private final Location location; + private int eggCount; + -+ public TurtleLayEggEvent(Turtle turtle, Location location, int eggCount) { ++ public TurtleLayEggEvent(@NotNull Turtle turtle, @NotNull Location location, int eggCount) { + super(turtle); + this.location = location; + this.eggCount = eggCount; @@ -89,6 +95,7 @@ index 00000000..7cb00f78 + * + * @return The turtle + */ ++ @NotNull + public Turtle getEntity() { + return (Turtle) entity; + } @@ -98,6 +105,7 @@ index 00000000..7cb00f78 + * + * @return Location of eggs + */ ++ @NotNull + public Location getLocation() { + return location; + } @@ -134,17 +142,19 @@ index 00000000..7cb00f78 + cancelled = cancel; + } + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } +} diff --git a/src/main/java/com/destroystokyo/paper/event/entity/TurtleStartDiggingEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/TurtleStartDiggingEvent.java new file mode 100644 -index 00000000..5d53ee08 +index 000000000..abeb24fcc --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/TurtleStartDiggingEvent.java @@ -0,0 +0,0 @@ @@ -155,6 +165,7 @@ index 00000000..5d53ee08 +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.EntityEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired when a Turtle starts digging to lay eggs @@ -162,9 +173,9 @@ index 00000000..5d53ee08 +public class TurtleStartDiggingEvent extends EntityEvent implements Cancellable { + private static final HandlerList handlers = new HandlerList(); + private boolean cancelled = false; -+ private final Location location; ++ @NotNull private final Location location; + -+ public TurtleStartDiggingEvent(Turtle turtle, Location location) { ++ public TurtleStartDiggingEvent(@NotNull Turtle turtle, @NotNull Location location) { + super(turtle); + this.location = location; + } @@ -174,6 +185,7 @@ index 00000000..5d53ee08 + * + * @return The turtle + */ ++ @NotNull + public Turtle getEntity() { + return (Turtle) entity; + } @@ -183,6 +195,7 @@ index 00000000..5d53ee08 + * + * @return Location where digging + */ ++ @NotNull + public Location getLocation() { + return location; + } @@ -197,22 +210,25 @@ index 00000000..5d53ee08 + cancelled = cancel; + } + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } +} diff --git a/src/main/java/org/bukkit/entity/Turtle.java b/src/main/java/org/bukkit/entity/Turtle.java -index 0a4cd299..e547eead 100644 +index 0a4cd2993..5375ea140 100644 --- a/src/main/java/org/bukkit/entity/Turtle.java +++ b/src/main/java/org/bukkit/entity/Turtle.java @@ -0,0 +0,0 @@ package org.bukkit.entity; +import org.bukkit.Location; ++import org.jetbrains.annotations.NotNull; + /** * Represents a turtle. @@ -226,6 +242,7 @@ index 0a4cd299..e547eead 100644 + * + * @return Home location + */ ++ @NotNull + Location getHome(); + + /** @@ -233,7 +250,7 @@ index 0a4cd299..e547eead 100644 + * + * @param location Home location + */ -+ void setHome(Location location); ++ void setHome(@NotNull Location location); + + /** + * Check if turtle is currently pathfinding to it's home diff --git a/Spigot-API-Patches/Use-ASM-for-event-executors.patch b/Spigot-API-Patches/Use-ASM-for-event-executors.patch index 8866bc17e8..4e10da1b8a 100644 --- a/Spigot-API-Patches/Use-ASM-for-event-executors.patch +++ b/Spigot-API-Patches/Use-ASM-for-event-executors.patch @@ -6,30 +6,30 @@ Subject: [PATCH] Use ASM for event executors. Uses method handles for private or static methods. diff --git a/pom.xml b/pom.xml -index f8f12595..84ba2076 100644 +index 524231ecc..082f2f0c5 100644 --- a/pom.xml +++ b/pom.xml @@ -0,0 +0,0 @@ - 1.3 + 7.1 test + + + org.ow2.asm + asm -+ 6.1.1 ++ 7.1 + + + org.ow2.asm + asm-commons -+ 6.1.1 ++ 7.1 + diff --git a/src/main/java/com/destroystokyo/paper/event/executor/MethodHandleEventExecutor.java b/src/main/java/com/destroystokyo/paper/event/executor/MethodHandleEventExecutor.java new file mode 100644 -index 00000000..9ff99e3b +index 000000000..72318d42d --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/executor/MethodHandleEventExecutor.java @@ -0,0 +0,0 @@ @@ -43,17 +43,18 @@ index 00000000..9ff99e3b +import org.bukkit.event.EventException; +import org.bukkit.event.Listener; +import org.bukkit.plugin.EventExecutor; ++import org.jetbrains.annotations.NotNull; + +public class MethodHandleEventExecutor implements EventExecutor { + private final Class eventClass; + private final MethodHandle handle; + -+ public MethodHandleEventExecutor(Class eventClass, MethodHandle handle) { ++ public MethodHandleEventExecutor(@NotNull Class eventClass, @NotNull MethodHandle handle) { + this.eventClass = eventClass; + this.handle = handle; + } + -+ public MethodHandleEventExecutor(Class eventClass, Method m) { ++ public MethodHandleEventExecutor(@NotNull Class eventClass, @NotNull Method m) { + this.eventClass = eventClass; + try { + m.setAccessible(true); @@ -64,7 +65,7 @@ index 00000000..9ff99e3b + } + + @Override -+ public void execute(Listener listener, Event event) throws EventException { ++ public void execute(@NotNull Listener listener, @NotNull Event event) throws EventException { + if (!eventClass.isInstance(event)) return; + try { + handle.invoke(listener, event); @@ -75,7 +76,7 @@ index 00000000..9ff99e3b +} diff --git a/src/main/java/com/destroystokyo/paper/event/executor/StaticMethodHandleEventExecutor.java b/src/main/java/com/destroystokyo/paper/event/executor/StaticMethodHandleEventExecutor.java new file mode 100644 -index 00000000..bac04fd8 +index 000000000..c83672427 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/executor/StaticMethodHandleEventExecutor.java @@ -0,0 +0,0 @@ @@ -94,13 +95,15 @@ index 00000000..bac04fd8 +import org.bukkit.event.EventException; +import org.bukkit.event.Listener; +import org.bukkit.plugin.EventExecutor; ++import org.jetbrains.annotations.NotNull; + +public class StaticMethodHandleEventExecutor implements EventExecutor { + private final Class eventClass; + private final MethodHandle handle; + -+ public StaticMethodHandleEventExecutor(Class eventClass, Method m) { ++ public StaticMethodHandleEventExecutor(@NotNull Class eventClass, @NotNull Method m) { + Preconditions.checkArgument(Modifier.isStatic(m.getModifiers()), "Not a static method: %s", m); ++ Preconditions.checkArgument(eventClass != null, "eventClass is null"); + this.eventClass = eventClass; + try { + m.setAccessible(true); @@ -111,7 +114,7 @@ index 00000000..bac04fd8 + } + + @Override -+ public void execute(Listener listener, Event event) throws EventException { ++ public void execute(@NotNull Listener listener, @NotNull Event event) throws EventException { + if (!eventClass.isInstance(event)) return; + try { + handle.invoke(event); @@ -122,7 +125,7 @@ index 00000000..bac04fd8 +} diff --git a/src/main/java/com/destroystokyo/paper/event/executor/asm/ASMEventExecutorGenerator.java b/src/main/java/com/destroystokyo/paper/event/executor/asm/ASMEventExecutorGenerator.java new file mode 100644 -index 00000000..140cf0ad +index 000000000..b6e7d8ee8 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/executor/asm/ASMEventExecutorGenerator.java @@ -0,0 +0,0 @@ @@ -132,6 +135,7 @@ index 00000000..140cf0ad +import java.util.concurrent.atomic.AtomicInteger; + +import org.bukkit.plugin.EventExecutor; ++import org.jetbrains.annotations.NotNull; +import org.objectweb.asm.ClassWriter; +import org.objectweb.asm.Type; +import org.objectweb.asm.commons.GeneratorAdapter; @@ -139,7 +143,8 @@ index 00000000..140cf0ad +import static org.objectweb.asm.Opcodes.*; + +public class ASMEventExecutorGenerator { -+ public static byte[] generateEventExecutor(Method m, String name) { ++ @NotNull ++ public static byte[] generateEventExecutor(@NotNull Method m, @NotNull String name) { + ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS); + writer.visit(V1_8, ACC_PUBLIC, name.replace('.', '/'), null, Type.getInternalName(Object.class), new String[] {Type.getInternalName(EventExecutor.class)}); + // Generate constructor @@ -165,6 +170,7 @@ index 00000000..140cf0ad + } + + public static AtomicInteger NEXT_ID = new AtomicInteger(1); ++ @NotNull + public static String generateName() { + int id = NEXT_ID.getAndIncrement(); + return "com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor" + id; @@ -172,13 +178,14 @@ index 00000000..140cf0ad +} diff --git a/src/main/java/com/destroystokyo/paper/event/executor/asm/ClassDefiner.java b/src/main/java/com/destroystokyo/paper/event/executor/asm/ClassDefiner.java new file mode 100644 -index 00000000..6941d9fb +index 000000000..beed9e6e0 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/executor/asm/ClassDefiner.java @@ -0,0 +0,0 @@ +package com.destroystokyo.paper.event.executor.asm; + +import com.destroystokyo.paper.utils.UnsafeUtils; ++import org.jetbrains.annotations.NotNull; + +public interface ClassDefiner { + @@ -201,8 +208,10 @@ index 00000000..6941d9fb + * @throws ClassFormatError if the class data is invalid + * @throws NullPointerException if any of the arguments are null + */ -+ public Class defineClass(ClassLoader parentLoader, String name, byte[] data); ++ @NotNull ++ public Class defineClass(@NotNull ClassLoader parentLoader, @NotNull String name, @NotNull byte[] data); + ++ @NotNull + public static ClassDefiner getInstance() { + return SafeClassDefiner.INSTANCE; + } @@ -210,7 +219,7 @@ index 00000000..6941d9fb +} diff --git a/src/main/java/com/destroystokyo/paper/event/executor/asm/SafeClassDefiner.java b/src/main/java/com/destroystokyo/paper/event/executor/asm/SafeClassDefiner.java new file mode 100644 -index 00000000..1473ff8c +index 000000000..ac99477e9 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/executor/asm/SafeClassDefiner.java @@ -0,0 +0,0 @@ @@ -222,6 +231,7 @@ index 00000000..1473ff8c +import com.google.common.base.Preconditions; + +import com.google.common.collect.MapMaker; ++import org.jetbrains.annotations.NotNull; +import org.objectweb.asm.Type; + +public class SafeClassDefiner implements ClassDefiner { @@ -231,8 +241,9 @@ index 00000000..1473ff8c + + private final ConcurrentMap loaders = new MapMaker().weakKeys().makeMap(); + ++ @NotNull + @Override -+ public Class defineClass(ClassLoader parentLoader, String name, byte[] data) { ++ public Class defineClass(@NotNull ClassLoader parentLoader, @NotNull String name, @NotNull byte[] data) { + GeneratedClassLoader loader = loaders.computeIfAbsent(parentLoader, GeneratedClassLoader::new); + synchronized (loader.getClassLoadingLock(name)) { + Preconditions.checkState(!loader.hasClass(name), "%s already defined", name); @@ -247,11 +258,11 @@ index 00000000..1473ff8c + ClassLoader.registerAsParallelCapable(); + } + -+ protected GeneratedClassLoader(ClassLoader parent) { ++ protected GeneratedClassLoader(@NotNull ClassLoader parent) { + super(parent); + } + -+ private Class define(String name, byte[] data) { ++ private Class define(@NotNull String name, byte[] data) { + synchronized (getClassLoadingLock(name)) { + assert !hasClass(name); + Class c = defineClass(name, data, 0, data.length); @@ -261,11 +272,12 @@ index 00000000..1473ff8c + } + + @Override -+ public Object getClassLoadingLock(String name) { ++ @NotNull ++ public Object getClassLoadingLock(@NotNull String name) { + return super.getClassLoadingLock(name); + } + -+ public boolean hasClass(String name) { ++ public boolean hasClass(@NotNull String name) { + synchronized (getClassLoadingLock(name)) { + try { + Class.forName(name); @@ -279,12 +291,13 @@ index 00000000..1473ff8c +} diff --git a/src/main/java/com/destroystokyo/paper/utils/UnsafeUtils.java b/src/main/java/com/destroystokyo/paper/utils/UnsafeUtils.java new file mode 100644 -index 00000000..62acbf82 +index 000000000..72e48e8ef --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/utils/UnsafeUtils.java @@ -0,0 +0,0 @@ +package com.destroystokyo.paper.utils; + ++import org.jetbrains.annotations.Nullable; +import sun.misc.Unsafe; + +import java.lang.reflect.Field; @@ -312,22 +325,22 @@ index 00000000..62acbf82 + return UNSAFE != null; + } + ++ @Nullable + public static Unsafe getUnsafe() { + return UNSAFE; + } +} diff --git a/src/main/java/org/bukkit/plugin/EventExecutor.java b/src/main/java/org/bukkit/plugin/EventExecutor.java -index 3b2c99ea..b11c6ce6 100644 +index a850f0780..9026e108c 100644 --- a/src/main/java/org/bukkit/plugin/EventExecutor.java +++ b/src/main/java/org/bukkit/plugin/EventExecutor.java -@@ -0,0 +0,0 @@ import org.bukkit.event.Event; - import org.bukkit.event.EventException; +@@ -0,0 +0,0 @@ import org.bukkit.event.EventException; import org.bukkit.event.Listener; + import org.jetbrains.annotations.NotNull; +// Paper start +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; -+import java.util.HashMap; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.function.Function; @@ -343,12 +356,13 @@ index 3b2c99ea..b11c6ce6 100644 * Interface which defines the class for event call backs to plugins */ public interface EventExecutor { - public void execute(Listener listener, Event event) throws EventException; + public void execute(@NotNull Listener listener, @NotNull Event event) throws EventException; + + // Paper start + ConcurrentMap> eventExecutorMap = new ConcurrentHashMap>() { ++ @NotNull + @Override -+ public Class computeIfAbsent(Method key, Function> mappingFunction) { ++ public Class computeIfAbsent(@NotNull Method key, @NotNull Function> mappingFunction) { + Class executorClass = get(key); + if (executorClass != null) + return executorClass; @@ -364,7 +378,8 @@ index 3b2c99ea..b11c6ce6 100644 + } + }; + -+ public static EventExecutor create(Method m, Class eventClass) { ++ @NotNull ++ public static EventExecutor create(@NotNull Method m, @NotNull Class eventClass) { + Preconditions.checkNotNull(m, "Null method"); + Preconditions.checkArgument(m.getParameterCount() != 0, "Incorrect number of arguments %s", m.getParameterCount()); + Preconditions.checkArgument(m.getParameterTypes()[0] == eventClass, "First parameter %s doesn't match event class %s", m.getParameterTypes()[0], eventClass); @@ -396,15 +411,15 @@ index 3b2c99ea..b11c6ce6 100644 + // Paper end } diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -index bf972302..77207f14 100644 +index ac0702dfb..b9bf2124b 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java @@ -0,0 +0,0 @@ public final class JavaPluginLoader implements PluginLoader { } } -- EventExecutor executor = new co.aikar.timings.TimedEventExecutor(new EventExecutor() { // Spigot -- public void execute(Listener listener, Event event) throws EventException { +- EventExecutor executor = new co.aikar.timings.TimedEventExecutor(new EventExecutor() { // Paper +- public void execute(@NotNull Listener listener, @NotNull Event event) throws EventException { // Paper - try { - if (!eventClass.isAssignableFrom(event.getClass())) { - return; @@ -416,8 +431,8 @@ index bf972302..77207f14 100644 - throw new EventException(t); - } - } -- }, plugin, method, eventClass); // Spigot -+ EventExecutor executor = new co.aikar.timings.TimedEventExecutor(EventExecutor.create(method, eventClass), plugin, method, eventClass); // Spigot // Paper - Use factory method `EventExecutor.create()` +- }, plugin, method, eventClass); // Paper ++ EventExecutor executor = new co.aikar.timings.TimedEventExecutor(EventExecutor.create(method, eventClass), plugin, method, eventClass); // Paper // Paper (Yes.) - Use factory method `EventExecutor.create()` if (false) { // Spigot - RL handles useTimings check now eventSet.add(new TimedRegisteredListener(listener, executor, eh.priority(), plugin, eh.ignoreCancelled())); } else { diff --git a/Spigot-API-Patches/Vex-getSummoner-API.patch b/Spigot-API-Patches/Vex-getSummoner-API.patch deleted file mode 100644 index 0be4d4fea3..0000000000 --- a/Spigot-API-Patches/Vex-getSummoner-API.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Wed, 4 Jul 2018 15:29:21 -0400 -Subject: [PATCH] Vex#getSummoner API - -Get's the Mob that summoned this Vex - -diff --git a/src/main/java/org/bukkit/entity/Vex.java b/src/main/java/org/bukkit/entity/Vex.java -index 6b61c4ab..7b9b21e5 100644 ---- a/src/main/java/org/bukkit/entity/Vex.java -+++ b/src/main/java/org/bukkit/entity/Vex.java -@@ -0,0 +0,0 @@ public interface Vex extends Monster { - * @param charging new state - */ - void setCharging(boolean charging); -+ -+ /** -+ * @return What Entity (most likely an Evoker, but not guaranteed) summoned this Vex -+ */ -+ Mob getSummoner(); // Paper - } --- \ No newline at end of file diff --git a/Spigot-API-Patches/WitchConsumePotionEvent.patch b/Spigot-API-Patches/WitchConsumePotionEvent.patch index 314069e9f2..e49c3ced76 100644 --- a/Spigot-API-Patches/WitchConsumePotionEvent.patch +++ b/Spigot-API-Patches/WitchConsumePotionEvent.patch @@ -7,7 +7,7 @@ Fires when a witch consumes the potion in their hand diff --git a/src/main/java/com/destroystokyo/paper/event/entity/WitchConsumePotionEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/WitchConsumePotionEvent.java new file mode 100644 -index 00000000..79021899 +index 000000000..fbbace36d --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/WitchConsumePotionEvent.java @@ -0,0 +0,0 @@ @@ -18,18 +18,21 @@ index 00000000..79021899 +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; + +/** + * Fired when a witch consumes the potion in their hand to buff themselves. + */ +public class WitchConsumePotionEvent extends EntityEvent implements Cancellable { -+ private ItemStack potion; ++ @Nullable private ItemStack potion; + -+ public WitchConsumePotionEvent(Witch witch, ItemStack potion) { ++ public WitchConsumePotionEvent(@NotNull Witch witch, @Nullable ItemStack potion) { + super(witch); + this.potion = potion; + } + ++ @NotNull + @Override + public Witch getEntity() { + return (Witch) super.getEntity(); @@ -38,6 +41,7 @@ index 00000000..79021899 + /** + * @return the potion the witch will consume and have the effects applied. + */ ++ @Nullable + public ItemStack getPotion() { + return potion; + } @@ -46,16 +50,18 @@ index 00000000..79021899 + * Sets the potion to be consumed and applied to the witch. + * @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; + } @@ -77,7 +83,7 @@ index 00000000..79021899 +} diff --git a/src/main/java/com/destroystokyo/paper/event/entity/WitchThrowPotionEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/WitchThrowPotionEvent.java new file mode 100644 -index 00000000..6ef6367b +index 000000000..6ef6367b6 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/WitchThrowPotionEvent.java @@ -0,0 +0,0 @@ diff --git a/Spigot-API-Patches/WitchReadyPotionEvent.patch b/Spigot-API-Patches/WitchReadyPotionEvent.patch index 78eade8c74..e034bdaa97 100644 --- a/Spigot-API-Patches/WitchReadyPotionEvent.patch +++ b/Spigot-API-Patches/WitchReadyPotionEvent.patch @@ -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; + } diff --git a/Spigot-API-Patches/WitchThrowPotionEvent.patch b/Spigot-API-Patches/WitchThrowPotionEvent.patch index 0cb21f1864..1345185483 100644 --- a/Spigot-API-Patches/WitchThrowPotionEvent.patch +++ b/Spigot-API-Patches/WitchThrowPotionEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] WitchThrowPotionEvent Fired when a witch throws a potion at a player diff --git a/src/main/java/com/destroystokyo/paper/event/entity/WitchThrowPotionEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/WitchThrowPotionEvent.java -index 6ef6367b..77487e28 100644 +index 6ef6367b6..688a596aa 100644 --- a/src/main/java/com/destroystokyo/paper/event/entity/WitchThrowPotionEvent.java +++ b/src/main/java/com/destroystokyo/paper/event/entity/WitchThrowPotionEvent.java @@ -0,0 +0,0 @@ @@ -19,6 +19,8 @@ index 6ef6367b..77487e28 100644 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 WitchThrowPotionEvent extends Event implements Cancellable { - public WitchThrowPotionEvent() { @@ -26,15 +28,16 @@ index 6ef6367b..77487e28 100644 + * Fired when a witch throws a potion at a player + */ +public class WitchThrowPotionEvent extends EntityEvent implements Cancellable { -+ private final LivingEntity target; -+ private ItemStack potion; ++ @NotNull private final LivingEntity target; ++ @Nullable private ItemStack potion; + -+ public WitchThrowPotionEvent(Witch witch, LivingEntity target, ItemStack potion) { ++ public WitchThrowPotionEvent(@NotNull Witch witch, @NotNull LivingEntity target, @Nullable ItemStack potion) { + super(witch); + this.target = target; + this.potion = potion; } ++ @NotNull + @Override + public Witch getEntity() { + return (Witch) super.getEntity(); @@ -43,6 +46,7 @@ index 6ef6367b..77487e28 100644 + /** + * @return The target of the potion + */ ++ @NotNull + public LivingEntity getTarget() { + return target; + } @@ -50,6 +54,7 @@ index 6ef6367b..77487e28 100644 + /** + * @return The potion the witch will throw at a player + */ ++ @Nullable + public ItemStack getPotion() { + return potion; + } @@ -58,13 +63,21 @@ index 6ef6367b..77487e28 100644 + * Sets the potion to be thrown at a player + * @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(); -@@ -0,0 +0,0 @@ public class WitchThrowPotionEvent extends Event implements Cancellable { ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } private boolean cancelled = false; diff --git a/Spigot-API-Patches/ensureServerConversions-API.patch b/Spigot-API-Patches/ensureServerConversions-API.patch index e04432fee8..69a67bffdb 100644 --- a/Spigot-API-Patches/ensureServerConversions-API.patch +++ b/Spigot-API-Patches/ensureServerConversions-API.patch @@ -7,13 +7,13 @@ This will take a Bukkit ItemStack and run it through any conversions a server pr to ensure it meets latest minecraft expectations. diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java -index ec2b8b8e..3012aec2 100644 +index cbcbe8c8a..8e602cf51 100644 --- a/src/main/java/org/bukkit/inventory/ItemFactory.java +++ b/src/main/java/org/bukkit/inventory/ItemFactory.java @@ -0,0 +0,0 @@ public interface ItemFactory { - */ @Deprecated - Material updateMaterial(final ItemMeta meta, final Material material) throws IllegalArgumentException; + @NotNull + Material updateMaterial(@NotNull final ItemMeta meta, @NotNull final Material material) throws IllegalArgumentException; + // Paper start + /** + * Minecart updates are converting simple item stacks into more complex NBT oriented Item Stacks. @@ -24,11 +24,12 @@ index ec2b8b8e..3012aec2 100644 + * @param item The item to process conversions on + * @return A potentially Data Converted ItemStack + */ -+ ItemStack ensureServerConversions(ItemStack item); ++ @NotNull ++ ItemStack ensureServerConversions(@NotNull ItemStack item); + // Paper end } diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java -index c744799f..5e8de115 100644 +index 7b709457f..e8f97c949 100644 --- a/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java @@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { @@ -59,6 +60,7 @@ index c744799f..5e8de115 100644 + * + * @return A potentially Data Converted ItemStack + */ ++ @NotNull + public ItemStack ensureServerConversions() { + return Bukkit.getServer().getItemFactory().ensureServerConversions(this); + } diff --git a/Spigot-API-Patches/getPlayerUniqueId-API.patch b/Spigot-API-Patches/getPlayerUniqueId-API.patch index a27257fcc7..69bb304862 100644 --- a/Spigot-API-Patches/getPlayerUniqueId-API.patch +++ b/Spigot-API-Patches/getPlayerUniqueId-API.patch @@ -9,7 +9,7 @@ In Offline Mode, will return an Offline UUID This is a more performant way to obtain a UUID for a name than loading an OfflinePlayer diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 75634a8d..cbabd807 100644 +index 16fa78b86..19fb0e5d2 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java @@ -0,0 +0,0 @@ public final class Bukkit { @@ -25,7 +25,7 @@ index 75634a8d..cbabd807 100644 + * @return A UUID, or null if that player name is not registered with Minecraft and the server is in online mode + */ + @Nullable -+ public static UUID getPlayerUniqueId(String playerName) { ++ public static UUID getPlayerUniqueId(@NotNull String playerName) { + return server.getPlayerUniqueId(playerName); + } + // Paper end @@ -34,12 +34,12 @@ index 75634a8d..cbabd807 100644 * Gets the plugin manager for interfacing with plugins. * diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 1d1f7784..9c5049cd 100644 +index edbfa3fdc..1df58f72a 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient { - */ - public Player getPlayer(UUID id); + @Nullable + public Player getPlayer(@NotNull UUID id); + // Paper start + /** @@ -50,7 +50,7 @@ index 1d1f7784..9c5049cd 100644 + * @return A UUID, or null if that player name is not registered with Minecraft and the server is in online mode + */ + @Nullable -+ public UUID getPlayerUniqueId(String playerName); ++ public UUID getPlayerUniqueId(@NotNull String playerName); + // Paper end + /** diff --git a/Spigot-API-Patches/isChunkGenerated-API.patch b/Spigot-API-Patches/isChunkGenerated-API.patch index 247faec308..eeb468196a 100644 --- a/Spigot-API-Patches/isChunkGenerated-API.patch +++ b/Spigot-API-Patches/isChunkGenerated-API.patch @@ -5,17 +5,16 @@ Subject: [PATCH] isChunkGenerated API diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java -index 7e1ee875..9457832b 100644 +index d3cff9de8..0966f5e03 100644 --- a/src/main/java/org/bukkit/Location.java +++ b/src/main/java/org/bukkit/Location.java -@@ -0,0 +0,0 @@ import org.bukkit.util.NumberConversions; - import org.bukkit.util.Vector; +@@ -0,0 +0,0 @@ + package org.bukkit; + ++import com.google.common.base.Preconditions; // Paper + import java.util.HashMap; + import java.util.Map; - // Paper start -+import com.google.common.base.Preconditions; - import java.util.Collection; - import java.util.function.Predicate; - import org.bukkit.entity.Entity; @@ -0,0 +0,0 @@ public class Location implements Cloneable, ConfigurationSerializable { public boolean isChunkLoaded() { return world.isChunkLoaded(locToBlock(x) >> 4, locToBlock(z) >> 4); } // Paper @@ -33,7 +32,7 @@ index 7e1ee875..9457832b 100644 /** * Sets the position of this Location and returns itself diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 30204b98..60b7f2e3 100644 +index 158917492..6b91635fe 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable { diff --git a/Spigot-Server-Patches/Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch b/Spigot-Server-Patches/Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch index 3397d3ea50..b1d4782a9c 100644 --- a/Spigot-Server-Patches/Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch +++ b/Spigot-Server-Patches/Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch @@ -16,7 +16,7 @@ intent to remove) and replace it with two new methods, clearly named and documented as to their purpose. diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 0ea31156..de17da99 100644 +index 57c6455bd..541461275 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -28,7 +28,7 @@ index 0ea31156..de17da99 100644 public boolean queueHealthUpdatePacket = false; public net.minecraft.server.PacketPlayOutUpdateHealth queuedHealthUpdatePacket; diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index ec760325..135d25ab 100644 +index ec760325b..135d25abd 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -0,0 +0,0 @@ public abstract class PlayerList { @@ -40,7 +40,7 @@ index ec760325..135d25ab 100644 UserCache usercache = this.server.getUserCache(); GameProfile gameprofile1 = usercache.a(gameprofile.getId()); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java -index fbdb2df2..e1973c5d 100644 +index fbdb2df27..e1973c5d6 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java @@ -0,0 +0,0 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa @@ -106,7 +106,7 @@ index fbdb2df2..e1973c5d 100644 NBTTagCompound data = getData(); if (data == null) return null; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index a2eae5d1..36a38713 100644 +index da54a4529..8e0cac8df 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/Spigot-Server-Patches/Add-LivingEntity-getTargetEntity.patch b/Spigot-Server-Patches/Add-LivingEntity-getTargetEntity.patch index 4828aa55dd..e990d67aa6 100644 --- a/Spigot-Server-Patches/Add-LivingEntity-getTargetEntity.patch +++ b/Spigot-Server-Patches/Add-LivingEntity-getTargetEntity.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add LivingEntity#getTargetEntity diff --git a/src/main/java/net/minecraft/server/AxisAlignedBB.java b/src/main/java/net/minecraft/server/AxisAlignedBB.java -index 1c0b783e..dad1ff73 100644 +index 1c0b783e8..dad1ff737 100644 --- a/src/main/java/net/minecraft/server/AxisAlignedBB.java +++ b/src/main/java/net/minecraft/server/AxisAlignedBB.java @@ -0,0 +0,0 @@ public class AxisAlignedBB { @@ -46,7 +46,7 @@ index 1c0b783e..dad1ff73 100644 public MovingObjectPosition b(Vec3D vec3d, Vec3D vec3d1) { return this.a(vec3d, vec3d1, (BlockPosition) null); diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 235061e5..a8271457 100644 +index 235061e57..a82714574 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -71,7 +71,7 @@ index 235061e5..a8271457 100644 return this.d(this.pitch, this.yaw); } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index f48ddbc6..1023505d 100644 +index f48ddbc68..1023505d1 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -0,0 +0,0 @@ package net.minecraft.server; @@ -130,7 +130,7 @@ index f48ddbc6..1023505d 100644 public int getShieldBlockingDelay() { diff --git a/src/main/java/net/minecraft/server/IEntitySelector.java b/src/main/java/net/minecraft/server/IEntitySelector.java -index f6916fd4..71f08d53 100644 +index f6916fd45..71f08d53c 100644 --- a/src/main/java/net/minecraft/server/IEntitySelector.java +++ b/src/main/java/net/minecraft/server/IEntitySelector.java @@ -0,0 +0,0 @@ public final class IEntitySelector { @@ -142,7 +142,7 @@ index f6916fd4..71f08d53 100644 return !(entity instanceof EntityHuman) || !((EntityHuman) entity).isSpectator(); }; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index eeab5937..d6a4bc64 100644 +index eeab59379..d6a4bc64a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -0,0 +0,0 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { diff --git a/Spigot-Server-Patches/Add-PlayerConnectionCloseEvent.patch b/Spigot-Server-Patches/Add-PlayerConnectionCloseEvent.patch index 2df686661c..b9ca0c67a0 100644 --- a/Spigot-Server-Patches/Add-PlayerConnectionCloseEvent.patch +++ b/Spigot-Server-Patches/Add-PlayerConnectionCloseEvent.patch @@ -34,7 +34,7 @@ how PlayerPreLoginEvent interacts with PlayerConnectionCloseEvent is undefined. diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index ca76f2a3..dfe7a029 100644 +index ca76f2a38..dfe7a029f 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener, ITickable { @@ -50,7 +50,7 @@ index ca76f2a3..dfe7a029 100644 private SecretKey loginKey; private EntityPlayer l; diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index 0b8796d0..55363723 100644 +index 0b8796d0a..553637239 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java @@ -0,0 +0,0 @@ import io.netty.handler.timeout.TimeoutException; diff --git a/Spigot-Server-Patches/Add-PlayerJumpEvent.patch b/Spigot-Server-Patches/Add-PlayerJumpEvent.patch index 02a6e9255e..eb2ffde2d7 100644 --- a/Spigot-Server-Patches/Add-PlayerJumpEvent.patch +++ b/Spigot-Server-Patches/Add-PlayerJumpEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerJumpEvent diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index e4d2c4fcf2..3acd9cdba5 100644 +index 298012f37..bfae875eb 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving { @@ -17,7 +17,7 @@ index e4d2c4fcf2..3acd9cdba5 100644 super.cH(); this.a(StatisticList.JUMP); diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 877598a543..8cd898a946 100644 +index 0b6a6cf73..d2d1ce35b 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -0,0 +0,0 @@ import org.bukkit.inventory.CraftingInventory; diff --git a/Spigot-Server-Patches/Add-Velocity-IP-Forwarding-Support.patch b/Spigot-Server-Patches/Add-Velocity-IP-Forwarding-Support.patch index 8c3c664db4..04238b69ca 100644 --- a/Spigot-Server-Patches/Add-Velocity-IP-Forwarding-Support.patch +++ b/Spigot-Server-Patches/Add-Velocity-IP-Forwarding-Support.patch @@ -14,7 +14,7 @@ forwarding, and is integrated into the Minecraft login process by using the 1.13 login plugin message packet. diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 7f9845d9..52ce8f89 100644 +index 7f9845d92..52ce8f89e 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -0,0 +0,0 @@ import java.io.IOException; @@ -55,7 +55,7 @@ index 7f9845d9..52ce8f89 100644 } diff --git a/src/main/java/com/destroystokyo/paper/proxy/VelocityProxy.java b/src/main/java/com/destroystokyo/paper/proxy/VelocityProxy.java new file mode 100644 -index 00000000..fdd8708f +index 000000000..fdd8708f9 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/proxy/VelocityProxy.java @@ -0,0 +0,0 @@ @@ -127,7 +127,7 @@ index 00000000..fdd8708f + } +} diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index c5801122..ca76f2a3 100644 +index c5801122d..ca76f2a38 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener, ITickable { @@ -203,7 +203,7 @@ index c5801122..ca76f2a3 100644 } diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index 4c111047..c5369791 100644 +index 4c1110479..c53697914 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java @@ -0,0 +0,0 @@ public class NetworkManager extends SimpleChannelInboundHandler> { @@ -216,7 +216,7 @@ index 4c111047..c5369791 100644 public java.util.UUID spoofedUUID; public com.mojang.authlib.properties.Property[] spoofedProfile; diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java -index b95836d4..621aad15 100644 +index b95836d44..621aad150 100644 --- a/src/main/java/net/minecraft/server/PacketDataSerializer.java +++ b/src/main/java/net/minecraft/server/PacketDataSerializer.java @@ -0,0 +0,0 @@ public class PacketDataSerializer extends ByteBuf { @@ -244,7 +244,7 @@ index b95836d4..621aad15 100644 int j = this.g(); diff --git a/src/main/java/net/minecraft/server/PacketLoginInCustomPayload.java b/src/main/java/net/minecraft/server/PacketLoginInCustomPayload.java -index bdac03da..430445cc 100644 +index bdac03da4..430445cc6 100644 --- a/src/main/java/net/minecraft/server/PacketLoginInCustomPayload.java +++ b/src/main/java/net/minecraft/server/PacketLoginInCustomPayload.java @@ -0,0 +0,0 @@ import java.io.IOException; @@ -259,7 +259,7 @@ index bdac03da..430445cc 100644 public PacketLoginInCustomPayload() {} diff --git a/src/main/java/net/minecraft/server/PacketLoginOutCustomPayload.java b/src/main/java/net/minecraft/server/PacketLoginOutCustomPayload.java -index 345843a7..23c96f44 100644 +index 345843a7f..23c96f44b 100644 --- a/src/main/java/net/minecraft/server/PacketLoginOutCustomPayload.java +++ b/src/main/java/net/minecraft/server/PacketLoginOutCustomPayload.java @@ -0,0 +0,0 @@ public class PacketLoginOutCustomPayload implements Packet { @@ -562,7 +562,7 @@ index 2021c0d0..154ab09e 100644 public void putAll(Map map) { diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 186cfda7..781e0687 100644 +index 186cfda7e..781e06877 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider { @@ -713,7 +713,7 @@ index 186cfda7..781e0687 100644 } diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index d938eb37..51df075b 100644 +index d938eb374..51df075b4 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { @@ -740,7 +740,7 @@ index d938eb37..51df075b 100644 completion = new Supplier() { public NBTTagCompound get() { diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java -index 2af07ae5..9c6844d4 100644 +index 2af07ae59..9c6844d44 100644 --- a/src/main/java/net/minecraft/server/ChunkSection.java +++ b/src/main/java/net/minecraft/server/ChunkSection.java @@ -0,0 +0,0 @@ public class ChunkSection { @@ -762,7 +762,7 @@ index 2af07ae5..9c6844d4 100644 public IBlockData getType(int i, int j, int k) { return (IBlockData) this.blockIds.a(i, j, k); diff --git a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java -index d3898599..8f061f5c 100644 +index d3898599f..8f061f5ca 100644 --- a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java +++ b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java @@ -0,0 +0,0 @@ public class ChunkTaskScheduler extends Scheduler map) { diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java -index 454903a0..dcbcb655 100644 +index 454903a0e..dcbcb655c 100644 --- a/src/main/java/net/minecraft/server/DataPaletteBlock.java +++ b/src/main/java/net/minecraft/server/DataPaletteBlock.java @@ -0,0 +0,0 @@ package net.minecraft.server; @@ -921,7 +921,7 @@ index 454903a0..dcbcb655 100644 // Paper start - Anti-Xray - Support default methods diff --git a/src/main/java/net/minecraft/server/DefinedStructureManager.java b/src/main/java/net/minecraft/server/DefinedStructureManager.java -index f5a6387f..f4568509 100644 +index f5a6387f2..f45685099 100644 --- a/src/main/java/net/minecraft/server/DefinedStructureManager.java +++ b/src/main/java/net/minecraft/server/DefinedStructureManager.java @@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger; @@ -934,7 +934,7 @@ index f5a6387f..f4568509 100644 private final MinecraftServer d; private final java.nio.file.Path e; diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 49ddb971..ec54a77e 100644 +index 49ddb9715..ec54a77e6 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -947,7 +947,7 @@ index 49ddb971..ec54a77e 100644 this.aJ = Sets.newHashSet(); this.aL = new double[] { 0.0D, 0.0D, 0.0D}; diff --git a/src/main/java/net/minecraft/server/IChunkLoader.java b/src/main/java/net/minecraft/server/IChunkLoader.java -index 4698ee99..dfb45cc4 100644 +index 4698ee99f..dfb45cc4e 100644 --- a/src/main/java/net/minecraft/server/IChunkLoader.java +++ b/src/main/java/net/minecraft/server/IChunkLoader.java @@ -0,0 +0,0 @@ import javax.annotation.Nullable; @@ -960,7 +960,7 @@ index 4698ee99..dfb45cc4 100644 Chunk a(GeneratorAccess generatoraccess, int i, int j, Consumer consumer) throws IOException; diff --git a/src/main/java/net/minecraft/server/MathHelper.java b/src/main/java/net/minecraft/server/MathHelper.java -index 8bb2593a..67bb2895 100644 +index 8bb2593aa..67bb28954 100644 --- a/src/main/java/net/minecraft/server/MathHelper.java +++ b/src/main/java/net/minecraft/server/MathHelper.java @@ -0,0 +0,0 @@ import java.util.function.IntPredicate; @@ -981,7 +981,7 @@ index 8bb2593a..67bb2895 100644 f %= 360.0F; if (f >= 180.0F) { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index d2ee4e57..236fbafe 100644 +index d2ee4e578..236fbafeb 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati @@ -1071,7 +1071,7 @@ index d2ee4e57..236fbafe 100644 i = SystemUtils.getMonotonicNanos(); diff --git a/src/main/java/net/minecraft/server/PaperAsyncChunkProvider.java b/src/main/java/net/minecraft/server/PaperAsyncChunkProvider.java new file mode 100644 -index 00000000..851756d6 +index 000000000..851756d65 --- /dev/null +++ b/src/main/java/net/minecraft/server/PaperAsyncChunkProvider.java @@ -0,0 +0,0 @@ @@ -1734,7 +1734,7 @@ index 00000000..851756d6 + +} diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index 240f5906..e4cf8548 100644 +index 240f59066..e4cf8548d 100644 --- a/src/main/java/net/minecraft/server/PlayerChunk.java +++ b/src/main/java/net/minecraft/server/PlayerChunk.java @@ -0,0 +0,0 @@ public class PlayerChunk { @@ -1832,7 +1832,7 @@ index 240f5906..e4cf8548 100644 } } diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 679488a3..b7dda8e2 100644 +index 679488a3c..b7dda8e28 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -0,0 +0,0 @@ public class PlayerChunkMap { @@ -1892,7 +1892,7 @@ index 679488a3..b7dda8e2 100644 private void e() { diff --git a/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java b/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java -index de6dd4fe..da6df06d 100644 +index de6dd4fed..da6df06d8 100644 --- a/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java +++ b/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java @@ -0,0 +0,0 @@ public class RegionLimitedWorldAccess implements GeneratorAccess { @@ -1905,7 +1905,7 @@ index de6dd4fe..da6df06d 100644 this.m = world.getChunkProvider().getChunkGenerator().getSettings(); this.i = world.getSeaLevel(); diff --git a/src/main/java/net/minecraft/server/SchedulerBatch.java b/src/main/java/net/minecraft/server/SchedulerBatch.java -index 8e909d9c..f214a74a 100644 +index 8e909d9ca..f214a74a2 100644 --- a/src/main/java/net/minecraft/server/SchedulerBatch.java +++ b/src/main/java/net/minecraft/server/SchedulerBatch.java @@ -0,0 +0,0 @@ public class SchedulerBatch, R> { @@ -1960,7 +1960,7 @@ index 8e909d9c..f214a74a 100644 } } diff --git a/src/main/java/net/minecraft/server/StructurePiece.java b/src/main/java/net/minecraft/server/StructurePiece.java -index d9def713..945a005e 100644 +index d9def7135..945a005e9 100644 --- a/src/main/java/net/minecraft/server/StructurePiece.java +++ b/src/main/java/net/minecraft/server/StructurePiece.java @@ -0,0 +0,0 @@ public abstract class StructurePiece { @@ -1995,7 +1995,7 @@ index d9def713..945a005e 100644 } diff --git a/src/main/java/net/minecraft/server/StructureStart.java b/src/main/java/net/minecraft/server/StructureStart.java -index 284e9671..8b08efe1 100644 +index 284e96710..8b08efe1f 100644 --- a/src/main/java/net/minecraft/server/StructureStart.java +++ b/src/main/java/net/minecraft/server/StructureStart.java @@ -0,0 +0,0 @@ import java.util.Random; @@ -2056,7 +2056,7 @@ index 284e9671..8b08efe1 100644 } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 9bfc5db3..2224eeab 100644 +index 9bfc5db39..2224eeab2 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; @@ -2153,7 +2153,7 @@ index 9bfc5db3..2224eeab 100644 if (entity.valid) { MinecraftServer.LOGGER.error("Attempted Double World add on " + entity, new Throwable()); return true; } // Paper if (!CraftEventFactory.doEntityAddEventCalling(this, entity, spawnReason)) { diff --git a/src/main/java/net/minecraft/server/WorldGenStronghold.java b/src/main/java/net/minecraft/server/WorldGenStronghold.java -index 69d8a25b..d0eaa9e9 100644 +index 69d8a25bd..d0eaa9e9f 100644 --- a/src/main/java/net/minecraft/server/WorldGenStronghold.java +++ b/src/main/java/net/minecraft/server/WorldGenStronghold.java @@ -0,0 +0,0 @@ import javax.annotation.Nullable; @@ -2306,7 +2306,7 @@ index 69d8a25b..d0eaa9e9 100644 } } diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 0ff3fe03..9b5509dc 100644 +index 0ff3fe03d..9b5509dce 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { @@ -2319,7 +2319,7 @@ index 0ff3fe03..9b5509dc 100644 } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index fac42f8e..59b1628e 100644 +index fac42f8e5..59b1628e5 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -0,0 +0,0 @@ public final class CraftServer implements Server { @@ -2347,7 +2347,7 @@ index fac42f8e..59b1628e 100644 } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 95fe3a91..b5a87cfa 100644 +index 95fe3a91b..b5a87cfaf 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -0,0 +0,0 @@ public class CraftWorld implements World { @@ -2385,7 +2385,7 @@ index 95fe3a91..b5a87cfa 100644 if (isChunkLoaded(chunkCoordX + x, chunkCoordZ + z)) { unloadChunk(chunkCoordX + x, chunkCoordZ + z); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 054ebc82..2e0b4de8 100644 +index 054ebc82b..2e0b4de83 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -0,0 +0,0 @@ public class CraftEventFactory { @@ -2447,7 +2447,7 @@ index 054ebc82..2e0b4de8 100644 if (!event.isCancelled()) { diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java -index 9c917370..a299092a 100644 +index 9c917370a..a299092a5 100644 --- a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java @@ -0,0 +0,0 @@ public class CustomChunkGenerator extends InternalChunkGenerator { diff --git a/Spigot-Server-Patches/Fix-issues-with-entity-loss-due-to-unloaded-chunks.patch b/Spigot-Server-Patches/Fix-issues-with-entity-loss-due-to-unloaded-chunks.patch index cb19ad41a8..9ca1358288 100644 --- a/Spigot-Server-Patches/Fix-issues-with-entity-loss-due-to-unloaded-chunks.patch +++ b/Spigot-Server-Patches/Fix-issues-with-entity-loss-due-to-unloaded-chunks.patch @@ -18,7 +18,7 @@ This change ensures the chunks are always loaded when entities are added to the world, or a valid entity moves between chunks. diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 57de5f48..2e48ea9d 100644 +index 57de5f48a..2e48ea9d8 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc diff --git a/Spigot-Server-Patches/Fix-sign-edit-memory-leak.patch b/Spigot-Server-Patches/Fix-sign-edit-memory-leak.patch index c820649ed4..19c3bb0a89 100644 --- a/Spigot-Server-Patches/Fix-sign-edit-memory-leak.patch +++ b/Spigot-Server-Patches/Fix-sign-edit-memory-leak.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Fix sign edit memory leak when a player edits a sign, a reference to their Entity is never cleand up. diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 04344a37..5c58b853 100644 +index 04344a371..5c58b8538 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { @@ -19,7 +19,7 @@ index 04344a37..5c58b853 100644 this.sendPacket(tileentity.getUpdatePacket()); // CraftBukkit return; diff --git a/src/main/java/net/minecraft/server/TileEntitySign.java b/src/main/java/net/minecraft/server/TileEntitySign.java -index c2bcbbba..fdb77131 100644 +index c2bcbbbab..fdb771317 100644 --- a/src/main/java/net/minecraft/server/TileEntitySign.java +++ b/src/main/java/net/minecraft/server/TileEntitySign.java @@ -0,0 +0,0 @@ public class TileEntitySign extends TileEntity implements ICommandListener { diff --git a/Spigot-Server-Patches/Handle-Excessive-Signs-in-Chunks-creating-too-large-.patch b/Spigot-Server-Patches/Handle-Excessive-Signs-in-Chunks-creating-too-large-.patch index a1992c2996..4181d3c01b 100644 --- a/Spigot-Server-Patches/Handle-Excessive-Signs-in-Chunks-creating-too-large-.patch +++ b/Spigot-Server-Patches/Handle-Excessive-Signs-in-Chunks-creating-too-large-.patch @@ -11,7 +11,7 @@ Use -DPaper.excessiveSignsLimit=500 to configure that limit, or -1 to disable the limit and let your players be abused. diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index 55363723..30f646e4 100644 +index 553637239..30f646e42 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java @@ -0,0 +0,0 @@ public class NetworkManager extends SimpleChannelInboundHandler> { @@ -31,7 +31,7 @@ index 55363723..30f646e4 100644 // Paper start - Async-Anti-Xray - Stop dispatching further packets and return false if the peeked packet is a chunk packet which is not ready diff --git a/src/main/java/net/minecraft/server/Packet.java b/src/main/java/net/minecraft/server/Packet.java -index 2d8e6a2f..8d0965a0 100644 +index 2d8e6a2f4..8d0965a05 100644 --- a/src/main/java/net/minecraft/server/Packet.java +++ b/src/main/java/net/minecraft/server/Packet.java @@ -0,0 +0,0 @@ public interface Packet { @@ -43,7 +43,7 @@ index 2d8e6a2f..8d0965a0 100644 return false; } diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java -index 4a57e8a3..eb54bdb6 100644 +index 4a57e8a3e..eb54bdb64 100644 --- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java +++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java @@ -0,0 +0,0 @@ public class PacketPlayOutMapChunk implements Packet { diff --git a/Spigot-Server-Patches/Handle-Large-Packets-disconnecting-client.patch b/Spigot-Server-Patches/Handle-Large-Packets-disconnecting-client.patch index 60905ec4b6..ac363db29c 100644 --- a/Spigot-Server-Patches/Handle-Large-Packets-disconnecting-client.patch +++ b/Spigot-Server-Patches/Handle-Large-Packets-disconnecting-client.patch @@ -7,7 +7,7 @@ If a players inventory is too big to send in a single packet, split the inventory set into multiple packets instead. diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index c5369791..0b8796d0 100644 +index c53697914..0b8796d0a 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java @@ -0,0 +0,0 @@ public class NetworkManager extends SimpleChannelInboundHandler> { @@ -27,7 +27,7 @@ index c5369791..0b8796d0 100644 NetworkManager.g.debug("Skipping packet due to errors", throwable.getCause()); } else { diff --git a/src/main/java/net/minecraft/server/Packet.java b/src/main/java/net/minecraft/server/Packet.java -index 601d4d0f..2d8e6a2f 100644 +index 601d4d0fa..2d8e6a2f4 100644 --- a/src/main/java/net/minecraft/server/Packet.java +++ b/src/main/java/net/minecraft/server/Packet.java @@ -0,0 +0,0 @@ public interface Packet { @@ -44,7 +44,7 @@ index 601d4d0f..2d8e6a2f 100644 return false; } diff --git a/src/main/java/net/minecraft/server/PacketEncoder.java b/src/main/java/net/minecraft/server/PacketEncoder.java -index 2aa805ee..4f7bc186 100644 +index 2aa805eef..4f7bc186a 100644 --- a/src/main/java/net/minecraft/server/PacketEncoder.java +++ b/src/main/java/net/minecraft/server/PacketEncoder.java @@ -0,0 +0,0 @@ public class PacketEncoder extends MessageToByteEncoder> { @@ -80,7 +80,7 @@ index 2aa805ee..4f7bc186 100644 + // Paper end } diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java -index 8e35d14f..4a57e8a3 100644 +index 8e35d14f9..4a57e8a3e 100644 --- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java +++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java @@ -0,0 +0,0 @@ public class PacketPlayOutMapChunk implements Packet { @@ -93,7 +93,7 @@ index 8e35d14f..4a57e8a3 100644 } else { this.d = new byte[i]; diff --git a/src/main/java/net/minecraft/server/PacketPlayOutWindowItems.java b/src/main/java/net/minecraft/server/PacketPlayOutWindowItems.java -index 706d8438..c0d8f8b4 100644 +index 706d84385..c0d8f8b42 100644 --- a/src/main/java/net/minecraft/server/PacketPlayOutWindowItems.java +++ b/src/main/java/net/minecraft/server/PacketPlayOutWindowItems.java @@ -0,0 +0,0 @@ public class PacketPlayOutWindowItems implements Packet { diff --git a/Spigot-Server-Patches/Here-s-Johnny.patch b/Spigot-Server-Patches/Here-s-Johnny.patch index 555aa3af59..b3f73fbbed 100644 --- a/Spigot-Server-Patches/Here-s-Johnny.patch +++ b/Spigot-Server-Patches/Here-s-Johnny.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Here's Johnny! diff --git a/src/main/java/net/minecraft/server/EntityVindicator.java b/src/main/java/net/minecraft/server/EntityVindicator.java -index 96d0651e..4bbb4817 100644 +index 96d0651e9..4bbb4817b 100644 --- a/src/main/java/net/minecraft/server/EntityVindicator.java +++ b/src/main/java/net/minecraft/server/EntityVindicator.java @@ -0,0 +0,0 @@ import javax.annotation.Nullable; @@ -18,7 +18,7 @@ index 96d0651e..4bbb4817 100644 return entity instanceof EntityLiving && ((EntityLiving) entity).df(); }; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java -index 951d4792..5ff957ce 100644 +index 951d47929..5ff957ced 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java @@ -0,0 +0,0 @@ public class CraftVindicator extends CraftIllager implements Vindicator { diff --git a/Spigot-Server-Patches/Honor-EntityAgeable.ageLock.patch b/Spigot-Server-Patches/Honor-EntityAgeable.ageLock.patch index abf206b246..2fa0657751 100644 --- a/Spigot-Server-Patches/Honor-EntityAgeable.ageLock.patch +++ b/Spigot-Server-Patches/Honor-EntityAgeable.ageLock.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Honor EntityAgeable.ageLock diff --git a/src/main/java/net/minecraft/server/EntityAgeable.java b/src/main/java/net/minecraft/server/EntityAgeable.java -index 2af1ac70..aa54e380 100644 +index 2af1ac702..aa54e380e 100644 --- a/src/main/java/net/minecraft/server/EntityAgeable.java +++ b/src/main/java/net/minecraft/server/EntityAgeable.java @@ -0,0 +0,0 @@ public abstract class EntityAgeable extends EntityCreature { diff --git a/Spigot-Server-Patches/Hook-into-CB-plugin-rewrites.patch b/Spigot-Server-Patches/Hook-into-CB-plugin-rewrites.patch index 9e751c239f..29e1bf2053 100644 --- a/Spigot-Server-Patches/Hook-into-CB-plugin-rewrites.patch +++ b/Spigot-Server-Patches/Hook-into-CB-plugin-rewrites.patch @@ -8,7 +8,7 @@ our own relocation. Also lets us rewrite NMS calls for when we're debugging in an IDE pre-relocate. diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -index 632df227..b6632322 100644 +index 632df2270..b66323220 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java @@ -0,0 +0,0 @@ import java.io.FileOutputStream; diff --git a/Spigot-Server-Patches/Ignore-Dimension-NBT-field-in-Entity-data.patch b/Spigot-Server-Patches/Ignore-Dimension-NBT-field-in-Entity-data.patch index 61fed5fd78..bf6a56f8f2 100644 --- a/Spigot-Server-Patches/Ignore-Dimension-NBT-field-in-Entity-data.patch +++ b/Spigot-Server-Patches/Ignore-Dimension-NBT-field-in-Entity-data.patch @@ -14,7 +14,7 @@ DimensionManager set to the world it is being placed into. This fixes corrupt entities breaking chunk saving in custom worlds. diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index ec54a77e..235061e5 100644 +index ec54a77e6..235061e57 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke diff --git a/Spigot-Server-Patches/Implement-PlayerLocaleChangeEvent.patch b/Spigot-Server-Patches/Implement-PlayerLocaleChangeEvent.patch index 29738987ee..1c98644097 100644 --- a/Spigot-Server-Patches/Implement-PlayerLocaleChangeEvent.patch +++ b/Spigot-Server-Patches/Implement-PlayerLocaleChangeEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Implement PlayerLocaleChangeEvent diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 3bd93ada9..8b7a79b65 100644 +index 2665faa6c..7ed9903a8 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -0,0 +0,0 @@ import org.bukkit.inventory.MainHand; @@ -40,7 +40,7 @@ index 3bd93ada9..8b7a79b65 100644 this.ct = packetplayinsettings.e(); this.getDataWatcher().set(EntityPlayer.bx, (byte) packetplayinsettings.f()); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 40f31dd53..4398737cd 100644 +index bd95e1778..f3f3e81b2 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/Spigot-Server-Patches/Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch b/Spigot-Server-Patches/Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch index 31e317a477..bbe75c02b0 100644 --- a/Spigot-Server-Patches/Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch +++ b/Spigot-Server-Patches/Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Implement an API for CanPlaceOn and CanDestroy NBT values diff --git a/src/main/java/net/minecraft/server/ArgumentBlock.java b/src/main/java/net/minecraft/server/ArgumentBlock.java -index 8e839028..f5293658 100644 +index 8e8390282..f52936581 100644 --- a/src/main/java/net/minecraft/server/ArgumentBlock.java +++ b/src/main/java/net/minecraft/server/ArgumentBlock.java @@ -0,0 +0,0 @@ public class ArgumentBlock { @@ -32,7 +32,7 @@ index 8e839028..f5293658 100644 this.s = this::l; if (this.i.canRead() && this.i.peek() == '#') { diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index eaf4cd11..be2e736e 100644 +index eaf4cd11c..be2e736eb 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -0,0 +0,0 @@ import javax.annotation.Nullable; diff --git a/Spigot-Server-Patches/Implement-furnace-cook-speed-multiplier-API.patch b/Spigot-Server-Patches/Implement-furnace-cook-speed-multiplier-API.patch index c52daab4a2..32a610c9ee 100644 --- a/Spigot-Server-Patches/Implement-furnace-cook-speed-multiplier-API.patch +++ b/Spigot-Server-Patches/Implement-furnace-cook-speed-multiplier-API.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Implement furnace cook speed multiplier API Signed-off-by: Tassu diff --git a/src/main/java/net/minecraft/server/TileEntityFurnace.java b/src/main/java/net/minecraft/server/TileEntityFurnace.java -index 5b6ccfa9..bfbd35bb 100644 +index 5b6ccfa9f..bfbd35bbe 100644 --- a/src/main/java/net/minecraft/server/TileEntityFurnace.java +++ b/src/main/java/net/minecraft/server/TileEntityFurnace.java @@ -0,0 +0,0 @@ import java.util.Map.Entry; @@ -57,7 +57,7 @@ index 5b6ccfa9..bfbd35bb 100644 this.cookTimeTotal = this.s(); this.burn(irecipe); diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java b/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java -index c2eea8ce..429c780e 100644 +index c2eea8ce0..429c780ec 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java @@ -0,0 +0,0 @@ public class CraftFurnace extends CraftContainer implements F diff --git a/Spigot-Server-Patches/Implement-getters-and-setters-for-EntityItem-owner-a.patch b/Spigot-Server-Patches/Implement-getters-and-setters-for-EntityItem-owner-a.patch index 1f7381c594..7342010088 100644 --- a/Spigot-Server-Patches/Implement-getters-and-setters-for-EntityItem-owner-a.patch +++ b/Spigot-Server-Patches/Implement-getters-and-setters-for-EntityItem-owner-a.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Implement getters and setters for EntityItem owner and diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java -index 6752d0b8..03fee65e 100644 +index 6752d0b8c..03fee65e4 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java @@ -0,0 +0,0 @@ public class EntityItem extends Entity { @@ -37,7 +37,7 @@ index 6752d0b8..03fee65e 100644 this.f = uuid; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java -index 6036592f..4128ba4c 100644 +index 6036592f7..4128ba4c0 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java @@ -0,0 +0,0 @@ import org.bukkit.inventory.ItemStack; diff --git a/Spigot-Server-Patches/Improve-death-events.patch b/Spigot-Server-Patches/Improve-death-events.patch index e5aa996399..69a458e8bf 100644 --- a/Spigot-Server-Patches/Improve-death-events.patch +++ b/Spigot-Server-Patches/Improve-death-events.patch @@ -15,7 +15,7 @@ items and experience which is otherwise only properly possible by using internal code. diff --git a/src/main/java/net/minecraft/server/CombatTracker.java b/src/main/java/net/minecraft/server/CombatTracker.java -index bbd5e2b2..19750cee 100644 +index bbd5e2b2a..19750ceed 100644 --- a/src/main/java/net/minecraft/server/CombatTracker.java +++ b/src/main/java/net/minecraft/server/CombatTracker.java @@ -0,0 +0,0 @@ public class CombatTracker { @@ -27,7 +27,7 @@ index bbd5e2b2..19750cee 100644 int i = this.f ? 300 : 100; diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index c29d7eeb..acd89649 100644 +index c29d7eeb0..acd89649c 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -55,7 +55,7 @@ index c29d7eeb..acd89649 100644 return SoundCategory.NEUTRAL; } diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java -index 2c54e3e3..a5cc5e28 100644 +index 2c54e3e34..a5cc5e284 100644 --- a/src/main/java/net/minecraft/server/EntityArmorStand.java +++ b/src/main/java/net/minecraft/server/EntityArmorStand.java @@ -0,0 +0,0 @@ public class EntityArmorStand extends EntityLiving { @@ -69,7 +69,7 @@ index 2c54e3e3..a5cc5e28 100644 } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 10d95d30..f48ddbc6 100644 +index 10d95d306..f48ddbc68 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity { @@ -206,7 +206,7 @@ index 10d95d30..f48ddbc6 100644 return this.isBaby() ? (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.5F : (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F; } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 13409c04..b01fffbd 100644 +index dc72538de..62feadc8a 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -257,7 +257,7 @@ index 13409c04..b01fffbd 100644 } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftSound.java b/src/main/java/org/bukkit/craftbukkit/CraftSound.java -index 17fab031..ee8219e3 100644 +index 17fab031b..ee8219e3b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftSound.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftSound.java @@ -0,0 +0,0 @@ public enum CraftSound { @@ -284,7 +284,7 @@ index 17fab031..ee8219e3 100644 this.minecraftKey = minecraftKey; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 07b9545e..a2eae5d1 100644 +index 7a5d0176b..da54a4529 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -305,7 +305,7 @@ index 07b9545e..a2eae5d1 100644 public void injectScaledMaxHealth(Collection collection, boolean force) { diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 93da4c72..054ebc82 100644 +index 93da4c726..054ebc82b 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -0,0 +0,0 @@ public class CraftEventFactory { diff --git a/Spigot-Server-Patches/InventoryCloseEvent-Reason-API.patch b/Spigot-Server-Patches/InventoryCloseEvent-Reason-API.patch index 02f3572d60..992bdcac8a 100644 --- a/Spigot-Server-Patches/InventoryCloseEvent-Reason-API.patch +++ b/Spigot-Server-Patches/InventoryCloseEvent-Reason-API.patch @@ -29,7 +29,7 @@ index 6150b56e0..3ca579e38 100644 } } diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index e06f03e80..59f108e49 100644 +index d4618d644..cc1bc01b1 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving { @@ -56,7 +56,7 @@ index e06f03e80..59f108e49 100644 this.activeContainer = this.defaultContainer; } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 55f4ab93e..13409c041 100644 +index e4e1d999e..dc72538de 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -110,7 +110,7 @@ index 55f4ab93e..13409c041 100644 this.m(); } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 1fdffcfb0..adc57a374 100644 +index ca5665137..38c784e75 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { @@ -136,7 +136,7 @@ index 96eff10ff..ddaa73e83 100644 PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(cserver.getPlayer(entityplayer), "\u00A7e" + entityplayer.getName() + " left the game"); cserver.getPluginManager().callEvent(playerQuitEvent); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index b82aa903c..a2bf6b046 100644 +index 9b19dce9b..cb7697f80 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -0,0 +0,0 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { @@ -155,7 +155,7 @@ index b82aa903c..a2bf6b046 100644 public boolean isBlocking() { return getHandle().isBlocking(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 0753a0f26..ce58cfc11 100644 +index e8450a565..29eeb3e29 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/Spigot-Server-Patches/Lazy-init-world-storage-in-CraftOfflinePlayer.patch b/Spigot-Server-Patches/Lazy-init-world-storage-in-CraftOfflinePlayer.patch index ec30375b12..7c5314a1b9 100644 --- a/Spigot-Server-Patches/Lazy-init-world-storage-in-CraftOfflinePlayer.patch +++ b/Spigot-Server-Patches/Lazy-init-world-storage-in-CraftOfflinePlayer.patch @@ -8,7 +8,7 @@ worlds loaded. This is typically a rare occurrence but probably one that should be covered as best we can. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java -index 698cfb91..fbdb2df2 100644 +index 698cfb918..fbdb2df27 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java @@ -0,0 +0,0 @@ import org.bukkit.plugin.Plugin; diff --git a/Spigot-Server-Patches/Limit-Client-Sign-length-more.patch b/Spigot-Server-Patches/Limit-Client-Sign-length-more.patch index d918d35545..0849edfcc4 100644 --- a/Spigot-Server-Patches/Limit-Client-Sign-length-more.patch +++ b/Spigot-Server-Patches/Limit-Client-Sign-length-more.patch @@ -22,7 +22,7 @@ it only impacts data sent from the client. Set -DPaper.maxSignLength=XX to change limit or -1 to disable diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 5c58b853..dc8c20ef 100644 +index 5c58b8538..dc8c20efb 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { diff --git a/Spigot-Server-Patches/Limit-lightning-strike-effect-distance.patch b/Spigot-Server-Patches/Limit-lightning-strike-effect-distance.patch index 58ed591a9f..3f45e0450a 100644 --- a/Spigot-Server-Patches/Limit-lightning-strike-effect-distance.patch +++ b/Spigot-Server-Patches/Limit-lightning-strike-effect-distance.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Limit lightning strike effect distance diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 0b54b7d7..d723868f 100644 +index 0b54b7d78..d723868fc 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -38,7 +38,7 @@ index 0b54b7d7..d723868f 100644 public boolean firePhysicsEventForRedstone = false; private void firePhysicsEventForRedstone() { diff --git a/src/main/java/net/minecraft/server/EntityLightning.java b/src/main/java/net/minecraft/server/EntityLightning.java -index 7781babf..50f62000 100644 +index 7781babf5..50f620009 100644 --- a/src/main/java/net/minecraft/server/EntityLightning.java +++ b/src/main/java/net/minecraft/server/EntityLightning.java @@ -0,0 +0,0 @@ public class EntityLightning extends EntityWeather { @@ -69,7 +69,7 @@ index 7781babf..50f62000 100644 --this.lifeTicks; diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 9b5509dc..409b5074 100644 +index 9b5509dce..409b50744 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { diff --git a/Spigot-Server-Patches/MC-136865-Use-valid-item-for-enchantment-checks-on-b.patch b/Spigot-Server-Patches/MC-136865-Use-valid-item-for-enchantment-checks-on-b.patch index e981f9b015..d2f28a1aee 100644 --- a/Spigot-Server-Patches/MC-136865-Use-valid-item-for-enchantment-checks-on-b.patch +++ b/Spigot-Server-Patches/MC-136865-Use-valid-item-for-enchantment-checks-on-b.patch @@ -13,7 +13,7 @@ keep the clone of the item used to a non empty value so it represents the item used. diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java -index 22378b6b..5e595b62 100644 +index 22378b6bc..5e595b62e 100644 --- a/src/main/java/net/minecraft/server/PlayerInteractManager.java +++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java @@ -0,0 +0,0 @@ public class PlayerInteractManager { diff --git a/Spigot-Server-Patches/MC-145260-Fix-Whitelist-On-Off-inconsistency.patch b/Spigot-Server-Patches/MC-145260-Fix-Whitelist-On-Off-inconsistency.patch index 90e1f97a22..03fd6eb0ea 100644 --- a/Spigot-Server-Patches/MC-145260-Fix-Whitelist-On-Off-inconsistency.patch +++ b/Spigot-Server-Patches/MC-145260-Fix-Whitelist-On-Off-inconsistency.patch @@ -11,7 +11,7 @@ everything to the Whitelist object. https://github.com/PaperMC/Paper/issues/1880 diff --git a/src/main/java/net/minecraft/server/JsonList.java b/src/main/java/net/minecraft/server/JsonList.java -index b7cde4d4..949039f8 100644 +index b7cde4d41..949039f89 100644 --- a/src/main/java/net/minecraft/server/JsonList.java +++ b/src/main/java/net/minecraft/server/JsonList.java @@ -0,0 +0,0 @@ public class JsonList> { @@ -23,7 +23,7 @@ index b7cde4d4..949039f8 100644 this.e = flag; } diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 135d25ab..408c382d 100644 +index 135d25abd..408c382d2 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -0,0 +0,0 @@ public abstract class PlayerList { diff --git a/Spigot-Server-Patches/MC-50319-Check-other-worlds-for-shooter-of-projectil.patch b/Spigot-Server-Patches/MC-50319-Check-other-worlds-for-shooter-of-projectil.patch index 392337f1c7..3d00edfdab 100644 --- a/Spigot-Server-Patches/MC-50319-Check-other-worlds-for-shooter-of-projectil.patch +++ b/Spigot-Server-Patches/MC-50319-Check-other-worlds-for-shooter-of-projectil.patch @@ -11,7 +11,7 @@ If the projectile fails to find the shooter in the current world, check other worlds. diff --git a/src/main/java/net/minecraft/server/EntityProjectile.java b/src/main/java/net/minecraft/server/EntityProjectile.java -index 62b5b6ec..60ab1c75 100644 +index 62b5b6ece..60ab1c751 100644 --- a/src/main/java/net/minecraft/server/EntityProjectile.java +++ b/src/main/java/net/minecraft/server/EntityProjectile.java @@ -0,0 +0,0 @@ public abstract class EntityProjectile extends Entity implements IProjectile { diff --git a/Spigot-Server-Patches/Make-the-default-permission-message-configurable.patch b/Spigot-Server-Patches/Make-the-default-permission-message-configurable.patch index 5184592862..ed4940c668 100644 --- a/Spigot-Server-Patches/Make-the-default-permission-message-configurable.patch +++ b/Spigot-Server-Patches/Make-the-default-permission-message-configurable.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Make the default permission message configurable diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 07f0b452..a7673dd4 100644 +index 07f0b4529..a7673dd49 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -0,0 +0,0 @@ import java.util.regex.Pattern; @@ -29,7 +29,7 @@ index 07f0b452..a7673dd4 100644 private static void savePlayerData() { savePlayerData = getBoolean("settings.save-player-data", savePlayerData); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 59b1628e..8d26f8d5 100644 +index 59b1628e5..8d26f8d52 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -0,0 +0,0 @@ public final class CraftServer implements Server { diff --git a/Spigot-Server-Patches/Mob-Pathfinding-API.patch b/Spigot-Server-Patches/Mob-Pathfinding-API.patch index 246ebacc25..c29bd7cf78 100644 --- a/Spigot-Server-Patches/Mob-Pathfinding-API.patch +++ b/Spigot-Server-Patches/Mob-Pathfinding-API.patch @@ -7,7 +7,7 @@ Implements Pathfinding API for mobs diff --git a/src/main/java/com/destroystokyo/paper/entity/PaperPathfinder.java b/src/main/java/com/destroystokyo/paper/entity/PaperPathfinder.java new file mode 100644 -index 00000000..ed3d86dd +index 000000000..ed3d86ddd --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/entity/PaperPathfinder.java @@ -0,0 +0,0 @@ @@ -125,7 +125,7 @@ index 00000000..ed3d86dd + } +} diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java -index c55aadb5..cac0ce2a 100644 +index c55aadb53..cac0ce2a3 100644 --- a/src/main/java/net/minecraft/server/NavigationAbstract.java +++ b/src/main/java/net/minecraft/server/NavigationAbstract.java @@ -0,0 +0,0 @@ public abstract class NavigationAbstract { @@ -173,7 +173,7 @@ index c55aadb5..cac0ce2a 100644 this.pathfindFailures = 0; this.lastFailure = 0; // Paper - Pathfinding optimizations this.c = null; diff --git a/src/main/java/net/minecraft/server/PathEntity.java b/src/main/java/net/minecraft/server/PathEntity.java -index 31fc1fbc..5cf7f3bf 100644 +index 31fc1fbc6..5cf7f3bf1 100644 --- a/src/main/java/net/minecraft/server/PathEntity.java +++ b/src/main/java/net/minecraft/server/PathEntity.java @@ -0,0 +0,0 @@ import javax.annotation.Nullable; @@ -212,7 +212,7 @@ index 31fc1fbc..5cf7f3bf 100644 return new Vec3D((double) pathpoint.a, (double) pathpoint.b, (double) pathpoint.c); diff --git a/src/main/java/net/minecraft/server/PathPoint.java b/src/main/java/net/minecraft/server/PathPoint.java -index 78ed0028..0dd6e46d 100644 +index 78ed00286..0dd6e46d1 100644 --- a/src/main/java/net/minecraft/server/PathPoint.java +++ b/src/main/java/net/minecraft/server/PathPoint.java @@ -0,0 +0,0 @@ package net.minecraft.server; @@ -229,7 +229,7 @@ index 78ed0028..0dd6e46d 100644 public int d = -1; public float e; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java -index 5bf1cd06..53c2d154 100644 +index 5bf1cd06f..53c2d154e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java @@ -0,0 +0,0 @@ import org.bukkit.loot.LootTable; diff --git a/Spigot-Server-Patches/Optimise-removeQueue.patch b/Spigot-Server-Patches/Optimise-removeQueue.patch index 7672a8fd19..494dd0e520 100644 --- a/Spigot-Server-Patches/Optimise-removeQueue.patch +++ b/Spigot-Server-Patches/Optimise-removeQueue.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Optimise removeQueue diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index ca715c138..3ee1d270f 100644 +index fcb5f590d..6b9bbc77c 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -0,0 +0,0 @@ import com.google.common.collect.Lists; diff --git a/Spigot-Server-Patches/Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch b/Spigot-Server-Patches/Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch index 28f20af302..c4e68c7430 100644 --- a/Spigot-Server-Patches/Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch +++ b/Spigot-Server-Patches/Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Optimize Biome Mob Lookups for Mob Spawning Uses an EnumMap as well as a Set paired List for O(1) contains calls. diff --git a/src/main/java/net/minecraft/server/BiomeBase.java b/src/main/java/net/minecraft/server/BiomeBase.java -index c399bdec..3496d423 100644 +index c399bdecc..3496d4236 100644 --- a/src/main/java/net/minecraft/server/BiomeBase.java +++ b/src/main/java/net/minecraft/server/BiomeBase.java @@ -0,0 +0,0 @@ public abstract class BiomeBase { diff --git a/Spigot-Server-Patches/Optimize-Light-Recalculations.patch b/Spigot-Server-Patches/Optimize-Light-Recalculations.patch index 41db0b7878..86e912a136 100644 --- a/Spigot-Server-Patches/Optimize-Light-Recalculations.patch +++ b/Spigot-Server-Patches/Optimize-Light-Recalculations.patch @@ -14,7 +14,7 @@ Also optimizes to not repeatedly look up the same chunk for light lookups. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index e0420405..0b54b7d7 100644 +index e04204055..0b54b7d78 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -30,7 +30,7 @@ index e0420405..0b54b7d7 100644 public boolean asynchronous; public EngineMode engineMode; diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index fb00e7a9..fdf062b8 100644 +index fb00e7a9c..fdf062b8b 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { @@ -52,7 +52,7 @@ index fb00e7a9..fdf062b8 100644 int i1 = iblockdata.b(this.world, blockposition); int j1 = iblockdata1.b(this.world, blockposition); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 2224eeab..57de5f48 100644 +index 2224eeab2..57de5f48a 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc diff --git a/Spigot-Server-Patches/Optimize-Server-World-Map.patch b/Spigot-Server-Patches/Optimize-Server-World-Map.patch index e3e0423f94..e0d0309bab 100644 --- a/Spigot-Server-Patches/Optimize-Server-World-Map.patch +++ b/Spigot-Server-Patches/Optimize-Server-World-Map.patch @@ -21,7 +21,7 @@ known NMS used methods, but we can add more if naughty plugins are found later. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldMap.java b/src/main/java/com/destroystokyo/paper/PaperWorldMap.java new file mode 100644 -index 00000000..af9e4455 +index 000000000..af9e4455c --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/PaperWorldMap.java @@ -0,0 +0,0 @@ @@ -217,7 +217,7 @@ index 00000000..af9e4455 + } +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 4543ac8f..d2ee4e57 100644 +index 4543ac8f1..d2ee4e578 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati diff --git a/Spigot-Server-Patches/Optimize-World-Time-Updates.patch b/Spigot-Server-Patches/Optimize-World-Time-Updates.patch index 8c92901f96..a396368625 100644 --- a/Spigot-Server-Patches/Optimize-World-Time-Updates.patch +++ b/Spigot-Server-Patches/Optimize-World-Time-Updates.patch @@ -8,7 +8,7 @@ the updates per world, so that we can re-use the same packet object for every player unless they have per-player time enabled. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 236fbafe..ce39ea09 100644 +index 236fbafeb..ce39ea09e 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati diff --git a/Spigot-Server-Patches/Optimize-and-Fix-ExpiringMap-Issues.patch b/Spigot-Server-Patches/Optimize-and-Fix-ExpiringMap-Issues.patch index 2f3f3c05ef..455f762589 100644 --- a/Spigot-Server-Patches/Optimize-and-Fix-ExpiringMap-Issues.patch +++ b/Spigot-Server-Patches/Optimize-and-Fix-ExpiringMap-Issues.patch @@ -14,7 +14,7 @@ manipulation, and instead to run clean once per tick per active expiring map. diff --git a/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java b/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java -index a2376844..835a2aae 100644 +index a23768441..835a2aae4 100644 --- a/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java +++ b/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java @@ -0,0 +0,0 @@ public abstract class ChunkGeneratorAbstract implem @@ -34,7 +34,7 @@ index a2376844..835a2aae 100644 } diff --git a/src/main/java/net/minecraft/server/ExpiringMap.java b/src/main/java/net/minecraft/server/ExpiringMap.java -index bd363647..bf609513 100644 +index bd3636479..bf6095137 100644 --- a/src/main/java/net/minecraft/server/ExpiringMap.java +++ b/src/main/java/net/minecraft/server/ExpiringMap.java @@ -0,0 +0,0 @@ package net.minecraft.server; @@ -290,7 +290,7 @@ index bd363647..bf609513 100644 + */ // Paper end } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 38c0201a..ae271a57 100644 +index 38c0201ac..ae271a57f 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati @@ -310,7 +310,7 @@ index 38c0201a..ae271a57 100644 co.aikar.timings.TimingsManager.FULL_SERVER_TICK.stopTiming(); // Paper } diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java -index 4cca6566..9c917370 100644 +index 4cca65666..9c917370a 100644 --- a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java @@ -0,0 +0,0 @@ public class CustomChunkGenerator extends InternalChunkGenerator { @@ -345,7 +345,7 @@ index d74bfa12..24ca3511 100644 public T a(World world) { return this.aT.apply(world); // CraftBukkit - decompile error diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index f01e776f..40b3ffd8 100644 +index f01e776fe..40b3ffd8c 100644 --- a/src/main/java/net/minecraft/server/EntityVillager.java +++ b/src/main/java/net/minecraft/server/EntityVillager.java @@ -0,0 +0,0 @@ public class EntityVillager extends EntityAgeable implements NPC, IMerchant { @@ -367,7 +367,7 @@ index f01e776f..40b3ffd8 100644 // Paper start if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityZapEvent(this, entitylightning, entitywitch).isCancelled()) { diff --git a/src/main/java/net/minecraft/server/EntityWolf.java b/src/main/java/net/minecraft/server/EntityWolf.java -index 4f1696d0..46d8e0a1 100644 +index 4f1696d01..46d8e0a1f 100644 --- a/src/main/java/net/minecraft/server/EntityWolf.java +++ b/src/main/java/net/minecraft/server/EntityWolf.java @@ -0,0 +0,0 @@ public class EntityWolf extends EntityTameableAnimal { @@ -380,7 +380,7 @@ index 4f1696d0..46d8e0a1 100644 if (uuid != null) { diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java -index 7998b80c..81cc0c3b 100644 +index 7998b80c1..81cc0c3b3 100644 --- a/src/main/java/net/minecraft/server/EntityZombie.java +++ b/src/main/java/net/minecraft/server/EntityZombie.java @@ -0,0 +0,0 @@ public class EntityZombie extends EntityMonster { @@ -420,7 +420,7 @@ index 7998b80c..81cc0c3b 100644 entitychicken1.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, 0.0F); entitychicken1.prepare(difficultydamagescaler, (GroupDataEntity) null, (NBTTagCompound) null); diff --git a/src/main/java/net/minecraft/server/EntityZombieHusk.java b/src/main/java/net/minecraft/server/EntityZombieHusk.java -index 85d40296..0cca7b6d 100644 +index 85d402965..0cca7b6d5 100644 --- a/src/main/java/net/minecraft/server/EntityZombieHusk.java +++ b/src/main/java/net/minecraft/server/EntityZombieHusk.java @@ -0,0 +0,0 @@ public class EntityZombieHusk extends EntityZombie { @@ -433,7 +433,7 @@ index 85d40296..0cca7b6d 100644 } diff --git a/src/main/java/net/minecraft/server/EntityZombieVillager.java b/src/main/java/net/minecraft/server/EntityZombieVillager.java -index 86e5fbcd..fb96743a 100644 +index 86e5fbcda..fb96743af 100644 --- a/src/main/java/net/minecraft/server/EntityZombieVillager.java +++ b/src/main/java/net/minecraft/server/EntityZombieVillager.java @@ -0,0 +0,0 @@ public class EntityZombieVillager extends EntityZombie { @@ -446,7 +446,7 @@ index 86e5fbcd..fb96743a 100644 entityvillager.u(this); entityvillager.setProfession(this.getProfession()); diff --git a/src/main/java/net/minecraft/server/ItemArmorStand.java b/src/main/java/net/minecraft/server/ItemArmorStand.java -index 576b3c56..4dd0e39e 100644 +index 576b3c565..4dd0e39ec 100644 --- a/src/main/java/net/minecraft/server/ItemArmorStand.java +++ b/src/main/java/net/minecraft/server/ItemArmorStand.java @@ -0,0 +0,0 @@ public class ItemArmorStand extends Item { @@ -459,7 +459,7 @@ index 576b3c56..4dd0e39e 100644 entityarmorstand.setPositionRotation(d0 + 0.5D, d1, d2 + 0.5D, f, 0.0F); diff --git a/src/main/java/net/minecraft/server/MobSpawnerPhantom.java b/src/main/java/net/minecraft/server/MobSpawnerPhantom.java -index 5ddf66ee..bb7e072e 100644 +index 5ddf66eef..bb7e072ee 100644 --- a/src/main/java/net/minecraft/server/MobSpawnerPhantom.java +++ b/src/main/java/net/minecraft/server/MobSpawnerPhantom.java @@ -0,0 +0,0 @@ public class MobSpawnerPhantom { @@ -472,7 +472,7 @@ index 5ddf66ee..bb7e072e 100644 entityphantom.setPositionRotation(blockposition1, 0.0F, 0.0F); groupdataentity = entityphantom.prepare(difficultydamagescaler, groupdataentity, (NBTTagCompound) null); diff --git a/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java b/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java -index d4fdcbdf..887e4461 100644 +index d4fdcbdfd..887e4461f 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java @@ -0,0 +0,0 @@ public class PathfinderGoalHorseTrap extends PathfinderGoal { @@ -494,7 +494,7 @@ index d4fdcbdf..887e4461 100644 entityskeleton.prepare(difficultydamagescaler, (GroupDataEntity) null, (NBTTagCompound) null); entityskeleton.setPosition(entityhorseabstract.locX, entityhorseabstract.locY, entityhorseabstract.locZ); diff --git a/src/main/java/net/minecraft/server/VillageSiege.java b/src/main/java/net/minecraft/server/VillageSiege.java -index 0ac1fb53..509d62f6 100644 +index 0ac1fb53a..509d62f6b 100644 --- a/src/main/java/net/minecraft/server/VillageSiege.java +++ b/src/main/java/net/minecraft/server/VillageSiege.java @@ -0,0 +0,0 @@ public class VillageSiege { @@ -507,7 +507,7 @@ index 0ac1fb53..509d62f6 100644 } catch (Exception exception) { exception.printStackTrace(); diff --git a/src/main/java/net/minecraft/server/WorldGenEndCityPieces.java b/src/main/java/net/minecraft/server/WorldGenEndCityPieces.java -index 94b21693..0a223cfe 100644 +index 94b21693e..0a223cfe5 100644 --- a/src/main/java/net/minecraft/server/WorldGenEndCityPieces.java +++ b/src/main/java/net/minecraft/server/WorldGenEndCityPieces.java @@ -0,0 +0,0 @@ public class WorldGenEndCityPieces { @@ -520,7 +520,7 @@ index 94b21693..0a223cfe 100644 entityshulker.setPosition((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D); entityshulker.g(blockposition); diff --git a/src/main/java/net/minecraft/server/WorldGenFeatureOceanRuinPieces.java b/src/main/java/net/minecraft/server/WorldGenFeatureOceanRuinPieces.java -index 2def56b0..abeb4aa0 100644 +index 2def56b06..abeb4aa02 100644 --- a/src/main/java/net/minecraft/server/WorldGenFeatureOceanRuinPieces.java +++ b/src/main/java/net/minecraft/server/WorldGenFeatureOceanRuinPieces.java @@ -0,0 +0,0 @@ public class WorldGenFeatureOceanRuinPieces { @@ -534,7 +534,7 @@ index 2def56b0..abeb4aa0 100644 entitydrowned.setPositionRotation(blockposition, 0.0F, 0.0F); entitydrowned.prepare(generatoraccess.getDamageScaler(blockposition), (GroupDataEntity) null, (NBTTagCompound) null); diff --git a/src/main/java/net/minecraft/server/WorldGenMonumentPieces.java b/src/main/java/net/minecraft/server/WorldGenMonumentPieces.java -index 0e7aed09..493a86e1 100644 +index 0e7aed09d..493a86e1b 100644 --- a/src/main/java/net/minecraft/server/WorldGenMonumentPieces.java +++ b/src/main/java/net/minecraft/server/WorldGenMonumentPieces.java @@ -0,0 +0,0 @@ public class WorldGenMonumentPieces { @@ -556,7 +556,7 @@ index 0e7aed09..493a86e1 100644 entityguardianelder.heal(entityguardianelder.getMaxHealth()); entityguardianelder.setPositionRotation((double) l + 0.5D, (double) i1, (double) j1 + 0.5D, 0.0F, 0.0F); diff --git a/src/main/java/net/minecraft/server/WorldGenVillagePieces.java b/src/main/java/net/minecraft/server/WorldGenVillagePieces.java -index 5fa2987d..967e33b3 100644 +index 5fa2987d2..967e33b3d 100644 --- a/src/main/java/net/minecraft/server/WorldGenVillagePieces.java +++ b/src/main/java/net/minecraft/server/WorldGenVillagePieces.java @@ -0,0 +0,0 @@ public class WorldGenVillagePieces { @@ -578,7 +578,7 @@ index 5fa2987d..967e33b3 100644 entityvillager.setPositionRotation((double) j1 + 0.5D, (double) k1, (double) l1 + 0.5D, 0.0F, 0.0F); entityvillager.setProfession(this.c(i1, generatoraccess.m().nextInt(6))); diff --git a/src/main/java/net/minecraft/server/WorldGenWitchHut.java b/src/main/java/net/minecraft/server/WorldGenWitchHut.java -index efb0379c..3d8193c4 100644 +index efb0379ce..3d8193c47 100644 --- a/src/main/java/net/minecraft/server/WorldGenWitchHut.java +++ b/src/main/java/net/minecraft/server/WorldGenWitchHut.java @@ -0,0 +0,0 @@ public class WorldGenWitchHut extends WorldGenScatteredPiece { @@ -591,7 +591,7 @@ index efb0379c..3d8193c4 100644 entitywitch.di(); entitywitch.setPositionRotation((double) j + 0.5D, (double) i, (double) k + 0.5D, 0.0F, 0.0F); diff --git a/src/main/java/net/minecraft/server/WorldGenWoodlandMansionPieces.java b/src/main/java/net/minecraft/server/WorldGenWoodlandMansionPieces.java -index 11010d8e..4eb746eb 100644 +index 11010d8e1..4eb746ebb 100644 --- a/src/main/java/net/minecraft/server/WorldGenWoodlandMansionPieces.java +++ b/src/main/java/net/minecraft/server/WorldGenWoodlandMansionPieces.java @@ -0,0 +0,0 @@ public class WorldGenWoodlandMansionPieces { @@ -639,7 +639,7 @@ index 11010d8e..4eb746eb 100644 entityvindicator.setPositionRotation(blockposition, 0.0F, 0.0F); entityvindicator.prepare(generatoraccess.getDamageScaler(new BlockPosition(entityvindicator)), (GroupDataEntity) null, (NBTTagCompound) null); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 409b5074..a4fc1e5e 100644 +index 409b50744..a4fc1e5e2 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { @@ -652,7 +652,7 @@ index 409b5074..a4fc1e5e 100644 entityhorseskeleton.s(true); entityhorseskeleton.setAgeRaw(0); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index e33135ad..6ed7c935 100644 +index e33135ada..6ed7c9355 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -0,0 +0,0 @@ public class CraftWorld implements World { diff --git a/Spigot-Server-Patches/Use-Vanilla-Minecart-Speeds.patch b/Spigot-Server-Patches/Use-Vanilla-Minecart-Speeds.patch index c957264f5b..db96429f85 100644 --- a/Spigot-Server-Patches/Use-Vanilla-Minecart-Speeds.patch +++ b/Spigot-Server-Patches/Use-Vanilla-Minecart-Speeds.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Use Vanilla Minecart Speeds CraftBukkit changed the values on flying speed, restore back to vanilla diff --git a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java -index 95b4c0eb..f83a695a 100644 +index 95b4c0eb1..f83a695a1 100644 --- a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java +++ b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java @@ -0,0 +0,0 @@ public abstract class EntityMinecartAbstract extends Entity implements INamableT diff --git a/Spigot-Server-Patches/Use-more-reasonable-thread-count-default-for-bootstr.patch b/Spigot-Server-Patches/Use-more-reasonable-thread-count-default-for-bootstr.patch index a7e3e299e9..21e0ee2470 100644 --- a/Spigot-Server-Patches/Use-more-reasonable-thread-count-default-for-bootstr.patch +++ b/Spigot-Server-Patches/Use-more-reasonable-thread-count-default-for-bootstr.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Use more reasonable thread count default for bootstrap diff --git a/src/main/java/net/minecraft/server/DataConverterRegistry.java b/src/main/java/net/minecraft/server/DataConverterRegistry.java -index ee40bccf..db9af361 100644 +index ee40bccf6..db9af361d 100644 --- a/src/main/java/net/minecraft/server/DataConverterRegistry.java +++ b/src/main/java/net/minecraft/server/DataConverterRegistry.java @@ -0,0 +0,0 @@ public class DataConverterRegistry { diff --git a/Spigot-Server-Patches/Workaround-for-vehicle-tracking-issue-on-disconnect.patch b/Spigot-Server-Patches/Workaround-for-vehicle-tracking-issue-on-disconnect.patch index 59e3fe1de4..32a3bdc849 100644 --- a/Spigot-Server-Patches/Workaround-for-vehicle-tracking-issue-on-disconnect.patch +++ b/Spigot-Server-Patches/Workaround-for-vehicle-tracking-issue-on-disconnect.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Workaround for vehicle tracking issue on disconnect diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index de17da99..010749dd 100644 +index 541461275..1d3730083 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting { diff --git a/Spigot-Server-Patches/fix-newlines-in-spigot-tab-list-API.patch b/Spigot-Server-Patches/fix-newlines-in-spigot-tab-list-API.patch deleted file mode 100644 index 020eb7008f..0000000000 --- a/Spigot-Server-Patches/fix-newlines-in-spigot-tab-list-API.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Shane Freeder -Date: Sat, 1 Sep 2018 11:29:52 +0100 -Subject: [PATCH] fix newlines in spigot tab list API - -Spigots implementation around the header/footer strips newlines from the -header/footer, this patch allows the tab list header/footer to retain newlines. - -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index ce58cfc11..143779dfc 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { - - @Override - public void setPlayerListHeader(String header) { -- this.playerListHeader = CraftChatMessage.fromStringOrNull(header); -+ this.playerListHeader = CraftChatMessage.fromStringOrNull(header, true); // Paper - fix up spigot tab API - updatePlayerListHeaderFooter(); - } - - @Override - public void setPlayerListFooter(String footer) { -- this.playerListFooter = CraftChatMessage.fromStringOrNull(footer); -+ this.playerListFooter = CraftChatMessage.fromStringOrNull(footer, true); // Paper - fix up spigot tab API - updatePlayerListHeaderFooter(); - } - - @Override - public void setPlayerListHeaderFooter(String header, String footer) { -- this.playerListHeader = CraftChatMessage.fromStringOrNull(header); -- this.playerListFooter = CraftChatMessage.fromStringOrNull(footer); -+ this.playerListHeader = CraftChatMessage.fromStringOrNull(header, true); // Paper - fix up spigot tab API -+ this.playerListFooter = CraftChatMessage.fromStringOrNull(footer, true); // Paper - fix up spigot tab API - updatePlayerListHeaderFooter(); - } - -diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java -index a067e39d5..5e20a9a61 100644 ---- a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java -+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java -@@ -0,0 +0,0 @@ public final class CraftChatMessage { - } - - public static IChatBaseComponent fromStringOrNull(String message) { -- return (message == null || message.isEmpty()) ? null : fromString(message)[0]; -+ // Paper start - fix up spigot tab API -+ return fromStringOrNull(message, false); -+ } -+ -+ public static IChatBaseComponent fromStringOrNull(String message, boolean keepNewlines) { -+ return (message == null || message.isEmpty()) ? null : fromString(message, keepNewlines)[0]; -+ // Paper end - fix up spigot tab API - } - - public static IChatBaseComponent[] fromString(String message) { --- \ No newline at end of file diff --git a/Spigot-Server-Patches/force-entity-dismount-during-teleportation.patch b/Spigot-Server-Patches/force-entity-dismount-during-teleportation.patch index 8ef1eb6671..d716ab35e1 100644 --- a/Spigot-Server-Patches/force-entity-dismount-during-teleportation.patch +++ b/Spigot-Server-Patches/force-entity-dismount-during-teleportation.patch @@ -20,7 +20,7 @@ this is going to be the best soultion all around. Improvements/suggestions welcome! diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 28ec879e..5aa26d9e 100644 +index 28ec879ed..5aa26d9ee 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -72,7 +72,7 @@ index 28ec879e..5aa26d9e 100644 if (event.isCancelled()) { return false; diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 82684dd6..dab958a0 100644 +index 4bbf57752..f5d9b4abc 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving { @@ -90,7 +90,7 @@ index 82684dd6..dab958a0 100644 } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 1023505d..d134d0fa 100644 +index 1023505d1..d134d0fae 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity { @@ -110,7 +110,7 @@ index 1023505d..d134d0fa 100644 this.A(entity); } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 005bcaac..0ea31156 100644 +index 5b1bbc772..57c6455bd 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting { diff --git a/Spigot-Server-Patches/limit-the-range-at-which-we-ll-consider-an-attackabl.patch b/Spigot-Server-Patches/limit-the-range-at-which-we-ll-consider-an-attackabl.patch index 2dd644428a..4432c0e3ae 100644 --- a/Spigot-Server-Patches/limit-the-range-at-which-we-ll-consider-an-attackabl.patch +++ b/Spigot-Server-Patches/limit-the-range-at-which-we-ll-consider-an-attackabl.patch @@ -12,7 +12,7 @@ decrease when set, allowing us to skip further checks earlier on when looking for an attackable entity diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 2f12e35a..a7f6288f 100644 +index 2f12e35ac..a7f6288f5 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc diff --git a/work/Bukkit b/work/Bukkit index f802d0a571..9a6a1de31b 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit f802d0a5711b4497c7d1c92108a18b34482f5fc2 +Subproject commit 9a6a1de31bef4b0e54195d5b14f2915c4f90f87f diff --git a/work/CraftBukkit b/work/CraftBukkit index 77ca7ca07b..8d8475fc46 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit 77ca7ca07bbc0d73699addd51eba032916b57f6b +Subproject commit 8d8475fc46dad8fb40f4261b5ae4f382a4fd02b7 diff --git a/work/Spigot b/work/Spigot index 3cb9dcb53e..cf694d87c1 160000 --- a/work/Spigot +++ b/work/Spigot @@ -1 +1 @@ -Subproject commit 3cb9dcb53e1a5e8c6c199abf8213f1092e3628f8 +Subproject commit cf694d87c16991fd93ca48fa1343072f468423ff