mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-18 22:49:45 +00:00
Add tab-completer for /spawnmob command (#2661)
This commit is contained in:
parent
e3ec0f3b9b
commit
3bb45b80b1
1 changed files with 11 additions and 0 deletions
|
@ -5,8 +5,10 @@ import com.earth2me.essentials.Mob;
|
||||||
import com.earth2me.essentials.SpawnMob;
|
import com.earth2me.essentials.SpawnMob;
|
||||||
import com.earth2me.essentials.User;
|
import com.earth2me.essentials.User;
|
||||||
import com.earth2me.essentials.utils.StringUtil;
|
import com.earth2me.essentials.utils.StringUtil;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
import org.bukkit.Server;
|
import org.bukkit.Server;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static com.earth2me.essentials.I18n.tl;
|
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);
|
final User target = getPlayer(ess.getServer(), args, 2, true, false);
|
||||||
SpawnMob.spawnmob(ess, server, sender, target, mobParts, mobData, mobCount);
|
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 a new issue