Jump to content

Recommended Posts

Posted (edited)

Hi,

So I've created 2 mods, one is server side only and retreive some information from a database, and the other is an usual client/server side mod.

On the server side mod I have an HashMap containing information I want to display to the player. I've created this method :

 

	public static Account getAccount(UUID uuid) {
		if (!accounts.containsKey(uuid))
			return null;
		return accounts.get(uuid);
	}

 

I then try to call my getAccount() method from the server side of my main mod (I try to load the informations in the constructor of a container) and I send the information to the client using packets.

The problem is that when I open the GUI, the game freezes and leaves no crash report. Have you got any idea on how to resolve this problem ?

 

PS: In order to test my setup I've included the server side mod into the build path of the main mod

 

Thanks,

-Fuze

Edited by FuzeIII
Posted

Open the GUI? What do you mean?

 

Freezing can mean a couple of things. One is that you ran in the debugger and hit a breakpoint. Try kicking your IDE to take you to its debugger panel. The other is that your code sank into an infinite loop. If you wait long enough, the stack will exhaust available memory and crash out with a memory error. The call trace will then show you the recursive calling loop (again and again and again).

 

Another (that you should never do) is that a modder wants to delay some action, so he calls some system level wait method that hangs the JRE. In-game delays need to be implemented with tick handlers so that the rest of the game can continue to run.

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

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.