Affichage d'armure buggé In-Game



  • Bonsoir, c'est encore moi. J'ai un problème. J'ai ajouté une nouvelle armure cependant la résolution des layers de l'armure sont plus grandes mais le jeux ne les agrandit pas donc je ne sais pas comment faire 😢

    EDIT : La taille des layers est de 256x512.

    Screen :
    :::

    :::

    Layers 1 :
    :::

    :::

    Layers 2 :
    :::

    :::

    Classe principale :
    :::

    ​package com.heartshadow.mod;
    
    import com.heartshadow.mod.admins.ItemCloud;
    import com.heartshadow.mod.admins.ItemElucidator;
    import com.heartshadow.mod.admins.ItemFrostmourne;
    import com.heartshadow.mod.admins.ItemMonado;
    import com.heartshadow.mod.admins.ItemZangetsu;
    import com.heartshadow.mod.armors.ItemDeldaArmor;
    import com.heartshadow.mod.armors.ItemEluArmor;
    import com.heartshadow.mod.blocks.BlockArkan;
    import com.heartshadow.mod.blocks.BlockDelda;
    import com.heartshadow.mod.blocks.OreArkan;
    import com.heartshadow.mod.blocks.OreDelda;
    import com.heartshadow.mod.items.ItemArkan;
    import com.heartshadow.mod.items.ItemDarkIron;
    import com.heartshadow.mod.items.ItemDarkStick;
    import com.heartshadow.mod.items.ItemDeldarium;
    import com.heartshadow.mod.proxy.CommonProxy;
    import com.heartshadow.mod.tools.ItemDeldaAxe;
    import com.heartshadow.mod.tools.ItemDeldaHoe;
    import com.heartshadow.mod.tools.ItemDeldaPickaxe;
    import com.heartshadow.mod.tools.ItemDeldaShovel;
    import com.heartshadow.mod.tools.ItemDeldaSword;
    import com.heartshadow.mod.world.DeldaGenerator;
    
    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.registry.GameRegistry;
    import net.minecraft.block.Block;
    import net.minecraft.block.material.Material;
    import net.minecraft.creativetab.CreativeTabs;
    import net.minecraft.init.Blocks;
    import net.minecraft.init.Items;
    import net.minecraft.item.Item;
    import net.minecraft.item.Item.ToolMaterial;
    import net.minecraft.item.ItemArmor.ArmorMaterial;
    import net.minecraft.item.ItemStack;
    import net.minecraftforge.common.util.EnumHelper;
    
    @Mod(modid = "hsmod", name = "HeartShadow MOD", version = "1.0.0")
    
    public class HSMOD
    {
    
        @Instance("hsmod")
        public static HSMOD instance;
    
        public static final String MODID = "hsmod";
    
        public static CreativeTabs HSCreativeTabs = new HSCreativeTabs("HSCreativeTabs");
    
        DeldaGenerator DeldaGenerator = new DeldaGenerator();
    
        //Admin
        public static Item monado;
        public static ToolMaterial admintool = EnumHelper.addToolMaterial("monatool", 2, 9999, 10.0F, 90.0F, 50);
        public static Item frostmourne;
        public static Item zangetsu;
        public static Item cloud;
    
        //Spécial
        public static Item elu;
        public static ToolMaterial elutool = EnumHelper.addToolMaterial("elutool", 2, 2500, 3.0F, 7.0F, 7);
        public static Item darkiron;
        public static Item darkstick;
        public static Item eluhelmet, eluchest, elulegs, eluboots;
        public static ArmorMaterial eluArmor = EnumHelper.addArmorMaterial("eluArmor", 32, new int[] {2, 7, 5, 3}, 13);
    
        //Deldarium
        public static Item itemDeldarium;
        public static Item swordDelda, pickaxeDelda, axeDelda, shovelDelda, hoeDelda;
        public static ToolMaterial toolDelda = EnumHelper.addToolMaterial("toolDelda", 2, 1374, 7.0F, 5.0F, 9);
        public static Block oreDelda;
        public static Item deldahelmet, deldachest, deldalegs, deldaboots;
        public static ArmorMaterial deldaArmor = EnumHelper.addArmorMaterial("deldaArmor", 38, new int[] {3, 6, 6, 3}, 10);
        public static Block blockDelda;
    
        //Arkanite
        public static Item itemArkan;
        public static Block oreArkan;
        public static Block blockArkan;
    
        @SidedProxy(clientSide = "com.heartshadow.mod.proxy.ClientProxy", serverSide = "com.heartshadow.mod.proxy.CommonProxy")
        public static CommonProxy proxy;
    
        @EventHandler
        public void preInit(FMLPreInitializationEvent event)
        {
            GameRegistry.registerWorldGenerator(new DeldaGenerator(), 0);
    
            //Admin
            monado = new ItemMonado(admintool).setUnlocalizedName("monado").setTextureName(HSMOD.MODID + ":monado").setCreativeTab(HSMOD.HSCreativeTabs);
            GameRegistry.registerItem(monado, "item_monado");
    
            frostmourne = new ItemFrostmourne(admintool).setUnlocalizedName("frostmourne").setTextureName(HSMOD.MODID + ":frostmourne").setCreativeTab(HSMOD.HSCreativeTabs);
            GameRegistry.registerItem(frostmourne, "item_frostmourne");
    
            zangetsu = new ItemZangetsu(admintool).setUnlocalizedName("zangetsu").setTextureName(HSMOD.MODID + ":zangetsu").setCreativeTab(HSMOD.HSCreativeTabs);
            GameRegistry.registerItem(zangetsu, "item_zangetsu");
    
            cloud = new ItemCloud(admintool).setUnlocalizedName("cloud").setTextureName(HSMOD.MODID + ":cloud").setCreativeTab(HSMOD.HSCreativeTabs);
            GameRegistry.registerItem(cloud, "item_cloud");
    
            //Spécial
            elu = new ItemElucidator(elutool).setUnlocalizedName("elu").setTextureName(HSMOD.MODID + ":elu").setCreativeTab(HSMOD.HSCreativeTabs);
            GameRegistry.registerItem(elu, "item_elu");
    
            darkiron = new ItemDarkIron().setUnlocalizedName("darkiron").setTextureName(HSMOD.MODID + ":darkiron").setCreativeTab(HSMOD.HSCreativeTabs);
            GameRegistry.registerItem(darkiron, "item_dark_iron");
    
            darkstick = new ItemDarkStick().setUnlocalizedName("darkstick").setTextureName(HSMOD.MODID + ":darkstick").setCreativeTab(HSMOD.HSCreativeTabs);
            GameRegistry.registerItem(darkstick, "item_dark_stick");
    
            eluhelmet = new ItemEluArmor(eluArmor, 0).setUnlocalizedName("eluhelmet").setTextureName(HSMOD.MODID + ":eluhelmet").setCreativeTab(HSMOD.HSCreativeTabs);
            GameRegistry.registerItem(eluhelmet, "item_elu_helmet");
            eluchest = new ItemEluArmor(eluArmor, 1).setUnlocalizedName("eluchest").setTextureName(HSMOD.MODID + ":eluchest").setCreativeTab(HSMOD.HSCreativeTabs);
            GameRegistry.registerItem(eluchest, "item_elu_chestplate");
            elulegs = new ItemEluArmor(eluArmor, 2).setUnlocalizedName("elulegs").setTextureName(HSMOD.MODID + ":elulegs").setCreativeTab(HSMOD.HSCreativeTabs);
            GameRegistry.registerItem(elulegs, "item_elu_leggings");
            eluboots = new ItemEluArmor(eluArmor, 3).setUnlocalizedName("eluboots").setTextureName(HSMOD.MODID + ":eluboots").setCreativeTab(HSMOD.HSCreativeTabs);
            GameRegistry.registerItem(eluboots, "item_elu_boots");
    
            //Deldarium
            swordDelda = new ItemDeldaSword(toolDelda).setUnlocalizedName("sworddelda").setTextureName(HSMOD.MODID + ":sworddelda").setCreativeTab(HSMOD.HSCreativeTabs);
            GameRegistry.registerItem(swordDelda,  "item_delda_sword");
    
            pickaxeDelda = new ItemDeldaPickaxe(toolDelda).setUnlocalizedName("pickaxedelda").setTextureName(HSMOD.MODID + ":pickaxedelda").setCreativeTab(HSMOD.HSCreativeTabs);
            GameRegistry.registerItem(pickaxeDelda,  "item_delda_pickaxe");
    
            axeDelda = new ItemDeldaAxe(toolDelda).setUnlocalizedName("axedelda").setTextureName(HSMOD.MODID + ":axedelda").setCreativeTab(HSMOD.HSCreativeTabs);
            GameRegistry.registerItem(axeDelda,  "item_delda_axe");
    
            shovelDelda = new ItemDeldaShovel(toolDelda).setUnlocalizedName("shoveldelda").setTextureName(HSMOD.MODID + ":shoveldelda").setCreativeTab(HSMOD.HSCreativeTabs);
            GameRegistry.registerItem(shovelDelda,  "item_delda_shovel");
    
            hoeDelda = new ItemDeldaHoe(toolDelda).setUnlocalizedName("hoedelda").setTextureName(HSMOD.MODID + ":hoedelda").setCreativeTab(HSMOD.HSCreativeTabs);
            GameRegistry.registerItem(hoeDelda,  "item_delda_hoe");
    
            itemDeldarium = new ItemDeldarium().setUnlocalizedName("deldarium").setTextureName(HSMOD.MODID + ":deldarium").setCreativeTab(HSMOD.HSCreativeTabs);
            GameRegistry.registerItem(itemDeldarium, "item_deldarium");
    
            oreDelda = new OreDelda(Material.rock).setBlockName("oredelda").setBlockTextureName(HSMOD.MODID + ":oredelda").setCreativeTab(HSMOD.HSCreativeTabs);
            GameRegistry.registerBlock(oreDelda, "ore_delda");
    
            blockDelda = new BlockDelda(Material.iron).setBlockName("blockdelda").setBlockTextureName(HSMOD.MODID + ":blockdelda").setCreativeTab(HSMOD.HSCreativeTabs);
            GameRegistry.registerBlock(blockDelda, "block_delda");
    
            deldahelmet = new ItemDeldaArmor(deldaArmor, 0).setUnlocalizedName("deldahelmet").setTextureName(HSMOD.MODID + ":deldahelmet").setCreativeTab(HSMOD.HSCreativeTabs);
            GameRegistry.registerItem(deldahelmet, "item_delda_helmet");
            deldachest = new ItemDeldaArmor(deldaArmor, 1).setUnlocalizedName("deldachest").setTextureName(HSMOD.MODID + ":deldachest").setCreativeTab(HSMOD.HSCreativeTabs);
            GameRegistry.registerItem(deldachest, "item_delda_chestplate");
            deldalegs = new ItemDeldaArmor(deldaArmor, 2).setUnlocalizedName("deldalegs").setTextureName(HSMOD.MODID + ":deldalegs").setCreativeTab(HSMOD.HSCreativeTabs);
            GameRegistry.registerItem(deldalegs, "item_delda_leggings");
            deldaboots = new ItemDeldaArmor(deldaArmor, 3).setUnlocalizedName("deldaboots").setTextureName(HSMOD.MODID + ":deldaboots").setCreativeTab(HSMOD.HSCreativeTabs);
            GameRegistry.registerItem(deldaboots, "item_delda_boots");
    
            //Arkanite
            itemArkan = new ItemArkan().setUnlocalizedName("arkanite").setTextureName(HSMOD.MODID + ":arkanite").setCreativeTab(HSMOD.HSCreativeTabs);
            GameRegistry.registerItem(itemArkan, "item_arkanite");
    
            oreArkan = new OreArkan(Material.rock).setBlockName("orearkan").setBlockTextureName(HSMOD.MODID + ":orearkan").setCreativeTab(HSMOD.HSCreativeTabs);
            GameRegistry.registerBlock(oreArkan,"ore_arkan");
    
            blockArkan = new BlockArkan(Material.iron).setBlockName("blockarkan").setBlockTextureName(HSMOD.MODID + ":blockarkan").setCreativeTab(HSMOD.HSCreativeTabs);
            GameRegistry.registerBlock(blockArkan, "block_arkan");
        }
    
        @EventHandler
        public void init(FMLInitializationEvent event)
        {
            proxy.registerRender();
    
            ///Deldarium
            GameRegistry.addRecipe(new ItemStack(swordDelda, 1), new Object[] {"X", "X", "Z", 'X', itemDeldarium, 'Z', Items.stick});
            GameRegistry.addRecipe(new ItemStack(pickaxeDelda, 1), new Object[] {"XXX", " Z ", " Z ", 'X', itemDeldarium, 'Z', Items.stick});
            GameRegistry.addRecipe(new ItemStack(axeDelda, 1), new Object[] {"XXX", "XZX", " Z ", 'X', itemDeldarium, 'Z', Items.stick});
            GameRegistry.addRecipe(new ItemStack(shovelDelda, 1), new Object[] {"X", "Z", "Z", 'X', itemDeldarium, 'Z', Items.stick});
            GameRegistry.addRecipe(new ItemStack(hoeDelda, 1), new Object[] {"XX ", " Z ", " Z ", 'X', itemDeldarium, 'Z', Items.stick});
            GameRegistry.addRecipe(new ItemStack(deldahelmet, 1), new Object[] {"XXX", "X X", 'X', itemDeldarium});
            GameRegistry.addRecipe(new ItemStack(deldachest, 1), new Object[] {"X X", "XXX", "XXX", 'X', itemDeldarium});
            GameRegistry.addRecipe(new ItemStack(deldalegs, 1), new Object[] {"XXX", "X X", "X X", 'X', itemDeldarium});
            GameRegistry.addRecipe(new ItemStack(deldaboots, 1), new Object[] {"X X", "X X", 'X', itemDeldarium});
            GameRegistry.addRecipe(new ItemStack(itemDeldarium, 9), new Object[] {"X", 'X', blockDelda});
            GameRegistry.addRecipe(new ItemStack(blockDelda, 1), new Object[] {"XXX", "XXX", "XXX", 'X', itemDeldarium});
            GameRegistry.addSmelting(oreDelda, new ItemStack(itemDeldarium, 1), 0.8F);
    
            //Arkanite
            GameRegistry.addSmelting(oreArkan, new ItemStack(itemArkan, 1), 1.5F);
            GameRegistry.addRecipe(new ItemStack(blockArkan, 1), new Object[] {"XXX", "XXX", "XXX", 'X', itemArkan});
            GameRegistry.addRecipe(new ItemStack(itemArkan, 9), new Object[] {"X", 'X', blockArkan});
    
            //Spécial
            GameRegistry.addRecipe(new ItemStack(darkiron, 1), new Object[] {"XZX", "ZXZ", "XZX", 'X', Blocks.coal_block, 'Z', Items.iron_ingot});
            GameRegistry.addRecipe(new ItemStack(darkstick, 1), new Object[] {"X", "X", "X", 'X', darkiron});
            GameRegistry.addRecipe(new ItemStack(elu, 1), new Object[] {"X", "X", "Z", 'X', darkiron, 'Z', darkstick});
            GameRegistry.addRecipe(new ItemStack(deldahelmet, 1), new Object[] {"XXX", "X X", 'X', darkiron});
            GameRegistry.addRecipe(new ItemStack(deldachest, 1), new Object[] {"X X", "XXX", "XXX", 'X', darkiron});
            GameRegistry.addRecipe(new ItemStack(deldalegs, 1), new Object[] {"XXX", "X X", "X X", 'X', darkiron});
            GameRegistry.addRecipe(new ItemStack(deldaboots, 1), new Object[] {"X X", "X X", 'X', darkiron});
    
        }
    
        @EventHandler
        public void postInit(FMLPostInitializationEvent event)
        {
    
        }
    }
    

    :::

    Classe Armure :
    :::

    ​package com.heartshadow.mod.armors;
    
    import com.heartshadow.mod.HSMOD;
    
    import net.minecraft.entity.Entity;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.item.ItemArmor;
    import net.minecraft.item.ItemStack;
    import net.minecraft.potion.Potion;
    import net.minecraft.world.World;
    
    public class ItemEluArmor extends ItemArmor
    {
    
        public ItemEluArmor(ArmorMaterial material_, int type)
        {
            super(material_, 0, type);
        }   
    
        public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
        {
            if(slot == 2)
            {
                return HSMOD.MODID + ":textures/models/armor/elu_layer_2.png";
            }
            return HSMOD.MODID + ":textures/models/armor/elu_layer_1.png";
        }
    
        public boolean getIsRepairable(ItemStack input, ItemStack repair)
        {
            if(repair.getItem() == HSMOD.darkiron)
            {
                return true;
            }
            return false;
        }
    }
    

    :::

    Merci à vous !


  • Administrateurs

    Tes textures ne respectent pas du tout le modèle de Minecraft. Pas étonnant que ça ne fonctionne pas correctement.



  • Bizarre, je tire les textures d'un modpack 1.7, je ne les ai pas modifié 😕


  • Administrateurs

    Prends celle de Minecraft, tu verra qu'elles n'ont pas du tout la même forme.
    Le modpack en question utilise surement un modèle d'armure custom.



  • D'accord merci !


Log in to reply