13
0
geforkt von Mirrors/Paper

API now compiles successfully

Dieser Commit ist enthalten in:
Jake Potrebic 2022-06-07 13:31:10 -07:00
Ursprung a22a744368
Commit da15f7cfbc
6 geänderte Dateien mit 9 neuen und 11 gelöschten Zeilen

Datei anzeigen

@ -39,7 +39,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ +
+ @NotNull + @NotNull
+ public ShapelessRecipe addIngredient(int count, @NotNull ItemStack item) { + 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) { + while (count-- > 0) {
+ ingredients.add(new RecipeChoice.ExactChoice(item)); + ingredients.add(new RecipeChoice.ExactChoice(item));
+ } + }

Datei anzeigen

@ -29,7 +29,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * @throws IllegalArgumentException If plugin is null + * @throws IllegalArgumentException If plugin is null
+ */ + */
+ public void removeAll(@NotNull Plugin owningPlugin) { + 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(); ) { + for (Iterator<Map<Plugin, MetadataValue>> iterator = metadataMap.values().iterator(); iterator.hasNext(); ) {
+ Map<Plugin, MetadataValue> values = iterator.next(); + Map<Plugin, MetadataValue> values = iterator.next();
+ if (values.containsKey(owningPlugin)) { + if (values.containsKey(owningPlugin)) {

Datei anzeigen

@ -13,7 +13,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+package com.destroystokyo.paper.event.server; +package com.destroystokyo.paper.event.server;
+ +
+import com.google.common.base.Preconditions; +import com.google.common.base.Preconditions;
+import org.apache.commons.lang.Validate;
+import org.bukkit.Bukkit; +import org.bukkit.Bukkit;
+import org.bukkit.event.Event; +import org.bukkit.event.Event;
+import org.bukkit.event.HandlerList; +import org.bukkit.event.HandlerList;

Datei anzeigen

@ -3257,7 +3257,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start + // Paper start
+ public ServerListPingEvent(@NotNull final InetAddress address, @NotNull final net.kyori.adventure.text.Component motd, final int numPlayers, final int maxPlayers) { + public ServerListPingEvent(@NotNull final InetAddress address, @NotNull final net.kyori.adventure.text.Component motd, final int numPlayers, final int maxPlayers) {
+ super(true); + 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.address = address;
this.motd = motd; this.motd = motd;
+ this.numPlayers = numPlayers; + this.numPlayers = numPlayers;

Datei anzeigen

@ -12,15 +12,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@
package com.destroystokyo.paper.event.server; 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 io.papermc.paper.util.TransformingRandomAccessList;
+import net.kyori.adventure.text.Component; +import net.kyori.adventure.text.Component;
+import net.kyori.examination.Examinable; +import net.kyori.examination.Examinable;
+import net.kyori.examination.ExaminableProperty; +import net.kyori.examination.ExaminableProperty;
+import net.kyori.examination.string.StringExaminer; +import net.kyori.examination.string.StringExaminer;
import org.apache.commons.lang.Validate;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
@@ -0,0 +0,0 @@ import org.bukkit.event.HandlerList; @@ -0,0 +0,0 @@ import org.bukkit.event.HandlerList;
import java.util.ArrayList; import java.util.ArrayList;
@ -77,7 +77,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (completions == this.stringCompletions) { + if (completions == this.stringCompletions) {
+ return; + return;
+ } + }
Validate.notNull(completions); Preconditions.checkNotNull(completions);
- this.completions = new ArrayList<>(completions); - this.completions = new ArrayList<>(completions);
+ this.completions.clear(); + this.completions.clear();
+ this.completions.addAll(fromStrings(completions)); + this.completions.addAll(fromStrings(completions));
@ -108,7 +108,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * @param newCompletions the new completions + * @param newCompletions the new completions
+ */ + */
+ public void completions(final @NotNull List<Completion> newCompletions) { + public void completions(final @NotNull List<Completion> newCompletions) {
+ Validate.notNull(newCompletions, "new completions"); + Preconditions.checkNotNull(newCompletions, "new completions");
+ this.completions.clear(); + this.completions.clear();
+ this.completions.addAll(newCompletions); + this.completions.addAll(newCompletions);
} }

Datei anzeigen

@ -42,8 +42,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ +
+package com.destroystokyo.paper.event.server; +package com.destroystokyo.paper.event.server;
+ +
+import com.google.common.collect.ImmutableList; +import com.google.common.base.Preconditions;
+import org.apache.commons.lang.Validate;
+import org.bukkit.Location; +import org.bukkit.Location;
+import org.bukkit.command.Command; +import org.bukkit.command.Command;
+import org.bukkit.command.CommandSender; +import org.bukkit.command.CommandSender;
@ -117,7 +116,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * @param completions the new completions + * @param completions the new completions
+ */ + */
+ public void setCompletions(@NotNull List<String> completions) { + public void setCompletions(@NotNull List<String> completions) {
+ Validate.notNull(completions); + Preconditions.checkNotNull(completions);
+ this.completions = new ArrayList<>(completions); + this.completions = new ArrayList<>(completions);
+ } + }
+ +