From 3bb45b80b10c753e74273d3d2b651efe67725898 Mon Sep 17 00:00:00 2001 From: montlikadani Date: Fri, 13 Mar 2020 10:30:50 +0100 Subject: [PATCH] Add tab-completer for /spawnmob command (#2661) --- .../earth2me/essentials/commands/Commandspawnmob.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java index b8f3c4002..c57bbe99a 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandspawnmob.java @@ -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 getTabCompleteOptions(Server server, User user, String commandLabel, String[] args) { + if (args.length == 1) { + return Lists.newArrayList(SpawnMob.mobParts(args[0])); + } else { + return Collections.emptyList(); + } + } }