package com.github.copiousdogs.item;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemDye;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import com.github.copiousdogs.lib.Reference;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemColored extends ItemCopiousDogs
{
private IIcon[] itemIcons;
public ItemColored()
{
setHasSubtypes(true);
setMaxDamage(0);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister register)
{
itemIcons = new IIcon[16];
for (int i = 0; i < 16; i++)
{
itemIcons<em> = register.registerIcon(Reference.MOD_ID + ":" + this.getUnlocalizedName().substring(this.getUnlocalizedName().lastIndexOf(".") + 1) + "_" + ItemDye.field_150921_b[getItemFromDye(i)]);
}
}
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs tab, List list)
{
for (int i = 0; i < 16; i++)
{
list.add(new ItemStack(this, 1, i));
}
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int par0)
{
return itemIcons[par0];
}
public static int getItemFromDye(int par0)
{
return 15 - par0;
}
public static int getDyeFromItem(int par0)
{
return 15 - par0;
}
}
</em>
<em>
but IIcon doesn't exist anymore in 1.8 and I have tried many ways of replacing this with other methods, They render the Meta items but only without textures and models.
any Help would be greatly appreciated!
Thanks!
p.s I know that minecraft uses a new method for rendering items and blocks and I am currently using It but I don't know how to make it work for the colored items that are based on dyes
The vital part is where it lists two layers under the "textures" attribute. I don't remember, but I think there is also a method inside the Item class called getColorFromItemStack or something like that. Actually that might just be for 1.7.10..... I don't remember.
To register multiple model files for items, I found one example that did this where they register item renders:
The vital part is where it lists two layers under the "textures" attribute. I don't remember, but I think there is also a method inside the Item class called getColorFromItemStack or something like that. Actually that might just be for 1.7.10..... I don't remember.
To register multiple model files for items, I found one example that did this where they register item renders:
this actually helped me fix the issue with textures stretching across all meta items. xD
but my initial issue is that The mobs have collars that have colors that change depending on the damage but that doesn't seem to be working still.
maybe its the Entity Render? I don't know what else it could possibly be. :/
thanks for the awesome help, I didn't know if the last one was me or not
this actually helped me fix the issue with textures stretching across all meta items. xD
but my initial issue is that The mobs have collars that have colors that change depending on the damage but that doesn't seem to be working still.
maybe its the Entity Render? I don't know what else it could possibly be. :/
thanks for the awesome help, I didn't know if the last one was me or not
so our 1.7 Class for ItemColored is
but IIcon doesn't exist anymore in 1.8 and I have tried many ways of replacing this with other methods, They render the Meta items but only without textures and models.
any Help would be greatly appreciated!
Thanks!
p.s I know that minecraft uses a new method for rendering items and blocks and I am currently using It but I don't know how to make it work for the colored items that are based on dyes
- snubmansters.com
Have you looked at how leather armor items change color?
Also see this troubleshooting guide and this tutorial for updating textures.
Yeah I did. xD
and I already know how to update textures... just not with metadata
EDIT
by metadata I mean following Damage so that colors are able to apply to physical models
- snubmansters.com
So hopefully you have all your .JSON files set up.
Here is the Minecraft file for models > item > leather_helmet.JSON
The vital part is where it lists two layers under the "textures" attribute. I don't remember, but I think there is also a method inside the Item class called getColorFromItemStack or something like that. Actually that might just be for 1.7.10..... I don't remember.
To register multiple model files for items, I found one example that did this where they register item renders:
the register function was just a local helper function that calls the Minecraft render manager and all that. It looks like this:
In this example, there were three item model files:
models > item > meta_item_0.JSON
models > item > meta_item_1.JSON
models > item > meta_item_2.JSON
Each specified a different texture where necessary. Hopefully this is what you are asking about.
Also look at this post where they solved the same problem.
this actually helped me fix the issue with textures stretching across all meta items. xD
but my initial issue is that The mobs have collars that have colors that change depending on the damage but that doesn't seem to be working still.
maybe its the Entity Render? I don't know what else it could possibly be. :/
thanks for the awesome help, I didn't know if the last one was me or not
heres the entity render class
- snubmansters.com
Make a new post for this. Include both the EntityDog.java and RenderDog.java and I will help you there.
I'm doing that right now, sorry for the delay.
- snubmansters.com