Welcome on MasterOf13FPS! MasterOf13FPS

Register today or sign up if you are already a member and never miss any cool content again :)

need help with module mode string

Tengoku

Member
Joined
Nov 1, 2021
Messages
41
Reaction score
2
Points
8
alright so for every module i have, if i change the mode of the module that i have toggled the string of the mode changes to a non-caps version of it

for example:
Fly - BlocksMC
then i change it to lets say vanilla
Fly - vanilla (and it was supposed to be "Vanilla" not "vanilla")
why does this happen and is it possible to fix it?
 
Send the code for getting the string of mode and how you set the string in module
 
You probably use toLowerCase() somewhere in your code.
If this doesn't help you we need the code from the places where you set it otherwise we can't help you
 
Send the code for getting the string of mode and how you set the string in module
public String getDisplayName() {
return displayName == null ? name : displayName;
}
public void setDisplayName(String displayName) {
this.displayName = displayName;
}

in module fly:
String mode = Terror.instance.settingsManager.getSettingByName("Fly Mode").getValString();
this.setDisplayName("Fly §7" + mode);
 
You probably use toLowerCase() somewhere in your code.
If this doesn't help you we need the code from the places where you set it otherwise we can't help you
checked most places and couldnt find anything, ill look harder tho.
 
public String getDisplayName() {
return displayName == null ? name : displayName;
}
public void setDisplayName(String displayName) {
this.displayName = displayName;
}

in module fly:
String mode = Terror.instance.settingsManager.getSettingByName("Fly Mode").getValString();
this.setDisplayName("Fly §7" + mode);
Do

Java:
String mode = Terror.instance.settingsManager.getSettingByName("Fly Mode").getValString();
String firstLetter = mode.substring(0, 1);
String rest = mode.substring(1);
firstLetter = firstLetter.toUpperCase();
String name = firstLetter + rest;
this.setDisplayName("Fly §7" + name);

It capitalized first letter but idk else you must have used toLowerCase somewhere

also don't use getSettingByName it can cause overlaping and "fly mode" in fly just looks bad
 
Do

Java:
String mode = Terror.instance.settingsManager.getSettingByName("Fly Mode").getValString();
String firstLetter = mode.substring(0, 1);
String rest = mode.substring(1);
firstLetter = firstLetter.toUpperCase();
String name = firstLetter + rest;
this.setDisplayName("Fly §7" + name);

It capitalized first letter but idk else you must have used toLowerCase somewhere

also don't use getSettingByName it can cause overlaping and "fly mode" in fly just looks bad

hmm i think you are right, i might be using toLowerCase somewhere, do you know if i can search for toLowerCase in the entire project without having to check every class manually?
 
hmm i think you are right, i might be using toLowerCase somewhere, do you know if i can search for toLowerCase in the entire project without having to check every class manually?
You can use eclipse search function and somehow make it ignore classes in net.minecraft
 
welp I searched and searched and found nothing :/
 
checked there as well, not using it :/
something like this happened to me a while ago i could never figure it out so i just did this.setDisplayName("Flight \2477Verus"); for each mode but you could just use a substring in your setdisplayname method like this
public void setDisplayName(String displayName) {
this.displayName = displayName.substring(0, 1).toUpperCase() + displayName.substring(1);
}
pretty sure it will work unless youre using a toLowerCase somewhere in your code, and where are you using this.setDisplayName? try using it in different places
 
something like this happened to me a while ago i could never figure it out so i just did this.setDisplayName("Flight \2477Verus"); for each mode but you could just use a substring in your setdisplayname method like this
public void setDisplayName(String displayName) {
this.displayName = displayName.substring(0, 1).toUpperCase() + displayName.substring(1);
}
pretty sure it will work unless youre using a toLowerCase somewhere in your code, and where are you using this.setDisplayName? try using it in different places
Thanks, I might use that.

Well I just use it in onUpdate for each module.
 
soo you say it could be a problem with my settings manager?
Or your arraylist idk.

Try to replace your setDisplayName with
Code:
public void setDisplayName(String displayName) {
    this.displayName = displayName.substring(0, 1).toUpperCase() + displayName.substring(1);
}
(basically what @TabioEz wrote)

Also, make sure that the displayName variable is private to prevent you from using it directly anywhere.

If this doesnt work send us your arraylist
 
Or your arraylist idk.

Try to replace your setDisplayName with
Code:
public void setDisplayName(String displayName) {
    this.displayName = displayName.substring(0, 1).toUpperCase() + displayName.substring(1);
}
(basically what @TabioEz wrote)

Also, make sure that the displayName variable is private to prevent you from using it directly anywhere.

If this doesnt work send us your arraylist
nope, it dosent work :/
here is my array list:

public void draw() { ScaledResolution sr = new ScaledResolution(mc); FontRenderer fr = mc.fontRendererObj; int color = ColorUtils.getRainbow(4, 0.4f, 1); if(mc.thePlayer.getHealth() < 4F){ fr.drawStringWithShadow("You are low! Heal fast!", sr.getScaledWidth() - 300, sr.getScaledHeight() - 301, Color.RED.getRGB()); } GlStateManager.translate(4, 4, 0); GlStateManager.scale(2, 2, 1); GlStateManager.translate(-4, -4, 0); //mc.getTextureManager().bindTexture(new ResourceLocation("Terror/logo.jpg")); //GuiScreen.drawModalRectWithCustomSizedTexture(0, 0, 12, 12, 65, 65, 65, 65); FontUtil.normal.drawString("Terror V3", 4, 4, color); GlStateManager.translate(4, 4, 0); GlStateManager.scale(0.5, 0.5, 1); GlStateManager.translate(-4, -4, 0); int count = 0; ArrayList<Module> enabledMods = new ArrayList<Module>(); for(Module m : Terror.instance.moduleManager.getModules()) if(m.isToggled()) enabledMods.add(m); enabledMods.sort((m1, m2) -> fr.getStringWidth(m2.getDisplayName()) - fr.getStringWidth(m1.getDisplayName())); //fr.drawString(ChatFormatting.AQUA + "FPS" + ChatFormatting.GRAY + "> " + ChatFormatting.WHITE + mc.getDebugFPS(), 5, 22, color); //GuiInventory.drawEntityOnScreen(80, 55, 25, 0, 0, mc.thePlayer); int wAlpha = (Keyboard.isKeyDown(mc.gameSettings.keyBindForward.getKeyCode()) ? 125 : 50); int aAlpha = (Keyboard.isKeyDown(mc.gameSettings.keyBindLeft.getKeyCode()) ? 125 : 50); int sAlpha = (Keyboard.isKeyDown(mc.gameSettings.keyBindBack.getKeyCode()) ? 125 : 50); int dAlpha = (Keyboard.isKeyDown(mc.gameSettings.keyBindRight.getKeyCode()) ? 125 : 50); Gui.drawRect(sr.getScaledWidth() - 29 - 29, sr.getScaledHeight() - 4 - 25 - 29, sr.getScaledWidth() - 4 - 29, sr.getScaledHeight() - 4 - 29, new Color(0, 0, 0, wAlpha).getRGB()); Gui.drawRect(sr.getScaledWidth() - 29 - 29 - 29, sr.getScaledHeight() - 4 - 25, sr.getScaledWidth() - 4 - 29 - 29, sr.getScaledHeight() - 4, new Color(0, 0, 0, aAlpha).getRGB()); Gui.drawRect(sr.getScaledWidth() - 29 - 29, sr.getScaledHeight() - 4 - 25, sr.getScaledWidth() - 4 - 29, sr.getScaledHeight() - 4, new Color(0, 0, 0, sAlpha).getRGB()); Gui.drawRect(sr.getScaledWidth() - 29, sr.getScaledHeight() - 4 - 25, sr.getScaledWidth() - 4, sr.getScaledHeight() - 4, new Color(0, 0, 0, dAlpha).getRGB()); fr.drawString("W", sr.getScaledWidth() - 48, sr.getScaledHeight() - 49, 0xffffffff); fr.drawString("A", sr.getScaledWidth() - 77, sr.getScaledHeight() - 20, 0xffffffff); fr.drawString("S", sr.getScaledWidth() - 48.5, sr.getScaledHeight() - 20, 0xffffffff); fr.drawString("D", sr.getScaledWidth() - 19, sr.getScaledHeight() - 20, 0xffffffff); int y = 2; for(Module m : enabledMods) { double offset = count*(fr.FONT_HEIGHT + 6); //Gui.drawRect(sr.getScaledWidth() - fr.getStringWidth(m.getDisplayName()) - 10, count * (fr.FONT_HEIGHT + 6), sr.getScaledWidth() - fr.getStringWidth(m.getDisplayName()) - 4, 6 + fr.FONT_HEIGHT + count * (fr.FONT_HEIGHT + 6), ColorUtils.getRainbow(4, 0.8f, 1, count * 150)); Gui.drawRect(sr.getScaledWidth() - fr.getStringWidth(m.getDisplayName()) - 8, count * (fr.FONT_HEIGHT + 4), sr.getScaledWidth(), 4 + fr.FONT_HEIGHT + count * (fr.FONT_HEIGHT + 4), 0x90000000); fr.drawString(m.getDisplayName(), sr.getScaledWidth() - fr.getStringWidth(m.getDisplayName()) - 4, 4 + count*(fr.FONT_HEIGHT + 4), color); Gui.drawRect(sr.getScaledWidth(), y - y, sr.getScaledWidth() - 2, 2 + (fr.FONT_HEIGHT + y) + y + 1, color); y += 6.5; count++; }
 
Looks like it's not a problem with your arraylist

Is the result of String mode = Terror.instance.settingsManager.getSettingByName("Fly Mode").getValString(); a lowercase string?
 
Looks like it's not a problem with your arraylist

Is the result of String mode = Terror.instance.settingsManager.getSettingByName("Fly Mode").getValString(); a lowercase string?
nope.

public String getValString(){
return this.sval;
}

private String sval;

no toLowerCase

Im starting to think its a problem with the settingsManager itself and i might as well just recode it.
 
Go to the hero clickgui
Go to the file "ElementComboBox.java"
Go to the method "mouseClicked"
You should find the line
Java:
clickgui.setmgr.getSettingByName(set.getName()).setValString(slcd.toLowerCase());
remove the ".toLowerCase()"
it should look like this:
Java:
clickgui.setmgr.getSettingByName(set.getName()).setValString(slcd);

//Removed toxic part
 
Last edited by a moderator:
shape1
shape2
shape3
shape4
shape5
shape6
Back
Top