auto-indent
This commit is contained in:
@@ -29,27 +29,27 @@ import net.minecraft.world.DimensionType;
|
||||
*
|
||||
* @author James Seibel
|
||||
* @author Leonardo Amato
|
||||
* @version 8-17-2021
|
||||
* @version 9-27-2021
|
||||
*/
|
||||
public class LodWorld
|
||||
{
|
||||
/** name of this world */
|
||||
private String worldName;
|
||||
|
||||
|
||||
|
||||
private Map<DimensionType, LodDimension> lodDimensions;
|
||||
|
||||
/**
|
||||
* If true then the LOD world is setup and ready to use
|
||||
*/
|
||||
|
||||
/** If true then the LOD world is setup and ready to use */
|
||||
private boolean isWorldLoaded = false;
|
||||
|
||||
|
||||
public static final String NO_WORLD_LOADED = "No world loaded";
|
||||
|
||||
|
||||
|
||||
|
||||
public LodWorld()
|
||||
{
|
||||
worldName = NO_WORLD_LOADED;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set up the LodQuadTreeWorld with the given newWorldName. <br>
|
||||
* This should be done whenever loading a new world.
|
||||
@@ -63,17 +63,17 @@ public class LodWorld
|
||||
deselectWorld();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (worldName.equals(newWorldName))
|
||||
// don't recreate everything if we
|
||||
// didn't actually change worlds
|
||||
return;
|
||||
|
||||
|
||||
worldName = newWorldName;
|
||||
lodDimensions = new Hashtable<DimensionType, LodDimension>();
|
||||
isWorldLoaded = true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the worldName to "No world loaded"
|
||||
* and clear the lodDimensions Map. <br>
|
||||
@@ -85,8 +85,8 @@ public class LodWorld
|
||||
lodDimensions = null;
|
||||
isWorldLoaded = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Adds newStorage to this world, if a LodQuadTreeDimension
|
||||
* already exists for the given dimension it is replaced.
|
||||
@@ -95,10 +95,10 @@ public class LodWorld
|
||||
{
|
||||
if (lodDimensions == null)
|
||||
return;
|
||||
|
||||
|
||||
lodDimensions.put(newStorage.dimension, newStorage);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns null if no LodQuadTreeDimension exists for the given dimension
|
||||
*/
|
||||
@@ -106,10 +106,10 @@ public class LodWorld
|
||||
{
|
||||
if (lodDimensions == null)
|
||||
return null;
|
||||
|
||||
|
||||
return lodDimensions.get(dimension);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Resizes the max width in regions that each LodDimension
|
||||
* should use.
|
||||
@@ -118,13 +118,13 @@ public class LodWorld
|
||||
{
|
||||
if (lodDimensions == null)
|
||||
return;
|
||||
|
||||
|
||||
saveAllDimensions();
|
||||
|
||||
|
||||
for (DimensionType key : lodDimensions.keySet())
|
||||
lodDimensions.get(key).setRegionWidth(newWidth);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Requests all dimensions save any dirty regions they may have.
|
||||
*/
|
||||
@@ -132,24 +132,24 @@ public class LodWorld
|
||||
{
|
||||
if (lodDimensions == null)
|
||||
return;
|
||||
|
||||
|
||||
ClientProxy.LOGGER.info("Saving LODs");
|
||||
|
||||
|
||||
for (DimensionType key : lodDimensions.keySet())
|
||||
lodDimensions.get(key).saveDirtyRegionsToFileAsync();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public boolean getIsWorldLoaded()
|
||||
{
|
||||
return isWorldLoaded;
|
||||
}
|
||||
|
||||
|
||||
public String getWorldName()
|
||||
{
|
||||
return worldName;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user