public abstract class StructureComponent
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
StructureComponent.BlockSelector |
Modifier and Type | Field and Description |
---|---|
protected StructureBoundingBox |
boundingBox |
protected int |
componentType
The type ID of this component.
|
Modifier | Constructor and Description |
---|---|
|
StructureComponent() |
protected |
StructureComponent(int type) |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
addComponentParts(World worldIn,
java.util.Random randomIn,
StructureBoundingBox structureBoundingBoxIn)
second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at
the end, it adds Fences...
|
void |
buildComponent(StructureComponent componentIn,
java.util.List<StructureComponent> listIn,
java.util.Random rand)
Initiates construction of the Structure Component picked, at the current Location of StructGen
|
protected void |
clearCurrentPositionBlocksUpwards(World worldIn,
int x,
int y,
int z,
StructureBoundingBox structurebb)
Deletes all continuous blocks from selected position upwards.
|
protected boolean |
createDispenser(World p_189419_1_,
StructureBoundingBox p_189419_2_,
java.util.Random p_189419_3_,
int p_189419_4_,
int p_189419_5_,
int p_189419_6_,
EnumFacing p_189419_7_,
ResourceLocation p_189419_8_) |
NBTTagCompound |
createStructureBaseNBT()
Writes structure base data (id, boundingbox,
coordBase and componentType ) to new NBTTagCompound and
returns it. |
protected void |
fillWithAir(World worldIn,
StructureBoundingBox structurebb,
int minX,
int minY,
int minZ,
int maxX,
int maxY,
int maxZ)
arguments: (World worldObj, StructureBoundingBox structBB, int minX, int minY, int minZ, int maxX, int maxY, int
maxZ)
|
protected void |
fillWithBlocks(World worldIn,
StructureBoundingBox boundingboxIn,
int xMin,
int yMin,
int zMin,
int xMax,
int yMax,
int zMax,
IBlockState boundaryBlockState,
IBlockState insideBlockState,
boolean existingOnly)
Fill the given area with the selected blocks
|
protected void |
fillWithRandomizedBlocks(World worldIn,
StructureBoundingBox boundingboxIn,
int minX,
int minY,
int minZ,
int maxX,
int maxY,
int maxZ,
boolean alwaysReplace,
java.util.Random rand,
StructureComponent.BlockSelector blockselector)
arguments: World worldObj, StructureBoundingBox structBB, int minX, int minY, int minZ, int maxX, int maxY, int
maxZ, boolean alwaysreplace, Random rand, StructurePieceBlockSelector blockselector
|
static StructureComponent |
findIntersecting(java.util.List<StructureComponent> listIn,
StructureBoundingBox boundingboxIn)
Discover if bounding box can fit within the current bounding box object.
|
protected boolean |
generateChest(World p_191080_1_,
StructureBoundingBox p_191080_2_,
java.util.Random p_191080_3_,
BlockPos p_191080_4_,
ResourceLocation p_191080_5_,
IBlockState p_191080_6_) |
protected boolean |
generateChest(World worldIn,
StructureBoundingBox structurebb,
java.util.Random randomIn,
int x,
int y,
int z,
ResourceLocation loot)
Adds chest to the structure and sets its contents
|
protected void |
generateDoor(World p_189915_1_,
StructureBoundingBox p_189915_2_,
java.util.Random p_189915_3_,
int p_189915_4_,
int p_189915_5_,
int p_189915_6_,
EnumFacing p_189915_7_,
BlockDoor p_189915_8_) |
protected void |
generateMaybeBox(World p_189914_1_,
StructureBoundingBox p_189914_2_,
java.util.Random p_189914_3_,
float p_189914_4_,
int p_189914_5_,
int p_189914_6_,
int p_189914_7_,
int p_189914_8_,
int p_189914_9_,
int p_189914_10_,
IBlockState p_189914_11_,
IBlockState p_189914_12_,
boolean p_189914_13_,
int p_189914_14_) |
protected IBlockState |
getBlockStateFromPos(World worldIn,
int x,
int y,
int z,
StructureBoundingBox boundingboxIn) |
StructureBoundingBox |
getBoundingBox() |
int |
getComponentType()
Returns the component type ID of this component.
|
EnumFacing |
getCoordBaseMode() |
protected int |
getSkyBrightness(World p_189916_1_,
int p_189916_2_,
int p_189916_3_,
int p_189916_4_,
StructureBoundingBox p_189916_5_) |
protected int |
getXWithOffset(int x,
int z) |
protected int |
getYWithOffset(int y) |
protected int |
getZWithOffset(int x,
int z) |
protected boolean |
isLiquidInStructureBoundingBox(World worldIn,
StructureBoundingBox boundingboxIn)
checks the entire StructureBoundingBox for Liquids
|
void |
offset(int x,
int y,
int z) |
protected void |
randomlyPlaceBlock(World worldIn,
StructureBoundingBox boundingboxIn,
java.util.Random rand,
float chance,
int x,
int y,
int z,
IBlockState blockstateIn) |
protected void |
randomlyRareFillWithBlocks(World worldIn,
StructureBoundingBox boundingboxIn,
int minX,
int minY,
int minZ,
int maxX,
int maxY,
int maxZ,
IBlockState blockstateIn,
boolean excludeAir) |
void |
readStructureBaseNBT(World worldIn,
NBTTagCompound tagCompound)
Reads and sets structure base data (boundingbox,
coordBase and componentType ) |
protected abstract void |
readStructureFromNBT(NBTTagCompound tagCompound,
TemplateManager p_143011_2_)
(abstract) Helper method to read subclass data from NBT
|
protected void |
replaceAirAndLiquidDownwards(World worldIn,
IBlockState blockstateIn,
int x,
int y,
int z,
StructureBoundingBox boundingboxIn)
Replaces air and liquid from given position downwards.
|
protected void |
setBlockState(World worldIn,
IBlockState blockstateIn,
int x,
int y,
int z,
StructureBoundingBox boundingboxIn) |
void |
setCoordBaseMode(EnumFacing facing) |
protected abstract void |
writeStructureToNBT(NBTTagCompound tagCompound)
(abstract) Helper method to write subclass data to NBT
|
protected StructureBoundingBox boundingBox
protected int componentType
public StructureComponent()
protected StructureComponent(int type)
public final NBTTagCompound createStructureBaseNBT()
coordBase
and componentType
) to new NBTTagCompound and
returns it.protected abstract void writeStructureToNBT(NBTTagCompound tagCompound)
public void readStructureBaseNBT(World worldIn, NBTTagCompound tagCompound)
coordBase
and componentType
)protected abstract void readStructureFromNBT(NBTTagCompound tagCompound, TemplateManager p_143011_2_)
public void buildComponent(StructureComponent componentIn, java.util.List<StructureComponent> listIn, java.util.Random rand)
public abstract boolean addComponentParts(World worldIn, java.util.Random randomIn, StructureBoundingBox structureBoundingBoxIn)
public StructureBoundingBox getBoundingBox()
public int getComponentType()
public static StructureComponent findIntersecting(java.util.List<StructureComponent> listIn, StructureBoundingBox boundingboxIn)
protected boolean isLiquidInStructureBoundingBox(World worldIn, StructureBoundingBox boundingboxIn)
protected int getXWithOffset(int x, int z)
protected int getYWithOffset(int y)
protected int getZWithOffset(int x, int z)
protected void setBlockState(World worldIn, IBlockState blockstateIn, int x, int y, int z, StructureBoundingBox boundingboxIn)
protected IBlockState getBlockStateFromPos(World worldIn, int x, int y, int z, StructureBoundingBox boundingboxIn)
protected int getSkyBrightness(World p_189916_1_, int p_189916_2_, int p_189916_3_, int p_189916_4_, StructureBoundingBox p_189916_5_)
protected void fillWithAir(World worldIn, StructureBoundingBox structurebb, int minX, int minY, int minZ, int maxX, int maxY, int maxZ)
protected void fillWithBlocks(World worldIn, StructureBoundingBox boundingboxIn, int xMin, int yMin, int zMin, int xMax, int yMax, int zMax, IBlockState boundaryBlockState, IBlockState insideBlockState, boolean existingOnly)
protected void fillWithRandomizedBlocks(World worldIn, StructureBoundingBox boundingboxIn, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, boolean alwaysReplace, java.util.Random rand, StructureComponent.BlockSelector blockselector)
protected void generateMaybeBox(World p_189914_1_, StructureBoundingBox p_189914_2_, java.util.Random p_189914_3_, float p_189914_4_, int p_189914_5_, int p_189914_6_, int p_189914_7_, int p_189914_8_, int p_189914_9_, int p_189914_10_, IBlockState p_189914_11_, IBlockState p_189914_12_, boolean p_189914_13_, int p_189914_14_)
protected void randomlyPlaceBlock(World worldIn, StructureBoundingBox boundingboxIn, java.util.Random rand, float chance, int x, int y, int z, IBlockState blockstateIn)
protected void randomlyRareFillWithBlocks(World worldIn, StructureBoundingBox boundingboxIn, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, IBlockState blockstateIn, boolean excludeAir)
protected void clearCurrentPositionBlocksUpwards(World worldIn, int x, int y, int z, StructureBoundingBox structurebb)
protected void replaceAirAndLiquidDownwards(World worldIn, IBlockState blockstateIn, int x, int y, int z, StructureBoundingBox boundingboxIn)
protected boolean generateChest(World worldIn, StructureBoundingBox structurebb, java.util.Random randomIn, int x, int y, int z, ResourceLocation loot)
protected boolean generateChest(World p_191080_1_, StructureBoundingBox p_191080_2_, java.util.Random p_191080_3_, BlockPos p_191080_4_, ResourceLocation p_191080_5_, IBlockState p_191080_6_)
protected boolean createDispenser(World p_189419_1_, StructureBoundingBox p_189419_2_, java.util.Random p_189419_3_, int p_189419_4_, int p_189419_5_, int p_189419_6_, EnumFacing p_189419_7_, ResourceLocation p_189419_8_)
protected void generateDoor(World p_189915_1_, StructureBoundingBox p_189915_2_, java.util.Random p_189915_3_, int p_189915_4_, int p_189915_5_, int p_189915_6_, EnumFacing p_189915_7_, BlockDoor p_189915_8_)
public void offset(int x, int y, int z)
public EnumFacing getCoordBaseMode()
public void setCoordBaseMode(EnumFacing facing)