Créer un gui et un container sur un bloc (type coffre)
-
@‘robin4002’:
Je ne vois pourtant plus aucune erreur, tu as essayé en plaçant un nouveau bloc ou tu essayé sur des blocs déjà existant ?
Test sur une nouvelle map, ça serait mieux.Pour info peut être un rapport, j’ai fait le tutoriel et au moment ou j’ai fait dans une classe le .instance, il n’exister pas j’ai du le créer mais je n’ai rien changer dessus peut être un rapport avec sa
PS: j’ai pas encore tester sur un nouveau monde
-
Ah ba oui, je viens de voir le problème :
@Instance(“ModCatnos”)
public static ModCatnos instance;@Mod(modid = “craftz”
Ces deux valeurs sont sensés être identique, si tu ne suis pas correctement la base, normal que ça bloque après.
-
@‘robin4002’:
Ah ba oui, je viens de voir le problème :
@Instance(“ModCatnos”)
public static ModCatnos instance;@Mod(modid = “craftz”
Ces deux valeurs sont sensés être identique, si tu ne suis pas correctement la base, normal que ça bloque après.
Cela doit venir du moment ou j’ai changer le nom de la classe
-
Salut J’ai un probleme lorsque je fait shift + click sur un item pour le mettre dans le coffre les 9 premier items se range normalement (1ligne) mais je ne peut pas en placer d’autre
-
Bonjour ! Est ce que ce tutoriel peux marcher en 1.7.X ? Merci de vos réponses !
-
Non, il y a eu beaucoup de modification depuis, je vais essayer de le mettre à jour au plus vite (j’ai prévu de faire un tutoriel sur les TESR en 1.7, puis je vais faire celui-la).
-
Ok ! Merci !
-
je ne sais pas si c’est ici que je dois le mettre mais comme c’est du gui c’est lié ( reprends moi si je me trompe ).
Comme le tuto ne marche pas en 1.7 j’ai chercher ailleurs et j’ai trouver mon bonheur cependant quand je fait clic droit crash
et dans le crash report sa m’indique :Unexpected error at cpw.mods.fml.common.network.NetworkRegistry.getLocalGuiContainer(NetworkRegistry.java:263) at cpw.mods.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:93) ***at com.bowser.robotic.common.FourArcBlock.onBlockActivated(FourArcBlock.java:71)*** at net.minecraft.client.multiplayer.PlayerControllerMP.onPlayerRightClick(PlayerControllerMP.java:376) at net.minecraft.client.Minecraft.func_147121_ag(Minecraft.java:1518) at net.minecraft.client.Minecraft.runTick(Minecraft.java:2033) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1028) at net.minecraft.client.Minecraft.run(Minecraft.java:951) at net.minecraft.client.main.Main.main(Main.java:164) 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 GradleStart.bounce(GradleStart.java:107) at GradleStart.startClient(GradleStart.java:100) at GradleStart.main(GradleStart.java:65)
il y a la ligne que j’ai surlignée qui renvoie a cette partie de la classe du bloc
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) { FMLNetworkHandler.openGui(player, Robotic.instance, 0, world, x, y, z); return true; }
a mon avis c’est sa qui fait crash mais je ne suis pas sur et je ne sais pas comment le régler
merci.
-
Tu peux envoyer le crash complet ? Car là on a tout sauf l’exception …
-
voila :
–-- Minecraft Crash Report ---- // Don't do that. Time: 25/10/14 11:00 Description: Unexpected error java.lang.NullPointerException: Unexpected error at cpw.mods.fml.common.network.NetworkRegistry.getLocalGuiContainer(NetworkRegistry.java:263) at cpw.mods.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:93) at com.bowser.robotic.common.FourArcBlock.onBlockActivated(FourArcBlock.java:71) at net.minecraft.client.multiplayer.PlayerControllerMP.onPlayerRightClick(PlayerControllerMP.java:376) at net.minecraft.client.Minecraft.func_147121_ag(Minecraft.java:1518) at net.minecraft.client.Minecraft.runTick(Minecraft.java:2033) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1028) at net.minecraft.client.Minecraft.run(Minecraft.java:951) at net.minecraft.client.main.Main.main(Main.java:164) 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 GradleStart.bounce(GradleStart.java:107) at GradleStart.startClient(GradleStart.java:100) at GradleStart.main(GradleStart.java:65) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at cpw.mods.fml.common.network.NetworkRegistry.getLocalGuiContainer(NetworkRegistry.java:263) at cpw.mods.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:93) at com.bowser.robotic.common.FourArcBlock.onBlockActivated(FourArcBlock.java:71) at net.minecraft.client.multiplayer.PlayerControllerMP.onPlayerRightClick(PlayerControllerMP.java:376) at net.minecraft.client.Minecraft.func_147121_ag(Minecraft.java:1518) -- Affected level -- Details: Level name: MpServer All players: 1 total; [EntityClientPlayerMP['Bowser338'/120, l='MpServer', x=294,09, y=28,62, z=550,88]] Chunk stats: MultiplayerChunkCache: 465, 465 Level seed: 0 Level generator: ID 00 - default, ver 1\. Features enabled: false Level generator options: Level spawn location: World: (228,64,244), Chunk: (at 4,4,4 in 14,15; contains blocks 224,0,240 to 239,255,255), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511) Level time: 12314 game time, 12314 day time Level dimension: 0 Level storage version: 0x00000 - Unknown? Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false) Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false Forced entities: 95 total; [EntityBat['Bat'/275, l='MpServer', x=371,34, y=17,10, z=596,09], EntitySkeleton['Skeleton'/137, l='MpServer', x=335,91, y=25,00, z=523,50], EntitySquid['Squid'/136, l='MpServer', x=321,15, y=44,00, z=527,13], EntitySkeleton['Skeleton'/139, l='MpServer', x=251,06, y=28,00, z=536,47], EntityWitch['Witch'/272, l='MpServer', x=370,31, y=14,00, z=595,25], EntityCreeper['Creeper'/138, l='MpServer', x=298,77, y=24,00, z=506,35], EntitySpider['Spider'/141, l='MpServer', x=250,47, y=29,00, z=539,03], EntityZombie['Zombie'/278, l='MpServer', x=343,44, y=26,00, z=624,66], EntitySkeleton['Skeleton'/140, l='MpServer', x=244,84, y=29,00, z=543,50], EntitySquid['Squid'/143, l='MpServer', x=257,47, y=50,93, z=607,89], EntityWitch['Witch'/142, l='MpServer', x=339,60, y=27,00, z=531,69], EntitySquid['Squid'/129, l='MpServer', x=326,38, y=39,12, z=552,42], EntitySquid['Squid'/128, l='MpServer', x=327,54, y=39,00, z=550,77], EntitySquid['Squid'/131, l='MpServer', x=268,56, y=40,00, z=564,51], EntitySquid['Squid'/130, l='MpServer', x=286,01, y=41,13, z=587,16], EntitySquid['Squid'/133, l='MpServer', x=260,00, y=37,40, z=532,41], EntitySquid['Squid'/132, l='MpServer', x=269,43, y=55,05, z=567,63], EntitySquid['Squid'/135, l='MpServer', x=279,54, y=45,00, z=522,50], EntitySquid['Squid'/134, l='MpServer', x=259,50, y=39,23, z=543,95], EntityCreeper['Creeper'/258, l='MpServer', x=372,50, y=13,00, z=583,50], EntitySpider['Spider'/259, l='MpServer', x=370,38, y=13,00, z=585,31], EntitySpider['Spider'/256, l='MpServer', x=367,77, y=11,00, z=576,03], EntitySkeleton['Skeleton'/154, l='MpServer', x=332,94, y=26,00, z=496,50], EntityCreeper['Creeper'/257, l='MpServer', x=371,25, y=13,00, z=580,56], EntityMinecartChest['entity.MinecartChest.name'/262, l='MpServer', x=360,50, y=15,50, z=615,88], EntitySpider['Spider'/263, l='MpServer', x=361,59, y=22,00, z=618,94], EntityZombie['Zombie'/260, l='MpServer', x=368,77, y=18,00, z=576,53], EntityCreeper['Creeper'/158, l='MpServer', x=339,66, y=31,00, z=525,53], EntityBat['Bat'/266, l='MpServer', x=359,90, y=23,01, z=606,84], EntitySquid['Squid'/144, l='MpServer', x=242,16, y=52,42, z=522,72], EntityZombie['Zombie'/267, l='MpServer', x=246,30, y=11,03, z=628,70], EntitySkeleton['Skeleton'/145, l='MpServer', x=326,50, y=16,00, z=500,31], EntityCreeper['Creeper'/264, l='MpServer', x=363,47, y=24,04, z=620,67], EntityBat['Bat'/265, l='MpServer', x=359,44, y=23,04, z=615,61], EntityZombie['Zombie'/149, l='MpServer', x=324,47, y=23,00, z=497,02], EntityCreeper['Creeper'/169, l='MpServer', x=340,03, y=24,00, z=519,38], EntityZombie['Zombie'/174, l='MpServer', x=339,50, y=15,00, z=590,50], EntityCreeper['Creeper'/162, l='MpServer', x=346,50, y=26,00, z=523,50], EntitySkeleton['Skeleton'/160, l='MpServer', x=341,50, y=26,00, z=526,13], EntityCreeper['Creeper'/167, l='MpServer', x=342,30, y=24,00, z=517,22], EntityCreeper['Creeper'/165, l='MpServer', x=345,44, y=25,00, z=521,41], EntityBat['Bat'/288, l='MpServer', x=353,45, y=11,00, z=470,27], EntityItem['item.tile.rail'/186, l='MpServer', x=331,06, y=12,13, z=606,16], EntitySquid['Squid'/187, l='MpServer', x=327,72, y=59,92, z=594,52], EntityItem['item.tile.rail'/184, l='MpServer', x=329,09, y=12,13, z=605,53], EntityZombie['Zombie'/291, l='MpServer', x=374,30, y=14,00, z=614,53], EntityZombie['Zombie'/178, l='MpServer', x=336,41, y=15,00, z=584,03], EntityZombie['Zombie'/176, l='MpServer', x=334,96, y=15,00, z=586,53], EntityBat['Bat'/204, l='MpServer', x=310,06, y=16,10, z=612,53], EntitySkeleton['Skeleton'/207, l='MpServer', x=344,09, y=27,00, z=509,53], EntityCreeper['Creeper'/206, l='MpServer', x=255,53, y=23,97, z=593,75], EntitySkeleton['Skeleton'/201, l='MpServer', x=231,13, y=30,00, z=538,50], EntityMinecartChest['entity.MinecartChest.name'/203, l='MpServer', x=314,50, y=19,50, z=610,50], EntityCreeper['Creeper'/202, l='MpServer', x=354,50, y=26,00, z=532,03], EntitySkeleton['Skeleton'/197, l='MpServer', x=233,13, y=24,00, z=546,50], EntitySquid['Squid'/199, l='MpServer', x=292,42, y=55,38, z=487,12], EntityZombie['Zombie'/194, l='MpServer', x=227,50, y=30,00, z=557,50], EntityCreeper['Creeper'/220, l='MpServer', x=363,50, y=14,00, z=588,50], EntityZombie['Zombie'/221, l='MpServer', x=364,22, y=14,00, z=582,34], EntityCreeper['Creeper'/222, l='MpServer', x=367,92, y=13,00, z=582,03], EntityZombie['Zombie'/223, l='MpServer', x=357,50, y=20,00, z=589,94], EntitySquid['Squid'/216, l='MpServer', x=259,69, y=55,99, z=488,35], EntitySkeleton['Skeleton'/217, l='MpServer', x=331,75, y=27,00, z=483,53], EntityCreeper['Creeper'/218, l='MpServer', x=354,09, y=25,00, z=526,53], EntitySkeleton['Skeleton'/212, l='MpServer', x=349,34, y=15,00, z=593,89], EntityCreeper['Creeper'/213, l='MpServer', x=342,56, y=12,00, z=595,66], EntityBat['Bat'/214, l='MpServer', x=244,61, y=25,00, z=530,14], EntitySkeleton['Skeleton'/208, l='MpServer', x=340,53, y=27,00, z=510,09], EntitySkeleton['Skeleton'/209, l='MpServer', x=337,26, y=30,00, z=497,58], EntityCreeper['Creeper'/210, l='MpServer', x=338,77, y=31,00, z=498,26], EntitySquid['Squid'/211, l='MpServer', x=346,34, y=55,73, z=507,77], EntitySpider['Spider'/239, l='MpServer', x=355,44, y=20,00, z=596,06], EntityBat['Bat'/238, l='MpServer', x=361,75, y=16,10, z=594,28], EntityMinecartChest['entity.MinecartChest.name'/237, l='MpServer', x=352,50, y=27,50, z=599,50], EntitySpider['Spider'/236, l='MpServer', x=354,81, y=15,00, z=595,28], EntitySpider['Spider'/232, l='MpServer', x=341,37, y=27,00, z=496,57], EntitySkeleton['Skeleton'/231, l='MpServer', x=236,38, y=23,00, z=507,75], EntityCreeper['Creeper'/230, l='MpServer', x=233,50, y=32,00, z=606,50], EntitySpider['Spider'/228, l='MpServer', x=251,78, y=15,24, z=617,53], EntityBat['Bat'/227, l='MpServer', x=322,25, y=31,10, z=618,25], EntityBat['Bat'/226, l='MpServer', x=361,09, y=16,10, z=589,28], EntityCreeper['Creeper'/225, l='MpServer', x=359,75, y=17,00, z=578,84], EntitySkeleton['Skeleton'/224, l='MpServer', x=367,95, y=18,00, z=576,50], EntityZombie['Zombie'/250, l='MpServer', x=259,16, y=18,00, z=624,44], EntityZombie['Zombie'/251, l='MpServer', x=216,16, y=22,00, z=515,25], EntityBat['Bat'/246, l='MpServer', x=367,50, y=17,73, z=575,50], EntitySkeleton['Skeleton'/127, l='MpServer', x=321,84, y=28,00, z=560,22], EntityMinecartChest['entity.MinecartChest.name'/247, l='MpServer', x=319,50, y=14,50, z=628,50], EntitySkeleton['Skeleton'/126, l='MpServer', x=321,50, y=27,16, z=557,46], EntitySquid['Squid'/125, l='MpServer', x=260,50, y=39,00, z=547,39], EntitySquid['Squid'/124, l='MpServer', x=278,89, y=50,01, z=543,23], EntitySquid['Squid'/123, l='MpServer', x=300,37, y=44,00, z=530,65], EntitySquid['Squid'/122, l='MpServer', x=302,53, y=39,70, z=547,47], EntityBat['Bat'/240, l='MpServer', x=355,03, y=27,10, z=596,22], EntityClientPlayerMP['Bowser338'/120, l='MpServer', x=294,09, y=28,62, z=550,88]] Retry entities: 0 total; [] Server brand: fml,forge Server type: Integrated singleplayer server Stacktrace: at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:415) at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2555) at net.minecraft.client.Minecraft.run(Minecraft.java:980) at net.minecraft.client.main.Main.main(Main.java:164) 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 GradleStart.bounce(GradleStart.java:107) at GradleStart.startClient(GradleStart.java:100) at GradleStart.main(GradleStart.java:65) – System Details -- Details: Minecraft Version: 1.7.10 Operating System: Windows 7 (amd64) version 6.1 Java Version: 1.7.0_51, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 758906560 bytes (723 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: 12, tallocated: 94 FML: MCP v9.05 FML v7.10.85.1231 Minecraft Forge 10.13.2.1231 4 mods loaded, 4 mods active mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available FML{7.10.85.1231} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.2.1231.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Forge{10.13.2.1231} [Minecraft Forge] (forgeSrc-1.7.10-10.13.2.1231.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available roboticmod{1.0.0} [Robotic Mod] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Launched Version: 1.7.10 LWJGL: 2.9.1 OpenGL: GeForce GTX 770/PCIe/SSE2 GL version 4.4.0, NVIDIA Corporation GL Caps: Using GL 1.3 multitexturing. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Anisotropic filtering is supported and maximum anisotropy is 16. Shaders are available because OpenGL 2.1 is supported. Is Modded: Definitely; Client brand changed to 'fml,forge' Type: Client (map_client.txt) Resource Packs: [] Current Language: English (US) Profiler Position: N/A (disabled) Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Anisotropic Filtering: Off (1)
-
As-tu remplis ta fonction getLocalGuiContainer dans le GuiHandler ? Si non, mets-y exactement pareil que pour le serveur en changeant le return par le gui de ton bloc.
Ce qui donne :
@Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { TileEntity te = world.getTileEntity(x, y, z); if(te instanceof TonTileEntity) return new GuiDetonBloc(player.inventory, (TonTileEntity)te); return null; }
-
j’ai sa :
@Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { if(ID == 0){ TileEntityFourArc tileEntityFourArc = (TileEntityFourArc) world.getTileEntity(x, y, z); return new ContainerFourArc(player.inventory, tileEntityFourArc); } return null; } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { if(ID == 0){ TileEntityFourArc ContainerFourArc = (TileEntityFourArc) world.getTileEntity(x, y, z); return new GuiFourArc(player.inventory, ContainerFourArc); } return null; }
en faisant comme tu me dit sa me met des erreurs
-
Tu as un NPE, à mon avis c’est ton instance qui est null, envoie ta classe principale.
-
je pense que j’ai oublié des choses dans la classe principale
package com.bowser.robotic.common; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.common.MinecraftForge; import com.bowser.robotic.proxy.CommonProxy; 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.network.NetworkRegistry; import cpw.mods.fml.common.registry.GameRegistry; @Mod(modid = "roboticmod", name = "Mod Robotic", version = "1.0.0") public class Robotic { public static final String modid = "roboticmod"; @Instance("roboticmod") public static Robotic instance; @SidedProxy(clientSide = "com.bowser.robotic.proxy.ClientProxy", serverSide = "com.bowser.robotic.proxy.CommonProxy") public static CommonProxy proxy; //blocks public static Block cuivreOre; public static Block blockCable; public static Block boisResine; public static Block feuillesResine; public static Block pousseResine; public static Block fourArc; public static Block lithiumOre; //items public static Item copperIngot; public static Item lithiumDust; @EventHandler public void preInit(FMLPreInitializationEvent event) { //Blocks cuivreOre = new OreCuivre(Material.rock).setBlockName("cuivreore").setBlockTextureName("roboticmod:orecuivre").setCreativeTab(CreativeTabs.tabBlock).setHardness(3.0F).setResistance(5.0F); GameRegistry.registerBlock(cuivreOre, "block_cuivre"); lithiumOre = new LithiumOre(Material.rock).setBlockName("lithiumore").setBlockTextureName("roboticmod:orelithium").setCreativeTab(CreativeTabs.tabBlock).setHardness(4.0F).setResistance(5.0F); GameRegistry.registerBlock(lithiumOre, "block_lithium"); //blocks+techne fourArc = new FourArcBlock(Material.rock, false).setBlockName("fourarc").setBlockTextureName("roboticmod:fourarcbreak").setCreativeTab(CreativeTabs.tabBlock).setHardness(3.0F).setResistance(5.0F); GameRegistry.registerBlock(fourArc, "four_arc"); blockCable = new BlockElectricCable().setBlockName("blockPipe").setCreativeTab(CreativeTabs.tabBlock); GameRegistry.registerBlock(blockCable, "block_cable"); //arbre de Resine boisResine = new BoisResine().setBlockTextureName("roboticmod:resine_bois").setBlockName("resine_bois"); feuillesResine = new FeuillesResine().setBlockTextureName("roboticmod:feuilles").setBlockName("resine_feuilles"); pousseResine = new PousseResine().setBlockTextureName("roboticmod:pousse").setBlockName("resine_pousse"); GameRegistry.registerBlock(boisResine , "resine_bois"); GameRegistry.registerBlock(feuillesResine , "resine_feuilles"); GameRegistry.registerBlock(pousseResine, "resine_pousse"); //items copperIngot = new CopperIngot().setUnlocalizedName("copperingot").setTextureName("roboticmod:copperingot").setCreativeTab(CreativeTabs.tabMaterials); GameRegistry.registerItem(copperIngot, "copper_ingot"); lithiumDust = new LithiumDust().setUnlocalizedName("lithiumdust").setTextureName("roboticmod:lithiumdust").setCreativeTab(CreativeTabs.tabMaterials); GameRegistry.registerItem(lithiumDust, "lithium_dust"); //recipe furnace basic GameRegistry.addSmelting(cuivreOre, new ItemStack(copperIngot, 1), 0f); } @EventHandler public void init(FMLInitializationEvent event) { proxy.registerRender(); proxy.registerTileEntityRender(); GameRegistry.registerTileEntity(TileEntityFourArc.class, "FourArc"); //generator GameRegistry.registerWorldGenerator(new WorldGeneratorCopper(), 0); //generation Arbres a Resine GameRegistry.registerWorldGenerator(new WorldGeneration(), 0); GameRegistry.registerTileEntity(TileEntityPipe.class, "Pipe"); } @EventHandler public void postInit(FMLPostInitializationEvent event) { } }
-
En fait non, ton instance est bonne, je viens de relire le crash, le npe n’est pas sur l’instance, mais ici :
at cpw.mods.fml.common.network.NetworkRegistry.getLocalGuiContainer(NetworkRegistry.java:263)
Donc le problème vient bien du GuiHandle que tu n’as visiblement pas enregistré.
Donc enregistre ton gui handler de la methode init de ta classe principale et ça sera bon. -
Désoler mais je sais pas du tout comment faire
j’ai regarder le tuto et j’ai adapté ( comme sa change en 1.7.10 )donc dans Init de la classe principale sa donne
proxy.registerGuiHandler(this.instance, new GuiHandler());donc dans CommonProxy il me dit de mettre :
public void registerGuiHandler(Robotic instance, GuiHandler guiHandler) { }
je dois mettre quelque chose dedans ? parce que sa ne marche toujours pas enfin toujours la meme erreur donc a pirori je l’ai mal enregistré
-
Non, il faut que tu enregistre le GuiHandler dans la fonction init de ta classe principale, regarde le tutoriel
-
c’est bon j’ai réussi
dans la classe principale on a :%(#555555)[[font=Arial, tahoma, sans-serif]proxy.registerGuiHandler(this.instance, new GuiHandler());]
et dans le CommonProxy :
public void registerGuiHandler(Robotic instance, GuiHandler guiHandler) { // TODO Auto-generated method stub NetworkRegistry.INSTANCE.registerGuiHandler(Robotic.modid, new GuiHandler()); }
En tout cas merci de votre aide a tous
-
Tu peux directement mettre le “NetworkRegistry.INSTANCE.registerGuiHandler(Robotic.modid, new GuiHandler());” dans ta fonction init.
-
Ok bon a savoir merci en tout cas