Class FeatureAbstractTree
java.lang.Object
org.cloudburstmc.server.level.feature.ReplacingWorldFeature
org.cloudburstmc.server.level.feature.tree.FeatureAbstractTree
- All Implemented Interfaces:
Predicate<org.cloudburstmc.api.block.BlockState>,WorldFeature,BlockFilter
- Direct Known Subclasses:
FeatureHugeTree,FeatureMushroomBrown,FeatureNormalTree
Common code for all tree types.
- Author:
- DaPorkchop_
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected IntRangeprotected BlockSelectorprotected BlockSelectorFields inherited from interface org.cloudburstmc.server.level.generator.standard.misc.filter.BlockFilter
AIR, REPLACEABLE -
Constructor Summary
ConstructorsConstructorDescriptionFeatureAbstractTree(@NonNull IntRange height)FeatureAbstractTree(@NonNull IntRange height, @NonNull GenerationTreeSpecies species)FeatureAbstractTree(@NonNull IntRange height, BlockSelector log, BlockSelector leaves) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract booleancanPlace(org.cloudburstmc.api.level.ChunkManager level, net.daporkchop.lib.random.PRandom random, int x, int y, int z, int height)protected intchooseHeight(org.cloudburstmc.api.level.ChunkManager level, net.daporkchop.lib.random.PRandom random, int x, int y, int z)protected abstract voidfinish(org.cloudburstmc.api.level.ChunkManager level, net.daporkchop.lib.random.PRandom random, int x, int y, int z, int height, org.cloudburstmc.api.block.BlockState log, org.cloudburstmc.api.block.BlockState leaves)booleanplace(org.cloudburstmc.api.level.ChunkManager level, net.daporkchop.lib.random.PRandom random, int x, int y, int z)Tries to place this feature into the given level at the given position.protected abstract voidplaceLeaves(org.cloudburstmc.api.level.ChunkManager level, net.daporkchop.lib.random.PRandom random, int x, int y, int z, int height, org.cloudburstmc.api.block.BlockState log, org.cloudburstmc.api.block.BlockState leaves)protected abstract voidplaceTrunk(org.cloudburstmc.api.level.ChunkManager level, net.daporkchop.lib.random.PRandom random, int x, int y, int z, int height, org.cloudburstmc.api.block.BlockState log, org.cloudburstmc.api.block.BlockState leaves)protected org.cloudburstmc.api.block.BlockStateselectLeaves(org.cloudburstmc.api.level.ChunkManager level, net.daporkchop.lib.random.PRandom random, int x, int y, int z, int height)protected org.cloudburstmc.api.block.BlockStateselectLog(org.cloudburstmc.api.level.ChunkManager level, net.daporkchop.lib.random.PRandom random, int x, int y, int z, int height)Methods inherited from class org.cloudburstmc.server.level.feature.ReplacingWorldFeature
allNeighborsMatch, allNeighborsMatch, replaceGrassWithDirt, test, testOrLiquid, testOrLiquid
-
Field Details
-
height
-
log
-
leaves
-
-
Constructor Details
-
FeatureAbstractTree
-
FeatureAbstractTree
public FeatureAbstractTree(@NonNull @NonNull IntRange height, @NonNull @NonNull GenerationTreeSpecies species) -
FeatureAbstractTree
public FeatureAbstractTree(@NonNull @NonNull IntRange height, BlockSelector log, BlockSelector leaves)
-
-
Method Details
-
place
public boolean place(org.cloudburstmc.api.level.ChunkManager level, net.daporkchop.lib.random.PRandom random, int x, int y, int z)Description copied from interface:WorldFeatureTries to place this feature into the given level at the given position.- Parameters:
level- the level to place the feature intorandom- an instance ofPRandomfor generating random numbersx- the X coordinate to generate the feature aty- the Y coordinate to generate the feature atz- the Z coordinate to generate the feature at- Returns:
- whether or not the feature could be placed
-
chooseHeight
protected int chooseHeight(org.cloudburstmc.api.level.ChunkManager level, net.daporkchop.lib.random.PRandom random, int x, int y, int z) -
canPlace
protected abstract boolean canPlace(org.cloudburstmc.api.level.ChunkManager level, net.daporkchop.lib.random.PRandom random, int x, int y, int z, int height) -
selectLog
protected org.cloudburstmc.api.block.BlockState selectLog(org.cloudburstmc.api.level.ChunkManager level, net.daporkchop.lib.random.PRandom random, int x, int y, int z, int height) -
selectLeaves
protected org.cloudburstmc.api.block.BlockState selectLeaves(org.cloudburstmc.api.level.ChunkManager level, net.daporkchop.lib.random.PRandom random, int x, int y, int z, int height) -
placeLeaves
protected abstract void placeLeaves(org.cloudburstmc.api.level.ChunkManager level, net.daporkchop.lib.random.PRandom random, int x, int y, int z, int height, org.cloudburstmc.api.block.BlockState log, org.cloudburstmc.api.block.BlockState leaves) -
placeTrunk
protected abstract void placeTrunk(org.cloudburstmc.api.level.ChunkManager level, net.daporkchop.lib.random.PRandom random, int x, int y, int z, int height, org.cloudburstmc.api.block.BlockState log, org.cloudburstmc.api.block.BlockState leaves) -
finish
protected abstract void finish(org.cloudburstmc.api.level.ChunkManager level, net.daporkchop.lib.random.PRandom random, int x, int y, int z, int height, org.cloudburstmc.api.block.BlockState log, org.cloudburstmc.api.block.BlockState leaves)
-