@@ -1,8 +1,8 @@
|
||||
package org.bukkit.event.server;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import java.net.InetAddress;
|
||||
import java.util.Iterator;
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.UndefinedNullability;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -27,7 +27,7 @@ public class ServerListPingEvent extends ServerEvent implements Iterable<Player>
|
||||
|
||||
public ServerListPingEvent(@NotNull final InetAddress address, @NotNull final String 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", numPlayers);
|
||||
this.address = address;
|
||||
this.motd = motd;
|
||||
this.numPlayers = numPlayers;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.bukkit.event.server;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import java.util.List;
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.Event;
|
||||
@@ -29,9 +29,9 @@ public class TabCompleteEvent extends Event implements Cancellable {
|
||||
private boolean cancelled;
|
||||
|
||||
public TabCompleteEvent(@NotNull CommandSender sender, @NotNull String buffer, @NotNull List<String> completions) {
|
||||
Validate.notNull(sender, "sender");
|
||||
Validate.notNull(buffer, "buffer");
|
||||
Validate.notNull(completions, "completions");
|
||||
Preconditions.checkArgument(sender != null, "sender");
|
||||
Preconditions.checkArgument(buffer != null, "buffer");
|
||||
Preconditions.checkArgument(completions != null, "completions");
|
||||
|
||||
this.sender = sender;
|
||||
this.buffer = buffer;
|
||||
@@ -75,7 +75,7 @@ public class TabCompleteEvent extends Event implements Cancellable {
|
||||
* @param completions the new completions
|
||||
*/
|
||||
public void setCompletions(@NotNull List<String> completions) {
|
||||
Validate.notNull(completions);
|
||||
Preconditions.checkArgument(completions != null);
|
||||
this.completions = completions;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user