Fix saving backups with the raw name.

Fix air block not being assigned as the default.
This commit is contained in:
Player 2014-04-30 09:44:09 +02:00
parent 2d3cd66680
commit 74c89da967
3 changed files with 10 additions and 14 deletions

View file

@ -27,7 +27,7 @@ public class GuiOldSaveLoadConfirm extends GuiYesNo {
super(parent, "", "", 0); super(parent, "", "", 0);
this.dirName = dirName; this.dirName = dirName;
this.saveName = saveName; 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 @Override
public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_)

View file

@ -64,24 +64,20 @@ public class ZipperUtil {
public static void backupWorld() throws IOException public static void backupWorld() throws IOException
{ {
String dirName = FMLCommonHandler.instance().getMinecraftServerInstance().getFolderName(); String dirName = FMLCommonHandler.instance().getMinecraftServerInstance().getFolderName();
String saveName;
if (FMLCommonHandler.instance().getSide().isClient()) backupWorld(dirName);
{
saveName = FMLCommonHandler.instance().getMinecraftServerInstance().getWorldName();
}
else
{
saveName = dirName;
}
backupWorld(dirName, saveName);
} }
@Deprecated
public static void backupWorld(String dirName, String saveName) throws IOException 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 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 try
{ {

View file

@ -687,7 +687,7 @@ public class GameData {
private GameData() private GameData()
{ {
iBlockRegistry = new FMLControlledNamespacedRegistry<Block>("air", MAX_BLOCK_ID, MIN_BLOCK_ID, Block.class,'\u0001'); iBlockRegistry = new FMLControlledNamespacedRegistry<Block>("minecraft:air", MAX_BLOCK_ID, MIN_BLOCK_ID, Block.class,'\u0001');
iItemRegistry = new FMLControlledNamespacedRegistry<Item>(null, MAX_ITEM_ID, MIN_ITEM_ID, Item.class,'\u0002'); iItemRegistry = new FMLControlledNamespacedRegistry<Item>(null, MAX_ITEM_ID, MIN_ITEM_ID, Item.class,'\u0002');
availabilityMap = new BitSet(MAX_ITEM_ID + 1); availabilityMap = new BitSet(MAX_ITEM_ID + 1);
blockedIds = new HashSet<Integer>(); blockedIds = new HashSet<Integer>();