diff --git a/src/main/java/com/github/halotroop/litecraft/Litecraft.java b/src/main/java/com/github/halotroop/litecraft/Litecraft.java index c285e81..6086cbf 100644 --- a/src/main/java/com/github/halotroop/litecraft/Litecraft.java +++ b/src/main/java/com/github/halotroop/litecraft/Litecraft.java @@ -114,15 +114,7 @@ public class Litecraft extends Game { System.out.println("Saving chunks..."); this.world.unloadAllChunks(); - try - { - this.getSave().saveGlobalData(this.world.getSeed(), this.player); - } - catch (IOException e) - { - System.err.println("A critical error occurred while trying to save world data!"); - e.printStackTrace(); - } + this.getSave().saveGlobalData(this.world.getSeed(), this.player); } ginger3D.cleanup(); System.exit(0); diff --git a/src/main/java/com/github/halotroop/litecraft/save/LitecraftSave.java b/src/main/java/com/github/halotroop/litecraft/save/LitecraftSave.java index 040bea4..193cfc7 100644 --- a/src/main/java/com/github/halotroop/litecraft/save/LitecraftSave.java +++ b/src/main/java/com/github/halotroop/litecraft/save/LitecraftSave.java @@ -125,11 +125,19 @@ public final class LitecraftSave } } - public void saveGlobalData(long seed, Player player) throws IOException + public void saveGlobalData(long seed, Player player) { - File globalDataFile = new File(this.file.getPath() + "/global_data.sod"); - globalDataFile.createNewFile(); // create world file if it doesn't exist. - writeGlobalData(globalDataFile, seed, player.getPosition()); + try + { + File globalDataFile = new File(this.file.getPath() + "/global_data.sod"); + globalDataFile.createNewFile(); // create world file if it doesn't exist. + writeGlobalData(globalDataFile, seed, player.getPosition()); + } + catch (IOException e) + { + System.err.println("A critical error occurred while trying to save world data!"); + e.printStackTrace(); + } } private void writeGlobalData(File globalDataFile, long seed, Vector3f playerPos) diff --git a/src/main/java/com/github/halotroop/litecraft/world/DynamicChunkLoader.java b/src/main/java/com/github/halotroop/litecraft/world/DynamicChunkLoader.java index adc8872..12d5282 100644 --- a/src/main/java/com/github/halotroop/litecraft/world/DynamicChunkLoader.java +++ b/src/main/java/com/github/halotroop/litecraft/world/DynamicChunkLoader.java @@ -3,7 +3,7 @@ package com.github.halotroop.litecraft.world; import java.util.*; import java.util.function.LongConsumer; -import com.github.hydos.multiThreading.GingerThread; +import com.github.hydos.multithreading.GingerThread; import it.unimi.dsi.fastutil.longs.*; diff --git a/src/main/java/com/github/hydos/ginger/engine/api/Ginger.java b/src/main/java/com/github/hydos/ginger/engine/api/Ginger.java index 40af6b6..dd45281 100644 --- a/src/main/java/com/github/hydos/ginger/engine/api/Ginger.java +++ b/src/main/java/com/github/hydos/ginger/engine/api/Ginger.java @@ -17,7 +17,7 @@ import com.github.hydos.ginger.engine.render.MasterRenderer; import com.github.hydos.ginger.engine.render.tools.MousePicker; import com.github.hydos.ginger.engine.screen.Screen; import com.github.hydos.ginger.engine.utils.Loader; -import com.github.hydos.multiThreading.GingerThreading; +import com.github.hydos.multithreading.GingerThreading; public class Ginger { diff --git a/src/main/java/com/github/hydos/ginger/engine/api/GingerRegister.java b/src/main/java/com/github/hydos/ginger/engine/api/GingerRegister.java index 8da7a5c..a37c0d6 100644 --- a/src/main/java/com/github/hydos/ginger/engine/api/GingerRegister.java +++ b/src/main/java/com/github/hydos/ginger/engine/api/GingerRegister.java @@ -8,7 +8,7 @@ import com.github.hydos.ginger.engine.font.GUIText; import com.github.hydos.ginger.engine.postprocessing.Fbo; import com.github.hydos.ginger.engine.render.MasterRenderer; import com.github.hydos.ginger.engine.screen.Screen; -import com.github.hydos.multiThreading.GingerThreading; +import com.github.hydos.multithreading.GingerThreading; /** Used if a game wants to access engine variables safely */ public class GingerRegister diff --git a/src/main/java/com/github/hydos/multiThreading/GingerThread.java b/src/main/java/com/github/hydos/multithreading/GingerThread.java similarity index 78% rename from src/main/java/com/github/hydos/multiThreading/GingerThread.java rename to src/main/java/com/github/hydos/multithreading/GingerThread.java index ec179f3..ca74c04 100644 --- a/src/main/java/com/github/hydos/multiThreading/GingerThread.java +++ b/src/main/java/com/github/hydos/multithreading/GingerThread.java @@ -1,4 +1,4 @@ -package com.github.hydos.multiThreading; +package com.github.hydos.multithreading; public abstract class GingerThread extends Thread { diff --git a/src/main/java/com/github/hydos/multiThreading/GingerThreading.java b/src/main/java/com/github/hydos/multithreading/GingerThreading.java similarity index 95% rename from src/main/java/com/github/hydos/multiThreading/GingerThreading.java rename to src/main/java/com/github/hydos/multithreading/GingerThreading.java index d1439a8..0c6a687 100644 --- a/src/main/java/com/github/hydos/multiThreading/GingerThreading.java +++ b/src/main/java/com/github/hydos/multithreading/GingerThreading.java @@ -1,4 +1,4 @@ -package com.github.hydos.multiThreading; +package com.github.hydos.multithreading; import java.util.*;