Nouvelle plantation
-
Les noms de classe commencent par une majuscule…
-
@‘robin4002’:
java.lang.IllegalArgumentException: The object com.sebenforce.framboise_culture@1e37cb10{1e37cb10} has been registered twice, using the names extasia:framboise and extasia:framboise_culture. (Other object at this id is com.sebenforce.framboise_culture@1e37cb10{1e37cb10})
Ton bloc est enregistré deux fois.
C’est ce que j’ai compris en lisant le rapport d’erreur cependant je ne crois pas l’avoir déclaté deux fois

Ma classe complète :
package com.sebenforce; 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.ItemSeeds; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.EnumHelper; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; 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; @Mod(modid = Main.MODID, version = Main.VERSION) public class Main { public static final String MODID = "extasia"; public static final String VERSION = "1.0"; public static Block blockOxinite; public static Block mineraiOxinite; public static Block blockAzur; public static Block mineraiAzur; public static Block blockExtase; public static Block mineraiExtase; public static Block glowstone1; public static Block glowstone2; public static Block glowstone3; public static Block framboise_culture; public static Item Oxinite; public static Item Azur; public static Item Extase; public static Item LingotObsidian, framboise_seed, framboise; public static Item casqueOxinite, plastronOxinite, jambesOxinite, bottesOxinite; public static Item casqueAzur, plastronAzur, jambesAzur, bottesAzur; public static Item casqueExtase, plastronExtase, jambesExtase, bottesExtase; public static Item epeeOxinite, piocheOxinite, hacheOxinite, pelleOxinite, hoeOxinite; public static Item epeeAzur, piocheAzur, hacheAzur, pelleAzur, hoeAzur; public static Item epeeObsidian, piocheObsidian, hacheObsidian, pelleObsidian, hoeObsidian; public static Item epeeExtase, piocheExtase, hacheExtase, pelleExtase, hoeExtase; public static ArmorMaterial oxinite = EnumHelper.addArmorMaterial("Oxinite", 111, new int[] { 4, 8, 6, 3 }, 9); //Argonate public static ArmorMaterial extase = EnumHelper.addArmorMaterial("Extase", 151, new int[] { 4, 8, 6, 4 }, 6); //Opal public static ArmorMaterial azur = EnumHelper.addArmorMaterial("Azur", 131, new int[] { 4, 9, 7, 4 }, 8); //Rubellite public static ToolMaterial outilsOxinite = EnumHelper.addToolMaterial("outilsOxinite", 3, 2545, 8.5F, 3.5F, 10); public static ToolMaterial outilsAzur = EnumHelper.addToolMaterial("outilsAzur", 3, 2387, 8.5F, 5.0F, 10); public static ToolMaterial outilsExtase = EnumHelper.addToolMaterial("outilsExtase", 3, 2101, 8.5F, 4.0F, 10); generationOxinite generationOxinite = new generationOxinite(); generationAzur generationAzur = new generationAzur(); generationExtase generationExtase = new generationExtase(); @EventHandler public void preInit(FMLPreInitializationEvent event) { GameRegistry.registerWorldGenerator(generationOxinite, 0); GameRegistry.registerWorldGenerator(generationAzur, 0); GameRegistry.registerWorldGenerator(generationExtase, 0); } @EventHandler public void load(FMLInitializationEvent event) { blockOxinite = new blockOxinite(Material.rock).setBlockName("blockOxinite").setBlockTextureName(Main.MODID + ":argorite_block").setCreativeTab(CreativeTabs.tabBlock).setHardness(6.0F); GameRegistry.registerBlock(blockOxinite, "blockOxinite"); blockAzur = new blockAzur(Material.rock).setBlockName("blockAzur").setBlockTextureName(Main.MODID + ":rubellite_block").setCreativeTab(CreativeTabs.tabBlock).setHardness(6.0F); GameRegistry.registerBlock(blockAzur, "blockAzur"); blockExtase = new blockExtase(Material.rock).setBlockName("blockExtase").setBlockTextureName(Main.MODID + ":opal_block").setCreativeTab(CreativeTabs.tabBlock).setHardness(6.0F); GameRegistry.registerBlock(blockExtase, "blockExtase"); glowstone1 = new glowstone1(Material.rock).setBlockName("glowstone1").setBlockTextureName(Main.MODID + ":blue_glowstone").setCreativeTab(CreativeTabs.tabBlock).setHardness(6.0F).setLightLevel(1.0F); GameRegistry.registerBlock(glowstone1, "glowstone1"); glowstone2 = new glowstone2(Material.rock).setBlockName("glowstone2").setBlockTextureName(Main.MODID + ":red_glowstone").setCreativeTab(CreativeTabs.tabBlock).setHardness(6.0F).setLightLevel(1.0F); GameRegistry.registerBlock(glowstone2, "glowstone2"); glowstone3 = new glowstone1(Material.rock).setBlockName("glowstone3").setBlockTextureName(Main.MODID + ":green_glowstone").setCreativeTab(CreativeTabs.tabBlock).setHardness(6.0F).setLightLevel(1.0F); GameRegistry.registerBlock(glowstone3, "glowstone3"); framboise_culture = new framboise_culture().setBlockName("framboise_culture2"); GameRegistry.registerBlock(framboise_culture, "framboise_culture"); /* framboise_seed = new ItemSeeds(framboise_culture, Blocks.farmland).setUnlocalizedName("framboise_seed").setTextureName(Main.MODID + ":framboise_seed"); GameRegistry.registerItem(framboise_seed, "framboise_seed");*/ //minerai mineraiOxinite = new mineraiOxinite(Material.rock).setBlockName("mineraiOxinite").setBlockTextureName(Main.MODID + ":argorite_ore").setCreativeTab(CreativeTabs.tabBlock).setHardness(6.0F); GameRegistry.registerBlock(mineraiOxinite, "mineraiOxinite"); mineraiAzur = new mineraiAzur(Material.rock).setBlockName("mineraiAzur").setBlockTextureName(Main.MODID + ":rubellite_ore").setCreativeTab(CreativeTabs.tabBlock).setHardness(6.0F); GameRegistry.registerBlock(mineraiAzur, "mineraiAzur"); mineraiExtase = new mineraiExtase(Material.rock).setBlockName("mineraiExtase").setBlockTextureName(Main.MODID + ":opal_ore").setCreativeTab(CreativeTabs.tabBlock).setHardness(6.0F); GameRegistry.registerBlock(mineraiExtase, "mineraiExtase"); //gems Oxinite = new Oxinite().setUnlocalizedName("Oxinite").setTextureName(Main.MODID + ":argonite").setCreativeTab(CreativeTabs.tabMaterials); GameRegistry.registerItem(Oxinite, "Oxinite"); Azur = new Azur().setUnlocalizedName("Azur").setTextureName(Main.MODID + ":rubellite").setCreativeTab(CreativeTabs.tabMaterials); GameRegistry.registerItem(Azur, "Azur"); Extase = new Extase().setUnlocalizedName("Extase").setTextureName(Main.MODID + ":opa").setCreativeTab(CreativeTabs.tabMaterials); GameRegistry.registerItem(Extase, "Extase"); framboise = new framboise().setUnlocalizedName("framboise").setTextureName(Main.MODID + ":framboise2").setCreativeTab(CreativeTabs.tabMaterials); GameRegistry.registerItem(framboise, "framboise"); //armures casqueOxinite = new armureOxinite(oxinite, 0).setUnlocalizedName("casqueOxinite").setTextureName(MODID + ":argonite_helmet"); plastronOxinite = new armureOxinite(oxinite, 1).setUnlocalizedName("plastronOxinite").setTextureName(MODID + ":argonite_chestplate"); jambesOxinite = new armureOxinite(oxinite, 2).setUnlocalizedName("jambesOxinite").setTextureName(MODID + ":argonite_leggings"); bottesOxinite = new armureOxinite(oxinite, 3).setUnlocalizedName("bottesOxinite").setTextureName(MODID + ":argonite_boots"); GameRegistry.registerItem(casqueOxinite, "casqueOxinite"); GameRegistry.registerItem(plastronOxinite, "plastronOxinite"); GameRegistry.registerItem(jambesOxinite, "jambesOxinite"); GameRegistry.registerItem(bottesOxinite, "bottesOxinite"); casqueAzur = new armureAzur(azur, 0).setUnlocalizedName("casqueAzur").setTextureName(MODID + ":rubellite_helmet"); plastronAzur = new armureAzur(azur, 1).setUnlocalizedName("plastronAzur").setTextureName(MODID + ":rubellite_chestplate"); jambesAzur = new armureAzur(azur, 2).setUnlocalizedName("jambesAzur").setTextureName(MODID + ":rubellite_leggings"); bottesAzur = new armureAzur(azur, 3).setUnlocalizedName("bottesAzur").setTextureName(MODID + ":rubellite_boots"); GameRegistry.registerItem(casqueAzur, "casqueAzur"); GameRegistry.registerItem(plastronAzur, "plastronAzur"); GameRegistry.registerItem(jambesAzur, "jambesAzur"); GameRegistry.registerItem(bottesAzur, "bottesAzur"); casqueExtase = new armureExtase(extase, 0).setUnlocalizedName("casqueExtase").setTextureName(MODID + ":opa_helmet"); plastronExtase = new armureExtase(extase, 1).setUnlocalizedName("plastronExtase").setTextureName(MODID + ":opa_chestplate"); jambesExtase = new armureExtase(extase, 2).setUnlocalizedName("jambesExtase").setTextureName(MODID + ":opal_leggings"); bottesExtase = new armureExtase(extase, 3).setUnlocalizedName("bottesExtase").setTextureName(MODID + ":opa_boots"); GameRegistry.registerItem(casqueExtase, "casqueExtase"); GameRegistry.registerItem(plastronExtase, "plastronExtase"); GameRegistry.registerItem(jambesExtase, "jambesExtase"); GameRegistry.registerItem(bottesExtase, "bottesExtase"); //outils epeeOxinite = new epeeOxinite(outilsOxinite).setUnlocalizedName("epeeOxinite").setTextureName(MODID + ":argonite_sword"); piocheOxinite = new piocheOxinite(outilsOxinite).setUnlocalizedName("piocheOxinite").setTextureName(MODID + ":argonite_pickaxe"); hacheOxinite = new hacheOxinite(outilsOxinite).setUnlocalizedName("hacheOxinite").setTextureName(MODID + ":argonite_axe"); pelleOxinite = new pelleOxinite(outilsOxinite).setUnlocalizedName("pelleOxinite").setTextureName(MODID + ":argonite_shovel"); hoeOxinite = new hoeOxinite(outilsOxinite).setUnlocalizedName("hoeOxinite").setTextureName(MODID + ":argonite_hoe"); GameRegistry.registerItem(epeeOxinite, "epeeOxinite"); GameRegistry.registerItem(piocheOxinite, "piocheOxinite"); GameRegistry.registerItem(hacheOxinite, "hacheOxinite"); GameRegistry.registerItem(pelleOxinite, "pelleOxinite"); GameRegistry.registerItem(hoeOxinite, "hoeOxinite"); epeeAzur = new epeeAzur(outilsAzur).setUnlocalizedName("epeeAzur").setTextureName(MODID + ":rubellite_sword"); piocheAzur = new piocheAzur(outilsAzur).setUnlocalizedName("piocheAzur").setTextureName(MODID + ":rubellite_pickaxe"); hacheAzur = new hacheAzur(outilsAzur).setUnlocalizedName("hacheAzur").setTextureName(MODID + ":rubellite_axe"); pelleAzur = new pelleAzur(outilsAzur).setUnlocalizedName("pelleAzur").setTextureName(MODID + ":rubellite_shovel"); hoeAzur = new hoeAzur(outilsAzur).setUnlocalizedName("hoeAzur").setTextureName(MODID + ":rubellite_hoe"); GameRegistry.registerItem(epeeAzur, "epeeAzur"); GameRegistry.registerItem(piocheAzur, "piocheAzur"); GameRegistry.registerItem(hacheAzur, "hacheAzur"); GameRegistry.registerItem(pelleAzur, "pelleAzur"); GameRegistry.registerItem(hoeAzur, "hoeAzur"); epeeExtase = new epeeExtase(outilsExtase).setUnlocalizedName("epeeExtase").setTextureName(MODID + ":opal_sword"); piocheExtase = new piocheExtase(outilsExtase).setUnlocalizedName("piocheExtase").setTextureName(MODID + ":opal_pickaxe"); hacheExtase = new hacheExtase(outilsExtase).setUnlocalizedName("hacheExtase").setTextureName(MODID + ":opal_axe"); pelleExtase = new pelleExtase(outilsExtase).setUnlocalizedName("pelleExtase").setTextureName(MODID + ":opal_shovel"); hoeExtase = new hoeExtase(outilsExtase).setUnlocalizedName("hoeExtase").setTextureName(MODID + ":opal_hoe"); GameRegistry.registerItem(epeeExtase, "epeeExtase"); GameRegistry.registerItem(piocheExtase, "piocheExtase"); GameRegistry.registerItem(hacheExtase, "hacheExtase"); GameRegistry.registerItem(pelleExtase, "pelleExtase"); GameRegistry.registerItem(hoeExtase, "hoeExtase"); //craft GameRegistry.addShapedRecipe(new ItemStack(casqueOxinite), new Object[]{"XXX", "X X", " ", 'X', Main.Oxinite}); GameRegistry.addShapedRecipe(new ItemStack(plastronOxinite), new Object[]{"X X", "XXX", "XXX", 'X', Main.Oxinite}); GameRegistry.addShapedRecipe(new ItemStack(jambesOxinite), new Object[]{"XXX", "X X", "X X", 'X', Main.Oxinite}); GameRegistry.addShapedRecipe(new ItemStack(bottesOxinite), new Object[]{" ", "X X", "X X", 'X', Main.Oxinite}); GameRegistry.addShapedRecipe(new ItemStack(casqueAzur), new Object[]{"XXX", "XYX", "XXX", 'X', Main.Azur,'Y',Items.diamond_helmet}); GameRegistry.addShapedRecipe(new ItemStack(plastronAzur), new Object[]{"XXX", "XYX", "XXX", 'X', Main.Azur,'Y',Items.diamond_chestplate}); GameRegistry.addShapedRecipe(new ItemStack(jambesAzur), new Object[]{"XXX", "XYX", "XXX", 'X', Main.Azur,'Y',Items.diamond_leggings}); GameRegistry.addRecipe(new ItemStack(bottesAzur), new Object[] {"XXX", "XYX", "XXX", 'X', Main.Azur,'Y',Items.diamond_boots}); GameRegistry.addShapedRecipe(new ItemStack(epeeOxinite), new Object[]{" X ", " X ", " Z ", 'X', Main.Oxinite,'Z', Items.stick}); GameRegistry.addShapedRecipe(new ItemStack(piocheOxinite), new Object[]{"XXX", " Z ", " Z ", 'X', Main.Oxinite,'Z', Items.stick}); GameRegistry.addShapedRecipe(new ItemStack(pelleOxinite), new Object[]{" X ", " Z ", " Z ", 'X', Main.Oxinite,'Z', Items.stick}); GameRegistry.addShapedRecipe(new ItemStack(hoeOxinite), new Object[]{"XX ", " Z ", " Z ", 'X', Main.Oxinite,'Z', Items.stick}); GameRegistry.addShapedRecipe(new ItemStack(hacheOxinite), new Object[]{"XX ", "XZ ", " Z ", 'X', Main.Oxinite,'Z', Items.stick}); GameRegistry.addShapedRecipe(new ItemStack(epeeAzur), new Object[]{"XXX", "XYX", "XXX", 'X', Main.Azur,'Y',Items.diamond_sword}); GameRegistry.addShapedRecipe(new ItemStack(piocheAzur), new Object[]{"XXX", "XYX", "XXX", 'X', Main.Azur,'Y',Items.diamond_pickaxe}); GameRegistry.addShapedRecipe(new ItemStack(pelleAzur), new Object[]{"XXX", "XYX", "XXX", 'X', Main.Azur,'Y',Items.diamond_shovel}); GameRegistry.addShapedRecipe(new ItemStack(hoeAzur), new Object[]{"XXX", "XYX", "XXX", 'X', Main.Azur,'Y',Items.diamond_hoe}); GameRegistry.addShapedRecipe(new ItemStack(hacheAzur), new Object[]{"XXX", "XYX", "XXX", 'X', Main.Azur,'Y',Items.diamond_axe}); GameRegistry.addShapedRecipe(new ItemStack(epeeExtase), new Object[]{" X ", " X ", " Z ", 'X', Items.emerald,'Z', Items.stick}); GameRegistry.addShapedRecipe(new ItemStack(piocheExtase), new Object[]{"XXX", " Z ", " Z ", 'X', Items.emerald,'Z', Items.stick}); GameRegistry.addShapedRecipe(new ItemStack(pelleExtase), new Object[]{" X ", " Z ", " Z ", 'X', Items.emerald,'Z', Items.stick}); GameRegistry.addShapedRecipe(new ItemStack(hoeExtase), new Object[]{"XX ", " Z ", " Z ", 'X', Items.emerald,'Z', Items.stick}); GameRegistry.addShapedRecipe(new ItemStack(hacheExtase), new Object[]{"XX ", "XZ ", " Z ", 'X', Items.emerald,'Z', Items.stick}); GameRegistry.addShapedRecipe(new ItemStack(blockOxinite), new Object[]{"XXX", "XXX", "XXX", 'X', Main.Oxinite}); GameRegistry.addShapedRecipe(new ItemStack(blockAzur), new Object[]{"XXX", "XXX", "XXX", 'X', Main.Azur}); } @EventHandler public void postInit(FMLPostInitializationEvent event) { } } -
Si …
Tu l’enregistre dans le constructeur :public framboise_culture() { setBlockName(name); setBlockTextureName(Main.MODID + ":" + name); GameRegistry.registerBlock(this, name); }Et dans la classe principale :
GameRegistry.registerBlock(framboise_culture, "framboise_culture"); -
@‘robin4002’:
Si …
Tu l’enregistre dans le constructeur :public framboise_culture() { setBlockName(name); setBlockTextureName(Main.MODID + ":" + name); GameRegistry.registerBlock(this, name); }Et dans la classe principale :
GameRegistry.registerBlock(framboise_culture, "framboise_culture");Ah oui autant pour moi, je l’ai enlevé dans la classe principale cepandant l’erreur est toujours la même.
-
@‘Sebenf0rce’:
@‘robin4002’:
Si …
Tu l’enregistre dans le constructeur :public framboise_culture() { setBlockName(name); setBlockTextureName(Main.MODID + ":" + name); GameRegistry.registerBlock(this, name); }Et dans la classe principale :
GameRegistry.registerBlock(framboise_culture, "framboise_culture");Ah oui autant pour moi, je l’ai enlevé dans la classe principale cepandant l’erreur est toujours la même.
Tu peux nous donner ton code ?
-
@‘Diangle’:
Tu peux nous donner ton code ?
Que veux tu ? J’ai mis plus haut la classe principale et la classe de la plantation.
-
Enlève plutôt le code qui se trouve dans le constructeur.
Et si tu es encore une erreur, vérifies bien qu’elle n’est pas identique. En fait le mieux est de renvoyé l’erreur dans même si tu penses que c’est la même. -
@‘robin4002’:
Enlève plutôt le code qui se trouve dans le constructeur.
Et si tu es encore une erreur, vérifies bien qu’elle n’est pas identique. En fait le mieux est de renvoyé l’erreur dans même si tu penses que c’est la même.Merci en enlevant le code du constructeur le jeu ne plante plus. J’ai cependant un problème, la plantation fonctionne bien mais rien n’est dropé lorsqu’elle est cassé.
-
Dans la classe de la plantation , mais ItemDropped
et tu return ta graine. -
@‘iFuSion34’:
Dans la classe de la plantation , mais ItemDropped
et tu return ta graine.Merci
