public abstract class WPObjectExporter<L extends Layer> extends AbstractLayerExporter<L>
WPObject
s to a
MinecraftWorld
.Modifier and Type | Class and Description |
---|---|
static class |
WPObjectExporter.Placement |
static class |
WPObjectExporter.WPObjectFixup |
AbstractLayerExporter.ChunksInTilesVisitor
Constructor and Description |
---|
WPObjectExporter(Dimension dimension,
Platform platform,
ExporterSettings settings,
L layer) |
Modifier and Type | Method and Description |
---|---|
static boolean |
isRoom(MinecraftWorld world,
Dimension dimension,
WPObject object,
int x,
int y,
int z,
WPObjectExporter.Placement placement)
Checks block by block and taking the object's collision mode attributes
and other rules into account whether it can be placed at a particular
location.
|
static boolean |
isSane(WPObject object,
int x,
int y,
int z,
int minHeight,
int maxHeight)
Check whether the coordinates of the extents of the object make sense.
|
static void |
renderObject(MinecraftWorld world,
Dimension dimension,
Platform platform,
WPObject object,
int x,
int y,
int z)
Export an object to the world, taking into account the blocks that are
already there.
|
static void |
renderObject(MinecraftWorld world,
Dimension dimension,
Platform platform,
WPObject object,
int x,
int y,
int z,
boolean obliterate)
Export an object to the world, optionally taking into account the blocks
that are already there.
|
static void |
renderObjectInverted(MinecraftWorld world,
Platform platform,
WPObject object,
int x,
int y,
int z)
Export an object to the world upside-down, optionally taking into account the blocks that are already there.
|
getDimension, getLayer, visitChunksForLayerInAreaForEditing
public WPObjectExporter(Dimension dimension, Platform platform, ExporterSettings settings, L layer)
public static void renderObject(MinecraftWorld world, Dimension dimension, Platform platform, WPObject object, int x, int y, int z)
world
- The Minecraft world to which to export the object.dimension
- The dimension corresponding to the exported world, used
to determine the terrain height.platform
- object
- The object to export.x
- The X coordinate at which to export the object.y
- The Y coordinate at which to export the object.z
- The Z coordinate at which to export the object.public static void renderObject(MinecraftWorld world, Dimension dimension, Platform platform, WPObject object, int x, int y, int z, boolean obliterate)
world
- The Minecraft world to which to export the object.dimension
- The dimension corresponding to the exported world, used
to determine the terrain height.platform
- object
- The object to export.x
- The X coordinate at which to export the object.y
- The Y coordinate at which to export the object.z
- The Z coordinate at which to export the object.obliterate
- When true
, all blocks of the object are
placed regardless of what is already there. When false
,
rules are followed and some or all blocks may not be placed,
depending on what is already there.public static void renderObjectInverted(MinecraftWorld world, Platform platform, WPObject object, int x, int y, int z)
renderObject(MinecraftWorld, Dimension, Platform, WPObject, int, int, int, boolean)
because they don't make sense when rendering an object upside-down. It treats the location as if it is entirely
above-ground.world
- The Minecraft world to which to export the object.platform
- object
- The object to export.x
- The X coordinate at which to export the object.y
- The Y coordinate at which to export the object.z
- The Z coordinate at which to export the object.public static boolean isSane(WPObject object, int x, int y, int z, int minHeight, int maxHeight)
true
if the object could potentially be placeable
and the caller can proceed with further checks.public static boolean isRoom(MinecraftWorld world, Dimension dimension, WPObject object, int x, int y, int z, WPObjectExporter.Placement placement)
isSane(WPObject, int, int, int, int, int)
first to weed out objects
for which this check does not even apply.true
if the object may be placed at the specified
location according to its collision mode attributes.