From 74c89da967c154ff8384b27a2679741e2a6105eb Mon Sep 17 00:00:00 2001 From: Player Date: Wed, 30 Apr 2014 09:44:09 +0200 Subject: [PATCH] Fix saving backups with the raw name. Fix air block not being assigned as the default. --- .../fml/client/GuiOldSaveLoadConfirm.java | 2 +- .../java/cpw/mods/fml/common/ZipperUtil.java | 20 ++++++++----------- .../mods/fml/common/registry/GameData.java | 2 +- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/fml/src/main/java/cpw/mods/fml/client/GuiOldSaveLoadConfirm.java b/fml/src/main/java/cpw/mods/fml/client/GuiOldSaveLoadConfirm.java index 426daa06b..f684347fe 100644 --- a/fml/src/main/java/cpw/mods/fml/client/GuiOldSaveLoadConfirm.java +++ b/fml/src/main/java/cpw/mods/fml/client/GuiOldSaveLoadConfirm.java @@ -27,7 +27,7 @@ public class GuiOldSaveLoadConfirm extends GuiYesNo { super(parent, "", "", 0); this.dirName = dirName; this.saveName = saveName; - this.zip = new File(FMLClientHandler.instance().getClient().mcDataDir,String.format("%s-%2$td%2$tm%2$ty%2$tH%2$tM%2$tS.zip", saveName, System.currentTimeMillis())); + this.zip = new File(FMLClientHandler.instance().getClient().mcDataDir,String.format("%s-%2$td%2$tm%2$ty%2$tH%2$tM%2$tS.zip", dirName, System.currentTimeMillis())); } @Override public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) diff --git a/fml/src/main/java/cpw/mods/fml/common/ZipperUtil.java b/fml/src/main/java/cpw/mods/fml/common/ZipperUtil.java index 0dfaefff8..a92a3c32c 100644 --- a/fml/src/main/java/cpw/mods/fml/common/ZipperUtil.java +++ b/fml/src/main/java/cpw/mods/fml/common/ZipperUtil.java @@ -64,24 +64,20 @@ public class ZipperUtil { public static void backupWorld() throws IOException { String dirName = FMLCommonHandler.instance().getMinecraftServerInstance().getFolderName(); - String saveName; - if (FMLCommonHandler.instance().getSide().isClient()) - { - saveName = FMLCommonHandler.instance().getMinecraftServerInstance().getWorldName(); - } - else - { - saveName = dirName; - } - - backupWorld(dirName, saveName); + backupWorld(dirName); } + @Deprecated public static void backupWorld(String dirName, String saveName) throws IOException + { + backupWorld(dirName); + } + + public static void backupWorld(String dirName) throws IOException { File dstFolder = FMLCommonHandler.instance().getSavesDirectory(); - File zip = new File(dstFolder, String.format("%s-%2$tY%2$tm%2$td-%2$tH%2$tM%2$tS.zip", saveName, System.currentTimeMillis())); + File zip = new File(dstFolder, String.format("%s-%2$tY%2$tm%2$td-%2$tH%2$tM%2$tS.zip", dirName, System.currentTimeMillis())); try { diff --git a/fml/src/main/java/cpw/mods/fml/common/registry/GameData.java b/fml/src/main/java/cpw/mods/fml/common/registry/GameData.java index 5f679c400..9d17d1ea0 100644 --- a/fml/src/main/java/cpw/mods/fml/common/registry/GameData.java +++ b/fml/src/main/java/cpw/mods/fml/common/registry/GameData.java @@ -687,7 +687,7 @@ public class GameData { private GameData() { - iBlockRegistry = new FMLControlledNamespacedRegistry("air", MAX_BLOCK_ID, MIN_BLOCK_ID, Block.class,'\u0001'); + iBlockRegistry = new FMLControlledNamespacedRegistry("minecraft:air", MAX_BLOCK_ID, MIN_BLOCK_ID, Block.class,'\u0001'); iItemRegistry = new FMLControlledNamespacedRegistry(null, MAX_ITEM_ID, MIN_ITEM_ID, Item.class,'\u0002'); availabilityMap = new BitSet(MAX_ITEM_ID + 1); blockedIds = new HashSet();