This post retains to the default code given when you decompile Minecraft and... Obfuscate it? I'm not sure the correct terms yet, so please excuse me.
Anyways, variable names I have gotten from the code I've gotten from Minecraft using MinecraftCoderPack & Eclipse. Please don't hound me about the variable names. I am trying my best based on what I know now. I am still learning Java scripting.
I believe I posted something similar, or about this a while ago, but I was not able to understand the response fully to the point I could implement it to my needs.
So... I have a string that I am wanting to get a number from.
Example:
public static final String[] exampleLetters = new String[] {"a", "b", "c", "d", "e", "f", "g"};
And, using a public Int (with no variables in the title), I am looking to take numbers for each string letter, to be able to output the value to other code.
Example:
public int letterConversion()
a = 0, b = 1, and so on to g = 6
I hope you get the idea.
How would I be able to get the numerical values of each letters using a public Int without any variables in the title?
I am not looking for someone to code my Minecraft mod, I am just looking for a point of reference to do what I am trying to for this specific sector I am working on at the moment.
---
Actual Code I have right now. Again, please ignore variable names, it's what I got use to while learning.
/** The list of the types of step blocks. */ public static final String[] slabType = new String[] {"stone", "sand", "cobble", "brick", "smoothStoneBrick", "netherBrick", "quartz"}; } /**This checks slabType for the material and registers a number to each type for other codes to use.*/ public int textureType() { int var1 = -1; { for ( int var2 = 0 ; var2 < slabType.length ; var2++ ) if (var2 == 0) return var1 = 0; else if (var2 == 1) return var1 = 1; else if (var2 == 2) return var1 = 2; else if (var2 == 3) return var1 = 3; else if (var2 == 4) return var1 = 4; else if (var2 == 5) return var1 = 5; else if (var2 == 6) return var1 = 6; } return var1; }
For what I have now, in the Int...
for ( int var2 = 0 ; var2 < slabType.length ; var2++ )
Is controlling the output. No mater what the 0 is the output, and I am not sure exactly why due to my still learning.