API now compiles successfully

This commit is contained in:
Jake Potrebic 2022-06-07 13:31:10 -07:00
parent a22a744368
commit da15f7cfbc
6 changed files with 9 additions and 11 deletions

View File

@ -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));
+ }

View File

@ -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<Map<Plugin, MetadataValue>> iterator = metadataMap.values().iterator(); iterator.hasNext(); ) {
+ Map<Plugin, MetadataValue> values = iterator.next();
+ if (values.containsKey(owningPlugin)) {

View File

@ -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;

View File

@ -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;

View File

@ -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<Completion> newCompletions) {
+ Validate.notNull(newCompletions, "new completions");
+ Preconditions.checkNotNull(newCompletions, "new completions");
+ this.completions.clear();
+ this.completions.addAll(newCompletions);
}

View File

@ -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<String> completions) {
+ Validate.notNull(completions);
+ Preconditions.checkNotNull(completions);
+ this.completions = new ArrayList<>(completions);
+ }
+