Completes #854 Use superior file constructor to not care about file separator
This commit is contained in:
@@ -61,7 +61,7 @@ public class WorldSettings extends Configuration
|
|||||||
|
|
||||||
private static WorldSettings instance;
|
private static WorldSettings instance;
|
||||||
private final List<Integer> storageCellDims = new ArrayList<Integer>();
|
private final List<Integer> storageCellDims = new ArrayList<Integer>();
|
||||||
private final File aeFolder;
|
private final File spawnDataFolder;
|
||||||
private final CompassService compass;
|
private final CompassService compass;
|
||||||
private final PlayerMappings mappings;
|
private final PlayerMappings mappings;
|
||||||
private final Map<GridStorageSearch, WeakReference<GridStorageSearch>> loadedStorage = new WeakHashMap<GridStorageSearch, WeakReference<GridStorageSearch>>();
|
private final Map<GridStorageSearch, WeakReference<GridStorageSearch>> loadedStorage = new WeakHashMap<GridStorageSearch, WeakReference<GridStorageSearch>>();
|
||||||
@@ -70,8 +70,8 @@ public class WorldSettings extends Configuration
|
|||||||
|
|
||||||
public WorldSettings( File aeFolder )
|
public WorldSettings( File aeFolder )
|
||||||
{
|
{
|
||||||
super( new File( aeFolder.getPath() + File.separatorChar + "settings.cfg" ) );
|
super( new File( aeFolder.getPath(), "settings.cfg" ) );
|
||||||
this.aeFolder = aeFolder;
|
this.spawnDataFolder = new File( aeFolder, SPAWNDATA_FOLDER );
|
||||||
this.compass = new CompassService( aeFolder );
|
this.compass = new CompassService( aeFolder );
|
||||||
|
|
||||||
for ( int dimID : this.get( "DimensionManager", "StorageCells", new int[0] ).getIntList() )
|
for ( int dimID : this.get( "DimensionManager", "StorageCells", new int[0] ).getIntList() )
|
||||||
@@ -101,7 +101,7 @@ public class WorldSettings extends Configuration
|
|||||||
{
|
{
|
||||||
File world = DimensionManager.getCurrentSaveRootDirectory();
|
File world = DimensionManager.getCurrentSaveRootDirectory();
|
||||||
|
|
||||||
File aeBaseFolder = new File( world.getPath() + File.separatorChar + "AE2" );
|
File aeBaseFolder = new File( world.getPath(), "AE2" );
|
||||||
|
|
||||||
if ( !aeBaseFolder.isDirectory() && !aeBaseFolder.mkdir() )
|
if ( !aeBaseFolder.isDirectory() && !aeBaseFolder.mkdir() )
|
||||||
{
|
{
|
||||||
@@ -161,7 +161,7 @@ public class WorldSettings extends Configuration
|
|||||||
throw new RuntimeException( "Invalid Request" );
|
throw new RuntimeException( "Invalid Request" );
|
||||||
|
|
||||||
NBTTagCompound data = null;
|
NBTTagCompound data = null;
|
||||||
File file = new File( this.aeFolder, SPAWNDATA_FOLDER + File.separatorChar + dim + '_' + ( chunkX >> 4 ) + '_' + ( chunkZ >> 4 ) + ".dat" );
|
File file = new File( this.spawnDataFolder, dim + '_' + ( chunkX >> 4 ) + '_' + ( chunkZ >> 4 ) + ".dat" );
|
||||||
|
|
||||||
if ( file.isFile() )
|
if ( file.isFile() )
|
||||||
{
|
{
|
||||||
@@ -227,7 +227,7 @@ public class WorldSettings extends Configuration
|
|||||||
if ( !Thread.holdsLock( WorldSettings.class ) )
|
if ( !Thread.holdsLock( WorldSettings.class ) )
|
||||||
throw new RuntimeException( "Invalid Request" );
|
throw new RuntimeException( "Invalid Request" );
|
||||||
|
|
||||||
File file = new File( this.aeFolder, SPAWNDATA_FOLDER + File.separatorChar + dim + '_' + ( chunkX >> 4 ) + '_' + ( chunkZ >> 4 ) + ".dat" );
|
File file = new File( this.spawnDataFolder, dim + '_' + ( chunkX >> 4 ) + '_' + ( chunkZ >> 4 ) + ".dat" );
|
||||||
FileOutputStream fileOutputStream = null;
|
FileOutputStream fileOutputStream = null;
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|||||||
@@ -185,6 +185,6 @@ public class CompassRegion
|
|||||||
AELog.info( "Failed to create AE2/compass/" );
|
AELog.info( "Failed to create AE2/compass/" );
|
||||||
}
|
}
|
||||||
|
|
||||||
return new File( folder + File.separatorChar + this.world + '_' + this.low_x + '_' + this.low_z + ".dat" );
|
return new File( folder, this.world + '_' + this.low_x + '_' + this.low_z + ".dat" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user