Class ReplacingWorldFeature
java.lang.Object
org.cloudburstmc.server.level.feature.ReplacingWorldFeature
- All Implemented Interfaces:
Predicate<org.cloudburstmc.api.block.BlockState>,WorldFeature,BlockFilter
- Direct Known Subclasses:
FeatureAbstractTree,FeatureChorusTree,FeatureFallenTree
Provides helper methods for other
WorldFeature to quickly check if a block can be replaced.- Author:
- DaPorkchop_
-
Field Summary
Fields inherited from interface org.cloudburstmc.server.level.generator.standard.misc.filter.BlockFilter
AIR, REPLACEABLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanallNeighborsMatch(org.cloudburstmc.api.level.ChunkManager level, int x, int y, int z, BlockFilter filter)Checks whether all the blocks that horizontally neighbor the given coordinates match the givenBlockFilter.booleanallNeighborsMatch(org.cloudburstmc.api.level.ChunkManager level, int x, int y, int z, BlockFilter filter, org.cloudburstmc.api.util.Direction except)Checks whether all the blocks that horizontally neighbor the given coordinates match the givenBlockFilter.voidreplaceGrassWithDirt(org.cloudburstmc.api.level.ChunkManager level, int x, int y, int z)Replaces the block at the given coordinates with dirt if it is a grassy block type.booleantest(org.cloudburstmc.api.block.BlockState state)booleantestOrLiquid(int runtimeId)booleantestOrLiquid(org.cloudburstmc.api.block.BlockState state)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.cloudburstmc.server.level.feature.WorldFeature
place
-
Constructor Details
-
ReplacingWorldFeature
public ReplacingWorldFeature()
-
-
Method Details
-
test
public boolean test(org.cloudburstmc.api.block.BlockState state)- Specified by:
testin interfaceBlockFilter- Specified by:
testin interfacePredicate<org.cloudburstmc.api.block.BlockState>
-
testOrLiquid
public boolean testOrLiquid(org.cloudburstmc.api.block.BlockState state) -
testOrLiquid
public boolean testOrLiquid(int runtimeId) -
replaceGrassWithDirt
public void replaceGrassWithDirt(org.cloudburstmc.api.level.ChunkManager level, int x, int y, int z)Replaces the block at the given coordinates with dirt if it is a grassy block type.The following blocks are considered "grassy": -
BlockIds.GRASS-BlockIds.MYCELIUM-BlockIds.PODZOL -
allNeighborsMatch
public boolean allNeighborsMatch(org.cloudburstmc.api.level.ChunkManager level, int x, int y, int z, BlockFilter filter)Checks whether all the blocks that horizontally neighbor the given coordinates match the givenBlockFilter. -
allNeighborsMatch
public boolean allNeighborsMatch(org.cloudburstmc.api.level.ChunkManager level, int x, int y, int z, BlockFilter filter, org.cloudburstmc.api.util.Direction except)Checks whether all the blocks that horizontally neighbor the given coordinates match the givenBlockFilter.
-