mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-03 06:57:39 +01:00
Add tab-completer for /spawnmob command (#2661)
This commit is contained in:
parent
e3ec0f3b9b
commit
3bb45b80b1
@ -5,8 +5,10 @@ import com.earth2me.essentials.Mob;
|
||||
import com.earth2me.essentials.SpawnMob;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.utils.StringUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.bukkit.Server;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import static com.earth2me.essentials.I18n.tl;
|
||||
@ -59,4 +61,13 @@ public class Commandspawnmob extends EssentialsCommand {
|
||||
final User target = getPlayer(ess.getServer(), args, 2, true, false);
|
||||
SpawnMob.spawnmob(ess, server, sender, target, mobParts, mobData, mobCount);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<String> getTabCompleteOptions(Server server, User user, String commandLabel, String[] args) {
|
||||
if (args.length == 1) {
|
||||
return Lists.newArrayList(SpawnMob.mobParts(args[0]));
|
||||
} else {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user