Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class GuiEvents {
- @SubscribeEvent
- public void overdrawGui(GuiScreenEvent.InitGuiEvent e){
- GuiScreen screen=null;
- if(e.getGui() instanceof GuiWorldSelection)
- Minecraft.getMinecraft().displayGuiScreen(new net.rexozz.pixelengine.client.gui.GuiWorldSelection(screen));
- else
- screen=e.getGui();
- }
- public static void tryLoadExistingWorld(net.rexozz.pixelengine.client.gui.GuiWorldSelection selectWorldGUI, WorldSummary comparator)
- {
- File dir = new File(new File(Minecraft.getMinecraft().mcDataDir, "saves"), comparator.getFileName());
- NBTTagCompound leveldat;
- try
- {
- leveldat = CompressedStreamTools.readCompressed(new FileInputStream(new File(dir, "level.dat")));
- }
- catch (Exception e)
- {
- try
- {
- leveldat = CompressedStreamTools.readCompressed(new FileInputStream(new File(dir, "level.dat_old")));
- }
- catch (Exception e1)
- {
- FMLLog.warning("There appears to be a problem loading the save %s, both level files are unreadable.", comparator.getFileName());
- return;
- }
- }
- NBTTagCompound fmlData = leveldat.getCompoundTag("FML");
- if (fmlData.hasKey("ModItemData"))
- {
- GuiScreen gui = (GuiScreen) new GuiOldSaveLoadConfirm(comparator.getFileName(), comparator.getDisplayName(), selectWorldGUI);
- Minecraft.getMinecraft().displayGuiScreen(gui);
- }
- else
- {
- try
- {
- Minecraft.getMinecraft().launchIntegratedServer(comparator.getFileName(), comparator.getDisplayName(), null);
- }
- catch (StartupQuery.AbortedException e)
- {
- // ignore
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement