mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-18 19:39:22 +00:00
Registry: Allow ignoring missing mods from the GUI, with confirm+backup
Registry: Add confirm+backup for automated corrupted id table fixup Require the user to confirm loading from a backup level.dat
This commit is contained in:
1 parent
9be92dcfcb
commit
fd6d55afcc
11 files changed
+228
-147
No files matched your search
@@ -21,9 +21,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -57,6 +55,7 @@ import net.minecraft.network.ServerStatusResponse;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.WorldSettings;
|
||||
import net.minecraft.world.storage.ISaveFormat;
|
||||
|
||||
import org.apache.logging.log4j.Level;
|
||||
import org.lwjgl.input.Mouse;
|
||||
@@ -77,7 +76,6 @@ import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.common.DummyModContainer;
|
||||
import cpw.mods.fml.common.DuplicateModsFoundException;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.FMLContainer;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import cpw.mods.fml.common.IFMLSidedHandler;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
@@ -88,7 +86,6 @@ import cpw.mods.fml.common.ModContainer;
|
||||
import cpw.mods.fml.common.ModMetadata;
|
||||
import cpw.mods.fml.common.ObfuscationReflectionHelper;
|
||||
import cpw.mods.fml.common.StartupQuery;
|
||||
import cpw.mods.fml.common.WorldAccessContainer;
|
||||
import cpw.mods.fml.common.WrongMinecraftVersionException;
|
||||
import cpw.mods.fml.common.event.FMLMissingMappingsEvent;
|
||||
import cpw.mods.fml.common.event.FMLMissingMappingsEvent.Action;
|
||||
@@ -441,6 +438,18 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||
{
|
||||
client.displayGuiScreen(new GuiConfirmation(query));
|
||||
}
|
||||
|
||||
if (query.isSynchronous())
|
||||
{
|
||||
while (!(client.currentScreen instanceof GuiMainMenu))
|
||||
{
|
||||
if (Thread.interrupted()) throw new InterruptedException();
|
||||
|
||||
client.loadingScreen.resetProgresAndWorkingMessage("");
|
||||
|
||||
Thread.sleep(50);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean handleLoadingScreen(ScaledResolution scaledResolution)
|
||||
@@ -486,6 +495,12 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||
// NOOP
|
||||
}
|
||||
|
||||
@Override
|
||||
public ISaveFormat getSaveFormat()
|
||||
{
|
||||
return client.getSaveLoader();
|
||||
}
|
||||
|
||||
@Override
|
||||
public MinecraftServer getServer()
|
||||
{
|
||||
@@ -635,7 +650,14 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||
}
|
||||
else
|
||||
{
|
||||
client.launchIntegratedServer(dirName, saveName, (WorldSettings)null);
|
||||
try
|
||||
{
|
||||
client.launchIntegratedServer(dirName, saveName, (WorldSettings)null);
|
||||
}
|
||||
catch (StartupQuery.AbortedException e)
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -820,19 +842,6 @@ public class FMLClientHandler implements IFMLSidedHandler
|
||||
}
|
||||
}
|
||||
|
||||
public void setDefaultMissingAction(FMLMissingMappingsEvent.Action action)
|
||||
{
|
||||
this.defaultMissingAction = action;
|
||||
}
|
||||
|
||||
private Action defaultMissingAction = FMLMissingMappingsEvent.Action.FAIL;
|
||||
|
||||
@Override
|
||||
public Action getDefaultMissingAction()
|
||||
{
|
||||
return defaultMissingAction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldAllowPlayerLogins()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user