From 77bc0e833f69092971f66adb6774d93de4d86aa9 Mon Sep 17 00:00:00 2001 From: SenseiKiwi Date: Tue, 3 Sep 2013 17:47:02 -0400 Subject: [PATCH] Fixed Bugs Fixed bugs that would cause Minecraft to crash on startup. At least I can get to the main menu now. --- .../mod_pocketDim/core/PocketManager.java | 16 +++------------- .../mod_pocketDim/dungeon/DungeonData.java | 2 +- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/StevenDimDoors/mod_pocketDim/core/PocketManager.java b/StevenDimDoors/mod_pocketDim/core/PocketManager.java index d590930..b79ee2b 100644 --- a/StevenDimDoors/mod_pocketDim/core/PocketManager.java +++ b/StevenDimDoors/mod_pocketDim/core/PocketManager.java @@ -98,8 +98,8 @@ public class PocketManager private static volatile boolean isLoading = false; private static volatile boolean isLoaded = false; private static volatile boolean isSaving = false; - private static UpdateWatcherProxy linkWatcher = null; - private static UpdateWatcherProxy dimWatcher = null; + private static final UpdateWatcherProxy linkWatcher = new UpdateWatcherProxy(); + private static final UpdateWatcherProxy dimWatcher = new UpdateWatcherProxy(); //HashMap that maps all the dimension IDs registered with DimDoors to their DD data. private static HashMap dimensionData = null; @@ -125,11 +125,7 @@ public class PocketManager } isLoading = true; - - //Set up fields dimensionData = new HashMap(); - dimWatcher = new UpdateWatcherProxy(); - linkWatcher = new UpdateWatcherProxy(); //Register Limbo DDProperties properties = DDProperties.instance(); @@ -396,8 +392,6 @@ public class PocketManager public static void unload() { save(); - dimWatcher = null; - linkWatcher = null; dimensionData = null; unregisterPockets(); } @@ -470,12 +464,8 @@ public class PocketManager } isLoading = true; - - // Set up fields dimensionData = new HashMap(); - dimWatcher = null; // Clients shouldn't need to watch dims - linkWatcher = null; // Clients shouldn't need to watch links - + // Load compacted client-side dimension data Compactor.readDimensions(input, new DimRegistrationCallback()); diff --git a/StevenDimDoors/mod_pocketDim/dungeon/DungeonData.java b/StevenDimDoors/mod_pocketDim/dungeon/DungeonData.java index 7c298df..aa4bfa3 100644 --- a/StevenDimDoors/mod_pocketDim/dungeon/DungeonData.java +++ b/StevenDimDoors/mod_pocketDim/dungeon/DungeonData.java @@ -31,7 +31,7 @@ public class DungeonData int indexB = schematicPath.lastIndexOf('/'); indexA = Math.max(indexA, indexB) + 1; - return schematicPath.substring(indexA, schematicPath.length() - DungeonHelper.SCHEMATIC_FILE_EXTENSION.length() - indexA); + return schematicPath.substring(indexA, schematicPath.length() - DungeonHelper.SCHEMATIC_FILE_EXTENSION.length()); } public int weight()