Save/load files

This commit is contained in:
PeytonPlayz595 2024-02-08 21:31:59 -05:00
parent 4100b8e110
commit c03763f0be
9 changed files with 120 additions and 181 deletions

View File

@ -1,6 +1,5 @@
package net.minecraft.client; package net.minecraft.client;
import java.io.File;
import net.minecraft.src.AxisAlignedBB; import net.minecraft.src.AxisAlignedBB;
import net.minecraft.src.Block; import net.minecraft.src.Block;
import net.minecraft.src.EffectRenderer; import net.minecraft.src.EffectRenderer;
@ -10,8 +9,6 @@ import net.minecraft.src.EntityRenderer;
import net.minecraft.src.FontRenderer; import net.minecraft.src.FontRenderer;
import net.minecraft.src.GLAllocation; import net.minecraft.src.GLAllocation;
import net.minecraft.src.GameSettings; import net.minecraft.src.GameSettings;
import net.minecraft.src.GameWindowListener;
import net.minecraft.src.GuiChat;
import net.minecraft.src.GuiConflictWarning; import net.minecraft.src.GuiConflictWarning;
import net.minecraft.src.GuiGameOver; import net.minecraft.src.GuiGameOver;
import net.minecraft.src.GuiIngame; import net.minecraft.src.GuiIngame;
@ -90,7 +87,6 @@ public class Minecraft implements Runnable {
public MovingObjectPosition objectMouseOver = null; public MovingObjectPosition objectMouseOver = null;
public GameSettings gameSettings; public GameSettings gameSettings;
public MouseHelper mouseHelper; public MouseHelper mouseHelper;
public File field_6297_D;
public static long[] field_9240_E = new long[512]; public static long[] field_9240_E = new long[512];
public static long[] field_9239_F = new long[512]; public static long[] field_9239_F = new long[512];
public static int field_9238_G = 0; public static int field_9238_G = 0;
@ -98,7 +94,6 @@ public class Minecraft implements Runnable {
private int field_9233_W; private int field_9233_W;
private TextureWaterFX field_9232_X = new TextureWaterFX(); private TextureWaterFX field_9232_X = new TextureWaterFX();
private TextureLavaFX field_9231_Y = new TextureLavaFX(); private TextureLavaFX field_9231_Y = new TextureLavaFX();
private static File minecraftDir = null;
public volatile boolean running = true; public volatile boolean running = true;
public String field_6292_I = ""; public String field_6292_I = "";
boolean field_6291_J = false; boolean field_6291_J = false;
@ -125,8 +120,7 @@ public class Minecraft implements Runnable {
public void startGame() { public void startGame() {
RenderManager.instance.field_4236_f = new ItemRenderer(this); RenderManager.instance.field_4236_f = new ItemRenderer(this);
this.field_6297_D = getMinecraftDir(); this.gameSettings = new GameSettings(this);
this.gameSettings = new GameSettings(this, this.field_6297_D);
this.renderEngine = new RenderEngine(this.gameSettings); this.renderEngine = new RenderEngine(this.gameSettings);
this.fontRenderer = new FontRenderer(this.gameSettings, "/font/default.png", this.renderEngine); this.fontRenderer = new FontRenderer(this.gameSettings, "/font/default.png", this.renderEngine);
this.loadScreen(); this.loadScreen();
@ -211,14 +205,6 @@ public class Minecraft implements Runnable {
var9.draw(); var9.draw();
} }
public static File getMinecraftDir() {
if(minecraftDir == null) {
minecraftDir = new File("minecraft");
}
return minecraftDir;
}
public void displayGuiScreen(GuiScreen var1) { public void displayGuiScreen(GuiScreen var1) {
if(!(this.currentScreen instanceof GuiUnused)) { if(!(this.currentScreen instanceof GuiUnused)) {
if(this.currentScreen != null) { if(this.currentScreen != null) {
@ -775,7 +761,7 @@ public class Minecraft implements Runnable {
public void func_6247_b(String var1) { public void func_6247_b(String var1) {
this.func_6261_a((World)null); this.func_6261_a((World)null);
System.gc(); System.gc();
World var2 = new World(new File(getMinecraftDir(), "saves"), var1); World var2 = new World("saves", var1);
if(var2.field_1033_r) { if(var2.field_1033_r) {
this.func_6263_a(var2, "Generating level"); this.func_6263_a(var2, "Generating level");
} else { } else {

View File

@ -1,51 +1,35 @@
package net.minecraft.src; package net.minecraft.src;
import java.io.File; import java.io.ByteArrayInputStream;
import java.io.FileInputStream; import java.io.ByteArrayOutputStream;
import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.util.Iterator; import java.util.Iterator;
import org.lwjgl.opengl.GL11;
public class ChunkLoader implements IChunkLoader { public class ChunkLoader implements IChunkLoader {
private File saveDir; private String saveDir;
private boolean createIfNecessary; private boolean createIfNecessary;
public ChunkLoader(File var1, boolean var2) { public ChunkLoader(String var1, boolean var2) {
this.saveDir = var1; this.saveDir = var1;
this.createIfNecessary = var2; this.createIfNecessary = var2;
} }
private File chunkFileForXZ(int var1, int var2) { private String chunkFileForXZ(int var1, int var2) {
String var3 = "c." + Integer.toString(var1, 36) + "." + Integer.toString(var2, 36) + ".dat"; String var3 = "c." + Integer.toString(var1, 36) + "." + Integer.toString(var2, 36) + ".dat";
String var4 = Integer.toString(var1 & 63, 36); String var4 = Integer.toString(var1 & 63, 36);
String var5 = Integer.toString(var2 & 63, 36); String var5 = Integer.toString(var2 & 63, 36);
File var6 = new File(this.saveDir, var4); String var6 = this.saveDir + "/" + var4 + "/" + var3;
if(!var6.exists()) { return var6;
if(!this.createIfNecessary) {
return null;
}
var6.mkdir();
}
var6 = new File(var6, var5);
if(!var6.exists()) {
if(!this.createIfNecessary) {
return null;
}
var6.mkdir();
}
var6 = new File(var6, var3);
return !var6.exists() && !this.createIfNecessary ? null : var6;
} }
public Chunk loadChunk(World var1, int var2, int var3) throws IOException { public Chunk loadChunk(World var1, int var2, int var3) throws IOException {
File var4 = this.chunkFileForXZ(var2, var3); String var4 = this.chunkFileForXZ(var2, var3);
if(var4 != null && var4.exists()) { if(GL11.readFile(var4) != null) {
try { try {
FileInputStream var5 = new FileInputStream(var4); byte[] data = GL11.readFile(var4);
ByteArrayInputStream var5 = new ByteArrayInputStream(data);
NBTTagCompound var6 = CompressedStreamTools.func_1138_a(var5); NBTTagCompound var6 = CompressedStreamTools.func_1138_a(var5);
if(!var6.hasKey("Level")) { if(!var6.hasKey("Level")) {
System.out.println("Chunk file at " + var2 + "," + var3 + " is missing level data, skipping"); System.out.println("Chunk file at " + var2 + "," + var3 + " is missing level data, skipping");
@ -76,26 +60,28 @@ public class ChunkLoader implements IChunkLoader {
public void saveChunk(World var1, Chunk var2) throws IOException { public void saveChunk(World var1, Chunk var2) throws IOException {
var1.func_663_l(); var1.func_663_l();
File var3 = this.chunkFileForXZ(var2.xPosition, var2.zPosition); String var3 = this.chunkFileForXZ(var2.xPosition, var2.zPosition);
if(var3.exists()) { if(GL11.readFile(var3) != null) {
var1.sizeOnDisk -= var3.length(); var1.sizeOnDisk -= GL11.getFileSize(var3);
} }
try { try {
File var4 = new File(this.saveDir, "tmp_chunk.dat"); String var4 = this.saveDir + "/tmp_chunk.dat";
FileOutputStream var5 = new FileOutputStream(var4); ByteArrayOutputStream var5 = new ByteArrayOutputStream();
NBTTagCompound var6 = new NBTTagCompound(); NBTTagCompound var6 = new NBTTagCompound();
NBTTagCompound var7 = new NBTTagCompound(); NBTTagCompound var7 = new NBTTagCompound();
var6.setTag("Level", var7); var6.setTag("Level", var7);
this.storeChunkInCompound(var2, var1, var7); this.storeChunkInCompound(var2, var1, var7);
CompressedStreamTools.writeGzippedCompoundToOutputStream(var6, var5); CompressedStreamTools.writeGzippedCompoundToOutputStream(var6, var5);
var5.flush();
GL11.writeFile(var4, var5.toByteArray());
var5.close(); var5.close();
if(var3.exists()) { if(GL11.readFile(var3) != null) {
var3.delete(); GL11.deleteFile(var3);
} }
var4.renameTo(var3); GL11.renameFile(var4, var3);
var1.sizeOnDisk += var3.length(); var1.sizeOnDisk += GL11.getFileSize(var3);
} catch (Exception var8) { } catch (Exception var8) {
var8.printStackTrace(); var8.printStackTrace();
} }

View File

@ -1,12 +1,13 @@
package net.minecraft.src; package net.minecraft.src;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.File; import java.io.ByteArrayInputStream;
import java.io.FileReader; import java.io.ByteArrayOutputStream;
import java.io.FileWriter; import java.io.InputStreamReader;
import java.io.PrintWriter; import java.io.PrintWriter;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;
public class GameSettings { public class GameSettings {
private static final String[] RENDER_DISTANCES = new String[]{"FAR", "NORMAL", "SHORT", "TINY"}; private static final String[] RENDER_DISTANCES = new String[]{"FAR", "NORMAL", "SHORT", "TINY"};
@ -33,15 +34,13 @@ public class GameSettings {
public KeyBinding keyBindSneak = new KeyBinding("Sneak", 42); public KeyBinding keyBindSneak = new KeyBinding("Sneak", 42);
public KeyBinding[] keyBindings = new KeyBinding[]{this.keyBindForward, this.keyBindLeft, this.keyBindBack, this.keyBindRight, this.keyBindJump, this.keyBindSneak, this.keyBindDrop, this.keyBindInventory, this.keyBindChat, this.keyBindToggleFog}; public KeyBinding[] keyBindings = new KeyBinding[]{this.keyBindForward, this.keyBindLeft, this.keyBindBack, this.keyBindRight, this.keyBindJump, this.keyBindSneak, this.keyBindDrop, this.keyBindInventory, this.keyBindChat, this.keyBindToggleFog};
protected Minecraft mc; protected Minecraft mc;
private File optionsFile;
public int numberOfOptions = 10; public int numberOfOptions = 10;
public int difficulty = 2; public int difficulty = 2;
public boolean thirdPersonView = false; public boolean thirdPersonView = false;
public String field_12259_z = ""; public String field_12259_z = "";
public GameSettings(Minecraft var1, File var2) { public GameSettings(Minecraft var1) {
this.mc = var1; this.mc = var1;
this.optionsFile = new File(var2, "options.txt");
this.loadOptions(); this.loadOptions();
} }
@ -119,11 +118,14 @@ public class GameSettings {
public void loadOptions() { public void loadOptions() {
try { try {
if(!this.optionsFile.exists()) { byte[] fileData = GL11.readFile("options.txt");
if(fileData == null) {
return; return;
} }
BufferedReader var1 = new BufferedReader(new FileReader(this.optionsFile)); ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(fileData);
InputStreamReader inputStreamReader = new InputStreamReader(byteArrayInputStream, "UTF-8");
BufferedReader var1 = new BufferedReader(inputStreamReader);
String var2 = ""; String var2 = "";
while(true) { while(true) {
@ -201,7 +203,8 @@ public class GameSettings {
public void saveOptions() { public void saveOptions() {
try { try {
PrintWriter var1 = new PrintWriter(new FileWriter(this.optionsFile)); ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
PrintWriter var1 = new PrintWriter(byteArrayOutputStream);
var1.println("music:" + this.musicVolume); var1.println("music:" + this.musicVolume);
var1.println("sound:" + this.soundVolume); var1.println("sound:" + this.soundVolume);
var1.println("invertYMouse:" + this.invertMouse); var1.println("invertYMouse:" + this.invertMouse);
@ -218,6 +221,10 @@ public class GameSettings {
for(int var2 = 0; var2 < this.keyBindings.length; ++var2) { for(int var2 = 0; var2 < this.keyBindings.length; ++var2) {
var1.println("key_" + this.keyBindings[var2].keyDescription + ":" + this.keyBindings[var2].keyCode); var1.println("key_" + this.keyBindings[var2].keyDescription + ":" + this.keyBindings[var2].keyCode);
} }
var1.flush();
byte[] fileData = byteArrayOutputStream.toByteArray();
GL11.writeFile("options.txt", fileData);
var1.close(); var1.close();
} catch (Exception var3) { } catch (Exception var3) {

View File

@ -1,27 +0,0 @@
package net.minecraft.src;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import net.minecraft.client.Minecraft;
public final class GameWindowListener extends WindowAdapter {
final Minecraft mc;
final Thread mcThread;
public GameWindowListener(Minecraft var1, Thread var2) {
this.mc = var1;
this.mcThread = var2;
}
public void windowClosing(WindowEvent var1) {
this.mc.shutdown();
try {
this.mcThread.join();
} catch (InterruptedException var3) {
var3.printStackTrace();
}
System.exit(0);
}
}

View File

@ -1,6 +1,5 @@
package net.minecraft.src; package net.minecraft.src;
import java.io.File;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
public class GuiDeleteWorld extends GuiSelectWorld { public class GuiDeleteWorld extends GuiSelectWorld {
@ -23,8 +22,7 @@ public class GuiDeleteWorld extends GuiSelectWorld {
public void deleteWorld(boolean var1, int var2) { public void deleteWorld(boolean var1, int var2) {
if(var1) { if(var1) {
File var3 = Minecraft.getMinecraftDir(); World.deleteWorld(this.getWorldName(var2));
World.deleteWorld(var3, this.getWorldName(var2));
} }
this.mc.displayGuiScreen(this.parentScreen); this.mc.displayGuiScreen(this.parentScreen);

View File

@ -1,6 +1,5 @@
package net.minecraft.src; package net.minecraft.src;
import java.io.File;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
public class GuiSelectWorld extends GuiScreen { public class GuiSelectWorld extends GuiScreen {
@ -13,10 +12,8 @@ public class GuiSelectWorld extends GuiScreen {
} }
public void initGui() { public void initGui() {
File var1 = Minecraft.getMinecraftDir();
for(int var2 = 0; var2 < 5; ++var2) { for(int var2 = 0; var2 < 5; ++var2) {
NBTTagCompound var3 = World.func_629_a(var1, "World" + (var2 + 1)); NBTTagCompound var3 = World.func_629_a("World" + (var2 + 1));
if(var3 == null) { if(var3 == null) {
this.controlList.add(new GuiButton(var2, this.width / 2 - 100, this.height / 6 + 24 * var2, "- empty -")); this.controlList.add(new GuiButton(var2, this.width / 2 - 100, this.height / 6 + 24 * var2, "- empty -"));
} else { } else {
@ -31,8 +28,7 @@ public class GuiSelectWorld extends GuiScreen {
} }
protected String getWorldName(int var1) { protected String getWorldName(int var1) {
File var2 = Minecraft.getMinecraftDir(); return World.func_629_a("World" + var1) != null ? "World" + var1 : null;
return World.func_629_a(var2, "World" + var1) != null ? "World" + var1 : null;
} }
public void initGui2() { public void initGui2() {

View File

@ -1,12 +1,15 @@
package net.minecraft.src; package net.minecraft.src;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream; import java.io.DataInputStream;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.File; //import java.io.File;
import java.io.FileInputStream; //import java.io.FileInputStream;
import java.io.FileOutputStream; //import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
@ -14,6 +17,8 @@ import java.util.Random;
import java.util.Set; import java.util.Set;
import java.util.TreeSet; import java.util.TreeSet;
import org.lwjgl.opengl.GL11;
public class World implements IBlockAccess { public class World implements IBlockAccess {
public boolean field_4214_a; public boolean field_4214_a;
private List field_1051_z; private List field_1051_z;
@ -40,8 +45,8 @@ public class World implements IBlockAccess {
public final WorldProvider worldProvider; public final WorldProvider worldProvider;
protected List worldAccesses; protected List worldAccesses;
private IChunkProvider chunkProvider; private IChunkProvider chunkProvider;
public File field_9433_s; public String field_9433_s;
public File field_9432_t; public String field_9432_t;
public long randomSeed; public long randomSeed;
private NBTTagCompound nbtCompoundPlayer; private NBTTagCompound nbtCompoundPlayer;
public long sizeOnDisk; public long sizeOnDisk;
@ -54,52 +59,42 @@ public class World implements IBlockAccess {
private int field_9426_L; private int field_9426_L;
private List field_1012_M; private List field_1012_M;
public static NBTTagCompound func_629_a(File var0, String var1) { public static NBTTagCompound func_629_a(String var1) {
File var2 = new File(var0, "saves"); byte[] data = GL11.readFile("saves/" + var1 + "/level.dat");
File var3 = new File(var2, var1); if(!(data == null)) {
if(!var3.exists()) { try {
return null; NBTTagCompound var5 = CompressedStreamTools.func_1138_a(new ByteArrayInputStream(data));
} else { NBTTagCompound var6 = var5.getCompoundTag("Data");
File var4 = new File(var3, "level.dat"); return var6;
if(var4.exists()) { } catch (Exception var7) {
try { var7.printStackTrace();
NBTTagCompound var5 = CompressedStreamTools.func_1138_a(new FileInputStream(var4)); }
NBTTagCompound var6 = var5.getCompoundTag("Data"); }
return var6; return null;
} catch (Exception var7) { }
var7.printStackTrace();
}
}
return null; public static void deleteWorld(String var1) {
} String path = "saves/" + var1 + "/";
} Collection<GL11.FileEntry> files = GL11.listFiles(path, true, false);
public static void deleteWorld(File var0, String var1) { for(GL11.FileEntry entry : files) {
File var2 = new File(var0, "saves"); byte[] data = GL11.readFile(entry.path);
File var3 = new File(var2, var1); if(data != null) {
if(var3.exists()) { GL11.deleteFile(entry.path);
deleteFiles(var3.listFiles()); }
var3.delete(); }
}
} byte[] data = GL11.readFile("saves/" + var1 + "/");
if(data != null) {
private static void deleteFiles(File[] var0) { GL11.deleteFile("saves/" + var1 + "/");
for(int var1 = 0; var1 < var0.length; ++var1) { }
if(var0[var1].isDirectory()) { }
deleteFiles(var0[var1].listFiles());
}
var0[var1].delete();
}
}
public WorldChunkManager func_4075_a() { public WorldChunkManager func_4075_a() {
return this.worldProvider.worldChunkMgr; return this.worldProvider.worldChunkMgr;
} }
public World(File var1, String var2) { public World(String var1, String var2) {
this(var1, var2, (new Random()).nextLong()); this(var1, var2, (new Random()).nextLong());
} }
@ -181,11 +176,11 @@ public class World implements IBlockAccess {
this.calculateInitialSkylight(); this.calculateInitialSkylight();
} }
public World(File var1, String var2, long var3) { public World(String var1, String var2, long var3) {
this(var1, var2, var3, (WorldProvider)null); this(var1, var2, var3, (WorldProvider)null);
} }
public World(File var1, String var2, long var3, WorldProvider var5) { public World(String var1, String var2, long var3, WorldProvider var5) {
this.field_4214_a = false; this.field_4214_a = false;
this.field_1051_z = new ArrayList(); this.field_1051_z = new ArrayList();
this.loadedEntityList = new ArrayList(); this.loadedEntityList = new ArrayList();
@ -214,17 +209,17 @@ public class World implements IBlockAccess {
this.field_1012_M = new ArrayList(); this.field_1012_M = new ArrayList();
this.field_9433_s = var1; this.field_9433_s = var1;
this.field_9431_w = var2; this.field_9431_w = var2;
var1.mkdirs(); this.field_9432_t = var1 + "/" + var2;
this.field_9432_t = new File(var1, var2);
this.field_9432_t.mkdirs();
try { try {
File var6 = new File(this.field_9432_t, "session.lock"); ByteArrayOutputStream data = new ByteArrayOutputStream();
DataOutputStream var7 = new DataOutputStream(new FileOutputStream(var6)); DataOutputStream var7 = new DataOutputStream(data);
try { try {
var7.writeLong(this.field_1054_E); var7.writeLong(this.field_1054_E);
} finally { } finally {
var7.flush();
GL11.writeFile(this.field_9432_t + "/session.lock", data.toByteArray());
var7.close(); var7.close();
} }
} catch (IOException var16) { } catch (IOException var16) {
@ -233,11 +228,12 @@ public class World implements IBlockAccess {
} }
Object var17 = new WorldProvider(); Object var17 = new WorldProvider();
File var18 = new File(this.field_9432_t, "level.dat"); String var18 = this.field_9432_t + "/level.dat";
this.field_1033_r = !var18.exists(); this.field_1033_r = GL11.readFile(var18) == null;
if(var18.exists()) { byte[] data = GL11.readFile(var18);
if(data != null) {
try { try {
NBTTagCompound var8 = CompressedStreamTools.func_1138_a(new FileInputStream(var18)); NBTTagCompound var8 = CompressedStreamTools.func_1138_a(new ByteArrayInputStream(data));
NBTTagCompound var9 = var8.getCompoundTag("Data"); NBTTagCompound var9 = var8.getCompoundTag("Data");
this.randomSeed = var9.getLong("RandomSeed"); this.randomSeed = var9.getLong("RandomSeed");
this.spawnX = var9.getInteger("SpawnX"); this.spawnX = var9.getInteger("SpawnX");
@ -285,7 +281,7 @@ public class World implements IBlockAccess {
this.calculateInitialSkylight(); this.calculateInitialSkylight();
} }
protected IChunkProvider func_4081_a(File var1) { protected IChunkProvider func_4081_a(String var1) {
return new ChunkProviderLoadOrGenerate(this, this.worldProvider.getChunkLoader(var1), this.worldProvider.getChunkProvider()); return new ChunkProviderLoadOrGenerate(this, this.worldProvider.getChunkLoader(var1), this.worldProvider.getChunkProvider());
} }
@ -367,22 +363,25 @@ public class World implements IBlockAccess {
var3.setTag("Data", var1); var3.setTag("Data", var1);
try { try {
File var4 = new File(this.field_9432_t, "level.dat_new"); String var4 = field_9432_t + "/level.dat_new";
File var5 = new File(this.field_9432_t, "level.dat_old"); String var5 = field_9432_t + "/level.dat_old";
File var6 = new File(this.field_9432_t, "level.dat"); String var6 = field_9432_t + "/level.dat";
CompressedStreamTools.writeGzippedCompoundToOutputStream(var3, new FileOutputStream(var4)); ByteArrayOutputStream data = new ByteArrayOutputStream();
if(var5.exists()) { CompressedStreamTools.writeGzippedCompoundToOutputStream(var3, data);
var5.delete(); GL11.writeFile(var4, data.toByteArray());
if(GL11.readFile(var5) != null) {
GL11.deleteFile(var5);
} }
var6.renameTo(var5); GL11.renameFile(var6, var5);
if(var6.exists()) { if(GL11.readFile(var6) != null) {
var6.delete(); GL11.deleteFile(var6);
} }
var4.renameTo(var6); GL11.renameFile(var4, var6);
if(var4.exists()) { if(GL11.readFile(var4) != null) {
var4.delete(); GL11.deleteFile(var4);
} }
} catch (Exception var7) { } catch (Exception var7) {
var7.printStackTrace(); var7.printStackTrace();
@ -1530,10 +1529,10 @@ public class World implements IBlockAccess {
} else { } else {
++this.field_4204_J; ++this.field_4204_J;
boolean var2;
try { try {
int var1 = 5000; int var1 = 5000;
boolean var2;
while(this.field_1051_z.size() > 0) { while(this.field_1051_z.size() > 0) {
--var1; --var1;
if(var1 <= 0) { if(var1 <= 0) {
@ -1545,11 +1544,10 @@ public class World implements IBlockAccess {
} }
var2 = false; var2 = false;
return var2;
} finally { } finally {
--this.field_4204_J; --this.field_4204_J;
} }
return var2;
} }
} }
@ -1954,8 +1952,8 @@ public class World implements IBlockAccess {
public void func_663_l() { public void func_663_l() {
try { try {
File var1 = new File(this.field_9432_t, "session.lock"); String var1 = this.field_9432_t + "/session.lock";
DataInputStream var2 = new DataInputStream(new FileInputStream(var1)); DataInputStream var2 = new DataInputStream(new ByteArrayInputStream(GL11.readFile(var1)));
try { try {
if(var2.readLong() != this.field_1054_E) { if(var2.readLong() != this.field_1054_E) {

View File

@ -1,7 +1,5 @@
package net.minecraft.src; package net.minecraft.src;
import java.io.File;
public class WorldProvider { public class WorldProvider {
public World worldObj; public World worldObj;
public WorldChunkManager worldChunkMgr; public WorldChunkManager worldChunkMgr;
@ -36,7 +34,7 @@ public class WorldProvider {
return new ChunkProviderGenerate(this.worldObj, this.worldObj.randomSeed); return new ChunkProviderGenerate(this.worldObj, this.worldObj.randomSeed);
} }
public IChunkLoader getChunkLoader(File var1) { public IChunkLoader getChunkLoader(String var1) {
return new ChunkLoader(var1, true); return new ChunkLoader(var1, true);
} }

View File

@ -1,7 +1,5 @@
package net.minecraft.src; package net.minecraft.src;
import java.io.File;
public class WorldProviderHell extends WorldProvider { public class WorldProviderHell extends WorldProvider {
public void registerWorldChunkManager() { public void registerWorldChunkManager() {
this.worldChunkMgr = new WorldChunkManagerHell(MobSpawnerBase.hell, 1.0D, 0.0D); this.worldChunkMgr = new WorldChunkManagerHell(MobSpawnerBase.hell, 1.0D, 0.0D);
@ -29,9 +27,8 @@ public class WorldProviderHell extends WorldProvider {
return new ChunkProviderHell(this.worldObj, this.worldObj.randomSeed); return new ChunkProviderHell(this.worldObj, this.worldObj.randomSeed);
} }
public IChunkLoader getChunkLoader(File var1) { public IChunkLoader getChunkLoader(String var1) {
File var2 = new File(var1, "DIM-1"); String var2 = var1 + "/DIM-1/";
var2.mkdirs();
return new ChunkLoader(var2, true); return new ChunkLoader(var2, true);
} }