public class Dimension extends InstanceKeeper implements TileProvider, java.io.Serializable, Tile.Listener, java.lang.Cloneable
Modifier and Type | Class and Description |
---|---|
static class |
Dimension.Anchor |
static class |
Dimension.Border |
static class |
Dimension.LayerAnchor |
static interface |
Dimension.Listener |
static class |
Dimension.Role
A role of a
Dimension within a game dimension. |
class |
Dimension.TileVisitationBuilder |
static interface |
Dimension.TileVisitor |
static class |
Dimension.WallType |
InstanceKeeper.InstantiationListener<T>
Modifier and Type | Field and Description |
---|---|
static int[] |
POSSIBLE_AUTO_BIOMES |
Constructor and Description |
---|
Dimension(World2 world,
java.lang.String name,
long minecraftSeed,
TileFactory tileFactory,
Dimension.Anchor anchor) |
Dimension(World2 world,
java.lang.String name,
long minecraftSeed,
TileFactory tileFactory,
Dimension.Anchor anchor,
boolean init) |
Modifier and Type | Method and Description |
---|---|
void |
addDimensionListener(Dimension.Listener listener) |
int |
addOverlay(Overlay overlay) |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener) |
void |
addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener) |
void |
addTile(Tile tile) |
void |
allBitLayerDataChanged(Tile tile) |
void |
allNonBitlayerDataChanged(Tile tile) |
void |
applyTheme(int x,
int y) |
void |
applyTheme(java.awt.Point coords) |
void |
armSavePoint() |
void |
changed()
Update the change number; for use when some aspect of a dimension changes
which the
Dimension class itself does not track. |
void |
clearLayerData(int x,
int y,
java.util.Set<Layer> excludedLayers)
Clear all layer data at a particular location (by resetting to the
layer's default value), possibly with the exception of certain layers.
|
void |
clearLayerData(Layer layer) |
void |
clearRedo() |
void |
clearUndo() |
boolean |
containsOneOf(Layer... layers) |
protected float |
doGetDistanceToEdge(Layer layer,
int x,
int y,
float maxDistance) |
protected int |
doGetFloodedCount(int x,
int y,
int r,
boolean lava) |
protected float |
doGetSlope(int x,
int y) |
java.util.Set<Layer> |
getAllLayers(boolean applyCombinedLayers)
Returns the set of all layers currently in use on the world, optionally
including layers that are included in combined layers.
|
java.util.Map<Layer,ExporterSettings> |
getAllLayerSettings() |
java.util.Set<Terrain> |
getAllTerrains() |
Dimension.Anchor |
getAnchor() |
<T> T |
getAttribute(org.pepsoft.util.AttributeKey<T> key) |
int |
getAutoBiome(int x,
int y) |
int |
getAutoBiome(int x,
int y,
int defaultBiome) |
int |
getAutoBiome(Tile tile,
int x,
int y) |
int |
getAutoBiome(Tile tile,
int x,
int y,
int defaultBiome) |
int |
getBitLayerCount(Layer layer,
int x,
int y,
int r)
Count the number of blocks where the specified bit layer is set in a square around a particular location
|
boolean |
getBitLayerValueAt(Layer layer,
int x,
int y) |
Dimension.Border |
getBorder() |
int |
getBorderLevel() |
int |
getBorderSize() |
int |
getCeilingHeight() |
long |
getChangeNo()
Get the change number.
|
int |
getContourSeparation() |
java.util.List<CustomBiome> |
getCustomBiomes() |
java.util.List<CustomLayer> |
getCustomLayers() |
java.util.List<CustomLayer> |
getCustomLayers(boolean applyCombinedLayers) |
HeightMap |
getDistancesToEdge(Layer layer,
float maxDistance)
Bake the edge distances for an entire painted layer and return them as a
HeightMap . |
float |
getDistanceToEdge(Layer layer,
int x,
int y,
float maxDistance)
Get the distance from the specified coordinate to the nearest pixel where
the specified layer is not set.
|
ExportSettings |
getExportSettings() |
java.awt.Rectangle |
getExtent() |
int |
getFloodedCount(int x,
int y,
int r,
boolean lava)
Count the number of blocks that are flooded in a square around a
particular location
|
Garden |
getGarden() |
MapGenerator |
getGenerator() |
int |
getGridSize() |
int |
getHeight() |
float |
getHeightAt(int x,
int y)
Get the terrain height at the specified coordinates, if a tile exists in the specified location.
|
float |
getHeightAt(java.awt.Point coords)
Get the terrain height at the specified coordinates, if a tile exists in the specified location.
|
float[] |
getHeightRange() |
java.util.Set<java.lang.String> |
getHiddenPalettes() |
float |
getHighestHeight() |
int |
getHighestIntHeight() |
int |
getHighestRawHeight() |
int |
getHighestX() |
int |
getHighestY() |
java.util.UUID |
getId() |
int |
getIntHeightAt(int x,
int y)
Get the terrain height at the specified coordinates, rounded to the nearest integer, if a tile exists in the
specified location.
|
int |
getIntHeightAt(int x,
int y,
int defaultHeight)
Get the terrain height at the specified coordinates, rounded to the nearest integer, if a tile exists in the
specified location.
|
int |
getIntHeightAt(java.awt.Point coords)
Get the terrain height at the specified coordinates, rounded to the nearest integer, if a tile exists in the
specified location.
|
int[] |
getIntHeightRange() |
java.awt.Point |
getLastViewPosition() |
java.util.Map<Layer,java.lang.Integer> |
getLayersAt(int x,
int y)
Gets all layers that are set at the specified location, along with their intensities or values.
|
ExporterSettings |
getLayerSettings(Layer layer) |
int |
getLayerValueAt(Layer layer,
int x,
int y) |
int |
getLayerValueAt(Layer layer,
java.awt.Point coords) |
float |
getLowestHeight() |
int |
getLowestIntHeight() |
int |
getLowestRawHeight() |
int |
getLowestX() |
int |
getLowestY() |
int |
getMaxHeight() |
long |
getMinecraftSeed() |
int |
getMinHeight() |
java.util.Set<Layer> |
getMinimumLayers()
Get the set of layers that has been configured to be applied everywhere.
|
int |
getMostPrevalentBiome(int x,
int y,
int defaultBiome)
Get the most prevalent biome in a 4x4 area.
|
java.lang.String |
getName() |
java.util.List<Overlay> |
getOverlays() |
int |
getRawHeightAt(int x,
int y)
Get the raw height value.
|
int |
getRawHeightAt(java.awt.Point coords)
Get the raw height value.
|
int[] |
getRawHeightRange() |
Dimension.WallType |
getRoofType() |
float |
getScale() |
long |
getSeed() |
float |
getSlope(int x,
int y) |
Dimension |
getSnapshot()
Get a snapshot of the current state of this dimension.
|
java.lang.String |
getSoloedPalette() |
Dimension.LayerAnchor |
getSubsurfaceLayerAnchor() |
Terrain |
getSubsurfaceMaterial() |
Terrain |
getTerrainAt(int x,
int y) |
Tile |
getTile(int x,
int y)
Get the tile for a particular set of world or absolute block coordinates.
|
Tile |
getTile(java.awt.Point coords) |
java.util.Set<java.awt.Point> |
getTileCoords() |
int |
getTileCount() |
TileFactory |
getTileFactory() |
Tile |
getTileForEditing(int x,
int y)
Get the tile for a particular set of world or absolute block coordinates with the intention of modifying it.
|
Tile |
getTileForEditing(java.awt.Point coords)
Get the tile for a particular set of world or absolute block coordinates with the intention of modifying it.
|
java.util.Collection<? extends Tile> |
getTiles()
Get a collection of all extant tiles in the dimension.
|
Dimension.LayerAnchor |
getTopLayerAnchor() |
int |
getTopLayerDepth(int x,
int y,
int z) |
int |
getTopLayerMinDepth() |
int |
getTopLayerVariation() |
java.lang.Integer |
getUndergroundBiome() |
Dimension.WallType |
getWallType() |
int |
getWaterLevelAt(int x,
int y) |
int |
getWaterLevelAt(java.awt.Point coords) |
int |
getWidth() |
World2 |
getWorld() |
void |
heightMapChanged(Tile tile) |
boolean |
isBorderTile(int x,
int y)
Indicates whether the specified tile is a border tile.
|
boolean |
isBottomless() |
boolean |
isContoursEnabled() |
boolean |
isCoverSteepTerrain() |
boolean |
isEventsInhibited() |
boolean |
isFixOverlayCoords() |
boolean |
isGridEnabled() |
boolean |
isOverlaysEnabled() |
boolean |
isPopulate() |
boolean |
isTilePresent(int x,
int y)
Determines whether a tile is present in the dimension on specific coordinates.
|
boolean |
isUndoAvailable() |
void |
layerDataChanged(Tile tile,
java.util.Set<Layer> changedLayers) |
void |
registerUndoManager(org.pepsoft.util.undo.UndoManager undoManager) |
void |
rememberChanges() |
void |
removeDimensionListener(Dimension.Listener listener) |
void |
removeOverlay(int index) |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener) |
void |
removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener) |
void |
removeTile(int tileX,
int tileY) |
void |
removeTile(java.awt.Point coords) |
void |
removeTile(Tile tile) |
void |
save(java.util.zip.ZipOutputStream out) |
void |
seedsChanged(Tile tile) |
<T> void |
setAttribute(org.pepsoft.util.AttributeKey<T> key,
T value) |
void |
setBitLayerValueAt(Layer layer,
int x,
int y,
boolean value) |
void |
setBorder(Dimension.Border border) |
void |
setBorderLevel(int borderLevel) |
void |
setBorderSize(int borderSize) |
void |
setBottomless(boolean bottomless) |
void |
setCeilingHeight(int ceilingHeight) |
void |
setContoursEnabled(boolean contoursEnabled) |
void |
setContourSeparation(int contourSeparation) |
void |
setCoverSteepTerrain(boolean coverSteepTerrain) |
void |
setCustomBiomes(java.util.List<CustomBiome> customBiomes) |
void |
setCustomLayers(java.util.List<CustomLayer> customLayers) |
void |
setEventsInhibited(boolean eventsInhibited) |
void |
setExportSettings(ExportSettings exportSettings) |
void |
setFixOverlayCoords(boolean fixOverlayCoords) |
void |
setGenerator(MapGenerator generator) |
void |
setGridEnabled(boolean gridEnabled) |
void |
setGridSize(int gridSize) |
void |
setHeightAt(int x,
int y,
float height) |
void |
setHeightAt(java.awt.Point coords,
float height) |
void |
setHiddenPalettes(java.util.Set<java.lang.String> hiddenPalettes) |
void |
setLastViewPosition(java.awt.Point lastViewPosition) |
void |
setLayerSettings(Layer layer,
ExporterSettings settings) |
void |
setLayerValueAt(Layer layer,
int x,
int y,
int value) |
void |
setMaxHeight(int maxHeight) |
void |
setMinecraftSeed(long minecraftSeed) |
void |
setMinHeight(int minHeight) |
void |
setName(java.lang.String name) |
void |
setOverlaysEnabled(boolean overlaysEnabled) |
void |
setPopulate(boolean populate) |
void |
setRawHeightAt(int x,
int y,
int rawHeight)
Set the raw height value.
|
void |
setRawHeightAt(java.awt.Point coords,
int rawHeight)
Set the raw height value.
|
void |
setRoofType(Dimension.WallType roofType) |
void |
setScale(float scale) |
void |
setSoloedPalette(java.lang.String soloedPalette) |
void |
setSubsurfaceLayerAnchor(Dimension.LayerAnchor subsurfaceLayerAnchor) |
void |
setSubsurfaceMaterial(Terrain subsurfaceMaterial) |
void |
setTerrainAt(int x,
int y,
Terrain terrain) |
void |
setTerrainAt(java.awt.Point coords,
Terrain terrain) |
void |
setTopLayerAnchor(Dimension.LayerAnchor topLayerAnchor) |
void |
setTopLayerMinDepth(int topLayerMinDepth) |
void |
setTopLayerVariation(int topLayerVariation) |
void |
setUndergroundBiome(java.lang.Integer undergroundBiome) |
void |
setWallType(Dimension.WallType wallType) |
void |
setWaterLevelAt(int x,
int y,
int waterLevel) |
void |
setWorld(World2 world) |
void |
terrainChanged(Tile tile) |
void |
transform(CoordinateTransform transform,
org.pepsoft.util.ProgressReceiver progressReceiver)
Transform the tiles of this dimension horizontally, for instance
translating and/or rotating them.
|
boolean |
undoChanges() |
void |
unregisterUndoManager() |
Dimension.TileVisitationBuilder |
visitTiles()
Visit the tiles in this dimension, optionally constraining the visited
tiles according to some basic constraints.
|
Dimension.TileVisitationBuilder |
visitTilesForEditing()
Visit the tiles in this dimension, optionally constraining the visited
tiles according to some basic constraints.
|
void |
waterLevelChanged(Tile tile) |
setInstantiationListener
public Dimension(World2 world, java.lang.String name, long minecraftSeed, TileFactory tileFactory, Dimension.Anchor anchor)
public Dimension(World2 world, java.lang.String name, long minecraftSeed, TileFactory tileFactory, Dimension.Anchor anchor, boolean init)
public World2 getWorld()
public void setWorld(World2 world)
public Dimension.Anchor getAnchor()
public java.util.UUID getId()
public java.lang.String getName()
public void setName(java.lang.String name)
public long getChangeNo()
public void changed()
Dimension
class itself does not track.public long getSeed()
public Terrain getSubsurfaceMaterial()
public void setSubsurfaceMaterial(Terrain subsurfaceMaterial)
public boolean isPopulate()
public void setPopulate(boolean populate)
public Dimension.Border getBorder()
public void setBorder(Dimension.Border border)
public int getBorderLevel()
public void setBorderLevel(int borderLevel)
public int getBorderSize()
public void setBorderSize(int borderSize)
public TileFactory getTileFactory()
public boolean isTilePresent(int x, int y)
isTilePresent
in interface TileProvider
x
- The tile X coordinate for which to determine whether a tile is present.y
- The tile Y coordinate for which to determine whether a tile is present.true
if the dimension contains a tile at the specified location.public boolean isBorderTile(int x, int y)
x
- The X coordinate of the tile for which to check whether it is a border tile.y
- The Y coordinate of the tile for which to check whether it is a border tile.true
if it is a border tile.public Tile getTile(int x, int y)
getTile
in interface TileProvider
x
- The tile X coordinate for which to get the tile.y
- The tile Y coordinate for which to get the tile.null
if there is no tile for those coordinatespublic Tile getTile(java.awt.Point coords)
public Tile getTileForEditing(int x, int y)
setEventsInhibited(boolean)
. Whenever
eventsInhibited
is true
, the dimension will automatically inhibit events on the tile,
mark it as dirty and fire an event for it when eventsInhibited
is set to false
.x
- The tile X coordinate for which to get the tile.y
- The tile Y coordinate for which to get the tile.null
if there is no tile for those coordinatespublic Tile getTileForEditing(java.awt.Point coords)
setEventsInhibited(boolean)
. Whenever
eventsInhibited
is true
, the dimension will automatically inhibit events on the tile,
mark it as dirty and fire an event for it when eventsInhibited
is set to false
.coords
- The world coordinates for which to get the tile.null
if there is no tile for those coordinatespublic java.awt.Rectangle getExtent()
getExtent
in interface TileProvider
public int getTileCount()
public java.util.Collection<? extends Tile> getTiles()
null
s.public java.util.Set<java.awt.Point> getTileCoords()
public void addTile(Tile tile)
public void removeTile(int tileX, int tileY)
public void removeTile(Tile tile)
public void removeTile(java.awt.Point coords)
public int getHighestX()
public int getHighestY()
public int getLowestX()
public int getLowestY()
public int getWidth()
public int getHeight()
public int getIntHeightAt(int x, int y)
x
- The X coordinate to query.y
- The Y coordinate to query.Integer.MIN_VALUE
if there is no tile at the specified coordinates.public int getIntHeightAt(int x, int y, int defaultHeight)
x
- The X coordinate to query.y
- The Y coordinate to query.defaultHeight
- The value to return if there is no tile at the specified coordinates.defaultHeight
if there is no tile at the specified coordinates.public int getIntHeightAt(java.awt.Point coords)
coords
- The coordinates to query.Integer.MIN_VALUE
if there is no tile at the specified coordinates.public int getLowestIntHeight()
public int getHighestIntHeight()
public int[] getIntHeightRange()
public float getHeightAt(int x, int y)
x
- The X coordinate to query.y
- The Y coordinate to query.-Float.MAX_VALUE
if there is
no tile at the specified coordinates.public float getHeightAt(java.awt.Point coords)
coords
- The coordinates to query.-Float.MAX_VALUE
if there is
no tile at the specified coordinates.public float getLowestHeight()
public float getHighestHeight()
public float[] getHeightRange()
public void setHeightAt(int x, int y, float height)
public void setHeightAt(java.awt.Point coords, float height)
public int getRawHeightAt(int x, int y)
minHeight
.public int getLowestRawHeight()
public int getHighestRawHeight()
public int[] getRawHeightRange()
public int getRawHeightAt(java.awt.Point coords)
minHeight
.public void setRawHeightAt(int x, int y, int rawHeight)
minHeight
.public void setRawHeightAt(java.awt.Point coords, int rawHeight)
minHeight
.public float getSlope(int x, int y)
protected final float doGetSlope(int x, int y)
public Terrain getTerrainAt(int x, int y)
public void setTerrainAt(int x, int y, Terrain terrain)
public java.util.Set<Terrain> getAllTerrains()
public void setTerrainAt(java.awt.Point coords, Terrain terrain)
public void applyTheme(int x, int y)
public int getWaterLevelAt(int x, int y)
public int getWaterLevelAt(java.awt.Point coords)
public void setWaterLevelAt(int x, int y, int waterLevel)
public int getLayerValueAt(Layer layer, int x, int y)
public int getLayerValueAt(Layer layer, java.awt.Point coords)
public void setLayerValueAt(Layer layer, int x, int y, int value)
public boolean getBitLayerValueAt(Layer layer, int x, int y)
public int getBitLayerCount(Layer layer, int x, int y, int r)
layer
- The bit layer to count.x
- The global X coordinate of the location around which to count the layer.y
- The global Y coordinate of the location around which to count the layer.r
- The radius of the square. The side of the square is 2·r+1public java.util.Map<Layer,java.lang.Integer> getLayersAt(int x, int y)
x
- The X location for which to retrieve all layers.y
- The Y location for which to retrieve all layers.null
or an empty map if no layers are present.public int getFloodedCount(int x, int y, int r, boolean lava)
x
- The global X coordinate of the location around which to count
flooded blocks.y
- The global Y coordinate of the location around which to count
flooded blocks.r
- The radius of the square.lava
- Whether to check for lava (when true
) or water
(when false
).protected final int doGetFloodedCount(int x, int y, int r, boolean lava)
public float getDistanceToEdge(Layer layer, int x, int y, float maxDistance)
layer
- The layer for which to find the distance to the nearest
edge.x
- The X coordinate of the location towards which to determine the distance.y
- The Y coordinate of the location towards which to determine the distance.maxDistance
- The maximum distance to return. If the actual distance is further, this value will be returned.public HeightMap getDistancesToEdge(Layer layer, float maxDistance)
HeightMap
. For high values of
maxDistance
this is much quicker than interrogating the edge distance of every pixel via
getDistanceToEdge(Layer, int, int, float)
, but the information is static and does not update when the
dimension is updated.
Note that the information in the height map is only valid for pixels where the layer is set in the dimension! For other pixels the value is undefined.
layer
- The layer for which to bake the edge distances. Must have data type
BIT
or BIT_PER_CHUNK
.maxDistance
- The maximum edge distance to calculate. Pixels where the layer is set and the distance to the
nearest edge is higher will have this value set.HeightMap
returning the distance to the nearest edge for every pixel where the specified layer
is set in this dimension.protected final float doGetDistanceToEdge(Layer layer, int x, int y, float maxDistance)
public void setBitLayerValueAt(Layer layer, int x, int y, boolean value)
public void clearLayerData(Layer layer)
public void clearLayerData(int x, int y, java.util.Set<Layer> excludedLayers)
x
- The X coordinate of the location to clear of layer data.y
- The Y coordinate of the location to clear of layer data.excludedLayers
- The layers to exclude, if any. May be
null
.public void setEventsInhibited(boolean eventsInhibited)
public boolean isEventsInhibited()
public java.util.Map<Layer,ExporterSettings> getAllLayerSettings()
public ExporterSettings getLayerSettings(Layer layer)
public void setLayerSettings(Layer layer, ExporterSettings settings)
public long getMinecraftSeed()
public void setMinecraftSeed(long minecraftSeed)
public java.util.List<Overlay> getOverlays()
public int addOverlay(Overlay overlay)
public void removeOverlay(int index)
public boolean isGridEnabled()
public void setGridEnabled(boolean gridEnabled)
public int getGridSize()
public void setGridSize(int gridSize)
public boolean isOverlaysEnabled()
public void setOverlaysEnabled(boolean overlaysEnabled)
public int getMinHeight()
public void setMinHeight(int minHeight)
public int getMaxHeight()
public void setMaxHeight(int maxHeight)
public int getContourSeparation()
public void setContourSeparation(int contourSeparation)
public boolean isContoursEnabled()
public void setContoursEnabled(boolean contoursEnabled)
public int getTopLayerMinDepth()
public void setTopLayerMinDepth(int topLayerMinDepth)
public int getTopLayerVariation()
public void setTopLayerVariation(int topLayerVariation)
public boolean isBottomless()
public void setBottomless(boolean bottomless)
public java.awt.Point getLastViewPosition()
public void setLastViewPosition(java.awt.Point lastViewPosition)
public java.util.List<CustomBiome> getCustomBiomes()
public void setCustomBiomes(java.util.List<CustomBiome> customBiomes)
public boolean isCoverSteepTerrain()
public void setCoverSteepTerrain(boolean coverSteepTerrain)
public boolean isFixOverlayCoords()
public void setFixOverlayCoords(boolean fixOverlayCoords)
public java.lang.Integer getUndergroundBiome()
public void setUndergroundBiome(java.lang.Integer undergroundBiome)
public Garden getGarden()
public java.util.List<CustomLayer> getCustomLayers()
public java.util.List<CustomLayer> getCustomLayers(boolean applyCombinedLayers)
public void setCustomLayers(java.util.List<CustomLayer> customLayers)
public java.util.Set<Layer> getAllLayers(boolean applyCombinedLayers)
applyCombinedLayers
- Whether to include layers from combined layers
which are not used independently in the dimension.public java.util.Set<Layer> getMinimumLayers()
public int getCeilingHeight()
public void setCeilingHeight(int ceilingHeight)
public Dimension.LayerAnchor getSubsurfaceLayerAnchor()
public void setSubsurfaceLayerAnchor(Dimension.LayerAnchor subsurfaceLayerAnchor)
public Dimension.LayerAnchor getTopLayerAnchor()
public void setTopLayerAnchor(Dimension.LayerAnchor topLayerAnchor)
public ExportSettings getExportSettings()
public void setExportSettings(ExportSettings exportSettings)
public MapGenerator getGenerator()
public void setGenerator(MapGenerator generator)
public Dimension.WallType getWallType()
public void setWallType(Dimension.WallType wallType)
public Dimension.WallType getRoofType()
public void setRoofType(Dimension.WallType roofType)
public float getScale()
public void setScale(float scale)
public java.util.Set<java.lang.String> getHiddenPalettes()
public void setHiddenPalettes(java.util.Set<java.lang.String> hiddenPalettes)
public java.lang.String getSoloedPalette()
public void setSoloedPalette(java.lang.String soloedPalette)
public void applyTheme(java.awt.Point coords)
public boolean isUndoAvailable()
public void registerUndoManager(org.pepsoft.util.undo.UndoManager undoManager)
public boolean undoChanges()
public void clearUndo()
public void armSavePoint()
public void rememberChanges()
public void clearRedo()
public void unregisterUndoManager()
public final int getAutoBiome(int x, int y)
public final int getAutoBiome(int x, int y, int defaultBiome)
public final int getAutoBiome(Tile tile, int x, int y)
public final int getAutoBiome(Tile tile, int x, int y, int defaultBiome)
public Dimension getSnapshot()
public int getTopLayerDepth(int x, int y, int z)
public void addDimensionListener(Dimension.Listener listener)
public void removeDimensionListener(Dimension.Listener listener)
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
public void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
public void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
public void transform(CoordinateTransform transform, org.pepsoft.util.ProgressReceiver progressReceiver) throws org.pepsoft.util.ProgressReceiver.OperationCancelled
transform
- The transform to apply to the tiles and their contents.progressReceiver
- An optional progress receiver to which progress
of the operation will be reported.org.pepsoft.util.ProgressReceiver.OperationCancelled
- If the progress receiver threw an
OperationCancelled
exception indicating that the user wished
to cancel the operation.public boolean containsOneOf(Layer... layers)
public Dimension.TileVisitationBuilder visitTilesForEditing()
visitTiles().andDo(tile -> { /* process tile */ });
To restrict to a filter:
visitTiles().forFilter(filter).andDo(tile -> { /* process tile */ });
To restrict to a brush:
visitTiles().forBrush(brush, x, y).andDo(tile -> { /* process tile */ });
To restrict to the selection:
visitTiles().forSelection().andDo(tile -> { /* process tile */ });
You can combine constraints:
visitTiles().forFilter(filter).forBrush(brush, x, y).andDo(tile -> { /* process tile */ });
public Dimension.TileVisitationBuilder visitTiles()
visitTiles().andDo(tile -> { /* process tile */ });
To restrict to a filter:
visitTiles().forFilter(filter).andDo(tile -> { /* process tile */ });
To restrict to a brush:
visitTiles().forBrush(brush, x, y).andDo(tile -> { /* process tile */ });
To restrict to the selection:
visitTiles().forSelection().andDo(tile -> { /* process tile */ });
You can combine constraints:
visitTiles().forFilter(filter).forBrush(brush, x, y).andDo(tile -> { /* process tile */ });
public <T> T getAttribute(org.pepsoft.util.AttributeKey<T> key)
public <T> void setAttribute(org.pepsoft.util.AttributeKey<T> key, T value)
public int getMostPrevalentBiome(int x, int y, int defaultBiome)
x
- X coordinate of the 4x4 area (in 4x4 areas).y
- Y coordinate of the 4x4 area (in 4x4 areas).defaultBiome
- The biome to return for areas where the biome is not defined.public void save(java.util.zip.ZipOutputStream out) throws java.io.IOException
java.io.IOException
public void heightMapChanged(Tile tile)
heightMapChanged
in interface Tile.Listener
public void terrainChanged(Tile tile)
terrainChanged
in interface Tile.Listener
public void waterLevelChanged(Tile tile)
waterLevelChanged
in interface Tile.Listener
public void seedsChanged(Tile tile)
seedsChanged
in interface Tile.Listener
public void layerDataChanged(Tile tile, java.util.Set<Layer> changedLayers)
layerDataChanged
in interface Tile.Listener
public void allBitLayerDataChanged(Tile tile)
allBitLayerDataChanged
in interface Tile.Listener
public void allNonBitlayerDataChanged(Tile tile)
allNonBitlayerDataChanged
in interface Tile.Listener