public class BlockPropertiesCalculator
extends java.lang.Object
The process consists of three passes. In the first pass, the blocks are set to their initial values:
In the second pass, the previously calculated values are propagated into the surrounding blocks. The second pass should be repeated until no changes result from it, meaning the area has been fully processed.
In the third pass the process is finalised, e.g. any floating leaf blocks are removed. The third pass should be
executed after the second pass has returned false
.
This class uses the Minecraft coordinate system.
Constructor and Description |
---|
BlockPropertiesCalculator(MinecraftWorld world,
Platform platform,
WorldExportSettings worldExportSettings,
BlockBasedExportSettings exportSettings) |
Modifier and Type | Method and Description |
---|---|
void |
finalise()
This should be invoked once after
secondPass() has returned false , to take any necessary final
steps of the process, such as removing floating leaf blocks. |
void |
firstPass()
Set the blocks to their initial values for the current dirty area.
|
int[] |
firstPass(Chunk chunk)
Set the blocks to their initial values for one entire chunk.
|
org.pepsoft.util.Box |
getDirtyArea()
Get the current dirty area in Minecraft coordinates.
|
static boolean |
isBlockPropertiesPassNeeded(Platform platform,
WorldExportSettings worldExportSettings,
BlockBasedExportSettings exportSettings) |
boolean |
secondPass()
For the current dirty area, propagate the selected block properties to surrounding blocks.
|
void |
setDirtyArea(org.pepsoft.util.Box dirtyArea)
Set the dirty area in Minecraft coordinates.
|
public BlockPropertiesCalculator(MinecraftWorld world, Platform platform, WorldExportSettings worldExportSettings, BlockBasedExportSettings exportSettings)
public org.pepsoft.util.Box getDirtyArea()
public void setDirtyArea(org.pepsoft.util.Box dirtyArea)
dirtyArea
- The dirty area in Minecraft coordinates to set.public boolean secondPass()
false
is returned if no changes were made at
all (indicating that the process is complete).public int[] firstPass(Chunk chunk)
public void firstPass()
public void finalise()
secondPass()
has returned false
, to take any necessary final
steps of the process, such as removing floating leaf blocks.public static boolean isBlockPropertiesPassNeeded(Platform platform, WorldExportSettings worldExportSettings, BlockBasedExportSettings exportSettings)