Résolu Nouvelle plantation
-
Salut à tous,
J’ai crée ma nouvelle plantation mais cela me fait crash et je ne vois vraiment pas pourquoi. Voici mon code : framboise_culture = new framboise_culture().setBlockName("framboise_culture"); GameRegistry.registerBlock(framboise_culture, "framboise_culture");
framboise = new framboise().setUnlocalizedName("framboise").setTextureName(Main.MODID + ":framboise2").setCreativeTab(CreativeTabs.tabMaterials); GameRegistry.registerItem(framboise, "framboise");
Et la classe de la plantation :
package com.sebenforce; import net.minecraft.block.BlockCrops; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.util.ChatComponentText; import net.minecraft.util.IIcon; import net.minecraft.world.World; import cpw.mods.fml.common.registry.GameRegistry; public class framboise_culture extends BlockCrops { public static final String name = "framboise"; private IIcon[] textures; public framboise_culture() { setBlockName(name); setBlockTextureName(Main.MODID + ":" + name); GameRegistry.registerBlock(this, name); } @Override public IIcon getIcon(int side, int meta) { if (meta < 7) { if (meta == 6) { meta = 5; } return this.textures[meta >> 1]; } else { return this.textures[3]; } } @Override protected Item func_149866_i() { //ici c'est l'item pour les graines (ex : wheat_seeds) return Main.framboise_seed; } @Override protected Item func_149865_P() { //et ici l'Item droppé (ex : wheat) return Main.framboise; } @Override public void registerBlockIcons(IIconRegister p_149651_1_) { this.textures = new IIcon[4]; for (int i = 0; i < this.textures.length; ++i) { this.textures* = p_149651_1_.registerIcon(this.getTextureName() + "_stage_" + i); } } }
Et enfin le rapport d’erreur :
:::
[20:43:26] [Sound Library Loader/INFO]: Sound engine started[20:43:27] [Client thread/INFO]: Created: 512x256 textures/blocks-atlas
[20:43:27] [Client thread/INFO]: Created: 256x256 textures/items-atlas
[20:43:27] [Client thread/ERROR] [FML]: Caught an exception during block registration
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})
at cpw.mods.fml.common.registry.FMLControlledNamespacedRegistry.add(FMLControlledNamespacedRegistry.java:382) ~[FMLControlledNamespacedRegistry.class:?]
at cpw.mods.fml.common.registry.GameData.registerBlock(GameData.java:817) ~[GameData.class:?]
at cpw.mods.fml.common.registry.GameData.registerBlock(GameData.java:792) ~[GameData.class:?]
at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:212) [GameRegistry.class:?]
at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:171) [GameRegistry.class:?]
at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:160) [GameRegistry.class:?]
at com.sebenforce.Main.load(Main.java:94) [Main.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:513) [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.EventHandler.handleEvent(EventHandler.java:74) [guava-15.0.jar:?]
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47) [guava-15.0.jar:?]
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) [guava-15.0.jar:?]
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) [guava-15.0.jar:?]
at com.google.common.eventbus.EventBus.post(EventBus.java:267) [guava-15.0.jar:?]
at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:208) [LoadController.class:?]
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187) [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.EventHandler.handleEvent(EventHandler.java:74) [guava-15.0.jar:?]
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47) [guava-15.0.jar:?]
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) [guava-15.0.jar:?]
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) [guava-15.0.jar:?]
at com.google.common.eventbus.EventBus.post(EventBus.java:267) [guava-15.0.jar:?]
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118) [LoadController.class:?]
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:690) [Loader.class:?]
at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:288) [FMLClientHandler.class:?]
at net.minecraft.client.Minecraft.startGame(Minecraft.java:573) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:880) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:112) [Main.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 net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]
[20:43:27] [Client thread/ERROR] [FML]: Fatal errors were detected during the transition from INITIALIZATION to POSTINITIALIZATION. Loading cannot continue
[20:43:27] [Client thread/ERROR] [FML]:
mcp{9.03} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized
FML{7.2.217.1147} [Forge Mod Loader] (forgeSrc-1.7.2-10.12.2.1147.jar) Unloaded->Constructed->Pre-initialized->Initialized
Forge{10.12.2.1147} [Minecraft Forge] (forgeSrc-1.7.2-10.12.2.1147.jar) Unloaded->Constructed->Pre-initialized->Initialized
extasia{1.0} [extasia] (bin) Unloaded->Constructed->Pre-initialized->Errored
[20:43:27] [Client thread/ERROR] [FML]: The following problems were captured during this phase
[20:43:27] [Client thread/ERROR] [FML]: Caught exception from extasia
cpw.mods.fml.common.LoaderException: 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})
at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:222) ~[GameRegistry.class:?]
at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:171) ~[GameRegistry.class:?]
at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:160) ~[GameRegistry.class:?]
at com.sebenforce.Main.load(Main.java:94) ~[Main.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:513) ~[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.EventHandler.handleEvent(EventHandler.java:74) ~[guava-15.0.jar:?]
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47) ~[guava-15.0.jar:?]
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) ~[guava-15.0.jar:?]
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) ~[guava-15.0.jar:?]
at com.google.common.eventbus.EventBus.post(EventBus.java:267) ~[guava-15.0.jar:?]
at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:208) ~[LoadController.class:?]
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187) ~[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.EventHandler.handleEvent(EventHandler.java:74) ~[guava-15.0.jar:?]
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47) ~[guava-15.0.jar:?]
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) ~[guava-15.0.jar:?]
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) ~[guava-15.0.jar:?]
at com.google.common.eventbus.EventBus.post(EventBus.java:267) ~[guava-15.0.jar:?]
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118) [LoadController.class:?]
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:690) [Loader.class:?]
at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:288) [FMLClientHandler.class:?]
at net.minecraft.client.Minecraft.startGame(Minecraft.java:573) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:880) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:112) [Main.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 net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]
Caused by: 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})
at cpw.mods.fml.common.registry.FMLControlledNamespacedRegistry.add(FMLControlledNamespacedRegistry.java:382) ~[FMLControlledNamespacedRegistry.class:?]
at cpw.mods.fml.common.registry.GameData.registerBlock(GameData.java:817) ~[GameData.class:?]
at cpw.mods.fml.common.registry.GameData.registerBlock(GameData.java:792) ~[GameData.class:?]
at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:212) ~[GameRegistry.class:?]
… 40 more
---- Minecraft Crash Report ----
// I just don’t know what went wrongTime: 31/05/15 20:43
Description: There was a severe problem during mod loading that has caused the game to failcpw.mods.fml.common.LoaderException: 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})
at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:222)
at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:171)
at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:160)
at com.sebenforce.Main.load(Main.java:94)
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 cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:513)
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.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:208)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187)
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.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:690)
at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:288)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:573)
at net.minecraft.client.Minecraft.run(Minecraft.java:880)
at net.minecraft.client.main.Main.main(Main.java:112)
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:134)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
Caused by: 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})
at cpw.mods.fml.common.registry.FMLControlledNamespacedRegistry.add(FMLControlledNamespacedRegistry.java:382)
at cpw.mods.fml.common.registry.GameData.registerBlock(GameData.java:817)
at cpw.mods.fml.common.registry.GameData.registerBlock(GameData.java:792)
at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:212)
… 40 moreA detailed walkthrough of the error, its code path and all known details is as follows:
– System Details –
Details:
Minecraft Version: 1.7.2
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.8.0_45, Oracle Corporation
Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 926453960 bytes (883 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP v9.03 FML v7.2.217.1147 Minecraft Forge 10.12.2.1147 4 mods loaded, 4 mods active
mcp{9.03} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized
FML{7.2.217.1147} [Forge Mod Loader] (forgeSrc-1.7.2-10.12.2.1147.jar) Unloaded->Constructed->Pre-initialized->Initialized
Forge{10.12.2.1147} [Minecraft Forge] (forgeSrc-1.7.2-10.12.2.1147.jar) Unloaded->Constructed->Pre-initialized->Initialized
extasia{1.0} [extasia] (bin) Unloaded->Constructed->Pre-initialized->Errored
#@!@# Game crashed! Crash report saved to: #@!@# C:\Users\Seb\Desktop\Projet eclipse\mod Argonia\eclipse.\crash-reports\crash-2015-05-31_20.43.27-client.txt
AL lib: (EE) alc_cleanup: 1 device not closed
Java HotSpot 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
:::Merci d’avance.
-
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.
-
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