public final class MinecraftWorldObject extends java.lang.Object implements MinecraftWorld, WPObject
MinecraftWorld and WPObject, allowing to render worlds and layers to it
 and then treat it as an object, for instance for generating previews. As such it does not support entities, tile
 entities, lighting information, etc., just basic block info. Trying to use the unsupported features will fail
 silently.
 
 For the MinecraftWorld interface the supported coordinates are those specified by the volume
 parameter. For the WPObject interface, the coordinates are translated so that the lower north west corner is
 at 0,0,0. In other words, the WPObject has no offset and all the coordinates are positive.
 
An offset may in fact be specified but it has no effect on the coordinates used by this object; it is purely meant
 to communicate to a consumer of the WPObject that the object should be shifted when placed.
WPObject.BlockVisitorATTRIBUTE_COLLISION_MODE, ATTRIBUTE_CONNECT_BLOCKS, ATTRIBUTE_EXTEND_FOUNDATION, ATTRIBUTE_FILE, ATTRIBUTE_FREQUENCY, ATTRIBUTE_HEIGHT_MODE, ATTRIBUTE_LEAF_DECAY_MODE, ATTRIBUTE_MANAGE_WATERLOGGED, ATTRIBUTE_NEEDS_FOUNDATION, ATTRIBUTE_OFFSET, ATTRIBUTE_RANDOM_MIRRORING_ONLY, ATTRIBUTE_RANDOM_ROTATION, ATTRIBUTE_RANDOM_ROTATION_ONLY, ATTRIBUTE_REPLACE_WITH_AIR, ATTRIBUTE_REPLACE_WITH_AIR_MATERIAL, ATTRIBUTE_SPAWN_IN_LAVA, ATTRIBUTE_SPAWN_IN_WATER, ATTRIBUTE_SPAWN_ON_LAND, ATTRIBUTE_SPAWN_ON_LAVA, ATTRIBUTE_SPAWN_ON_WATER, ATTRIBUTE_SPAWN_ON_WATER_NO_COLLIDE, ATTRIBUTE_UNDERGROUND_MODE, ATTRIBUTE_VERTICAL_OFFSET, ATTRIBUTE_Y_VARIATION, COLLISION_MODE_ALL, COLLISION_MODE_NONE, COLLISION_MODE_SOLID, HEIGHT_MODE_FIXED, HEIGHT_MODE_TERRAIN, LEAF_DECAY_NO_CHANGE, LEAF_DECAY_OFF, LEAF_DECAY_ON| Constructor and Description | 
|---|
| MinecraftWorldObject(java.lang.String name,
                    org.pepsoft.util.Box volume,
                    int maxHeight,
                    int waterLevel)Create a new  MinecraftWorldObjectwhich is initialised with
 all air and has no offset. | 
| MinecraftWorldObject(java.lang.String name,
                    org.pepsoft.util.Box volume,
                    int maxHeight,
                    int waterLevel,
                    Material[] lowestBlocks,
                    javax.vecmath.Point3i offset)Create a new  MinecraftWorldObject. | 
| Modifier and Type | Method and Description | 
|---|---|
| void | addChunk(Chunk chunk)Copies the block IDs and data values from the specified chunk to this
 object, insofar as it intersects the object bounds. | 
| void | addEntity(double x,
         double y,
         double height,
         Entity entity) | 
| void | addTileEntity(int x,
             int y,
             int height,
             TileEntity tileEntity) | 
| MinecraftWorldObject | clone()Create a clone of the object. | 
| void | close()Close the chunk provider, flushing any changes and closing any system
 resources. | 
| <T extends java.io.Serializable> | getAttribute(org.pepsoft.util.AttributeKey<T> key)Convencience method for getting the value of an attribute stored in the
 external metadata, if any. | 
| java.util.Map<java.lang.String,java.io.Serializable> | getAttributes()Get a live view of the object metadata. | 
| int | getBlockLightLevel(int x,
                  int y,
                  int height)Returns  0ifheightis too large. | 
| int | getBlockTypeAt(int x,
              int y,
              int height)Returns  Constants.BLK_AIRifheightis too large. | 
| Chunk | getChunk(int x,
        int z)Retrieve a chunk. | 
| Chunk | getChunkForEditing(int x,
                  int z)Retrieve a chunk for editing. | 
| int | getDataAt(int x,
         int y,
         int height)Returns  0ifheightis too large. | 
| javax.vecmath.Point3i | getDimensions()Get the dimensions of the object. | 
| java.util.List<Entity> | getEntities()Get any entities contained in the object. | 
| int | getHighestNonAirBlock(int x,
                     int y)Get the Z coordinate of the highest non-air block in a specific column. | 
| boolean | getMask(int x,
       int y,
       int z)Determine whether a block should be placed at the specified relative coordinates. | 
| Material | getMaterial(int x,
           int y,
           int z)Get the material to place at the specified relative coordinates. | 
| Material | getMaterialAt(int x,
             int y,
             int height)Returns  nullifheightis too large. | 
| int | getMaxHeight() | 
| int | getMinHeight() | 
| java.lang.String | getName()Get the name of the object. | 
| javax.vecmath.Point3i | getOffset()Get the offset to apply to this object when placing it. | 
| int | getSkyLightLevel(int x,
                int y,
                int height)Returns  15ifheightis too large. | 
| java.util.List<TileEntity> | getTileEntities()Get any tile entities contained in the object. | 
| org.pepsoft.util.Box | getVolume() | 
| int | getWaterLevel() | 
| boolean | isChunkPresent(int x,
              int y)Determine whether the world contains any data in a particular chunk (a
 16 by 16 block area). | 
| void | markForUpdateWorld(int x,
                  int y,
                  int height)Mark a block to be updated by Minecraft when next loaded. | 
| void | prepareForExport(Dimension dimension)Make preparations, if necessary, for exporting the object. | 
| void | reset() | 
| <T extends java.io.Serializable> | setAttribute(org.pepsoft.util.AttributeKey<T> key,
            T value)Convenience method for setting the value of an attribute stored in the
 external metadata, if any. | 
| void | setAttributes(java.util.Map<java.lang.String,java.io.Serializable> attributes)Store external metadata about the object. | 
| void | setBlockLightLevel(int x,
                  int y,
                  int height,
                  int blockLightLevel)Fails silently if  heightis too large. | 
| void | setBlockTypeAt(int x,
              int y,
              int height,
              int blockType)Fails silently if  heightis too large. | 
| void | setDataAt(int x,
         int y,
         int height,
         int data)Fails silently if  heightis too large. | 
| void | setMaterialAt(int x,
             int y,
             int height,
             Material material)Fails silently if  heightis too large. | 
| void | setName(java.lang.String name)Set the name of the object. | 
| void | setSkyLightLevel(int x,
                int y,
                int height,
                int skyLightLevel)Fails silently if  heightis too large. | 
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdump, getAllMaterials, guessConnectBlocks, guessManageWaterlogged, guestimateOffset, hasAttribute, visitBlockspublic MinecraftWorldObject(java.lang.String name,
                            org.pepsoft.util.Box volume,
                            int maxHeight,
                            int waterLevel)
MinecraftWorldObject which is initialised with
 all air and has no offset.name - The name of the world/object.volume - The volume of blocks in world coordinates which the object should encompass. Blocks outside this
               volume are returned as air for read operations and silently ignored for write operations.maxHeight - The height to return from MinecraftWorld.getMaxHeight(). Must be a power of two and may
                  be higher than the volume; that just means the blocks between the top of the volume and
                  maxHeight won't be stored.public MinecraftWorldObject(java.lang.String name,
                            org.pepsoft.util.Box volume,
                            int maxHeight,
                            int waterLevel,
                            Material[] lowestBlocks,
                            javax.vecmath.Point3i offset)
MinecraftWorldObject.name - The name of the world/object.volume - The volume of blocks in world coordinates which the object should encompass. Blocks outside this
               volume are returned as air for read operations and silently ignored for write operations.maxHeight - The height to return from MinecraftWorld.getMaxHeight(). Must be a power of two and may
                  be higher than the volume; that just means the blocks between the top of the volume and
                  maxHeight won't be stored.lowestBlocks - An optional column of materials with which the bottom of the volume should be filled. All
                     other blocks will be initialised as air. May be null, in which case all blocks
                     will be initialised as air.offset - The offset to return from WPObject.getOffset().public void reset()
public org.pepsoft.util.Box getVolume()
public int getWaterLevel()
public int getBlockTypeAt(int x,
                          int y,
                          int height)
MinecraftWorldConstants.BLK_AIR if height is too large.getBlockTypeAt in interface MinecraftWorldpublic int getDataAt(int x,
                     int y,
                     int height)
MinecraftWorld0 if height is too large.getDataAt in interface MinecraftWorldpublic Material getMaterialAt(int x, int y, int height)
MinecraftWorldnull if height is too large.getMaterialAt in interface MinecraftWorldpublic void setBlockTypeAt(int x,
                           int y,
                           int height,
                           int blockType)
MinecraftWorldheight is too large.setBlockTypeAt in interface MinecraftWorldpublic void setDataAt(int x,
                      int y,
                      int height,
                      int data)
MinecraftWorldheight is too large.setDataAt in interface MinecraftWorldpublic void setMaterialAt(int x,
                          int y,
                          int height,
                          Material material)
MinecraftWorldheight is too large.setMaterialAt in interface MinecraftWorldpublic void markForUpdateWorld(int x,
                               int y,
                               int height)
MinecraftWorldThe default implementation uses ChunkProvider.getChunk(int, int) to get the chunk, and if it exists invokes
 Chunk.markForUpdateChunk(int, int, int) on it.
markForUpdateWorld in interface MinecraftWorldpublic int getMinHeight()
getMinHeight in interface MinecraftWorldpublic int getMaxHeight()
getMaxHeight in interface MinecraftWorldpublic void addEntity(double x,
                      double y,
                      double height,
                      Entity entity)
addEntity in interface MinecraftWorldpublic void addTileEntity(int x,
                          int y,
                          int height,
                          TileEntity tileEntity)
addTileEntity in interface MinecraftWorldpublic int getBlockLightLevel(int x,
                              int y,
                              int height)
MinecraftWorld0 if height is too large.getBlockLightLevel in interface MinecraftWorldpublic void setBlockLightLevel(int x,
                               int y,
                               int height,
                               int blockLightLevel)
MinecraftWorldheight is too large.setBlockLightLevel in interface MinecraftWorldpublic int getSkyLightLevel(int x,
                            int y,
                            int height)
MinecraftWorld15 if height is too large.getSkyLightLevel in interface MinecraftWorldpublic void setSkyLightLevel(int x,
                             int y,
                             int height,
                             int skyLightLevel)
MinecraftWorldheight is too large.setSkyLightLevel in interface MinecraftWorldpublic boolean isChunkPresent(int x,
                              int y)
MinecraftWorldisChunkPresent in interface ChunkProviderisChunkPresent in interface MinecraftWorldx - The X coordinate in chunk coordinates.y - The Y coordinate in chunk coordinates.true if data is present for the specified chunk.public void addChunk(Chunk chunk)
addChunk in interface MinecraftWorldchunk - The chunk to copy.public int getHighestNonAirBlock(int x,
                                 int y)
MinecraftWorldgetHighestNonAirBlock in interface MinecraftWorldx - The X coordinate of the column.y - The Y coordinate of the column.Integer.MIN_VALUE if the
 column is empty or no data is present
 for the specified coordinates.public Chunk getChunk(int x, int z)
ChunkProvidernull is
 returned. The returned chunk may be read-only.getChunk in interface ChunkProviderx - The X coordinate of the chunk to retrieve.z - The Z coordinate of the chunk to retrieve.null if there is no chunk at
 the specified coordinates.public Chunk getChunkForEditing(int x, int z)
ChunkProvidernull may be returned, or the provider may
 create a new, empty chunk. The returned chunk is guaranteed not to be
 read-only.getChunkForEditing in interface ChunkProviderx - The X coordinate of the chunk to retrieve.z - The Z coordinate of the chunk to retrieve.null if there is no chunk at
 the specified coordinates, and this chunk provider does not create new
 chunks.public void close()
ChunkProviderclose in interface java.lang.AutoCloseableclose in interface ChunkProviderpublic java.lang.String getName()
WPObjectpublic void setName(java.lang.String name)
WPObjectpublic javax.vecmath.Point3i getDimensions()
WPObjectgetDimensions in interface WPObjectpublic Material getMaterial(int x, int y, int z)
WPObjectWPObject.getMask(int, int, int) returns true. These coordinates are zero-based and must never be
 negative.getMaterial in interface WPObjectx - The relative X coordinate.y - The relative Y coordinate.z - The relative Z coordinate.public boolean getMask(int x,
                       int y,
                       int z)
WPObjectpublic java.util.List<Entity> getEntities()
WPObjectgetEntities in interface WPObjectnull.public java.util.List<TileEntity> getTileEntities()
WPObjectgetTileEntities in interface WPObjectnull.public void prepareForExport(Dimension dimension)
WPObjectWPObject.getMask(int, int, int) or
 WPObject.getMaterial(int, int, int) are invoked.prepareForExport in interface WPObjectdimension - The dimension for which the object is being exported.public java.util.Map<java.lang.String,java.io.Serializable> getAttributes()
WPObjectgetAttributes in interface WPObjectnull.public <T extends java.io.Serializable> T getAttribute(org.pepsoft.util.AttributeKey<T> key)
WPObjectnull) if it is
 not.getAttribute in interface WPObjectT - The type of the attribute.key - The key of the attribute.public void setAttributes(java.util.Map<java.lang.String,java.io.Serializable> attributes)
WPObjectsetAttributes in interface WPObjectattributes - The external metadata to store.public <T extends java.io.Serializable> void setAttribute(org.pepsoft.util.AttributeKey<T> key,
                                                          T value)
WPObjectnull will
 delete the attribute from the store. If the store becomes empty it is
 deleted entirely.setAttribute in interface WPObjectT - The type of the attribute.key - The key of the attribute to set or delete.value - The value of the attribute to set, or null to
     delete it.public javax.vecmath.Point3i getOffset()
WPObjectThis is a convenience method which must return the same as invoking
 getAttribute(ATTRIBUTE_OFFSET). See
 WPObject.getAttribute(AttributeKey) and WPObject.ATTRIBUTE_OFFSET.
public MinecraftWorldObject clone()
WPObject