Problème Hache



  • Bonjour je viens de créer un kit d'outils en 1.12 et pour une raison inconnue la création de mes haches me fait crash le jeu à l'initialisiation (sans mon mod fonctionne très bien )

    Je vous met ci-dessous mes logs

    –-- Minecraft Crash Report ----
    // There are four lights!
    
    Time: 10/26/17 9:58 AM
    Description: There was a severe problem during mod loading that has caused the game to fail
    
    net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Mineprove (simpleores)
    Caused by: java.lang.ExceptionInInitializerError
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at net.minecraftforge.fml.common.AutomaticEventSubscriber.inject(AutomaticEventSubscriber.java:81)
    at net.minecraftforge.fml.common.FMLModContainer.constructMod(FMLModContainer.java:608)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)
    at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)
    at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)
    at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)
    at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)
    at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)
    at com.google.common.eventbus.EventBus.post(EventBus.java:217)
    at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:252)
    at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:230)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)
    at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)
    at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)
    at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)
    at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)
    at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)
    at com.google.common.eventbus.EventBus.post(EventBus.java:217)
    at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:147)
    at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:570)
    at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:227)
    at net.minecraft.client.Minecraft.init(Minecraft.java:508)
    at net.minecraft.client.Minecraft.run(Minecraft.java:416)
    at net.minecraft.client.main.Main.main(Main.java:118)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
    at GradleStart.main(GradleStart.java:26)
    Caused by: java.lang.ArrayIndexOutOfBoundsException: 5
    at net.minecraft.item.ItemAxe.<init>(ItemAxe.java:19)
    at fr.priya.simpleores.items.tools.CopperAxe.<init>(CopperAxe.java:13)
    at fr.priya.simpleores.init.ItemsInit.<clinit>(ItemsInit.java:75)
    ... 46 more
    
    A detailed walkthrough of the error, its code path and all known details is as follows:
    ---------------------------------------------------------------------------------------
    
    -- System Details --
    Details:
    Minecraft Version: 1.12
    Operating System: Windows 10 (amd64) version 10.0
    Java Version: 1.8.0_131, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 810784592 bytes (773 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)
    JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
    FML: MCP 9.40 Powered by Forge 14.21.1.2387 5 mods loaded, 5 mods active
    States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
    UC minecraft{1.12} [Minecraft] (minecraft.jar)
    UC mcp{9.19} [Minecraft Coder Pack] (minecraft.jar)
    UC FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.12-14.21.1.2387.jar)
    UC forge{14.21.1.2387} [Minecraft Forge] (forgeSrc-1.12-14.21.1.2387.jar)
    UE simpleores{1.0 - MC 1.12} [Mineprove] (bin)
    Loaded coremods (and transformers):
    GL info: ' Vendor: 'Intel' Version: '4.4.0 - Build 21.20.16.4475' Renderer: 'Intel(R) HD Graphics 500'
    

    Ma classe d'initialisation des items

    package fr.priya.simpleores.init;
    
    import fr.priya.simpleores.Reference;
    import fr.priya.simpleores.items.Corn;
    import fr.priya.simpleores.items.Ingot;
    import fr.priya.simpleores.items.armor.AmnethysteArmor;
    import fr.priya.simpleores.items.armor.CopperArmor;
    import fr.priya.simpleores.items.armor.RubisArmor;
    import fr.priya.simpleores.items.armor.SaphirArmor;
    import fr.priya.simpleores.items.armor.TinArmor;
    import fr.priya.simpleores.items.tools.CopperAxe;
    import fr.priya.simpleores.items.tools.CopperHoe;
    import fr.priya.simpleores.items.tools.CopperPickaxe;
    import fr.priya.simpleores.items.tools.CopperShovel;
    import fr.priya.simpleores.items.tools.CopperSword;
    import net.minecraft.client.renderer.block.model.ModelResourceLocation;
    import net.minecraft.init.Blocks;
    import net.minecraft.inventory.EntityEquipmentSlot;
    import net.minecraft.item.Item;
    import net.minecraft.item.Item.ToolMaterial;
    import net.minecraft.item.ItemSeeds;
    import net.minecraftforge.client.event.ModelRegistryEvent;
    import net.minecraftforge.client.model.ModelLoader;
    import net.minecraftforge.common.util.EnumHelper;
    import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
    import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
    import net.minecraftforge.fml.relauncher.Side;
    import net.minecraftforge.fml.relauncher.SideOnly;
    @EventBusSubscriber(value = Side.CLIENT, modid = Reference.MODID)
    
    public class ItemsInit {
    public static final Item COPPER_INGOT = new Ingot("copper_ingot");
    public static final Item TIN_INGOT = new Ingot("tin_ingot");
    public static final Item AMNETHYSTE = new Ingot("amnethyste");
    public static final Item RUBIS = new Ingot("rubis");
    public static final Item SAPHIR = new Ingot("saphir");
    public static final Item PAIN = new Ingot("pain");
    public static final Item CORN_SEED = new ItemSeeds(CropsInit.CORN_CROP, Blocks.FARMLAND).setRegistryName("corn_seed").setUnlocalizedName("corn_seed");
    public static final Item CORN = new Corn(3,2F,false).setRegistryName("corn").setUnlocalizedName("corn");
    //public static final Item APPLE_CAKE_ITEM = new ItemBlock(CropsInit.APPLE_CAKE).setRegistryName(CropsInit.APPLE_CAKE.getRegistryName());
    public static final Item RICE = new Ingot("rice");
        public static final Item COPPER_HELMET = new CopperArmor(EntityEquipmentSlot.HEAD).setRegistryName("copper_helmet").setUnlocalizedName("copper_helmet");
        public static final Item COPPER_CHESTPLATE = new CopperArmor(EntityEquipmentSlot.CHEST).setRegistryName("copper_chestplate").setUnlocalizedName("copper_chestplate");
        public static final Item COPPER_LEGGINGS = new CopperArmor(EntityEquipmentSlot.LEGS).setRegistryName("copper_leggings").setUnlocalizedName("copper_leggings");
        public static final Item COPPER_BOOTS = new CopperArmor(EntityEquipmentSlot.FEET).setRegistryName("copper_boots").setUnlocalizedName("copper_boots");
    
        public static final Item AMNETHYSTE_HELMET = new AmnethysteArmor(EntityEquipmentSlot.HEAD).setRegistryName("amnethyste_helmet").setUnlocalizedName("amnethyste_helmet");
        public static final Item AMNETHYSTE_CHESTPLATE = new AmnethysteArmor(EntityEquipmentSlot.CHEST).setRegistryName("amnethyste_chestplate").setUnlocalizedName("amnethyste_chestplate");
        public static final Item AMNETHYSTE_LEGGINGS = new AmnethysteArmor(EntityEquipmentSlot.LEGS).setRegistryName("amnethyste_leggings").setUnlocalizedName("amnethyste_leggings");
        public static final Item AMNETHYSTE_BOOTS = new AmnethysteArmor(EntityEquipmentSlot.FEET).setRegistryName("amnethyste_boots").setUnlocalizedName("amnethyste_boots");
    
        public static final Item TIN_HELMET = new TinArmor(EntityEquipmentSlot.HEAD).setRegistryName("tin_helmet").setUnlocalizedName("tin_helmet");
        public static final Item TIN_CHESTPLATE = new TinArmor(EntityEquipmentSlot.CHEST).setRegistryName("tin_chestplate").setUnlocalizedName("tin_chestplate");
        public static final Item TIN_LEGGINGS = new TinArmor(EntityEquipmentSlot.LEGS).setRegistryName("tin_leggings").setUnlocalizedName("tin_leggings");
        public static final Item TIN_BOOTS = new TinArmor(EntityEquipmentSlot.FEET).setRegistryName("tin_boots").setUnlocalizedName("tin_boots");
    
        public static final Item RUBIS_HELMET = new RubisArmor(EntityEquipmentSlot.HEAD).setRegistryName("rubis_helmet").setUnlocalizedName("rubis_helmet");
        public static final Item RUBIS_CHESTPLATE = new RubisArmor(EntityEquipmentSlot.CHEST).setRegistryName("rubis_chestplate").setUnlocalizedName("rubis_chestplate");
        public static final Item RUBIS_LEGGINGS = new RubisArmor(EntityEquipmentSlot.LEGS).setRegistryName("rubis_leggings").setUnlocalizedName("rubis_leggings");
        public static final Item RUBIS_BOOTS = new RubisArmor(EntityEquipmentSlot.FEET).setRegistryName("rubis_boots").setUnlocalizedName("rubis_boots");
    
        public static final Item SAPHIR_HELMET = new SaphirArmor(EntityEquipmentSlot.HEAD).setRegistryName("saphir_helmet").setUnlocalizedName("saphir_helmet");
        public static final Item SAPHIR_CHESTPLATE = new SaphirArmor(EntityEquipmentSlot.CHEST).setRegistryName("saphir_chestplate").setUnlocalizedName("saphir_chestplate");
        public static final Item SAPHIR_LEGGINGS = new SaphirArmor(EntityEquipmentSlot.LEGS).setRegistryName("saphir_leggings").setUnlocalizedName("saphir_leggings");
        public static final Item SAPHIR_BOOTS = new SaphirArmor(EntityEquipmentSlot.FEET).setRegistryName("saphir_boots").setUnlocalizedName("saphir_boots");
    
        public static ToolMaterial toolcopper = EnumHelper.addToolMaterial("toolcopper", 1, 199, 8.0F, 4.0F, 18);
        public static ToolMaterial tooltin = EnumHelper.addToolMaterial("tooltin", 1, 249, 8.0F, 5.0F, 18);
        public static ToolMaterial toolrubis = EnumHelper.addToolMaterial("toolrubis", 2, 299, 10.0F, 8.0F, 30);
        public static ToolMaterial toolamnethyste = EnumHelper.addToolMaterial("toolamnethyste", 2, 399, 10.0F, 9.0F, 18);
        public static ToolMaterial toolsaphir = EnumHelper.addToolMaterial("toolsaphir", 2, 399, 10.0F, 9.0F, 18);
    
        public static final Item COPPER_SWORD = new CopperSword("copper_sword", toolcopper);
        public static final Item COPPER_AXE = new CopperHoe("copper_axe", toolcopper);
        public static final Item COPPER_HOE = new CopperHoe("copper_hoe", toolcopper);
        public static final Item COPPER_PICKAXE = new CopperPickaxe("copper_pickaxe", toolcopper);
        public static final Item COPPER_SHOVEL = new CopperShovel("copper_shovel", toolcopper);
    
        public static final Item SAPHIR_SWORD = new CopperSword("saphir_sword", toolsaphir);
        public static final Item SAPHIR_AXE = new CopperAxe("saphir_axe", toolsaphir);
        public static final Item SAPHIR_HOE = new CopperHoe("saphir_hoe", toolsaphir);
        public static final Item SAPHIR_PICKAXE = new CopperPickaxe("saphir_pickaxe", toolsaphir);
        public static final Item SAPHIR_SHOVEL = new CopperShovel("saphir_shovel", toolsaphir);
    
        public static final Item AMNETHYSTE_SWORD = new CopperSword("amnethyste_sword", toolamnethyste);
        public static final Item AMNETHYSTE_AXE = new CopperAxe("amnethyste_axe", toolamnethyste);
        public static final Item AMNETHYSTE_HOE = new CopperHoe("amnethyste_hoe", toolamnethyste);
        public static final Item AMNETHYSTE_PICKAXE = new CopperPickaxe("amnethyste_pickaxe", toolamnethyste);
        public static final Item AMNETHYSTE_SHOVEL = new CopperShovel("amnethyste_shovel", toolamnethyste);
    
        public static final Item TIN_SWORD = new CopperSword("tin_sword", tooltin);
        public static final Item TIN_AXE = new CopperAxe("tin_axe", tooltin);
        public static final Item TIN_HOE = new CopperHoe("tin_hoe", tooltin);
        public static final Item TIN_PICKAXE = new CopperPickaxe("tin_pickaxe", tooltin);
        public static final Item TIN_SHOVEL = new CopperShovel("tin_shovel", tooltin);
    
        public static final Item RUBIS_SWORD = new CopperSword("rubis_sword", toolrubis);
        public static final Item RUBIS_AXE = new CopperAxe("rubis_axe", toolrubis);
        public static final Item RUBIS_HOE = new CopperHoe("rubis_hoe", toolrubis);
        public static final Item RUBIS_PICKAXE = new CopperPickaxe("rubis_pickaxe", toolrubis);
        public static final Item RUBIS_SHOVEL = new CopperShovel("rubis_shovel", toolrubis);
    
       public static void setItemName(Item item, String name)
       {
           item.setRegistryName(Reference.MODID, name).setUnlocalizedName(Reference.MODID + "." + name);
       }
    
    @SideOnly(Side.CLIENT)
       @SubscribeEvent
       public static void registerItemsModels(ModelRegistryEvent event)
       {
       registerModel(AMNETHYSTE, 0);
       registerModel(COPPER_INGOT, 0);
       registerModel(TIN_INGOT, 0);
       registerModel(RUBIS, 0);
       registerModel(SAPHIR, 0);
       registerModel(PAIN, 0);
       registerModel(CORN_SEED, 0);
       registerModel(CORN, 0);
    //   registerModel(APPLE_CAKE_ITEM, 0);
       registerModel(RICE, 0);
          registerModel(COPPER_HELMET, 0);
            registerModel(COPPER_CHESTPLATE, 0);
            registerModel(COPPER_LEGGINGS, 0);
            registerModel(COPPER_BOOTS, 0);
    
            registerModel(SAPHIR_HELMET, 0);
            registerModel(SAPHIR_CHESTPLATE, 0);
            registerModel(SAPHIR_LEGGINGS, 0);
            registerModel(SAPHIR_BOOTS, 0);
    
            registerModel(RUBIS_HELMET, 0);
            registerModel(RUBIS_CHESTPLATE, 0);
            registerModel(RUBIS_LEGGINGS, 0);
            registerModel(RUBIS_BOOTS, 0);
    
            registerModel(AMNETHYSTE_HELMET, 0);
            registerModel(AMNETHYSTE_CHESTPLATE, 0);
            registerModel(AMNETHYSTE_LEGGINGS, 0);
            registerModel(AMNETHYSTE_BOOTS, 0);
    
            registerModel(TIN_HELMET, 0);
            registerModel(TIN_CHESTPLATE, 0);
            registerModel(TIN_LEGGINGS, 0);
            registerModel(TIN_BOOTS, 0);
    
            registerModel(COPPER_SWORD, 0);
            registerModel(COPPER_PICKAXE, 0);
            registerModel(COPPER_HOE, 0);
            registerModel(COPPER_SHOVEL, 0);
            registerModel(COPPER_AXE, 0);
    
            registerModel(TIN_SWORD, 0);
            registerModel(TIN_PICKAXE, 0);
            registerModel(TIN_HOE, 0);
            registerModel(TIN_SHOVEL, 0);
            registerModel(TIN_AXE, 0);
    
            registerModel(AMNETHYSTE_SWORD, 0);
            registerModel(AMNETHYSTE_PICKAXE, 0);
            registerModel(AMNETHYSTE_HOE, 0);
            registerModel(AMNETHYSTE_SHOVEL, 0);
            registerModel(AMNETHYSTE_AXE, 0);
    
            registerModel(RUBIS_SWORD, 0);
            registerModel(RUBIS_PICKAXE, 0);
            registerModel(RUBIS_HOE, 0);
            registerModel(RUBIS_SHOVEL, 0);
            registerModel(RUBIS_AXE, 0);
    
            registerModel(SAPHIR_SWORD, 0);
            registerModel(SAPHIR_PICKAXE, 0);
            registerModel(SAPHIR_HOE, 0);
            registerModel(SAPHIR_SHOVEL, 0);
            registerModel(SAPHIR_AXE, 0);
       }
    
    @SideOnly(Side.CLIENT)
       public static void registerModel(Item item, int metadata)
       {
    ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory"));
       }
    
    }
    
    

    et ma classe pour mes haches

    package fr.priya.simpleores.items.tools;
    
    import fr.priya.simpleores.ModSimpleores;
    import fr.priya.simpleores.init.ItemsInit;
    import net.minecraft.item.ItemAxe;
    import net.minecraft.creativetab.CreativeTabs;
    import net.minecraft.item.Item;
    import net.minecraft.item.Item.ToolMaterial;
    
    public class CopperAxe extends ItemAxe{
    
    public CopperAxe(String name, ToolMaterial material)
    {
    super(material);
    ItemsInit.setItemName(this, name);
    
    setCreativeTab(ModSimpleores.combatTab);
    }
    
    }
    
    

    Merci d'avoir lu ce post ;)</clinit></init></init>


  • Administrateurs

    Salut,
    Il faut utiliser le constructeur ItemAxe(Item.ToolMaterial material, float damage, float speed) de la hache, le constructeur protected ItemAxe(Item.ToolMaterial material) ne peut que fonctionner pour les haches de Minecraft).

    Remplaces donc
    super(material);
    par :
    super(material, damage, speed);
    (en remplaçant damage et speed par des floats, si tu veux voir les valeurs des haches de minecraft regardes dans la classe ItemAxe).