Jump to content

Recommended Posts

Posted (edited)

Hi

I want to program a mod where, after loading Forge, the Minecraft standard screen (which is displayed when you load e.B. a world, when you change a dimension, when you change settings, ...) is displayed with a text (which changes frequently).

Edited by ErfinderLabyrinth
  • ErfinderLabyrinth changed the title to Display Minecraft Standard Background (Dirt) after the loading of Forge
Posted
10 minutes ago, diesieben07 said:

Please elaborate on what you mean by "finished loading" exactly.

Once the red background with the Mojang logo and the loading bar in the title screen where you can also select the options single player, multiplayer, ... has

Posted

maybe he's angry at people and wants them to read his advertisement (or bad poetry) before allowing them into the game?

or he simply forgot most important thing about making a mod - that mods are additions that other people would hopefully enjoy.

Posted

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?

Posted

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.

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.