Fix translations in replay recovery gui
This commit is contained in:
@@ -344,7 +344,7 @@ public class ReplayMod implements
|
|||||||
|
|
||||||
testIfMoeshAndExitMinecraft();
|
testIfMoeshAndExitMinecraft();
|
||||||
|
|
||||||
runLater(() -> {
|
runPostStartup(() -> {
|
||||||
// Cleanup deleted corrupted replays
|
// Cleanup deleted corrupted replays
|
||||||
try {
|
try {
|
||||||
File[] files = getReplayFolder().listFiles();
|
File[] files = getReplayFolder().listFiles();
|
||||||
@@ -390,6 +390,27 @@ public class ReplayMod implements
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute the given runnable after game has started (once the overlay has been closed).
|
||||||
|
* Most importantly, it will run after resources (including language keys!) have been loaded.
|
||||||
|
* Below 1.14, this is equivalent to {@link #runLater(Runnable)}.
|
||||||
|
*/
|
||||||
|
public void runPostStartup(Runnable runnable) {
|
||||||
|
runLater(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
//#if MC>=11400
|
||||||
|
if (getMinecraft().overlay != null) {
|
||||||
|
// delay until after resources have been loaded
|
||||||
|
runLater(this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//#endif
|
||||||
|
runnable.run();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set when the currently running code has been scheduled by runLater.
|
* Set when the currently running code has been scheduled by runLater.
|
||||||
* If this is the case, subsequent calls to runLater have to be delayed until all scheduled tasks have been
|
* If this is the case, subsequent calls to runLater have to be delayed until all scheduled tasks have been
|
||||||
|
|||||||
@@ -86,19 +86,9 @@ public class ReplayModOnline extends EventRegistrations implements Module {
|
|||||||
// Initial login prompt
|
// Initial login prompt
|
||||||
if (!core.getSettingsRegistry().get(Setting.SKIP_LOGIN_PROMPT)) {
|
if (!core.getSettingsRegistry().get(Setting.SKIP_LOGIN_PROMPT)) {
|
||||||
if (!isLoggedIn()) {
|
if (!isLoggedIn()) {
|
||||||
core.runLater(new Runnable() {
|
core.runPostStartup(() -> {
|
||||||
@Override
|
GuiScreen parent = GuiScreen.wrap(getMinecraft().currentScreen);
|
||||||
public void run() {
|
new GuiLoginPrompt(apiClient, parent, parent, false).display();
|
||||||
//#if MC>=11400
|
|
||||||
if (getMinecraft().overlay != null) {
|
|
||||||
// delay until after resources have been loaded
|
|
||||||
core.runLater(this);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
//#endif
|
|
||||||
GuiScreen parent = GuiScreen.wrap(getMinecraft().currentScreen);
|
|
||||||
new GuiLoginPrompt(apiClient, parent, parent, false).display();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user