Jump to content

[SOLVED] GUI Tutorial Problems


pro-mole

Recommended Posts

GOOD NEWS I've found a solution here: http://www.minecraftforum.net/topic/1513224-solved-a-mod-tried-to-open-a-gui-on-the-server-without-being-a-networkmod-solution-included/ Guess this notation isn't in any tutorial yet.

 

I've started developing my first GUI using this tutorial from this very site, but I've reached a problem in the very last thing that needs to be done, opening the GUI. The code states this code

 

player.openGui(YourMod.instance, 0, world, x, y, z);

 

will open the GUI when called in the onBlockActivated call for my block. Problem is, "YourMod.instance" (where YourMod is the class name of my mode) is not a valid variable, so Minecraft fails at that point. What would be the correct call for my mod's instance in this case?

Link to comment
Share on other sites

  • 2 weeks later...

i used the solution but now it crashes whenever i open a gui Error log:

 


      Minecraft has crashed!      
      ----------------------      

Minecraft has stopped running because it encountered a problem; Unexpected error
This error has been saved to C:\Users\Ash\Documents\Programming\MCP\jars\.\crash-reports\crash-2012-10-22_05.28.28-client.txt for your convenience. Please include a copy of this file if you report this crash to anyone.



--- BEGIN ERROR REPORT 2a84ab19 --------
Generated 10/22/12 5:28 AM

- Minecraft Version: 1.3.2
- Operating System: Windows 7 (amd64) version 6.1
- Java Version: 1.7.0_05, Oracle Corporation
- Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
- Memory: 892157480 bytes (850 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
- JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
- FML: FML v3.1.50.400 Minecraft Forge 4.2.5.317 3 mods loaded, 3 mods active
FML [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available
Forge [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available
EC [Electro Craft] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available
- LWJGL: 2.4.2
- OpenGL: Intel(R) HD Graphics GL version 2.1.0 - Build 8.15.10.2555, Intel
- Is Modded: Definitely; 'forge,fml'
- Type: Client
- Texture Pack: Default
- Profiler Position: N/A (disabled)
- World MpServer Entities: 1 total; [EntityClientPlayerMP['Player400'/3, l='MpServer', x=-2507.51, y=5.62, z=505.93]]
- World MpServer Players: 1 total; [EntityClientPlayerMP['Player400'/3, l='MpServer', x=-2507.51, y=5.62, z=505.93]]
- World MpServer Chunk Stats: MultiplayerChunkCache: 441
- Forced Entities: 1 total; [EntityClientPlayerMP['Player400'/3, l='MpServer', x=-2507.51, y=5.62, z=505.93]]
- Retry Entities: 0 total; []

java.lang.NullPointerException
at cpw.mods.fml.common.network.NetworkRegistry.openLocalGui(NetworkRegistry.java:322)
at cpw.mods.fml.common.network.FMLNetworkHandler.openGui(FMLNetworkHandler.java:341)
at net.minecraft.src.EntityPlayer.openGui(EntityPlayer.java:2051)
at Firediamond.Mods.Blocks.Discharger.onBlockActivated(Discharger.java:29)
at net.minecraft.src.PlayerControllerMP.onPlayerRightClick(PlayerControllerMP.java:322)
at net.minecraft.client.Minecraft.clickMouse(Minecraft.java:1318)
at net.minecraft.client.Minecraft.runTick(Minecraft.java:1731)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:845)
at net.minecraft.client.Minecraft.run(Minecraft.java:775)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT ae481e47 ----------

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.