Debug Helpers
This commit is contained in:
parent
6b2c997baf
commit
f07a651279
2 changed files with 33 additions and 0 deletions
|
@ -0,0 +1,29 @@
|
||||||
|
package org.betterx.bclib.api.v2.levelgen.features.placement;
|
||||||
|
|
||||||
|
import com.mojang.serialization.Codec;
|
||||||
|
import net.minecraft.core.BlockPos;
|
||||||
|
import net.minecraft.util.RandomSource;
|
||||||
|
import net.minecraft.world.level.levelgen.placement.PlacementContext;
|
||||||
|
import net.minecraft.world.level.levelgen.placement.PlacementModifier;
|
||||||
|
import net.minecraft.world.level.levelgen.placement.PlacementModifierType;
|
||||||
|
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
public class Debug extends PlacementModifier {
|
||||||
|
public static final Debug INSTANCE = new Debug();
|
||||||
|
public static final Codec<Debug> CODEC = Codec.unit(Debug::new);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Stream<BlockPos> getPositions(
|
||||||
|
PlacementContext placementContext,
|
||||||
|
RandomSource randomSource,
|
||||||
|
BlockPos blockPos
|
||||||
|
) {
|
||||||
|
return Stream.of(blockPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PlacementModifierType<?> type() {
|
||||||
|
return PlacementModifiers.DEBUG;
|
||||||
|
}
|
||||||
|
}
|
|
@ -9,6 +9,10 @@ import net.minecraft.world.level.levelgen.placement.PlacementModifier;
|
||||||
import net.minecraft.world.level.levelgen.placement.PlacementModifierType;
|
import net.minecraft.world.level.levelgen.placement.PlacementModifierType;
|
||||||
|
|
||||||
public class PlacementModifiers {
|
public class PlacementModifiers {
|
||||||
|
public static final PlacementModifierType<Debug> DEBUG = register(
|
||||||
|
"debug",
|
||||||
|
Debug.CODEC
|
||||||
|
);
|
||||||
public static final PlacementModifierType<IsEmptyAboveSampledFilter> IS_EMPTY_ABOVE_SAMPLED_FILTER = register(
|
public static final PlacementModifierType<IsEmptyAboveSampledFilter> IS_EMPTY_ABOVE_SAMPLED_FILTER = register(
|
||||||
"is_empty_above_sampled_filter",
|
"is_empty_above_sampled_filter",
|
||||||
IsEmptyAboveSampledFilter.CODEC
|
IsEmptyAboveSampledFilter.CODEC
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue