1

Modders help !!!

Eatme4dinner's Avatar Eatme4dinner9/12/12 7:23 pm
9/12/2012 8:57 pm
modwizcode's Avatar modwizcode
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";
}
}
Posted by Eatme4dinner's Avatar
Eatme4dinner
Level 37 : Artisan Modder
22

Create an account or sign in to comment.

14

1
09/12/2012 8:57 pm
Level 2 : Apprentice Network
modwizcode
modwizcode's Avatar
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
09/12/2012 8:12 pm
Level 2 : Apprentice Network
modwizcode
modwizcode's Avatar
Did you test the code?
1
09/12/2012 8:13 pm
Level 66 : High Grandmaster Hero
sed11
sed11's Avatar
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 -_-
1
09/12/2012 8:10 pm
Level 25 : Expert Modder
InactiveAccount12
InactiveAccount12's Avatar
Believe there is another method missing O.o
ModLoader.addArmor(armorname);
1
09/12/2012 8:07 pm
Level 2 : Apprentice Network
modwizcode
modwizcode's Avatar
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);
}
1
09/12/2012 8:06 pm
Level 2 : Apprentice Network
modwizcode
modwizcode's Avatar
Thats a tutorial for items
1
09/12/2012 8:10 pm
Level 66 : High Grandmaster Hero
sed11
sed11's Avatar
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.

CephrusBelieve there is another method missing O.o
ModLoader.addArmor(armorname);


He has that in his code already somewhere at the top, kind-of.
1
09/12/2012 7:36 pm
Level 2 : Apprentice Network
modwizcode
modwizcode's Avatar
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
09/12/2012 7:41 pm
Level 66 : High Grandmaster Hero
sed11
sed11's Avatar
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.
1
09/12/2012 7:30 pm
Level 2 : Apprentice Network
modwizcode
modwizcode's Avatar
Can i get full source too?
1
09/12/2012 7:30 pm
Level 2 : Apprentice Network
modwizcode
modwizcode's Avatar
Override does not work you have to register a texture
1
09/12/2012 7:32 pm
Level 66 : High Grandmaster Hero
sed11
sed11's Avatar
The ModLoader.addOverride method does work for textures....
1
1
09/12/2012 7:29 pm
Level 66 : High Grandmaster Hero
sed11
sed11's Avatar
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.
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome