Jump to content

Item textures won't show up when other mods are installed?


ocomobock

Recommended Posts

I've been making a mod, and every time I add a new item to it, recompile and reobfuscate, and install it on my minecraft.jar, the textures are completely transparent. Does anyone have any idea why? This doesn't seem to happen with ModLoaderMP. The only other item that isn't from my mod that is transparent is the Creeper Shard from the Mutant Creeper mod.

 

I'm trying to make it so you can download the same .zip file and be able to install the mod on a ModLoaderMP minecraft.jar and a Forge minecraft.jar. That might be the problem.

 

kUqT5.png

 

1E01n.png

 

Could someone please help? I've been trying to fix this for a while now.

Link to comment
Share on other sites

I'll just give you some of my code, I'm not really sure what you're asking.

 

public static Item scoaletonKatana = (new ItemScoaletonKatana(657, null).setItemName("katanaScoaleton"));
public static Item darkBones = (new ItemDarkBones(656).setItemName("bonesDark"));
public static Item darkBoneMeal = (new ItemDarkBoneMeal(655).setItemName("bonemealDark"));
public static final Block darkSoil = (new BlockDarkSoil(146)).setHardness(0.7F).setStepSound(Block.soundGravelFootstep).setResistance(2000F).setBlockName("soilDark").setLightOpacity(1).setRequiresSelfNotify();
public static final Block darkSoil2 = (new BlockDarkSoil(145)).setHardness(0.7F).setStepSound(Block.soundGravelFootstep).setResistance(2000F).setBlockName("soilDark").setLightOpacity(1).setRequiresSelfNotify();
public static Item scoaletonSpawner = (new ItemScoaletonEgg(658)).setItemName("testSpawner");

public void load()
{

	ModLoader.addSpawn(EntityScoaleton.class, ScoaletonMaximumGroupSize, ScoaletonMinimumGroupSize, ScoaletonSpawnRate, EnumCreatureType.monster);
	ModLoader.registerEntityID(EntityScoaleton.class, "Scoaleton", 85);

	ModLoader.addName(scoaletonSpawner, "Spawn Scoaleton");
	scoaletonSpawner.iconIndex = ModLoader.addOverride("/gui/items.png", "/ocomo/scoaletonegg.png");
	ModLoader.addName(darkBones, "Dark Bones");
	darkBones.iconIndex = ModLoader.addOverride("/gui/items.png", "/ocomo/darkbones.png");
	ModLoader.addName(darkBoneMeal, "Dark Bone Meal");
	darkBoneMeal.iconIndex = ModLoader.addOverride("/gui/items.png", "/ocomo/darkbonemeal.png");
	ModLoader.addName(scoaletonKatana, "Katana");
	scoaletonKatana.iconIndex = ModLoader.addOverride("/gui/items.png", "/ocomo/katana.png");

Link to comment
Share on other sites

I tried putting that in the Item file itself, and the mod_XXXXX file.

 

public ItemScoaletonKatana(int par1, EnumToolMaterial par2EnumToolMaterial)
    {
        super(par1);
        this.maxStackSize = 1;
        this.setMaxDamage(mod_Scoaleton.KatanaDurability);
        this.weaponDamage = 10;
        setTextureFile("/ocomo/katana.png");
    }

 

It doesn't show the item name either.

 

public static Item scoaletonKatana = (new ItemScoaletonKatana(657, null).setItemName("katanaScoaleton"));
public static Item darkBones = (new ItemDarkBones(656).setItemName("bonesDark"));
public static Item darkBoneMeal = (new ItemDarkBoneMeal(655).setItemName("bonemealDark"));
public static final Block darkSoil = (new BlockDarkSoil(146)).setHardness(0.7F).setStepSound(Block.soundGravelFootstep).setResistance(2000F).setBlockName("soilDark").setLightOpacity(1).setRequiresSelfNotify();
public static final Block darkSoil2 = (new BlockDarkSoil(145)).setHardness(0.7F).setStepSound(Block.soundGravelFootstep).setResistance(2000F).setBlockName("soilDark").setLightOpacity(1).setRequiresSelfNotify();
public static Item scoaletonSpawner = (new ItemScoaletonEgg(658)).setItemName("testSpawner");

public void load()
{

	ModLoader.addSpawn(EntityScoaleton.class, ScoaletonMaximumGroupSize, ScoaletonMinimumGroupSize, ScoaletonSpawnRate, EnumCreatureType.monster);
	ModLoader.registerEntityID(EntityScoaleton.class, "Scoaleton", 85);

	ModLoader.addName(scoaletonSpawner, "Spawn Scoaleton");
	scoaletonSpawner.iconIndex = ModLoader.addOverride("/gui/items.png", "/ocomo/scoaletonegg.png");
	ModLoader.addName(darkBones, "Dark Bones");
	darkBones.iconIndex = ModLoader.addOverride("/gui/items.png", "/ocomo/darkbones.png");
	ModLoader.addName(darkBoneMeal, "Dark Bone Meal");
	darkBoneMeal.iconIndex = ModLoader.addOverride("/gui/items.png", "/ocomo/darkbonemeal.png");
	scoaletonKatana.setTextureFile("/ocomo/katana.png");

 

I tried putting it in the item file itself:

 

public String getTextureFile()
    {
            return "/ocomo/katana.png";
    }

 

But that didn't work either.

Link to comment
Share on other sites

When you're using the new spritesheets, you have to have all of you textures in the right folders in the <mcp folder>/jars/bin/minecraft.jar.

Then it'll work! :D

So, what would happen if I did push that shiny red button over there? ... Really? ... Can I try it? ... Damn.

Link to comment
Share on other sites

So like this?

 

public static Item scoaletonKatana = (new ItemScoaletonKatana(657, null));
public static Item darkBones = (new ItemDarkBones(656).setItemName("bonesDark"));
public static Item darkBoneMeal = (new ItemDarkBoneMeal(655).setItemName("bonemealDark"));
public static final Block darkSoil = (new BlockDarkSoil(146)).setHardness(0.7F).setStepSound(Block.soundGravelFootstep).setResistance(2000F).setBlockName("soilDark").setLightOpacity(1).setRequiresSelfNotify();
public static final Block darkSoil2 = (new BlockDarkSoil(145)).setHardness(0.7F).setStepSound(Block.soundGravelFootstep).setResistance(2000F).setBlockName("soilDark").setLightOpacity(1).setRequiresSelfNotify();
public static Item scoaletonSpawner = (new ItemScoaletonEgg(658)).setItemName("testSpawner");

public void load()
{

	ModLoader.addSpawn(EntityScoaleton.class, ScoaletonMaximumGroupSize, ScoaletonMinimumGroupSize, ScoaletonSpawnRate, EnumCreatureType.monster);
	ModLoader.registerEntityID(EntityScoaleton.class, "Scoaleton", 85);

	MinecraftForgeClient.preloadTexture("ocomo/katana.png");

	ModLoader.addName(scoaletonSpawner, "Spawn Scoaleton");
	scoaletonSpawner.iconIndex = ModLoader.addOverride("/gui/items.png", "/ocomo/scoaletonegg.png");
	ModLoader.addName(darkBones, "Dark Bones");
	darkBones.iconIndex = ModLoader.addOverride("/gui/items.png", "/ocomo/darkbones.png");
	ModLoader.addName(darkBoneMeal, "Dark Bone Meal");
	darkBoneMeal.iconIndex = ModLoader.addOverride("/gui/items.png", "/ocomo/darkbonemeal.png");
	ModLoader.addName(scoaletonKatana, "Katana");
	scoaletonKatana.setTextureFile("/ocomo/katana.png");

 

Cause that isn't working. Sorry I keep asking questions >_<

Link to comment
Share on other sites

I used the quick fix to set it to null because an error kept appearing on that line. I wasn't really sure why it wanted to do that. I just figured out why that was happening now though and changed it. I'm pretty sure it's because I copied the code from the sword class, and since the sword class is looking for the tool material, it wanted me to add a value.

 

I also noticed that there wasn't a / at the beginning of the path in MinecraftForgeClient.preloadTexture, but I fixed that. The texture still isn't loading.

Link to comment
Share on other sites

package net.minecraft.src;

public class ItemScoaletonKatana extends Item
{
    private int weaponDamage;

    public ItemScoaletonKatana(int par1)
    {
        super(par1);
        this.maxStackSize = 1;
        this.setMaxDamage(mod_Scoaleton.KatanaDurability);
        this.weaponDamage = 10;
    }

    /**
     * Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
     * sword
     */
    public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
    {
        return par2Block.blockID == Block.web.blockID ? 15.0F : 1.5F;
    }

    /**
     * Current implementations of this method in child classes do not use the entry argument beside ev. They just raise
     * the damage on the stack.
     */
    public boolean hitEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving)
    {
        par1ItemStack.damageItem(1, par3EntityLiving);
        par2EntityLiving.setFire(mod_Scoaleton.KatanaFireTime);
        return true;
    }

    public boolean onBlockDestroyed(ItemStack par1ItemStack, int par2, int par3, int par4, int par5, EntityLiving par6EntityLiving)
    {
        par1ItemStack.damageItem(2, par6EntityLiving);
        return true;
    }

    /**
     * Returns the damage against a given entity.
     */
    public int getDamageVsEntity(Entity par1Entity)
    {
        return this.weaponDamage;
    }

    /**
     * Returns True is the item is renderer in full 3D when hold.
     */
    public boolean isFull3D()
    {
        return true;
    }

    /**
     * returns the action that specifies what animation to play when the items is being used
     */
    public EnumAction getItemUseAction(ItemStack par1ItemStack)
    {
        return EnumAction.block;
    }

    /**
     * How long it takes to use or consume an item
     */
    public int getMaxItemUseDuration(ItemStack par1ItemStack)
    {
        return 72000;
    }

    /**
     * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
     */
    public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
    {
        par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack));
        return par1ItemStack;
    }

    /**
     * Returns if the item (tool) can harvest results from the block type.
     */
    public boolean canHarvestBlock(Block par1Block)
    {
        return par1Block.blockID == Block.web.blockID;
    }
    
    public String getTextureFile()
    {
            return "/ocomo/katana.png";
    }
}

Link to comment
Share on other sites

The texture is still invisible.

 

package net.minecraft.src;

import net.minecraft.src.forge.ITextureProvider;

public class ItemScoaletonKatana extends Item implements ITextureProvider
{
    private int weaponDamage;

    public ItemScoaletonKatana(int par1)
    {
        super(par1);
        this.maxStackSize = 1;
        this.setMaxDamage(mod_Scoaleton.KatanaDurability);
        this.weaponDamage = 10;
    }

Link to comment
Share on other sites

https://github.com/cpw/ironchest/ works, copy how it does it, and make sure not to use addOverride.  :)

I looked through the mod_ file and the Item files and I can't really find anything similar to what hotrods is talking about.

 

Anyways, I figured out a lot of mods have this problem, and is caused by Optifine. I uninstalled Optifine (replacing and deleting files in my minecraft.jar took forever <_<) which seemed to fix it. So I'll probably just end up letting everyone know that if they wanna use this mod, they either can't have Optifine installed, or have to deal with the missing textures.

 

Without Optifine:

 

VVTRc.png

 

With Optifine:

 

1E01n.png

Link to comment
Share on other sites

https://github.com/cpw/ironchest/ works, copy how it does it, and make sure not to use addOverride.  :)

I looked through the mod_ file and the Item files and I can't really find anything similar to what hotrods is talking about.

 

Anyways, I figured out a lot of mods have this problem, and is caused by Optifine. I uninstalled Optifine (replacing and deleting files in my minecraft.jar took forever <_<) which seemed to fix it. So I'll probably just end up letting everyone know that if they wanna use this mod, they either can't have Optifine installed, or have to deal with the missing textures.

 

Without Optifine:

 

VVTRc.png

 

With Optifine:

 

VjjRa.png

 

maybe im blind, but i cannot spot the difference between those two images =S

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.