Schemex
-
Posts
8 -
Joined
-
Last visited
Posts posted by Schemex
-
-
To: GotoLink
Yes, I did, extensively. And that really doesn't matter. It is easier to do it this way and, additionally, I decided to try it out with the
if statements and nothing changes.
-
@Override public int getRenderPasses(int metadata){ return 1; }
remove or change to 2.
That didn't help. However, thanks for helping me clean up my code.
-
Just the color of the armor, that's all.
-
I am 90% sure you don't... I have seen other posts similar to mine on the forum and there was no mention of that.
-
-
-
Build: Recommended 1.7.10 (downloaded last week)
Background: I am attempting to develop a mod that has many different types of armor. For convenience purposes, I am going to simply going to recolor one texture, similar to how leather works.
However, I have spent hours reading through tons of posts regarding this to no avail. I have tried reading through the render class for player and I am fairly sure I've implemented it correctly, but, inevitably, it doesn't work.
I am able to change the items associated with the armor parts (helmet, chestplate, etc...), but when they are applied to the player, it is the default grey texture I stole from leather armor ( http://i.imgur.com/9r793b0.png ).
I am not attempting to use any overlay features. I just want to recolor my textures.
My current code:
package com.betterToolsAndArmor.armor; import org.lwjgl.opengl.GL11; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.util.DamageSource; import net.minecraft.util.IIcon; import net.minecraftforge.common.ISpecialArmor; public class ItemArmorLocalBase extends ItemArmor implements ISpecialArmor { public ItemArmorLocalBase(ArmorMaterial p_i45325_1_, int p_i45325_2_, int p_i45325_3_) { super(p_i45325_1_, p_i45325_2_, p_i45325_3_); } @Override public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot) { return new ArmorProperties(0, 0, 0); } @Override public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot) { return 5; } @Override public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) { stack.damageItem(damage * 2, entity); } @Override public String getArmorTexture(ItemStack armor, Entity entity, int slot, String type) { if (((ItemArmor) (armor.getItem())).armorType == 2) { return modid + ":textures/armor/magic_2.png"; } return modid + ":textures/armor/magic_1.png"; } public CreativeTabs[] getCreativeTabs() { return new CreativeTabs[] {CreativeTabs.tabCombat}; } public boolean getIsRepairable(ItemStack armor, ItemStack stack) { //return stack.getItem() == ModItems.craftableObsidian; return false; } //the part that actually applies @Override public boolean hasColor(ItemStack item) { return true; } @Override public int getColor(ItemStack item) { return 9846527; } @Override @SideOnly(Side.CLIENT) public int getColorFromItemStack(ItemStack item, int unUsed) { return getColor(item); } @Override public void registerIcons(IIconRegister r) { itemIcon = r.registerIcon(iconReg); } //I am fairly sure this is supurfulous @Override @SideOnly(Side.CLIENT) public boolean requiresMultipleRenderPasses() { return true; } @Override public int getRenderPasses(int metadata) { // TODO Auto-generated method stub return 1; } @Override public IIcon getIcon(ItemStack stack, int pass) { // TODO Auto-generated method stub return itemIcon; //return icons[pass]; } }
[1.7.10] [Still needs help] Armor-Similar-to-Leather's Color isn't Changing
in Modder Support
Posted
EDIT 2:
I have been playing around with it, trying to find a way to recolor from there, but I haven't found one yet.
I wrote the method above just to see if I can use GL1 to recolor it; however, I think this method is called at the wrong time, I am not using GL1 correctly, or there is a better alternative.
EDIT 3:
Just a follow up, I tested if the functions are being called by creating a file with the word "test" in it, and, sure enough, when the entity is being rendered, the thread is run (but the color of the armor doesn't change).
EDIT 4:
Is there a forge event that is called that could simply change the color of the texture when the texture is first initialized?