Jump to content

Item Icon Overlaps Exiting Item


WildBamaBoy

Recommended Posts

Just moved to Forge from ModLoader. While testing I noticed that the icon of one of my items overlaps the Leather Tunic that already exists in Minecraft and a couple of other odd problems with icons.

 

width=800 height=449https://dl.dropbox.com/u/64124307/Minecraft%20Comes%20Alive/Development/jars/screenshots/2012-11-12_01.03.02.png[/img]

 

The first item is my item. The one beside that is the Leather Tunic, and beside that are the two mob eggs that I have added. Note that I do not use Forge's built in method of creating mob eggs, instead I created the egg classes and icons myself. Notice that the eggs have blue arrows on the top left and bottom right. These are not present in the actual icon file.

 

Why is this happening and how do I fix it? I still use ModLoader's methods for adding items if that could be the problem. I am unsure of how to properly do the same using Forge, or if it is any different at all.

 

itemBabyGirl = new ItemBabyGirl(modPropertiesManager.modProperties.itemID_BabyGirl).setIconIndex(ModLoader.addOverride("/gui/items.png", "/MCA/ItemBabyGirl.png")).setItemName("BabyGirl");

Link to comment
Share on other sites

I'd like to see the code for your item, as well as the version of forge you're using this is odd.. this shouldn't happen. We do no alpha blending in the textures, even more, it shouldn't put your texture on a existing slot.

However, beyond that, stop using ModLoader functions -.-

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Link to comment
Share on other sites

What's the proper way of adding items without using ModLoader's functions? I'm using Forge v6.0.1.341.

 

Here's the code for the item.

 

package mca;

import net.minecraft.src.CreativeTabs;

public class ItemBabyGirl extends ItemBaby
{
    public ItemBabyGirl(int i)
    {
        super(i);
        setItemName("Baby Girl");
        gender = "Female";
        setCreativeTab(CreativeTabs.tabMisc);
    }
}

 

And the class it extends from:

package mca;

import net.minecraft.src.EntityPlayer;
import net.minecraft.src.Item;
import net.minecraft.src.ItemStack;
import net.minecraft.src.World;

public class ItemBaby extends Item
{
public String gender;

public ItemBaby(int i)
{
	super(i);
	maxStackSize = 1;
}

@Override
public boolean onItemUse(ItemStack itemStack, EntityPlayer entityPlayer, World world, int i, int j, int k, int l, float m, float n, float o)
{
	if (MCA.instance.worldPropertiesManager.worldProperties.babyReadyToGrow)
	{
		if (!entityPlayer.worldObj.isRemote)
		{
			entityPlayer.inventory.setInventorySlotContents(entityPlayer.inventory.currentItem, null);

			EntityPlayerChild entityPlayerChild = new EntityPlayerChild(world, entityPlayer, MCA.instance.worldPropertiesManager.worldProperties.babyName, gender);
			entityPlayerChild.setLocationAndAngles(i, j + 1, k, entityPlayer.rotationYaw, entityPlayer.rotationPitch);
			world.spawnEntityInWorld(entityPlayerChild);

			entityPlayer.triggerAchievement(MCA.instance.achievementBabyGrowUp);

			MCA.instance.worldPropertiesManager.worldProperties.babyExists = false;
			MCA.instance.worldPropertiesManager.worldProperties.babyReadyToGrow = false;
			MCA.instance.worldPropertiesManager.worldProperties.minutesBabyExisted = 0;
			MCA.instance.worldPropertiesManager.worldProperties.babyName = "null";
			MCA.instance.worldPropertiesManager.saveWorldProperties();
		}
	}

	return true;
}
}

 

And the code for the eggs:

package mca;

import java.util.HashMap;
import java.util.Map;
import java.util.Random;

import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Side;

import net.minecraft.src.Block;
import net.minecraft.src.CreativeTabs;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.Facing;
import net.minecraft.src.Item;
import net.minecraft.src.ItemStack;
import net.minecraft.src.World;

public class ItemEggMale extends Item
{
public ItemEggMale(int par1)
{
	super(par1);
	setHasSubtypes(true);
	setCreativeTab(CreativeTabs.tabMisc);
}

public boolean requiresMultipleRenderPasses()
{
	return true;
}

public int getIconFromDamageForRenderPass(int par1, int par2)
{
	if (par2 > 0)
	{
		return super.getIconFromDamageForRenderPass(par1, par2) + 16;
	}
	else
	{
		return super.getIconFromDamageForRenderPass(par1, par2);
	}
}

public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
	if (par3World.isRemote)
	{
		return true;
	}

	int i = par3World.getBlockId(par4, par5, par6);
	par4 += Facing.offsetsXForSide[par7];
	par5 += Facing.offsetsYForSide[par7];
	par6 += Facing.offsetsZForSide[par7];
	double d = 0.0D;

	if (par7 == 1 && i == Block.fence.blockID || i == Block.netherFence.blockID)
	{
		d = 0.5D;
	}

	if (spawnVillager(par3World, par1ItemStack.getItemDamage(), (double)par4 + 0.5D, (double)par5 + d, (double)par6 + 0.5D) && !par2EntityPlayer.capabilities.isCreativeMode)
	{
		par1ItemStack.stackSize--;
	}

	return true;
}

public static boolean spawnVillager(World par0World, int par1, double par2, double par4, double par6)
{
	EntityVillager entityVillager = new EntityVillager(par0World, "Male", new Random().nextInt();

	if (entityVillager != null)
	{
		entityVillager.setLocationAndAngles(par2, par4, par6, par0World.rand.nextFloat() * 360F, 0.0F);

		if (!par0World.isRemote)
		{
			par0World.spawnEntityInWorld(entityVillager);

			for (Map.Entry<Integer, Integer> mapEntry : MCA.instance.idsMap.entrySet())
			{
				if (mapEntry.getValue() > entityVillager.mcaID)
				{
					entityVillager.mcaID = mapEntry.getValue();
				}
			}

			entityVillager.mcaID++;
			MCA.instance.idsMap.put(entityVillager.entityId, entityVillager.mcaID);
			MCA.instance.log(entityVillager.mcaID);
		}
	}

	return entityVillager != null;
}
}

 

package mca;

import java.util.HashMap;
import java.util.Map;
import java.util.Random;

import net.minecraft.src.Block;
import net.minecraft.src.CreativeTabs;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.Facing;
import net.minecraft.src.Item;
import net.minecraft.src.ItemStack;
import net.minecraft.src.World;

public class ItemEggFemale extends Item
{
    public ItemEggFemale(int par1)
    {
        super(par1);
        setHasSubtypes(true);
        setCreativeTab(CreativeTabs.tabMisc);
    }

    public boolean requiresMultipleRenderPasses()
    {
        return true;
    }

    public int getIconFromDamageForRenderPass(int par1, int par2)
    {
        if (par2 > 0)
        {
            return super.getIconFromDamageForRenderPass(par1, par2) + 16;
        }
        else
        {
            return super.getIconFromDamageForRenderPass(par1, par2);
        }
    }

    public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
    {
        if (par3World.isRemote)
        {
            return true;
        }

        int i = par3World.getBlockId(par4, par5, par6);
        par4 += Facing.offsetsXForSide[par7];
        par5 += Facing.offsetsYForSide[par7];
        par6 += Facing.offsetsZForSide[par7];
        double d = 0.0D;

        if (par7 == 1 && i == Block.fence.blockID || i == Block.netherFence.blockID)
        {
            d = 0.5D;
        }

        if (spawnVillager(par3World, par1ItemStack.getItemDamage(), (double)par4 + 0.5D, (double)par5 + d, (double)par6 + 0.5D) && !par2EntityPlayer.capabilities.isCreativeMode)
        {
            par1ItemStack.stackSize--;
        }

        return true;
    }

    public static boolean spawnVillager(World par0World, int par1, double par2, double par4, double par6)
    {
    	int profession = new Random().nextInt(;
    	
    	if (profession == 4) profession = 0;
    	
        EntityVillager entityVillager = new EntityVillager(par0World, "Female", profession);
        
        if (entityVillager != null)
        {
        	entityVillager.setLocationAndAngles(par2, par4, par6, par0World.rand.nextFloat() * 360F, 0.0F);
        	
        	if (!par0World.isRemote)
        	{
        		par0World.spawnEntityInWorld(entityVillager);
        		
			for (Map.Entry<Integer, Integer> mapEntry : MCA.instance.idsMap.entrySet())
			{
				if (mapEntry.getValue() > entityVillager.mcaID)
				{
					entityVillager.mcaID = mapEntry.getValue();
				}
			}

			entityVillager.mcaID++;
			MCA.instance.idsMap.put(entityVillager.entityId, entityVillager.mcaID);
			MCA.instance.log(entityVillager.mcaID);
        	}
        }

        return entityVillager != null;
    }
}

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I was just trying to play my modded world when i randomly got this crash for no reason. I sorted through like every mod and eventually I realized it was LLibrary but I can't seem to find a solution to fix the crashing. I can't lose the world that I have that uses this mod please help me. Here's the report: https://pastebin.com/0D00B79i If anyone has a solution please let me know.  
    • 🤑DAFTAR & LOGIN🤑 🤑DAFTAR & LOGIN🤑 🤑DAFTAR & LOGIN🤑   Daftar Slot Ligawin88 adalah bocoran slot rekomendasi gacor dari Ligawin88 yang bisa anda temukan di SLOT Ligawin88. Situs SLOT Ligawin88 hari ini yang kami bagikan di sini adalah yang terbaik dan bersiaplah untuk mengalami sensasi tak terlupakan dalam permainan slot online. Temukan game SLOT Ligawin88 terbaik dengan 100 pilihan provider ternama yang dipercaya akan memberikan kepuasan dan kemenangan hari ini untuk meraih x500. RTP SLOT Ligawin88 merupakan SLOT Ligawin88 hari ini yang telah menjadi pilihan utama bagi pemain judi online di seluruh Indonesia. Setiap harinya jutaan pemain memasuki dunia maya untuk memperoleh hiburan seru dan kemenangan besar dalam bermain slot dengan adanya bocoran RTP SLOT Ligawin88. Tidak ada yang lebih menyenangkan daripada mengungguli mesin slot dan meraih jackpot x500 yang menggiurkan di situs SLOT Ligawin88 hari ini yang telah disediakan SLOT Ligawin88. Menangkan jackpot besar x500 rajanya maxwin dari segala slot dan raih kemenangan spektakuler di situs Ligawin88 terbaik 2024 adalah tempat yang menyediakan mesin slot dengan peluang kemenangan lebih tinggi daripada situs slot lainnya. Bagi anda yang mencari pengalaman judi slot paling seru dan mendebarkan, situs bo SLOT Ligawin88 terbaik 2024 adalah pilihan yang tepat. Jelajahi dunia slot online melalui situs SLOT Ligawin88 di link SLOT Ligawin88.
    • 🤑DAFTAR & LOGIN🤑 🤑DAFTAR & LOGIN🤑 🤑DAFTAR & LOGIN🤑   Daftar Slot Asusslot adalah bocoran slot rekomendasi gacor dari Asusslot yang bisa anda temukan di SLOT Asusslot. Situs SLOT Asusslot hari ini yang kami bagikan di sini adalah yang terbaik dan bersiaplah untuk mengalami sensasi tak terlupakan dalam permainan slot online. Temukan game SLOT Asusslot terbaik dengan 100 pilihan provider ternama yang dipercaya akan memberikan kepuasan dan kemenangan hari ini untuk meraih x500. RTP SLOT Asusslot merupakan SLOT Asusslot hari ini yang telah menjadi pilihan utama bagi pemain judi online di seluruh Indonesia. Setiap harinya jutaan pemain memasuki dunia maya untuk memperoleh hiburan seru dan kemenangan besar dalam bermain slot dengan adanya bocoran RTP SLOT Asusslot. Tidak ada yang lebih menyenangkan daripada mengungguli mesin slot dan meraih jackpot x500 yang menggiurkan di situs SLOT Asusslot hari ini yang telah disediakan SLOT Asusslot. Menangkan jackpot besar x500 rajanya maxwin dari segala slot dan raih kemenangan spektakuler di situs Asusslot terbaik 2024 adalah tempat yang menyediakan mesin slot dengan peluang kemenangan lebih tinggi daripada situs slot lainnya. Bagi anda yang mencari pengalaman judi slot paling seru dan mendebarkan, situs bo SLOT Asusslot terbaik 2024 adalah pilihan yang tepat. Jelajahi dunia slot online melalui situs SLOT Asusslot di link SLOT Asusslot.
    • 🤑DAFTAR & LOGIN🤑 🤑DAFTAR & LOGIN🤑 🤑DAFTAR & LOGIN🤑 Daftar Slot Galeri555 adalah bocoran slot rekomendasi gacor dari Galeri555 yang bisa anda temukan di SLOT Galeri555. Situs SLOT Galeri555 hari ini yang kami bagikan di sini adalah yang terbaik dan bersiaplah untuk mengalami sensasi tak terlupakan dalam permainan slot online. Temukan game SLOT Galeri555 terbaik dengan 100 pilihan provider ternama yang dipercaya akan memberikan kepuasan dan kemenangan hari ini untuk meraih x500. RTP SLOT Galeri555 merupakan SLOT Galeri555 hari ini yang telah menjadi pilihan utama bagi pemain judi online di seluruh Indonesia. Setiap harinya jutaan pemain memasuki dunia maya untuk memperoleh hiburan seru dan kemenangan besar dalam bermain slot dengan adanya bocoran RTP SLOT Galeri555. Tidak ada yang lebih menyenangkan daripada mengungguli mesin slot dan meraih jackpot x500 yang menggiurkan di situs SLOT Galeri555 hari ini yang telah disediakan SLOT Galeri555. Menangkan jackpot besar x500 rajanya maxwin dari segala slot dan raih kemenangan spektakuler di situs Galeri555 terbaik 2024 adalah tempat yang menyediakan mesin slot dengan peluang kemenangan lebih tinggi daripada situs slot lainnya. Bagi anda yang mencari pengalaman judi slot paling seru dan mendebarkan, situs bo SLOT Galeri555 terbaik 2024 adalah pilihan yang tepat. Jelajahi dunia slot online melalui situs SLOT Galeri555 di link SLOT Galeri555.
    • 🤑DAFTAR & LOGIN🤑 🤑DAFTAR & LOGIN🤑 🤑DAFTAR & LOGIN🤑 Daftar Slot Kocok303 adalah bocoran slot rekomendasi gacor dari Kocok303 yang bisa anda temukan di SLOT Kocok303. Situs SLOT Kocok303 hari ini yang kami bagikan di sini adalah yang terbaik dan bersiaplah untuk mengalami sensasi tak terlupakan dalam permainan slot online. Temukan game SLOT Kocok303 terbaik dengan 100 pilihan provider ternama yang dipercaya akan memberikan kepuasan dan kemenangan hari ini untuk meraih x500. RTP SLOT Kocok303 merupakan SLOT Kocok303 hari ini yang telah menjadi pilihan utama bagi pemain judi online di seluruh Indonesia. Setiap harinya jutaan pemain memasuki dunia maya untuk memperoleh hiburan seru dan kemenangan besar dalam bermain slot dengan adanya bocoran RTP SLOT Kocok303. Tidak ada yang lebih menyenangkan daripada mengungguli mesin slot dan meraih jackpot x500 yang menggiurkan di situs SLOT Kocok303 hari ini yang telah disediakan SLOT Kocok303. Menangkan jackpot besar x500 rajanya maxwin dari segala slot dan raih kemenangan spektakuler di situs Kocok303 terbaik 2024 adalah tempat yang menyediakan mesin slot dengan peluang kemenangan lebih tinggi daripada situs slot lainnya. Bagi anda yang mencari pengalaman judi slot paling seru dan mendebarkan, situs bo SLOT Kocok303 terbaik 2024 adalah pilihan yang tepat. Jelajahi dunia slot online melalui situs SLOT Kocok303 di link SLOT Kocok303.
  • Topics

×
×
  • Create New...

Important Information

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