Jump to content

Display Minecraft Standard Background (Dirt) after the loading of Forge


ErfinderLabyrinth

Recommended Posts

  • ErfinderLabyrinth changed the title to Display Minecraft Standard Background (Dirt) after the loading of Forge

I have now solved it like this:

//Called when the mod is loaded
new Thread(() -> {
			while (true) {
				if (!ClientModLoader.isLoading()) {
					try {
						Thread.sleep(3000);
					} catch (InterruptedException e) {
						e.printStackTrace();
					}
					Minecraft.getInstance().setScreen(new LoadScreen());
					return;
				}
			}
		}).start();
//Called when the main screen is to be loaded
public static void finished() {
	java.lang.System.out.println("finishedloading");
	Minecraft.getInstance().setScreen(new MainMenuScreen());

}

I realize that this only works with the client and not on the server

But are there any other problems besides the one mentioned above?

Link to comment
Share on other sites

1. Die drei Sekunden sind dafür da, da wenn ClientModLoader.isLoading() false ist, es trotzdem noch kurz braucht, bis man mit der Methode Minecraft#setScreen erfolgreich einen Screen anzeigen kann.

2. Der Thread fragt dauerhaft, ob Forge mit dem Laden fertig sei und wenn Forge mit dem Laden fertig ist wartet es 3 Sekunden(Begründung siehe 1.) und lädt den Load Screen. Wenn die Load-Engine fertig ist, wird die Methode finished() aufgerufen, dieser dann den Hauptbildschirm ladet.

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.