Résolu Problème GUI
-
Normal, hitX, hitY et hitZ correspondent à l’endroit où le joueur a cliqué, regarde les valeurs que tu mets. utilise le paramètre blockPos (pos.getX() etc.).
-
Oui, mais a la moindre modification, Ecplise me demande d’enlever l’Override
-
Car tu essaie de modifier les paramètres de ta fonction, revois tes cours en java.
-
j’ai fait que deux cours, je les attaques sérieusement dans 13j, quand je part en vacances
-
@‘Eryah’:
tout fonctionne, du moins, je le croyais… openGUI veut des int, et non des float…
@Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) { FMLNetworkHandler.*openGui*(playerIn, 1, UsefulthingsMod.instance, worldIn, hitX, hitY, hitZ); }
The method openGui(EntityPlayer, Object, int, World, int, int, int) in the type FMLNetworkHandler is not applicable for the arguments (EntityPlayer, int, UsefulthingsMod, World, float, float, float)
SÉRIEUSEMENT !!!
Je t’ai dit d’utiliser :
playerIn.openGui(ClassePrincipale.instance, id du gui, worldIn, pos.getX(), pos.getY(), pos.getZ());u_U
-
Sa me demande un return, je met true ou false ?
-
true si tu veux qu’il y est l’animation du bras (c’est ce qu’il faut mettre dans la plupart des cas). Si tu mets false et qu’un joueur a un block en main, çà va poser le block.
-
Mon GUI ne s’ouvre toujours pas…
Il y a pourtant tout …
Surement car…
@Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { if(ID == GUI.CRUSHER.ordinal()) return new GuiCrusher(((TileEntityCrusher)world.getTileEntity(new BlockPos(x, y, z))), player.inventory); return ****null****; }
C’était ça.
Par contre… Je crash au rightclick, d’après le crash-report, il y a un problème au niveau de l’affichage du GUI---- Minecraft Crash Report ---- // Ooh. Shiny. Time: 05/07/15 22:59 Description: Unexpected error java.lang.ClassCastException: java.lang.Boolean cannot be cast to net.minecraft.client.gui.GuiScreen at net.minecraftforge.fml.client.FMLClientHandler.showGuiScreen(FMLClientHandler.java:472) at net.minecraftforge.fml.common.FMLCommonHandler.showGuiScreen(FMLCommonHandler.java:344) at net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:98) at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2577) at eryah.usefulthings.blocks.Crusher.onBlockActivated(Crusher.java:151) at net.minecraft.client.multiplayer.PlayerControllerMP.func_178890_a(PlayerControllerMP.java:416) at net.minecraft.client.Minecraft.rightClickMouse(Minecraft.java:1571) at net.minecraft.client.Minecraft.runTick(Minecraft.java:2130) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1087) at net.minecraft.client.Minecraft.run(Minecraft.java:376) at net.minecraft.client.main.Main.main(Main.java:117) 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 net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) at GradleStart.main(Unknown Source) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at net.minecraftforge.fml.client.FMLClientHandler.showGuiScreen(FMLClientHandler.java:472) at net.minecraftforge.fml.common.FMLCommonHandler.showGuiScreen(FMLCommonHandler.java:344) at net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:98) at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2577) at eryah.usefulthings.blocks.Crusher.onBlockActivated(Crusher.java:151) at net.minecraft.client.multiplayer.PlayerControllerMP.func_178890_a(PlayerControllerMP.java:416) at net.minecraft.client.Minecraft.rightClickMouse(Minecraft.java:1571) -- Affected level -- Details: Level name: MpServer All players: 1 total; [EntityPlayerSP['Eryah'/105, l='MpServer', x=181,55, y=65,91, z=316,90]] Chunk stats: MultiplayerChunkCache: 30, 30 Level seed: 0 Level generator: ID 01 - flat, ver 0\. Features enabled: false Level generator options: Level spawn location: 182,00,4,00,237,00 - World: (182,4,237), Chunk: (at 6,0,13 in 11,14; contains blocks 176,0,224 to 191,255,239), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511) Level time: 1934547 game time, 1 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: 62 total; [EntityItemFrame['entity.ItemFrame.name'/22, l='MpServer', x=182,97, y=65,50, z=239,50], EntityItemFrame['entity.ItemFrame.name'/23, l='MpServer', x=182,97, y=65,50, z=251,50], EntityItemFrame['entity.ItemFrame.name'/24, l='MpServer', x=182,97, y=65,50, z=255,50], EntityItemFrame['entity.ItemFrame.name'/25, l='MpServer', x=182,97, y=65,50, z=241,50], EntityItemFrame['entity.ItemFrame.name'/26, l='MpServer', x=182,97, y=65,50, z=243,50], EntityItemFrame['entity.ItemFrame.name'/27, l='MpServer', x=182,97, y=65,50, z=245,50], EntityItemFrame['entity.ItemFrame.name'/28, l='MpServer', x=182,97, y=65,50, z=247,50], EntityItemFrame['entity.ItemFrame.name'/29, l='MpServer', x=182,97, y=65,50, z=253,50], EntityItemFrame['entity.ItemFrame.name'/30, l='MpServer', x=182,97, y=65,50, z=249,50], EntityItemFrame['entity.ItemFrame.name'/31, l='MpServer', x=182,97, y=65,50, z=259,50], EntityItemFrame['entity.ItemFrame.name'/32, l='MpServer', x=182,97, y=65,50, z=263,50], EntityItemFrame['entity.ItemFrame.name'/33, l='MpServer', x=182,97, y=65,50, z=257,50], EntityItemFrame['entity.ItemFrame.name'/34, l='MpServer', x=182,97, y=65,50, z=261,50], EntityItemFrame['entity.ItemFrame.name'/35, l='MpServer', x=182,97, y=65,50, z=271,50], EntityItemFrame['entity.ItemFrame.name'/36, l='MpServer', x=182,97, y=65,50, z=265,50], EntityItemFrame['entity.ItemFrame.name'/37, l='MpServer', x=182,97, y=65,50, z=269,50], EntityItemFrame['entity.ItemFrame.name'/38, l='MpServer', x=182,97, y=65,50, z=267,50], EntityItemFrame['entity.ItemFrame.name'/39, l='MpServer', x=182,97, y=65,50, z=283,50], EntityItemFrame['entity.ItemFrame.name'/40, l='MpServer', x=182,97, y=65,50, z=273,50], EntityItemFrame['entity.ItemFrame.name'/41, l='MpServer', x=182,97, y=65,50, z=279,50], EntityItemFrame['entity.ItemFrame.name'/42, l='MpServer', x=182,97, y=65,50, z=277,50], EntityItemFrame['entity.ItemFrame.name'/43, l='MpServer', x=182,97, y=65,50, z=281,50], EntityItemFrame['entity.ItemFrame.name'/44, l='MpServer', x=182,97, y=65,50, z=285,50], EntityItemFrame['entity.ItemFrame.name'/45, l='MpServer', x=182,97, y=65,50, z=287,50], EntityItemFrame['entity.ItemFrame.name'/46, l='MpServer', x=182,97, y=65,50, z=275,50], EntityItemFrame['entity.ItemFrame.name'/47, l='MpServer', x=182,97, y=65,50, z=299,50], EntityItemFrame['entity.ItemFrame.name'/48, l='MpServer', x=182,97, y=65,50, z=301,50], EntityItemFrame['entity.ItemFrame.name'/49, l='MpServer', x=182,97, y=65,50, z=289,50], EntityItemFrame['entity.ItemFrame.name'/50, l='MpServer', x=182,97, y=65,50, z=293,50], EntityItemFrame['entity.ItemFrame.name'/51, l='MpServer', x=182,97, y=65,50, z=297,50], EntityItemFrame['entity.ItemFrame.name'/52, l='MpServer', x=182,97, y=65,50, z=295,50], EntityItemFrame['entity.ItemFrame.name'/53, l='MpServer', x=182,97, y=65,50, z=303,50], EntityItemFrame['entity.ItemFrame.name'/54, l='MpServer', x=182,97, y=65,50, z=291,50], EntityItemFrame['entity.ItemFrame.name'/55, l='MpServer', x=182,97, y=65,50, z=309,50], EntityItemFrame['entity.ItemFrame.name'/56, l='MpServer', x=182,97, y=65,50, z=319,50], EntityItemFrame['entity.ItemFrame.name'/57, l='MpServer', x=182,97, y=65,50, z=305,50], EntityItemFrame['entity.ItemFrame.name'/58, l='MpServer', x=182,97, y=65,50, z=313,50], EntityItemFrame['entity.ItemFrame.name'/59, l='MpServer', x=179,03, y=65,50, z=319,50], EntityItemFrame['entity.ItemFrame.name'/60, l='MpServer', x=182,97, y=65,50, z=317,50], EntityItemFrame['entity.ItemFrame.name'/61, l='MpServer', x=182,97, y=65,50, z=311,50], EntityItemFrame['entity.ItemFrame.name'/62, l='MpServer', x=182,97, y=65,50, z=307,50], EntityItemFrame['entity.ItemFrame.name'/63, l='MpServer', x=182,97, y=65,50, z=315,50], EntityItemFrame['entity.ItemFrame.name'/64, l='MpServer', x=182,97, y=65,50, z=333,50], EntityItemFrame['entity.ItemFrame.name'/65, l='MpServer', x=182,97, y=65,50, z=335,50], EntityItemFrame['entity.ItemFrame.name'/66, l='MpServer', x=182,97, y=65,50, z=331,50], EntityItemFrame['entity.ItemFrame.name'/67, l='MpServer', x=182,97, y=65,50, z=327,50], EntityItemFrame['entity.ItemFrame.name'/68, l='MpServer', x=182,97, y=65,50, z=323,50], EntityItemFrame['entity.ItemFrame.name'/69, l='MpServer', x=182,97, y=65,50, z=329,50], EntityItemFrame['entity.ItemFrame.name'/70, l='MpServer', x=182,97, y=65,50, z=325,50], EntityItemFrame['entity.ItemFrame.name'/71, l='MpServer', x=182,97, y=65,50, z=321,50], EntityItemFrame['entity.ItemFrame.name'/72, l='MpServer', x=179,03, y=65,50, z=321,50], EntityItemFrame['entity.ItemFrame.name'/73, l='MpServer', x=182,97, y=65,50, z=337,50], EntityItemFrame['entity.ItemFrame.name'/74, l='MpServer', x=182,97, y=65,50, z=341,50], EntityItemFrame['entity.ItemFrame.name'/75, l='MpServer', x=182,97, y=65,50, z=339,50], EntityItemFrame['entity.ItemFrame.name'/76, l='MpServer', x=182,97, y=65,50, z=343,50], EntityItemFrame['entity.ItemFrame.name'/77, l='MpServer', x=182,97, y=65,50, z=345,50], EntityRabbit['Lapin'/87, l='MpServer', x=213,97, y=64,00, z=254,19], EntityRabbit['Lapin'/88, l='MpServer', x=218,69, y=64,00, z=249,97], EntityCow['Vache'/89, l='MpServer', x=222,78, y=64,00, z=282,16], EntityCow['Vache'/90, l='MpServer', x=217,19, y=64,00, z=275,81], EntityCow['Vache'/91, l='MpServer', x=213,66, y=64,00, z=343,19], EntityPlayerSP['Eryah'/105, l='MpServer', x=181,55, y=65,91, z=316,90]] Retry entities: 0 total; [] Server brand: fml,forge Server type: Integrated singleplayer server Stacktrace: at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:392) at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2613) at net.minecraft.client.Minecraft.run(Minecraft.java:405) at net.minecraft.client.main.Main.main(Main.java:117) 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 net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) at GradleStart.main(Unknown Source) – System Details -- Details: Minecraft Version: 1.8 Operating System: Windows 8.1 (amd64) version 6.3 Java Version: 1.8.0_45, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 788700336 bytes (752 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 v9.10 FML v8.99.8.1412 Minecraft Forge 11.14.1.1412 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{8.99.8.1412} [Forge Mod Loader] (forgeSrc-1.8-11.14.1.1412.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Forge{11.14.1.1412} [Minecraft Forge] (forgeSrc-1.8-11.14.1.1412.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available ut{Beta 1.0} [Useful Things] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Loaded coremods (and transformers): GL info: ' Vendor: 'ATI Technologies Inc.' Version: '4.2.12420 Compatibility Profile Context 13.151.0.0' Renderer: 'AMD Radeon HD 8240' Launched Version: 1.8 LWJGL: 2.9.1 OpenGL: AMD Radeon HD 8240 GL version 4.2.12420 Compatibility Profile Context 13.151.0.0, ATI Technologies Inc. GL Caps: Using GL 1.3 multitexturing. Using GL 1.3 texture combiners. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Shaders are available because OpenGL 2.1 is supported. VBOs are available because OpenGL 1.5 is supported. Using VBOs: No Is Modded: Definitely; Client brand changed to 'fml,forge' Type: Client (map_client.txt) Resource Packs: [] Current Language: Français (France) Profiler Position: N/A (disabled)
-
C’est mieux avec le rapport complet. As-tu bien enregistré ton GuiHandler ? Es-tu sûr de l’ID que t’utilises ? D’après ce que je vois t’utilises un enum, fait gaffe à çà. A ta place j’utiliserai plutôt un switch avec l’ID.
-
java.lang.ClassCastException: java.lang.Boolean cannot be cast to net.minecraft.client.gui.GuiScreen
Heu ? Envoie ton code car tu as fait un truc étrange. -
Donc, j’ai fais une connerie, j’ai pas supprimé une partie de code erroné, ce qu’il fait qu’un bon code s’est mélangé avec un mauvais code
Un nouveau crash. Par contre, avant le crash, j’ai vu mon curseur une demi seconde. Preuve que le GUI s’est bien ouvert
–-- Minecraft Crash Report ---- // There are four lights! Time: 05/07/15 23:14 Description: Rendering screen java.lang.ArrayIndexOutOfBoundsException: 9 at eryah.usefulthings.tileentity.TileEntityCrusher.getStackInSlot(TileEntityCrusher.java:62) at net.minecraft.inventory.Slot.getStack(Slot.java:79) at net.minecraft.client.gui.inventory.GuiContainer.drawSlot(GuiContainer.java:225) at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:116) at net.minecraftforge.client.ForgeHooksClient.drawScreen(ForgeHooksClient.java:462) at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1134) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1114) at net.minecraft.client.Minecraft.run(Minecraft.java:376) at net.minecraft.client.main.Main.main(Main.java:117) 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 net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) at GradleStart.main(Unknown Source) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at eryah.usefulthings.tileentity.TileEntityCrusher.getStackInSlot(TileEntityCrusher.java:62) at net.minecraft.inventory.Slot.getStack(Slot.java:79) at net.minecraft.client.gui.inventory.GuiContainer.drawSlot(GuiContainer.java:225) at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:116) at net.minecraftforge.client.ForgeHooksClient.drawScreen(ForgeHooksClient.java:462) -- Screen render details -- Details: Screen name: eryah.usefulthings.gui.GuiCrusher Mouse location: Scaled: (213, 119). Absolute: (427, 240) Screen size: Scaled: (427, 240). Absolute: (854, 480). Scale factor of 2 -- Affected level -- Details: Level name: MpServer All players: 1 total; [EntityPlayerSP['Eryah'/104, l='MpServer', x=181,55, y=65,91, z=316,90]] Chunk stats: MultiplayerChunkCache: 25, 25 Level seed: 0 Level generator: ID 01 - flat, ver 0\. Features enabled: false Level generator options: Level spawn location: 182,00,4,00,237,00 - World: (182,4,237), Chunk: (at 6,0,13 in 11,14; contains blocks 176,0,224 to 191,255,239), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511) Level time: 1934861 game time, 1 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: 43 total; [EntityItemFrame['entity.ItemFrame.name'/64, l='MpServer', x=182,97, y=65,50, z=335,50], EntityItemFrame['entity.ItemFrame.name'/65, l='MpServer', x=182,97, y=65,50, z=331,50], EntityItemFrame['entity.ItemFrame.name'/66, l='MpServer', x=182,97, y=65,50, z=327,50], EntityItemFrame['entity.ItemFrame.name'/67, l='MpServer', x=182,97, y=65,50, z=323,50], EntityItemFrame['entity.ItemFrame.name'/68, l='MpServer', x=182,97, y=65,50, z=329,50], EntityItemFrame['entity.ItemFrame.name'/69, l='MpServer', x=182,97, y=65,50, z=325,50], EntityItemFrame['entity.ItemFrame.name'/70, l='MpServer', x=182,97, y=65,50, z=321,50], EntityItemFrame['entity.ItemFrame.name'/71, l='MpServer', x=179,03, y=65,50, z=321,50], EntityItemFrame['entity.ItemFrame.name'/72, l='MpServer', x=182,97, y=65,50, z=337,50], EntityItemFrame['entity.ItemFrame.name'/73, l='MpServer', x=182,97, y=65,50, z=341,50], EntityItemFrame['entity.ItemFrame.name'/74, l='MpServer', x=182,97, y=65,50, z=339,50], EntityItemFrame['entity.ItemFrame.name'/75, l='MpServer', x=182,97, y=65,50, z=343,50], EntityItemFrame['entity.ItemFrame.name'/76, l='MpServer', x=182,97, y=65,50, z=345,50], EntityCow['Vache'/88, l='MpServer', x=217,91, y=64,00, z=274,13], EntityCow['Vache'/89, l='MpServer', x=217,19, y=64,00, z=275,81], EntityCow['Vache'/90, l='MpServer', x=213,66, y=64,00, z=343,19], EntityItemFrame['entity.ItemFrame.name'/38, l='MpServer', x=182,97, y=65,50, z=283,50], EntityItemFrame['entity.ItemFrame.name'/39, l='MpServer', x=182,97, y=65,50, z=273,50], EntityItemFrame['entity.ItemFrame.name'/40, l='MpServer', x=182,97, y=65,50, z=279,50], EntityPlayerSP['Eryah'/104, l='MpServer', x=181,55, y=65,91, z=316,90], EntityItemFrame['entity.ItemFrame.name'/41, l='MpServer', x=182,97, y=65,50, z=277,50], EntityItemFrame['entity.ItemFrame.name'/42, l='MpServer', x=182,97, y=65,50, z=281,50], EntityItemFrame['entity.ItemFrame.name'/43, l='MpServer', x=182,97, y=65,50, z=285,50], EntityItemFrame['entity.ItemFrame.name'/44, l='MpServer', x=182,97, y=65,50, z=287,50], EntityItemFrame['entity.ItemFrame.name'/45, l='MpServer', x=182,97, y=65,50, z=275,50], EntityItemFrame['entity.ItemFrame.name'/46, l='MpServer', x=182,97, y=65,50, z=301,50], EntityItemFrame['entity.ItemFrame.name'/47, l='MpServer', x=182,97, y=65,50, z=289,50], EntityItemFrame['entity.ItemFrame.name'/48, l='MpServer', x=182,97, y=65,50, z=293,50], EntityItemFrame['entity.ItemFrame.name'/49, l='MpServer', x=182,97, y=65,50, z=297,50], EntityItemFrame['entity.ItemFrame.name'/50, l='MpServer', x=182,97, y=65,50, z=295,50], EntityItemFrame['entity.ItemFrame.name'/51, l='MpServer', x=182,97, y=65,50, z=303,50], EntityItemFrame['entity.ItemFrame.name'/52, l='MpServer', x=182,97, y=65,50, z=291,50], EntityItemFrame['entity.ItemFrame.name'/53, l='MpServer', x=182,97, y=65,50, z=299,50], EntityItemFrame['entity.ItemFrame.name'/54, l='MpServer', x=182,97, y=65,50, z=309,50], EntityItemFrame['entity.ItemFrame.name'/55, l='MpServer', x=182,97, y=65,50, z=319,50], EntityItemFrame['entity.ItemFrame.name'/56, l='MpServer', x=182,97, y=65,50, z=305,50], EntityItemFrame['entity.ItemFrame.name'/57, l='MpServer', x=182,97, y=65,50, z=313,50], EntityItemFrame['entity.ItemFrame.name'/58, l='MpServer', x=179,03, y=65,50, z=319,50], EntityItemFrame['entity.ItemFrame.name'/59, l='MpServer', x=182,97, y=65,50, z=317,50], EntityItemFrame['entity.ItemFrame.name'/60, l='MpServer', x=182,97, y=65,50, z=311,50], EntityItemFrame['entity.ItemFrame.name'/61, l='MpServer', x=182,97, y=65,50, z=307,50], EntityItemFrame['entity.ItemFrame.name'/62, l='MpServer', x=182,97, y=65,50, z=315,50], EntityItemFrame['entity.ItemFrame.name'/63, l='MpServer', x=182,97, y=65,50, z=333,50]] Retry entities: 0 total; [] Server brand: fml,forge Server type: Integrated singleplayer server Stacktrace: at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:392) at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2613) at net.minecraft.client.Minecraft.run(Minecraft.java:398) at net.minecraft.client.main.Main.main(Main.java:117) 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 net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) at GradleStart.main(Unknown Source) – System Details -- Details: Minecraft Version: 1.8 Operating System: Windows 8.1 (amd64) version 6.3 Java Version: 1.8.0_45, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 853632336 bytes (814 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 v9.10 FML v8.99.8.1412 Minecraft Forge 11.14.1.1412 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{8.99.8.1412} [Forge Mod Loader] (forgeSrc-1.8-11.14.1.1412.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Forge{11.14.1.1412} [Minecraft Forge] (forgeSrc-1.8-11.14.1.1412.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available ut{Beta 1.0} [Useful Things] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Loaded coremods (and transformers): GL info: ' Vendor: 'ATI Technologies Inc.' Version: '4.2.12420 Compatibility Profile Context 13.151.0.0' Renderer: 'AMD Radeon HD 8240' Launched Version: 1.8 LWJGL: 2.9.1 OpenGL: AMD Radeon HD 8240 GL version 4.2.12420 Compatibility Profile Context 13.151.0.0, ATI Technologies Inc. GL Caps: Using GL 1.3 multitexturing. Using GL 1.3 texture combiners. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Shaders are available because OpenGL 2.1 is supported. VBOs are available because OpenGL 1.5 is supported. Using VBOs: No Is Modded: Definitely; Client brand changed to 'fml,forge' Type: Client (map_client.txt) Resource Packs: [] Current Language: Français (France) Profiler Position: N/A (disabled)
-
La tableau dans ton tile entity est plus petit que le nombre de slot que tu as ajouté.
-
Pas possible, je ne les ais pas changé… J’ai pris les code du four, donc 3 slots, et mon GUI à 3 slots…
-
Envoi la classe du container.
-
package eryah.usefulthings.container; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.inventory.SlotFurnaceFuel; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import eryah.usefulthings.recipes.CrusherRecipes; import eryah.usefulthings.tileentity.TileEntityCrusher; public class ContainerCrusher extends Container { private final IInventory tileCrusher; private int field_178152_f; private int field_178153_g; private int field_178154_h; private int field_178155_i; private static final String __OBFID = "CL_00001748"; public ContainerCrusher(TileEntityCrusher tileEntityCrusher, IInventory crusherInventory) { this.tileCrusher = crusherInventory; this.addSlotToContainer(new Slot(crusherInventory, 0, 56, 17)); this.addSlotToContainer(new SlotFurnaceFuel(crusherInventory, 1, 56, 53)); this.addSlotToContainer(new SlotResult(crusherInventory, 2, 116, 35)); int i; for (i = 0; i < 3; ++i) { for (int j = 0; j < 9; ++j) { this.addSlotToContainer(new Slot(tileEntityCrusher, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); } } for (i = 0; i < 9; ++i) { this.addSlotToContainer(new Slot(tileEntityCrusher, i, 8 + i * 18, 142)); } } /** * Add the given Listener to the list of Listeners. Method name is for legacy. */ public void addCraftingToCrafters(ICrafting listener) { super.addCraftingToCrafters(listener); listener.func_175173_a(this, this.tileCrusher); } /** * Looks for changes made in the container, sends them to every listener. */ public void detectAndSendChanges() { super.detectAndSendChanges(); for (int i = 0; i < this.crafters.size(); ++i) { ICrafting icrafting = (ICrafting)this.crafters.get(i); if (this.field_178152_f != this.tileCrusher.getField(2)) { icrafting.sendProgressBarUpdate(this, 2, this.tileCrusher.getField(2)); } if (this.field_178154_h != this.tileCrusher.getField(0)) { icrafting.sendProgressBarUpdate(this, 0, this.tileCrusher.getField(0)); } if (this.field_178155_i != this.tileCrusher.getField(1)) { icrafting.sendProgressBarUpdate(this, 1, this.tileCrusher.getField(1)); } if (this.field_178153_g != this.tileCrusher.getField(3)) { icrafting.sendProgressBarUpdate(this, 3, this.tileCrusher.getField(3)); } } this.field_178152_f = this.tileCrusher.getField(2); this.field_178154_h = this.tileCrusher.getField(0); this.field_178155_i = this.tileCrusher.getField(1); this.field_178153_g = this.tileCrusher.getField(3); } @SideOnly(Side.CLIENT) public void updateProgressBar(int id, int data) { this.tileCrusher.setField(id, data); } public boolean canInteractWith(EntityPlayer playerIn) { return this.tileCrusher.isUseableByPlayer(playerIn); } /** * Take a stack from the specified inventory slot. */ public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) { ItemStack itemstack = null; Slot slot = (Slot)this.inventorySlots.get(index); if (slot != null && slot.getHasStack()) { ItemStack itemstack1 = slot.getStack(); itemstack = itemstack1.copy(); if (index == 2) { if (!this.mergeItemStack(itemstack1, 3, 39, true)) { return null; } slot.onSlotChange(itemstack1, itemstack); } else if (index != 1 && index != 0) { if (CrusherRecipes.instance().getSmeltingResult(itemstack1) != null) { if (!this.mergeItemStack(itemstack1, 0, 1, false)) { return null; } } else if (TileEntityCrusher.isItemFuel(itemstack1)) { if (!this.mergeItemStack(itemstack1, 1, 2, false)) { return null; } } else if (index >= 3 && index < 30) { if (!this.mergeItemStack(itemstack1, 30, 39, false)) { return null; } } else if (index >= 30 && index < 39 && !this.mergeItemStack(itemstack1, 3, 30, false)) { return null; } } else if (!this.mergeItemStack(itemstack1, 3, 39, false)) { return null; } if (itemstack1.stackSize == 0) { slot.putStack((ItemStack)null); } else { slot.onSlotChanged(); } if (itemstack1.stackSize == itemstack.stackSize) { return null; } slot.onPickupFromSlot(playerIn, itemstack1); } return itemstack; } }
-
Tu as inversé l’inventaire du joueur et celui de ton container.
-
Je ne vois pas l’erreur…
C’est ici ? public ContainerCrusher(TileEntityCrusher tileEntityCrusher, *IInventory crusherInventory*) { this.tileCrusher = crusherInventory; this.addSlotToContainer(new Slot(crusherInventory, 0, 56, 17)); this.addSlotToContainer(new SlotFurnaceFuel(crusherInventory, 1, 56, 53)); this.addSlotToContainer(new SlotResult(crusherInventory, 2, 116, 35)); int i; for (i = 0; i < 3; ++i) { for (int j = 0; j < 9; ++j) { this.addSlotToContainer(new Slot(tileEntityCrusher, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); } } for (i = 0; i < 9; ++i) { this.addSlotToContainer(new Slot(tileEntityCrusher, i, 8 + i * 18, 142)); } }
Pour remplacer, ma fainéantise a fais que j’ai juste utiliser le find and replace, et que j’ai remplacer furnace par crusher
-
ça devrait être :
public ContainerCrusher(TileEntityCrusher tileEntityCrusher, IInventory playerInv)
et du-coup en dessous tu as inversé les deux. -
Le même crash revient…
Je ne comprends pas, il n’y a pas vraiment d’erreur…
J’ai surement des variables, paramètres, ou autre non compatibles vanilla -> Forge -
Renvoies ton code.