#1182: Consolidate Preconditions use and minor cleanup
By: Doc <nachito94@msn.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package org.bukkit.craftbukkit.command;
|
||||
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.mojang.brigadier.ParseResults;
|
||||
import com.mojang.brigadier.tree.CommandNode;
|
||||
import java.util.ArrayList;
|
||||
@@ -11,7 +12,6 @@ import net.minecraft.commands.CommandListenerWrapper;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.dedicated.DedicatedServer;
|
||||
import net.minecraft.world.entity.vehicle.EntityMinecartCommandBlock;
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.command.BlockCommandSender;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@@ -48,9 +48,9 @@ public final class VanillaCommandWrapper extends BukkitCommand {
|
||||
|
||||
@Override
|
||||
public List<String> tabComplete(CommandSender sender, String alias, String[] args, Location location) throws IllegalArgumentException {
|
||||
Validate.notNull(sender, "Sender cannot be null");
|
||||
Validate.notNull(args, "Arguments cannot be null");
|
||||
Validate.notNull(alias, "Alias cannot be null");
|
||||
Preconditions.checkArgument(sender != null, "Sender cannot be null");
|
||||
Preconditions.checkArgument(args != null, "Arguments cannot be null");
|
||||
Preconditions.checkArgument(alias != null, "Alias cannot be null");
|
||||
|
||||
CommandListenerWrapper icommandlistener = getListener(sender);
|
||||
ParseResults<CommandListenerWrapper> parsed = dispatcher.getDispatcher().parse(toDispatcher(args, getName()), icommandlistener);
|
||||
|
||||
Reference in New Issue
Block a user