How would you go about creating your own EnumToolMaterial? I'm developing a mod which adds a Bedrock Pickaxe, which I want to be stronger than diamond.
Rollback Post to RevisionRollBack
I'm working on an open-source mod called Craft++. Check it out!
Illegal modifier for parameter BEDROCK; only final is permitted
D:
EDIT: Now when I removed static, it says in the following line:
tool = new BedrockPick(Ids.ultiPick, EnumToolMaterial.BEDROCK);
That bedrock isn't a field or can't be resolved.
EDIT2: Resolved! I changed the line to:
tool = new BedrockPick(Ids.ultiPick, EnumHelper.addToolMaterial("BEDROCK", 3, -1, 16.0F, 4.0F, 5));
And removed the line you told me to put before. Thanks anyways!
For future reference, [classname].[field] is for referencing fields in a different class. It's not an arbitrary requirement that you prefix some fields with their type's name. Also, if the static modifier was giving you an error, you probably put it in the wrong place. What you have will work well enough if you only need it once, but is highly unnecessary if you're making a full set of tools.
(I had it between @Instance and @SidedProxy if that is the problem)
Armors take different parameters. For example, the vanilla diamond is
DIAMOND(33, new int[]{3, 8, 6, 3}, 10)
The first int is for durability. The value there gets multiplied by this array in ItemArmor
private static final int[] maxDamageArray = new int[] {11, 16, 15, 13};
So a diamond helmet has 33 * 11 as its max damage. A chestplate has 33 * 16, leggings 33 * 15, boots 33 * 13.
The array is how many points of proection each piece does 1 point = 1/2 chestplate in the gui. The last int is enchantability.
Armors take different parameters. For example, the vanilla diamond is
DIAMOND(33, new int[]{3, 8, 6, 3}, 10)
The first int is for durability. The value there gets multiplied by this array in ItemArmor
private static final int[] maxDamageArray = new int[] {11, 16, 15, 13};
So a diamond helmet has 33 * 11 as its max damage. A chestplate has 33 * 16, leggings 33 * 15, boots 33 * 13.
The array is how many points of proection each piece does 1 point = 1/2 chestplate in the gui. The last int is enchantability.
I'm working on an open-source mod called Craft++. Check it out!
public static EnumToolMaterial (INSERTNAMEOFTOOLMATERIALHERE) = new EnumToolMaterial();
Then add in the arguments it request.
To be honest I never knew about that, haha.
Be sure to quote my post if you want a reply.
lol @ Cameronazzi copy-pasting my sig into his
It gives me the error:
Illegal modifier for parameter BEDROCK; only final is permitted
D:
EDIT: Now when I removed static, it says in the following line:
tool = new BedrockPick(Ids.ultiPick, EnumToolMaterial.BEDROCK);
That bedrock isn't a field or can't be resolved.
EDIT2: Resolved! I changed the line to:
tool = new BedrockPick(Ids.ultiPick, EnumHelper.addToolMaterial("BEDROCK", 3, -1, 16.0F, 4.0F, 5));
And removed the line you told me to put before. Thanks anyways!
I'm working on an open-source mod called Craft++. Check it out!
For future reference, [classname].[field] is for referencing fields in a different class. It's not an arbitrary requirement that you prefix some fields with their type's name. Also, if the static modifier was giving you an error, you probably put it in the wrong place. What you have will work well enough if you only need it once, but is highly unnecessary if you're making a full set of tools.
I used that template to make a armor material for steel but it returned an error at EnumHelper. Here is my code:
(I had it between @Instance and @SidedProxy if that is the problem)
Armors take different parameters. For example, the vanilla diamond is
The first int is for durability. The value there gets multiplied by this array in ItemArmor
So a diamond helmet has 33 * 11 as its max damage. A chestplate has 33 * 16, leggings 33 * 15, boots 33 * 13.
The array is how many points of proection each piece does 1 point = 1/2 chestplate in the gui. The last int is enchantability.
Thanks! That fixed the problem.