From da15f7cfbc020a8b53f13675d72877f1d3b38fab Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Tue, 7 Jun 2022 13:31:10 -0700 Subject: [PATCH] API now compiles successfully --- patches/api/Add-ItemStack-Recipe-API-helper-methods.patch | 2 +- patches/api/Add-MetadataStoreBase.removeAll-Plugin.patch | 2 +- patches/api/Add-exception-reporting-event.patch | 1 - patches/api/Adventure.patch | 2 +- ...w-for-Component-suggestion-tooltips-in-AsyncTabC.patch | 8 ++++---- patches/api/AsyncTabCompleteEvent.patch | 5 ++--- 6 files changed, 9 insertions(+), 11 deletions(-) diff --git a/patches/api/Add-ItemStack-Recipe-API-helper-methods.patch b/patches/api/Add-ItemStack-Recipe-API-helper-methods.patch index 1b37c4b71e..bd9733467f 100644 --- a/patches/api/Add-ItemStack-Recipe-API-helper-methods.patch +++ b/patches/api/Add-ItemStack-Recipe-API-helper-methods.patch @@ -39,7 +39,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + @NotNull + public ShapelessRecipe addIngredient(int count, @NotNull ItemStack item) { -+ Validate.isTrue(ingredients.size() + count <= 9, "Shapeless recipes cannot have more than 9 ingredients"); ++ Preconditions.checkArgument(ingredients.size() + count <= 9, "Shapeless recipes cannot have more than 9 ingredients"); + while (count-- > 0) { + ingredients.add(new RecipeChoice.ExactChoice(item)); + } diff --git a/patches/api/Add-MetadataStoreBase.removeAll-Plugin.patch b/patches/api/Add-MetadataStoreBase.removeAll-Plugin.patch index 0d5791064b..e6d7abc340 100644 --- a/patches/api/Add-MetadataStoreBase.removeAll-Plugin.patch +++ b/patches/api/Add-MetadataStoreBase.removeAll-Plugin.patch @@ -29,7 +29,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * @throws IllegalArgumentException If plugin is null + */ + public void removeAll(@NotNull Plugin owningPlugin) { -+ Validate.notNull(owningPlugin, "Plugin cannot be null"); ++ Preconditions.checkNotNull(owningPlugin, "Plugin cannot be null"); + for (Iterator> iterator = metadataMap.values().iterator(); iterator.hasNext(); ) { + Map values = iterator.next(); + if (values.containsKey(owningPlugin)) { diff --git a/patches/api/Add-exception-reporting-event.patch b/patches/api/Add-exception-reporting-event.patch index c384bb42c9..89e87d78a6 100644 --- a/patches/api/Add-exception-reporting-event.patch +++ b/patches/api/Add-exception-reporting-event.patch @@ -13,7 +13,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +package com.destroystokyo.paper.event.server; + +import com.google.common.base.Preconditions; -+import org.apache.commons.lang.Validate; +import org.bukkit.Bukkit; +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; diff --git a/patches/api/Adventure.patch b/patches/api/Adventure.patch index 283b5c8cec..cf64a67539 100644 --- a/patches/api/Adventure.patch +++ b/patches/api/Adventure.patch @@ -3257,7 +3257,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper start + public ServerListPingEvent(@NotNull final InetAddress address, @NotNull final net.kyori.adventure.text.Component motd, final int numPlayers, final int maxPlayers) { + super(true); -+ Validate.isTrue(numPlayers >= 0, "Cannot have negative number of players online", numPlayers); ++ Preconditions.checkArgument(numPlayers >= 0, "Cannot have negative number of players online (%s)", numPlayers); + this.address = address; this.motd = motd; + this.numPlayers = numPlayers; diff --git a/patches/api/Allow-for-Component-suggestion-tooltips-in-AsyncTabC.patch b/patches/api/Allow-for-Component-suggestion-tooltips-in-AsyncTabC.patch index a1edf349db..cf532982ef 100644 --- a/patches/api/Allow-for-Component-suggestion-tooltips-in-AsyncTabC.patch +++ b/patches/api/Allow-for-Component-suggestion-tooltips-in-AsyncTabC.patch @@ -12,15 +12,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ package com.destroystokyo.paper.event.server; - import com.google.common.collect.ImmutableList; + import com.google.common.base.Preconditions; +import io.papermc.paper.util.TransformingRandomAccessList; +import net.kyori.adventure.text.Component; +import net.kyori.examination.Examinable; +import net.kyori.examination.ExaminableProperty; +import net.kyori.examination.string.StringExaminer; - import org.apache.commons.lang.Validate; import org.bukkit.Location; import org.bukkit.command.Command; + import org.bukkit.command.CommandSender; @@ -0,0 +0,0 @@ import org.bukkit.event.HandlerList; import java.util.ArrayList; @@ -77,7 +77,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + if (completions == this.stringCompletions) { + return; + } - Validate.notNull(completions); + Preconditions.checkNotNull(completions); - this.completions = new ArrayList<>(completions); + this.completions.clear(); + this.completions.addAll(fromStrings(completions)); @@ -108,7 +108,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * @param newCompletions the new completions + */ + public void completions(final @NotNull List newCompletions) { -+ Validate.notNull(newCompletions, "new completions"); ++ Preconditions.checkNotNull(newCompletions, "new completions"); + this.completions.clear(); + this.completions.addAll(newCompletions); } diff --git a/patches/api/AsyncTabCompleteEvent.patch b/patches/api/AsyncTabCompleteEvent.patch index d88db3a095..a30b32825e 100644 --- a/patches/api/AsyncTabCompleteEvent.patch +++ b/patches/api/AsyncTabCompleteEvent.patch @@ -42,8 +42,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + +package com.destroystokyo.paper.event.server; + -+import com.google.common.collect.ImmutableList; -+import org.apache.commons.lang.Validate; ++import com.google.common.base.Preconditions; +import org.bukkit.Location; +import org.bukkit.command.Command; +import org.bukkit.command.CommandSender; @@ -117,7 +116,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * @param completions the new completions + */ + public void setCompletions(@NotNull List completions) { -+ Validate.notNull(completions); ++ Preconditions.checkNotNull(completions); + this.completions = new ArrayList<>(completions); + } +