mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-27 19:24:43 +02:00
CommandCaller
This commit is contained in:
@ -53,11 +53,11 @@ public class BukkitCommand implements CommandExecutor, TabCompleter {
|
||||
return null;
|
||||
}
|
||||
final Set<String> tabOptions = new HashSet<>();
|
||||
ArrayList<Command> commands = MainCommand.instance.getCommands();
|
||||
ArrayList<Command<PlotPlayer>> commands = MainCommand.instance.getCommands();
|
||||
String best = new StringComparison(strings[0], commands).getBestMatch();
|
||||
tabOptions.add(best);
|
||||
final String arg = strings[0].toLowerCase();
|
||||
for (final Command cmd : MainCommand.instance.getCommands()) {
|
||||
for (final Command<PlotPlayer> cmd : MainCommand.instance.getCommands()) {
|
||||
String label = cmd.getCommand();
|
||||
if (!label.equalsIgnoreCase(best)) {
|
||||
if (label.startsWith(arg)) {
|
||||
|
@ -12,8 +12,11 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.permissions.Permission;
|
||||
import org.bukkit.permissions.PermissionDefault;
|
||||
|
||||
import com.intellectualcrafters.plot.commands.RequiredType;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.config.Settings;
|
||||
import com.intellectualcrafters.plot.util.EconHandler;
|
||||
import com.intellectualcrafters.plot.util.MainUtil;
|
||||
import com.intellectualcrafters.plot.util.UUIDHandler;
|
||||
import com.plotsquared.bukkit.util.bukkit.BukkitUtil;
|
||||
|
||||
@ -82,6 +85,11 @@ public class BukkitPlayer implements PlotPlayer {
|
||||
this.player.sendMessage(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMessage(C c, String... args) {
|
||||
MainUtil.sendMessage(this, c, args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void teleport(final Location loc) {
|
||||
this.player.teleport(new org.bukkit.Location(BukkitUtil.getWorld(loc.getWorld()), loc.getX() + 0.5, loc.getY(), loc.getZ() + 0.5, loc.getYaw(), loc.getPitch()));
|
||||
@ -191,4 +199,9 @@ public class BukkitPlayer implements PlotPlayer {
|
||||
public void saveData() {
|
||||
player.saveData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public RequiredType getSuperCaller() {
|
||||
return RequiredType.PLAYER;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user