Jump to content

AshIndigo

Members
  • Posts

    40
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

AshIndigo's Achievements

Tree Puncher

Tree Puncher (2/8)

2

Reputation

  1. 735 lines Is your code all in one class??? Jesus
  2. Check your profile for forge first and make sure it is on an applicable forge version and if need be reinstall forge
  3. Kind of late but I have some form of internet now so I'll just leave this here. First of all update to the latest forge otherwise this may not work at all. 1st step: Set your color somewhere using ItemArmor#setColor 2nd step: Override hasOverlay, hasColor, setColor, and getColor to remove the ArmorMaterial.LEATHER check which will let you supply your own stats. 3rd step: Override getArmorTexture but you have to supply a different texture based on the type string. (I wont be supplying direct code but if something is confusing let me know)
  4. 1.7.10 isn't supported update to 1.10.2 then ask.
  5. I managed to get it working while I didn't have internet so I'll just mark it as solved.
  6. ((ItemArmor) result.getItem()).setColor(result, 25555555); I completely forgot that existed. And for setColor I'm just setting the material to ItemArmor.ArmorMaterial.LEATHER for now. I'll override right now.
  7. My IRecipe class also contains code for the recipes for other items which aren't relevant to the armor so I just posted the main part where the NBT is set. if (invCraft.getStackInSlot(0).getItem() == AlloycraftItems.alloy) { if (invCraft.getStackInSlot(1).getItem() == AlloycraftItems.alloy) { if (invCraft.getStackInSlot(2).getItem() == AlloycraftItems.alloy) { if (invCraft.getStackInSlot(3).getItem() == AlloycraftItems.alloy) { if (invCraft.getStackInSlot(5).getItem() == AlloycraftItems.alloy) { ItemStack alloy1 = invCraft.getStackInSlot(0); ItemStack alloy2 = invCraft.getStackInSlot(1); ItemStack alloy3 = invCraft.getStackInSlot(2); ItemStack alloy4 = invCraft.getStackInSlot(3); ItemStack alloy5 = invCraft.getStackInSlot(5); int prop1 = (int) Math.sqrt(alloy1.getTagCompound().getInteger("Strength") + alloy2.getTagCompound().getInteger("Strength") + alloy3.getTagCompound().getInteger("Strength") + alloy4.getTagCompound().getInteger("Strength") + alloy5.getTagCompound().getInteger("Strength")); int prop2 = (int) Math.sqrt(alloy1.getTagCompound().getInteger("Durability") + alloy2.getTagCompound().getInteger("Durability") + alloy3.getTagCompound().getInteger("Durability") + alloy4.getTagCompound().getInteger("Durability") + alloy5.getTagCompound().getInteger("Durability")); int prop3 = (int) Math.sqrt(alloy1.getTagCompound().getInteger("Enchantability") + alloy2.getTagCompound().getInteger("Enchantability") + alloy3.getTagCompound().getInteger("Enchantability") + alloy4.getTagCompound().getInteger("Enchantability") + alloy5.getTagCompound().getInteger("Enchantability")); result = new ItemStack(AlloycraftItems.alloyhelmet, 1); ((ItemArmor) result.getItem()).setColor(result, 25555555); result.setTagCompound(new NBTTagCompound()); result.getTagCompound().setInteger("Strength", prop1); result.getTagCompound().setInteger("Durability", prop2); result.getTagCompound().setInteger("Enchantability", prop3); ((ItemArmor) result.getItem()).setColor(result, new Color(result.getTagCompound().getInteger("Strength"), result.getTagCompound().getInteger("Durability"), result.getTagCompound().getInteger("Enchantability")).getRGB()); return result; } } } } }
  8. I do have recipes in my IRecipe class which will set the tag for the three integers.
  9. I'm probably missing something here but I've been calling setColor in onCreated. Should I b calling it on the client only? ((ItemArmor) stack.getItem()).setColor(stack, new Color(stack.getTagCompound().getInteger("Strength"), stack.getTagCompound().getInteger("Durability"), stack.getTagCompound().getInteger("Enchantability")).getRGB());
  10. I had this issue to when trying to update forge to 1.10.2 and I was able to fix it by entering this command into my cmd prompt set JAVA_HOME="(put your jdk dir here)"
  11. Can you post your new code and json files?
  12. Just learned that EnumChatFormatting doesnt exist anymore after trying to find it, it's now called TextFormatting.
  13. I'm using ItemArmor#setColor in the onCreated method, and I just overrode hasColor and made it return true. But the armor stays the same with no color. Should I just be creating the display and color tag myself instead of using vanilla methods to do it?
  14. So I want to make custom dyeable armor i.e leather armor but whenever I try to set the color with Item#onCreated the armor stays white with seemingly no overlay. Here is my code package com.ashindigo.alloycraft.items; import java.awt.Color; import java.util.List; import com.ashindigo.alloycraft.AlloycraftMain; import com.ashindigo.utils.UtilsArmor; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.Item; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.fml.relauncher.Side; // TODO Add wearing color public class AlloyArmor extends ItemArmor { public AlloyArmor(String name, ArmorMaterial material, EntityEquipmentSlot type, String modid) { super(ItemArmor.ArmorMaterial.LEATHER, 0, type); setCreativeTab(AlloycraftMain.alloycrafttab); GameRegistry.register(this, new ResourceLocation(modid, name)); maxStackSize = 1; this.setUnlocalizedName(modid + "_" + name); } @Override public void onCreated(ItemStack stack, World world, EntityPlayer player) { // stack.getTagCompound().getInteger("Strength"), stack.getTagCompound().getInteger("Durability"), stack.getTagCompound().getInteger("Enchantability") ((ItemArmor) stack.getItem()).setColor(stack, new Color( stack.getTagCompound().getInteger("Strength"), stack.getTagCompound().getInteger("Durability"), stack.getTagCompound().getInteger("Enchantability")).getRGB()); if ( ((ItemArmor) stack.getItem()).hasOverlay(stack)) // Allow this for anything, not only cloth { int i = ((ItemArmor) stack.getItem()).getColor(stack); float f = (float)(i >> 16 & 255) / 255.0F; float f1 = (float)(i >> 8 & 255) / 255.0F; float f2 = (float)(i & 255) / 255.0F; System.out.println("Has Overlay!"); System.out.println(f); System.out.println(f1); System.out.println(f2); } System.out.println(this.getColor(stack)); if (stack.getTagCompound() == null) { stack.setTagCompound(new NBTTagCompound()); stack.getTagCompound().setInteger("Durability", 0); stack.getTagCompound().setInteger("Enchantability", 0); stack.getTagCompound().setInteger("Strength", 0); } } public void addInformation(ItemStack itemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { if (itemStack.getTagCompound() != null) { par3List.add("§4Strength: §7" + Integer.toString(itemStack.getTagCompound().getInteger("Strength"))); par3List.add("§2Durability: §7" + Integer.toString(itemStack.getTagCompound().getInteger("Durability"))); par3List.add("§1Enchantability: §7" + Integer.toString(itemStack.getTagCompound().getInteger("Enchantability"))); } } @Override public String getArmorTexture(ItemStack stack, Entity entity, EntityEquipmentSlot slot, String type) { return "textures/models/armor/" + "leather_layer" + "_" + (armorType.getSlotIndex() == 2 ? "2" : "1") + ".png"; } /* @Override public boolean hasOverlay(ItemStack stack) { return true; } */ }
  15. Bump? I don't know if I need a custom renderer for this...
×
×
  • Create New...

Important Information

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