mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-07-01 12:36:41 +00:00
Tab completion
This commit is contained in:
@ -1,6 +1,10 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import com.sk89q.worldedit.blocks.metadata.MobType;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import me.totalfreedom.totalfreedommod.util.Groups;
|
||||
@ -80,4 +84,25 @@ public class Command_mobpurge extends FreedomCommand
|
||||
|
||||
return removed;
|
||||
}
|
||||
|
||||
public static List<String> getAllMobNames()
|
||||
{
|
||||
List<String> names = new ArrayList<>();
|
||||
for (EntityType entityType : Groups.MOB_TYPES)
|
||||
{
|
||||
names.add(entityType.name());
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteOptions(CommandSender sender, Command command, String alias, String[] args)
|
||||
{
|
||||
if (args.length == 1)
|
||||
{
|
||||
return getAllMobNames();
|
||||
}
|
||||
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user