public class StructureCreator
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
StructureCreator.DefaultValidityChecker |
static interface |
StructureCreator.ICheckBlockValidity
Implement this if you want to check for custom conditions
|
Constructor and Description |
---|
StructureCreator() |
Modifier and Type | Method and Description |
---|---|
void |
addBlock(Location location,
net.minecraft.block.Block block)
Adds a block to the structure with the default implementation of
StructureCreator.ICheckBlockValidity |
void |
addBlock(Location location,
net.minecraft.block.Block block,
int meta)
Adds a block to the structure with the default implementation of
StructureCreator.ICheckBlockValidity |
void |
addBlock(Location location,
net.minecraft.block.Block block,
int meta,
StructureCreator.ICheckBlockValidity validityChecker)
Adds a block to the structure with a custom implementation of
StructureCreator.ICheckBlockValidity |
void |
generateStructure()
Generates the structure, it won't generate if
isStructureValid() is false |
void |
generateStructure(boolean forceOptionalBlocks)
Generates the structure with the set flags, it won't generate if
isStructureValid() is false |
void |
generateStructure(boolean forceOptionalBlocks,
boolean forceNonOptionalBlocks)
Generates the structure with the set flags
|
boolean |
isStructureValid()
Checks if the structure is valid for spawning
|
public void addBlock(Location location, net.minecraft.block.Block block)
StructureCreator.ICheckBlockValidity
location
- The location of the blockblock
- The blockpublic void addBlock(Location location, net.minecraft.block.Block block, int meta)
StructureCreator.ICheckBlockValidity
location
- The location of the blockblock
- The blockmeta
- The meta for the blockpublic void addBlock(Location location, net.minecraft.block.Block block, int meta, StructureCreator.ICheckBlockValidity validityChecker)
StructureCreator.ICheckBlockValidity
location
- The location of the blockblock
- The blockmeta
- The meta for the blockvalidityChecker
- The StructureCreator.ICheckBlockValidity
to usepublic boolean isStructureValid()
public void generateStructure()
isStructureValid()
is falsepublic void generateStructure(boolean forceOptionalBlocks)
isStructureValid()
is falseforceOptionalBlocks
- If true, blocks which don't need to be generated for the structure to spawn will spawnpublic void generateStructure(boolean forceOptionalBlocks, boolean forceNonOptionalBlocks)
forceOptionalBlocks
- If true, blocks which don't need to be generated for the structure to spawn will spawnforceNonOptionalBlocks
- If true, the structure will generate regardless of the results of isStructureValid()