Jump to content

[1.6.4] Armour textures not working


Creeoer

Recommended Posts

Hello, for some reason my armour textures dont seem to be working right, but the texture for the leggings work jsut fine..any help as to why it wont work would be appreciated, heres my code:

 

Armour Class:

 

package Creeoer.NetherArmour.items;

 

import Creeoer.NetherArmour.NetherArmour;

import Creeoer.NetherArmour.NetherArmourInfo;

import net.minecraft.client.renderer.texture.IconRegister;

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.entity.Entity;

import net.minecraft.item.EnumArmorMaterial;

import net.minecraft.item.ItemArmor;

import net.minecraft.item.ItemStack;

 

public class AaronZiteArmor extends ItemArmor {

 

public AaronZiteArmor(int par1, EnumArmorMaterial par2EnumArmorMaterial,

int par3, int par4, String string) {

super(par1, par2EnumArmorMaterial, par3, par4);

this.material = par2EnumArmorMaterial;

par2EnumArmorMaterial.getDamageReductionAmount(par4);

this.setMaxDamage(par2EnumArmorMaterial.getDurability(par4));

this.maxStackSize = 1;

this.setCreativeTab(CreativeTabs.tabCombat);

armorNamePrefix = armorNamePrefix;

 

}

public String armorNamePrefix;

public EnumArmorMaterial material;

 

public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) {

if(stack.toString().contains("leggings")) {

return "NetherArmour:" + armorNamePrefix + "AaronZiteLeggings" ;

}

if(stack.toString().contains("Leggings")) if(itemID == NetherArmour.AaronZiteLeggings.itemID){

  return "NetherArmour:" + armorNamePrefix + "AaronZiteLeggings";

}

return armorNamePrefix;

 

 

}

public String getArmorTexture1(ItemStack stack, Entity entity, int slot, int layer) {

if(stack.toString().contains("helmet")) {

return "NetherArmour:" + armorNamePrefix + "AaronZiteHelmet" ;

}

if(stack.toString().contains("Helmet")) if(itemID == NetherArmour.AaronZiteHelmet.itemID){

  return "NetherArmour:" + armorNamePrefix + "AaronZiteHelmet";

}

    return "NetherArmour:" + armorNamePrefix + "AaronZiteLeggings";

}

public void registerIcons(IconRegister par1iconRegister){

if(itemID == NetherArmour.AaronZiteHelmet.itemID) {

itemIcon = par1iconRegister.registerIcon("NetherArmour:AaronZiteHelmet");

setTextureName(NetherArmourInfo.NAME.toLowerCase() + ":AaronZiteHelmet");

}if(itemID == NetherArmour.AaronZiteChestplate.itemID) {

itemIcon = par1iconRegister.registerIcon("NetherArmour:AaronZiteChestplate");

setTextureName(NetherArmourInfo.NAME.toLowerCase() + ":AaronZiteChestplate");

    }if(itemID == NetherArmour.AaronZiteLeggings.itemID) {

itemIcon = par1iconRegister.registerIcon(NetherArmourInfo.NAME.toLowerCase() + ":AaronZiteLeggings");

setTextureName(NetherArmourInfo.NAME.toLowerCase() + ":AaronZiteLeggings");

        }if(itemID == NetherArmour.AaronZiteBoots.itemID) {

itemIcon = par1iconRegister.registerIcon("NetherArmour:AaronZiteBoots");

            setTextureName(NetherArmourInfo.NAME.toLowerCase() + ":AaronZiteBoots");

}

}

}

 

 

 

Main Class:

 

package Creeoer.NetherArmour;

 

 

 

import net.minecraft.block.Block;

import net.minecraft.block.material.Material;

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.item.EnumArmorMaterial;

import net.minecraft.item.EnumToolMaterial;

import net.minecraft.item.Item;

import net.minecraft.item.ItemStack;

import net.minecraft.potion.Potion;

import net.minecraft.potion.PotionEffect;

import net.minecraftforge.common.EnumHelper;

import net.minecraftforge.common.MinecraftForge;

import Creeoer.NetherArmour.CommonProxy;

import Creeoer.NetherArmour.blocks.AaronTreeLeaf;

import Creeoer.NetherArmour.blocks.AaronTreeLog;

import Creeoer.NetherArmour.blocks.AaronZiteBlock;

import Creeoer.NetherArmour.blocks.AaronZiteOre;

import Creeoer.NetherArmour.items.AaronZite;

import Creeoer.NetherArmour.items.AaronZiteArmor;

import Creeoer.NetherArmour.items.AaronZiteSword;

import cpw.mods.fml.common.Mod;

import cpw.mods.fml.common.Mod.EventHandler;

import cpw.mods.fml.common.Mod.Instance;

import cpw.mods.fml.common.SidedProxy;

import cpw.mods.fml.common.event.FMLInitializationEvent;

import cpw.mods.fml.common.event.FMLPostInitializationEvent;

import cpw.mods.fml.common.event.FMLPreInitializationEvent;

import cpw.mods.fml.common.network.NetworkMod;

import cpw.mods.fml.common.registry.GameRegistry;

import cpw.mods.fml.common.registry.LanguageRegistry;

 

@Mod(modid=NetherArmourInfo.ID, name=NetherArmourInfo.NAME, version=NetherArmourInfo.VERS)

@NetworkMod(clientSideRequired=true, serverSideRequired=false)

public class NetherArmour {

 

//EnumToolMaterial

public static EnumArmorMaterial AaronZiteArmor = EnumHelper.addArmorMaterial("AaronZitearmor",55, new int[]{6,9,9,6}, 30);

public static EnumToolMaterial AaronZiteTools = EnumHelper.addToolMaterial("AaronZitetools", 3, 1600, 12.5F, 8.0F, 22);

 

 

//Tools

public final Item aaronZiteSword = new AaronZiteSword(5005, AaronZiteTools).setCreativeTab(CreativeTabs.tabCombat).setUnlocalizedName("AaronZiteSword").setTextureName(NetherArmourInfo.NAME.toLowerCase() + ":AaronZiteSword");

//Other

public final static Block AaronTreeLog = new AaronTreeLog(3999, Material.wood);

public final static Block AaronZiteBlock = new AaronZiteBlock(3995, Material.ground). setHardness(4.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("AaronZiteBlock").setCreativeTab(CreativeTabs.tabBlock).setTextureName(NetherArmourInfo.NAME.toLowerCase() + ":AaronZiteBlock");

    public final static Block AaronZiteOre = new AaronZiteOre(3996, Material.rock);

public final static Item AaronZite = new AaronZite(3998);

    public final static Block AaronTreeLeaf = new AaronTreeLeaf(3997, Material.leaves);

 

    //Armor

    public static Item AaronZiteHelmet = new AaronZiteArmor(5006, AaronZiteArmor, 0, 0, "AaronZite").setUnlocalizedName("AaronZiteHelmet");

    public static Item AaronZiteChestplate = new AaronZiteArmor(5007, AaronZiteArmor, 0, 1, "AaronZite").setUnlocalizedName("AaronZiteChestplate");

    public static Item AaronZiteLeggings = new AaronZiteArmor(5008, AaronZiteArmor, 0, 2, "AaronZite").setUnlocalizedName("AaronZiteLeggings");

    public static Item AaronZiteBoots = new AaronZiteArmor(5009, AaronZiteArmor, 0, 3, "AaronZite").setUnlocalizedName("AaronZiteBoots");

    EventManager oreManager = new EventManager();

   

    TreeManager treemangager = new TreeManager();

 

        // The instance of your mod that Forge uses.

        @Instance("NetherArmour")

        public static NetherArmour instance;

       

        // Says where the client and server 'proxy' code is loaded.

        @SidedProxy(clientSide=NetherArmourInfo.CLIENTPROXY + "ClientProxy" , serverSide=NetherArmourInfo.COMMONPROXY + "CommonProxy")

        public static CommonProxy proxy;

       

        @EventHandler

        public void preInit(FMLPreInitializationEvent event) {

                // Stub Method

        }

       

        @EventHandler

        public void load(FMLInitializationEvent event) {

                proxy.registerRenderers();

                ItemStack dirtstack = new ItemStack(Block.dirt);

                ItemStack diamondstack = new ItemStack(Item.diamond, 64);

                ItemStack blackWoolStack = new ItemStack(Block.cloth, 10, 15);

                ItemStack stoneStack = new ItemStack(1, 32, 0);

                ItemStack gravelstack = new ItemStack(Block.gravel);

              //Registration for Blocks

              GameRegistry.registerBlock(AaronZiteBlock, "AaronZiteBlock");

              LanguageRegistry.addName(AaronZiteBlock, "AaronZite Block"); 

              MinecraftForge.setBlockHarvestLevel(AaronZiteBlock, "pickaxe", 3);

              GameRegistry.registerBlock(AaronTreeLeaf, "AaronTreeLeaf");

              LanguageRegistry.addName(AaronTreeLeaf, "Aaron Tree Leaf");

              GameRegistry.registerBlock(AaronTreeLog, "AaronTreeLog");

              LanguageRegistry.addName(AaronTreeLog, "Aaron Tree Log");

              GameRegistry.registerBlock(AaronZiteOre, "AaronZiteOre");

              LanguageRegistry.addName(AaronZiteOre, "AaronZite Ore");

              MinecraftForge.setBlockHarvestLevel(AaronZiteBlock, "picaxe", 3);

              //Registration for Items

              GameRegistry.registerItem(AaronZite, "AaronZite");

              LanguageRegistry.addName(AaronZite, "AaronZite");

              //Registration for ermm Managers

              GameRegistry.registerWorldGenerator(oreManager);

              GameRegistry.registerWorldGenerator(treemangager);

              //Registration for Tools

 

              GameRegistry.registerItem(aaronZiteSword, "AaronZiteSword");

              LanguageRegistry.addName(aaronZiteSword, "AaronZite Sword");

              //Registration for Armour

              LanguageRegistry.addName(AaronZiteHelmet, "AaronZite Helmet");

              LanguageRegistry.addName(AaronZiteChestplate,"AaronZite ChestPlate");

              LanguageRegistry.addName(AaronZiteLeggings,"AaronZite Leggings");

              LanguageRegistry.addName(AaronZiteBoots,"AaronZite Boots");

              //Crafting Item Stacks

              ItemStack aaronziteStack = new ItemStack(NetherArmour.AaronZite);

             

              ItemStack blazeRodStack = new ItemStack(Item.blazeRod);

              //Crafting for items

              GameRegistry.addRecipe(new ItemStack (aaronZiteSword), " x", " x"," y", 'x', aaronziteStack, 'y', blazeRodStack);

             

             

              //Crafting for Armour

              GameRegistry.addRecipe(new ItemStack (AaronZiteChestplate), "x x", "xxx","xxx", 'x', aaronziteStack);

              GameRegistry.addRecipe(new ItemStack (AaronZiteHelmet), "xxx", "x x", 'x', aaronziteStack);

              GameRegistry.addRecipe(new ItemStack (AaronZiteBoots), "x x", "x x", 'x', aaronziteStack);

              GameRegistry.addRecipe(new ItemStack (AaronZiteLeggings), "xxx", "x x","x x",'x', aaronziteStack);

              //Crafting for blocks

              GameRegistry.addRecipe(new ItemStack (AaronZiteBlock), " xxx", " xxx"," xxx", 'x', aaronziteStack);

             

           

           

        }

       

        @EventHandler

        public void postInit(FMLPostInitializationEvent event) {

         

        }

     

}

 

Link to comment
Share on other sites

armorNamePrefix = armorNamePrefix; ?

 

Really?

 

Do you ever initialize that variable to anything?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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.



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • !warudo.isClientSide() still not a gui not an error just a simple message [06:44:39] [Render thread/WARN] [minecraft/MenuScreens]: Failed to create screen for menu type: mercmod:gem_polishing_menu Not a hint of what the problem is  this silent simple error dont tell much about the problem the code i made don't show errors highlighted   in mi old code 1.19.4 i launch the menu part from client side  but now i recheck the video and kapenjoe does it server side         
    • Hey, for getting your model to show up in Forge, double-check the way you've set up your model registration. Sometimes, it's just a tiny mix-up with where you've put your model file or maybe missing the right event to hook it up. Also, peek at your @Mod.EventBusSubscriber setup; it's gotta be listening in the right place. And don't forget to place your model file in the exact right spot with the correct naming. If in doubt, the Forge docs or forum threads can be super helpful.
    • Since flying mobs like bees and flies aren't affected, the problem likely lies with how ground mob AI interacts with the server environment. Checking the server logs, as you've done, is a good step. You might want to look for errors related to mob AI or pathfinding. Consider removing or updating mods one at a time to isolate the issue. Additionally, ensure your server's performance isn't being overly taxed by the modpack, as this can sometimes lead to unusual behavior with entity AI.
    • I'm having the same issue rn. Hostile mobs wont move until attacked but peaceful land mobs wont move at all. If it swims or flies its unaffected until it touches blocks.
    • Im trying to register model for my item but it doesn't works. First I Created a class where i declared all my items.   public class ModItems { public static final List<Item> ITEMS = new ArrayList<Item>(); public static final Item MY_ITEM = new MyItemClass(); } Then I created the MyItemClass where i describe my item. public class MyItemClass extends Item { public MyItemClass() { this.setRegistryName("my_item"); this.setUnlocalizedName("my_item"); this.setCreativeTab(CreativeTabs.COMBAT); ModItems.ITEMS.add(this); } } And The i created a class where i was trying register the model and where i registered my item @Mod.EventBusSubscriber public class EventsHandler { @SubscribeEvent public void registerItems(RegistryEvent.Register<Item> event) { event.getRegistry().register(new MyItemClass()); } @SubscribeEvent @SideOnly(Side.CLIENT) public static void onRegistryModel(ModelRegistryEvent event) { registryModel(new MyItemClass()); } @SideOnly(Side.CLIENT) private static void registryModel(Item item) { final ResourceLocation regName = item.getRegistryName(); final ModelResourceLocation mr1 = new ModelResourceLocation(regName, "inventory"); ModelBakery.registerItemVariants(item, mr1); ModelLoader.setCustomModelResourceLocation(item, 0, mr1); } } The registerItems method just registers my items. Then im catching ModelRegistryEvent to register my model. And in the last private method im registering models. In The game iitem still has purple-black cube instead of texture. I dont forgot to create the models\item folder and my_item.json file im sorry if this text has a grammatical errors. My english is very low  
  • Topics

×
×
  • Create New...

Important Information

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