Les recettes



  • C'est un problème qui arrive de temps en temps et j'ai jamais su pourquoi, relance ton jeu et ça ira.



  • je l'ai déjà fait 6-7 fois ^^



  • Envoi les logs complètes



  • [16:54:25] [Server thread/INFO]: Starting minecraft server version 1.7.10
    [16:54:28] [Server thread/INFO]: Loading properties
    [16:54:28] [Server thread/INFO]: Default game type: SURVIVAL
    [16:54:28] [Server thread/INFO]: Generating keypair
    [16:54:28] [Server thread/INFO]: Starting Minecraft server on *:25565
    [16:54:28] [Server thread/ERROR]: Encountered an unexpected exception
    java.lang.StringIndexOutOfBoundsException: String index out of range: 7
    at java.lang.String.charAt(Unknown Source) ~[?:1.8.0_45]
    at net.minecraft.item.crafting.CraftingManager.addRecipe(CraftingManager.java:232) ~[CraftingManager.class:?]
    at cpw.mods.fml.common.registry.GameRegistry.addShapedRecipe(GameRegistry.java:250) ~[GameRegistry.class:?]
    at cpw.mods.fml.common.registry.GameRegistry.addRecipe(GameRegistry.java:245) ~[GameRegistry.class:?]
    at fr.craftesys.items.common.ModItems.init(ModItems.java:76) ~[ModItems.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_45]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_45]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_45]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_45]
    at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:532) ~[FMLModContainer.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_45]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_45]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_45]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_45]
    at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?]
    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?]
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?]
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?]
    at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?]
    at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:212) ~[LoadController.class:?]
    at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:190) ~[LoadController.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_45]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_45]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_45]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_45]
    at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?]
    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?]
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?]
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?]
    at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?]
    at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119) ~[LoadController.class:?]
    at cpw.mods.fml.common.Loader.initializeMods(Loader.java:737) ~[Loader.class:?]
    at cpw.mods.fml.server.FMLServerHandler.finishServerLoading(FMLServerHandler.java:97) ~[FMLServerHandler.class:?]
    at cpw.mods.fml.common.FMLCommonHandler.onServerStarted(FMLCommonHandler.java:319) ~[FMLCommonHandler.class:?]
    at net.minecraft.server.dedicated.DedicatedServer.startServer(DedicatedServer.java:213) ~[DedicatedServer.class:?]
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:445) [MinecraftServer.class:?]
    at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) [MinecraftServer$2.class:?]
    [16:54:28] [Server thread/ERROR]: This crash report has been saved to: C:\Users\Anthony\Desktop\forge-1.7.10-10.13.4.1448-1.7.10-src\eclipse\.\crash-reports\crash-2015-07-11_16.54.28-server.txt
    
    


  • Il y a un problème avec tes crafts, renvoi ta classe principale.



  • package fr.craftesys.items.common;
    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 fr.craftesys.items.proxy.commonproxy;
    import net.minecraft.block.Block;
    import net.minecraft.block.material.Material;
    import net.minecraft.creativetab.CreativeTabs;
    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.MinecraftForge;
    import net.minecraftforge.common.util.EnumHelper;
    
    @Mod(modid = "moditems", name = "Mod Items", version = "1.7.10")
    public class ModItems
    {
    public static final String MODID = "moditems";
    @Instance(MODID)
    public static ModItems instance;
    @SidedProxy(clientSide = "fr.craftesys.items.proxy.clientproxy", serverSide = "fr.craftesys.items.proxy.commonproxy")
    public static commonproxy proxy;
    public static Item rubis;
    public static Item itemrubis, helmetrubis, chestPlaterubis, leggingsrubis, bootsrubis;
    public static Block blockrubis;
    public static ArmorMaterial armorrubis = EnumHelper.addArmorMaterial("armorrubis", 85, new int[] {4, 6, 5, 4}, 20);
    public static Item swordrubis, pickaxerubis, axerubis, shovelrubis, hoerubis;
    public static ToolMaterial toolrubis = EnumHelper.addToolMaterial("toolrubis",3 , 1499, 12.0F, 4.0F, 18);
    @EventHandler
    public void preInit(FMLPreInitializationEvent event)
    {
    itemrubis = new RubisItems().setUnlocalizedName("rubis").setTextureName(MODID + ":item_rubis").setCreativeTab(CreativeTabs.tabMaterials);
    
    helmetrubis = new ItemRubisArmor(armorrubis, 0).setUnlocalizedName("helmetrubis").setTextureName(MODID + ":helmetrubis");
    chestPlaterubis = new ItemRubisArmor(armorrubis, 1).setUnlocalizedName("chestPlaterubis").setTextureName(MODID + ":chestplaterubis");
    leggingsrubis = new ItemRubisArmor(armorrubis, 2).setUnlocalizedName("leggingsrubis").setTextureName(MODID + ":leggingsrubis");
    bootsrubis = new ItemRubisArmor(armorrubis, 3).setUnlocalizedName("bootsrubis").setTextureName(MODID + ":bootsrubis");
    swordrubis = new ItemRubisSword(toolrubis).setUnlocalizedName("swordrubis").setTextureName(MODID + ":sword_rubis");
    pickaxerubis = new ItemRubisPickaxe(toolrubis).setUnlocalizedName("pickaxerubis").setTextureName(MODID + ":pickaxe_rubis");
    axerubis = new ItemRubisAxe(toolrubis).setUnlocalizedName("axerubis").setTextureName(MODID + ":axe_rubis");
    shovelrubis = new ItemRubisShovel(toolrubis).setUnlocalizedName("shovelrubis").setTextureName(MODID + ":shovel_rubis");
    hoerubis = new ItemRubisHoe(toolrubis).setUnlocalizedName("hoerubis").setTextureName(MODID + ":hoe_rubis");
    blockrubis = new Blockrubis(Material.rock).setBlockName("rubisblock").setBlockTextureName("moditems:block_rubis").setCreativeTab(CreativeTabs.tabBlock);;
    
    GameRegistry.registerItem(itemrubis, "item_rubis");
    GameRegistry.registerItem(helmetrubis, "item_rubis_helmet");
    GameRegistry.registerItem(chestPlaterubis, "item_rubis_chestplate");
    GameRegistry.registerItem(leggingsrubis, "item_rubis_leggings");
    GameRegistry.registerItem(bootsrubis, "item_rubis_boots");
    GameRegistry.registerItem(swordrubis, "item_rubis_sword");
    GameRegistry.registerItem(pickaxerubis, "item_rubis_pickaxe");
    GameRegistry.registerItem(axerubis, "item_rubis_axe");
    GameRegistry.registerItem(shovelrubis, "item_rubis_shovel");
    GameRegistry.registerItem(hoerubis, "item_rubis_hoe");
    GameRegistry.registerBlock(blockrubis, "block_rubis");
    }
    
    @EventHandler
    public void init(FMLInitializationEvent event)
    {
    MinecraftForge.EVENT_BUS.register(new LivingEventHandler());
    proxy.registerRender();
    GameRegistry.addRecipe(new ItemStack(helmetrubis), new Object[]{"XXX", "X X", " ", 'X', new ItemStack(itemrubis)});
    GameRegistry.addRecipe(new ItemStack(chestPlaterubis), new Object[]{"X X", "XXX", "XXX", 'X', new ItemStack(itemrubis)});
    GameRegistry.addRecipe(new ItemStack(leggingsrubis), new Object[]{"XXX", "X X", "X X", 'X', new ItemStack(itemrubis)});
    GameRegistry.addRecipe(new ItemStack(bootsrubis), new Object[]{" ", "X X", "X X", 'X', new ItemStack(itemrubis)});
    GameRegistry.addRecipe(new ItemStack(swordrubis), new Object[]{" X ", " X ", " Y ", 'X', new ItemStack(itemrubis)});// 'Y' , new ItemStack(Items.stick)});
    GameRegistry.addRecipe(new ItemStack(pickaxerubis), new Object[]{"XXX", " Y ", " Y ", 'X', new ItemStack(itemrubis)}); // 'Y' , new ItemStack(Items.stick)});
    GameRegistry.addRecipe(new ItemStack(axerubis), new Object[]{"XX", "XY", " Y ", 'X', new ItemStack(itemrubis)}); //'Y' , new ItemStack(Items.stick)});;
    GameRegistry.addRecipe(new ItemStack(shovelrubis), new Object[]{"XX", " Y ", " Y ", 'X', new ItemStack(itemrubis)}); //'Y' , new ItemStack(Items.stick)});
    GameRegistry.addRecipe(new ItemStack(hoerubis), new Object[]{"XXX", "X X", " ", 'X', new ItemStack(itemrubis)}); //'Y' , new ItemStack(Items.stick)});
    GameRegistry.addRecipe(new ItemStack(blockrubis), new Object[]{"XXX", "XXX", "XXX", 'X', new ItemStack(itemrubis)});
    }
    
    @EventHandler
    public void postInit(FMLPostInitializationEvent event)
    {
    
    }
    }
    
    


  • Il te manque le "Y" : {"XXX", " Y ", " Y ", 'X', new ItemStack(itemrubis)}



  • j'ai un problème avec la Hoe

    quand je C/C un autre craft comme la pioche, et que je change le nom, ça donne ça :

    GameRegistry.addRecipe(new ItemStack(hoerubis), new Object[]{"XXX", " Y ", " Y ", 'X', new ItemStack(itemrubis), 'Y' , new ItemStack(Items.stick)});

    en changeant le nom ça marche, or quand j’enlève le X de la première ligne afin d'obtenir cela :

    GameRegistry.addRecipe(new ItemStack(hoelrubis), new Object[]{"XX", " Y ", " Y ", 'X', new ItemStack(itemrubis), 'Y' , new ItemStack(Items.stick)});

    ça ne marche plus



  • Parce qu'il faut mettre le même nombre, si tu veux faire une épée, ces 2 là marchent :
    -GameRegistry.addRecipe(new ItemStack(tonEpee), "X", "X", "Y", 'X', tonItem, 'Y', Items.stick)
    -GameRegistry.addRecipe(new ItemStack(tonEpee), " X ", " X ", " Y ", 'X', tonItem, 'Y', Items.stick)
    mais si tu fais un mélange des 2 çà marche plus : il faut le même nombre de colonnes sur chaque ligne.



  • ahhhhhhhh j'avais pas vu l'espace,  des fautes tellement bêtes en plus, merci

    et si on veut que plusieurs craft fassent le même items (genre le casque ça dépend ou on place les items)  il faut refaire la même ligne en changeant juste les emplacements ?



  • çà dépend, si c'est juste l'emplacement dans la table de craft, il faut juste mettre le moins d'espaces possibles, par exemple pour l'épée, si tu mets une seule lettre dans chaque ligne, ton épée sera craftable sur la colonne de gauche, centre ou droite. Tu n'es pas non plus obligé de mettre les 3 lignes. En revanche si le craft change totalement, il faudra rajouter un craft en plus.

    Pour ton casque :
    GameRegistry.addRecipe(new ItemStack(tonCasque), "XXX", "X X", 'X', tonItem)

    Sinon regarde les classes de Minecraft ou FFMTLibs.


Log in to reply