Rewrote All the Things #81

Merged
SenseiKiwi merged 8 commits from rewrite into DevBranch 2013-09-04 03:26:52 +00:00
2 changed files with 4 additions and 14 deletions
Showing only changes of commit 77bc0e833f - Show all commits

View File

@@ -98,8 +98,8 @@ public class PocketManager
private static volatile boolean isLoading = false; private static volatile boolean isLoading = false;
private static volatile boolean isLoaded = false; private static volatile boolean isLoaded = false;
private static volatile boolean isSaving = false; private static volatile boolean isSaving = false;
private static UpdateWatcherProxy<Point4D> linkWatcher = null; private static final UpdateWatcherProxy<Point4D> linkWatcher = new UpdateWatcherProxy<Point4D>();
private static UpdateWatcherProxy<ClientDimData> dimWatcher = null; private static final UpdateWatcherProxy<ClientDimData> dimWatcher = new UpdateWatcherProxy<ClientDimData>();
//HashMap that maps all the dimension IDs registered with DimDoors to their DD data. //HashMap that maps all the dimension IDs registered with DimDoors to their DD data.
private static HashMap<Integer, InnerDimData> dimensionData = null; private static HashMap<Integer, InnerDimData> dimensionData = null;
@@ -125,11 +125,7 @@ public class PocketManager
} }
isLoading = true; isLoading = true;
//Set up fields
dimensionData = new HashMap<Integer, InnerDimData>(); dimensionData = new HashMap<Integer, InnerDimData>();
dimWatcher = new UpdateWatcherProxy<ClientDimData>();
linkWatcher = new UpdateWatcherProxy<Point4D>();
//Register Limbo //Register Limbo
DDProperties properties = DDProperties.instance(); DDProperties properties = DDProperties.instance();
@@ -396,8 +392,6 @@ public class PocketManager
public static void unload() public static void unload()
{ {
save(); save();
dimWatcher = null;
linkWatcher = null;
dimensionData = null; dimensionData = null;
unregisterPockets(); unregisterPockets();
} }
@@ -470,12 +464,8 @@ public class PocketManager
} }
isLoading = true; isLoading = true;
// Set up fields
dimensionData = new HashMap<Integer, InnerDimData>(); dimensionData = new HashMap<Integer, InnerDimData>();
dimWatcher = null; // Clients shouldn't need to watch dims
linkWatcher = null; // Clients shouldn't need to watch links
// Load compacted client-side dimension data // Load compacted client-side dimension data
Compactor.readDimensions(input, new DimRegistrationCallback()); Compactor.readDimensions(input, new DimRegistrationCallback());

View File

@@ -31,7 +31,7 @@ public class DungeonData
int indexB = schematicPath.lastIndexOf('/'); int indexB = schematicPath.lastIndexOf('/');
indexA = Math.max(indexA, indexB) + 1; 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() public int weight()