Modders help !!!

Discuss the game, stories, screenshots, videos, ideas, creations, top score!?

Post Permalink
by Eatme4dinner » 9/12/2012

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";
}
}
Image
Image
Image
User avatar
Level 29
Expert Modder
Posts: 59
Joined: 7/8/12

Post Permalink
by sed11 » 9/12/2012

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.
Image

Image

Image

Image

Creepers gonna Creep!
User avatar
Level 60
High Grandmaster Creeper
Posts: 7027
Joined: 7/9/11
Minecraft: cjw12


Post Permalink
by modwizcode » 9/12/2012

Override does not work you have to register a texture
Level 1
New Engineer
Posts: 30
Joined: 3/15/12

Post Permalink
by modwizcode » 9/12/2012

Can i get full source too?
Level 1
New Engineer
Posts: 30
Joined: 3/15/12

Post Permalink
by sed11 » 9/12/2012

modwizcode wrote:Override does not work you have to register a texture



The ModLoader.addOverride method does work for textures....
Image

Image

Image

Image

Creepers gonna Creep!
User avatar
Level 60
High Grandmaster Creeper
Posts: 7027
Joined: 7/9/11
Minecraft: cjw12

Post Permalink
by modwizcode » 9/12/2012

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.
Level 1
New Engineer
Posts: 30
Joined: 3/15/12

Post Permalink
by sed11 » 9/12/2012

modwizcode wrote: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.



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.
Image

Image

Image

Image

Creepers gonna Creep!
User avatar
Level 60
High Grandmaster Creeper
Posts: 7027
Joined: 7/9/11
Minecraft: cjw12

Post Permalink
by modwizcode » 9/12/2012

Thats a tutorial for items
Level 1
New Engineer
Posts: 30
Joined: 3/15/12

Post Permalink
by modwizcode » 9/12/2012

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);
}
Level 1
New Engineer
Posts: 30
Joined: 3/15/12

Post Permalink
by Cephrus » 9/12/2012

Believe there is another method missing O.o
Code: Select all
ModLoader.addArmor(armorname);
User avatar
Level 21
Expert Modder
Posts: 9
Joined: 3/12/12

Post Permalink
by sed11 » 9/12/2012

modwizcode wrote:Thats a tutorial for items



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.

Cephrus wrote:Believe there is another method missing O.o
Code: Select all
ModLoader.addArmor(armorname);


He has that in his code already somewhere at the top, kind-of.
Image

Image

Image

Image

Creepers gonna Creep!
User avatar
Level 60
High Grandmaster Creeper
Posts: 7027
Joined: 7/9/11
Minecraft: cjw12

Next

Return to Discussion