I'm making a minecraft mod menu (That sounds even worse on here) and Im trying to make the string variables appear from most lengthy to least lengthy I.e: "Chest Stealer" "Player ESP" "Flight" "Speed" "box" etc.
Here is my current code:
for(Module m : myClient.getModules())
{
if(m.isToggled() && m.getName() != "Click GUI" )
{
modules.add(m.getName());
for(int i = 0; i < modules.size();i++)
{
int currentModule = i;
for(int j = 0; j < modules.size();j++)
{
if(modules.get(currentModule).length() > modules.get(j).length())
{
int currentPos;
currentPos = modules.indexOf(i);
modules.set(modules.indexOf(j), modules.get(i));
modules.set(currentPos, modules.get(j));
}
}
Every time I try and tackle this problem I end up forgetting what I wanted to do mid-coding or it just doesnt work. Current, while 1 mod is active: Draws the mods name, no problem 2 mods are active: Leaves the mod that was activated first on top and draws the second mod's name twice below. 3+ mods are active: crashes.
Any feedback will be greatly appreciate, Thanks everyone