1
Modders help !!!
What is wrong with my code it says different pictures are not found when they are right in the right place ! Here is the source code:
package net.minecraft.src;
public class mod_lavaarmor extends BaseMod
{
public static final Item LavaHelmet = new ItemArmor(5001, EnumArmorMaterial.LAVAARMOR, ModLoader.addArmor("lavaarmor"), 0).setItemName("Lava Helmet");
public static final Item LavaChestplate = new ItemArmor(5002, EnumArmorMaterial.LAVAARMOR, ModLoader.addArmor("lavaarmor"), 1).setItemName("Lava Chestplate");
public static final Item LavaLeggings = new ItemArmor(5003, EnumArmorMaterial.LAVAARMOR, ModLoader.addArmor("lavaarmor"), 2).setItemName("Lava Leggings");
public static final Item LavaBoots = new ItemArmor(5004, EnumArmorMaterial.LAVAARMOR, ModLoader.addArmor("lavaarmor"), 3).setItemName("Lava Boots");
public void load()
{
LavaHelmet.iconIndex = ModLoader.addOverride("/gui/items.png", "/armor/Lavahelmet.png");
LavaChestplate.iconIndex = ModLoader.addOverride("/gui/items.png", "/chestplate/Lavachestplate.png");
LavaLeggings.iconIndex = ModLoader.addOverride("/gui/items.png", "/armor/Lavaleggings.png");
LavaBoots.iconIndex = ModLoader.addOverride("/gui/items.png", "/textures/Lavaboots.png");
ModLoader.addRecipe(new ItemStack(LavaHelmet, 1), new Object [] {"###", "# #", Character.valueOf('#'), Item.bucketLava});
ModLoader.addRecipe(new ItemStack(LavaChestplate, 1), new Object [] {"# #", "###", "###", Character.valueOf('#'), Item.bucketLava});
ModLoader.addRecipe(new ItemStack(LavaLeggings, 1), new Object [] {"###", "# #", "# #", Character.valueOf('#'), Item.bucketLava});
ModLoader.addRecipe(new ItemStack(LavaBoots, 1), new Object [] {"# #", "# #", Character.valueOf('#'), Item.bucketLava});
ModLoader.addName(LavaHelmet, "Helmet");
ModLoader.addName(LavaChestplate, "Chestplate");
ModLoader.addName(LavaLeggings, "Leggings");
ModLoader.addName(LavaBoots, "Boots");
}
public String getVersion()
{
return "1.3.2";
}
}
package net.minecraft.src;
public class mod_lavaarmor extends BaseMod
{
public static final Item LavaHelmet = new ItemArmor(5001, EnumArmorMaterial.LAVAARMOR, ModLoader.addArmor("lavaarmor"), 0).setItemName("Lava Helmet");
public static final Item LavaChestplate = new ItemArmor(5002, EnumArmorMaterial.LAVAARMOR, ModLoader.addArmor("lavaarmor"), 1).setItemName("Lava Chestplate");
public static final Item LavaLeggings = new ItemArmor(5003, EnumArmorMaterial.LAVAARMOR, ModLoader.addArmor("lavaarmor"), 2).setItemName("Lava Leggings");
public static final Item LavaBoots = new ItemArmor(5004, EnumArmorMaterial.LAVAARMOR, ModLoader.addArmor("lavaarmor"), 3).setItemName("Lava Boots");
public void load()
{
LavaHelmet.iconIndex = ModLoader.addOverride("/gui/items.png", "/armor/Lavahelmet.png");
LavaChestplate.iconIndex = ModLoader.addOverride("/gui/items.png", "/chestplate/Lavachestplate.png");
LavaLeggings.iconIndex = ModLoader.addOverride("/gui/items.png", "/armor/Lavaleggings.png");
LavaBoots.iconIndex = ModLoader.addOverride("/gui/items.png", "/textures/Lavaboots.png");
ModLoader.addRecipe(new ItemStack(LavaHelmet, 1), new Object [] {"###", "# #", Character.valueOf('#'), Item.bucketLava});
ModLoader.addRecipe(new ItemStack(LavaChestplate, 1), new Object [] {"# #", "###", "###", Character.valueOf('#'), Item.bucketLava});
ModLoader.addRecipe(new ItemStack(LavaLeggings, 1), new Object [] {"###", "# #", "# #", Character.valueOf('#'), Item.bucketLava});
ModLoader.addRecipe(new ItemStack(LavaBoots, 1), new Object [] {"# #", "# #", Character.valueOf('#'), Item.bucketLava});
ModLoader.addName(LavaHelmet, "Helmet");
ModLoader.addName(LavaChestplate, "Chestplate");
ModLoader.addName(LavaLeggings, "Leggings");
ModLoader.addName(LavaBoots, "Boots");
}
public String getVersion()
{
return "1.3.2";
}
}
Create an account or sign in to comment.
14
1
Ok sorry about that i just didn't have time to test completely i am setting up hosting and stuff which is a little distracting.
1
Did you test the code?
1
Not the 1.6.6 code, but still, the ModLoader.addOverride method still works, so that's not his problem, its what he put as his textures' paths.(Except helmet and leggings probably.)
I know that method works because I use it in my mods, like I said -_-
I know that method works because I use it in my mods, like I said -_-
1
Believe there is another method missing O.o
ModLoader.addArmor(armorname);
1
public void onRegisterBlocksAndItems()
{
int tut3Icon = api().registerItemIcon(imageName(getClass(), "gfx/mcp.png"), 1);//This gives us a custom texture for the item. the "1" tells the Mod System to grab the second 16x16 pixel square(going from left to right) in the .png.
this.tut3 = new ItemTut3(api(), tut3Icon);
}
{
int tut3Icon = api().registerItemIcon(imageName(getClass(), "gfx/mcp.png"), 1);//This gives us a custom texture for the item. the "1" tells the Mod System to grab the second 16x16 pixel square(going from left to right) in the .png.
this.tut3 = new ItemTut3(api(), tut3Icon);
}
1
Thats a tutorial for items
1
I know, and the way you make items still uses the iconIndex thing when using ModLoader to add the texture.That tutorial is outdated too, because when you see the version in the code, its 1.6.6
Try using the method before saying it does not work/is wrong :/
That code could still work, but probably not because it is in 1.6.6, like what was said.
He's also trying to make Armor, not a simple item.
He has that in his code already somewhere at the top, kind-of.
Try using the method before saying it does not work/is wrong :/
That code could still work, but probably not because it is in 1.6.6, like what was said.
He's also trying to make Armor, not a simple item.
CephrusBelieve there is another method missing O.oModLoader.addArmor(armorname);
He has that in his code already somewhere at the top, kind-of.
1
Yes but I think that custom Items are made to be registered. They have no texture setup to be overridden. Follow the link. Also I can help better with full source.
1
My mods use the ModLoader.addOverride method for textures and they work, it makes it search for the texture in the given path instead of looking in /terrain.png (For blocks.) or /gui/items.png. (For items.)
You can make the texture be somewhere in one of those and set the texture-number to a certain block or space in the .png, but making a separate texture is easier and shouldn't make you get the texture wrong more than once.
Also, that link leads to a tutorial that seems to work for Minecraft Beta 1.6.6, and you don't need to edit the lang file you just need to register the name of the item or block.
"ModLoader.registerBlock(Blockname)" < Only for block, and you do "ModLoader.addName(Namehere, "Namehere")" for items, and after the register thing for blocks.
You can make the texture be somewhere in one of those and set the texture-number to a certain block or space in the .png, but making a separate texture is easier and shouldn't make you get the texture wrong more than once.
Also, that link leads to a tutorial that seems to work for Minecraft Beta 1.6.6, and you don't need to edit the lang file you just need to register the name of the item or block.
"ModLoader.registerBlock(Blockname)" < Only for block, and you do "ModLoader.addName(Namehere, "Namehere")" for items, and after the register thing for blocks.
1
Can i get full source too?
1
Override does not work you have to register a texture
1
The ModLoader.addOverride method does work for textures....
1
1
Are all the textures in the armor folder?
If so, then change your texture's path in the code to /armor/(the image name).png
You only did this for the helmet and leggings :/
If they are in different folders inside minecraft.jar, make sure the name is exactly how it should be like it is in the code with capitals or lowercases.
If so, then change your texture's path in the code to /armor/(the image name).png
You only did this for the helmet and leggings :/
If they are in different folders inside minecraft.jar, make sure the name is exactly how it should be like it is in the code with capitals or lowercases.