Class AbstractOreFeature
java.lang.Object
net.minecraft.world.level.levelgen.feature.AbstractOreFeature
- All Implemented Interfaces:
Feature
- Direct Known Subclasses:
OreFeature, ScatteredOreFeature
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final floatprotected final intprotected final List<BlockReplacement> Fields inherited from interface Feature
CODEC, DIRECT_CODEC, LIST_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionAbstractOreFeature(List<BlockReplacement> targetStates, int size, float discardChanceOnAirExposure) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanPlaceOre(BlockState state, Function<BlockPos, BlockState> blockGetter, RandomSource random, BlockReplacement targetState, BlockPos.MutableBlockPos orePos) static booleancheckNeighbors(Function<BlockPos, BlockState> blockGetter, BlockPos pos, Predicate<BlockState> predicate) abstract com.mojang.serialization.MapCodec<? extends AbstractOreFeature> codec()final floatstatic booleanisAdjacentToAir(Function<BlockPos, BlockState> blockGetter, BlockPos pos) protected static <T extends AbstractOreFeature>
com.mojang.serialization.MapCodec<T> makeCodec(com.mojang.datafixers.util.Function3<List<BlockReplacement>, Integer, Float, T> constructor) private static booleanshouldSkipAirCheck(RandomSource random, float discardChanceOnAirExposure) final intsize()final List<BlockReplacement> Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Feature
getSubFeatures, markAboveForPostProcessing, place, safeSetBlock, setBlock
-
Field Details
-
targetStates
-
size
protected final int size -
discardChanceOnAirExposure
protected final float discardChanceOnAirExposure
-
-
Constructor Details
-
AbstractOreFeature
public AbstractOreFeature(List<BlockReplacement> targetStates, int size, float discardChanceOnAirExposure)
-
-
Method Details
-
makeCodec
protected static <T extends AbstractOreFeature> com.mojang.serialization.MapCodec<T> makeCodec(com.mojang.datafixers.util.Function3<List<BlockReplacement>, Integer, Float, T> constructor) -
codec
-
targetStates
-
size
public final int size() -
discardChanceOnAirExposure
public final float discardChanceOnAirExposure() -
canPlaceOre
public boolean canPlaceOre(BlockState state, Function<BlockPos, BlockState> blockGetter, RandomSource random, BlockReplacement targetState, BlockPos.MutableBlockPos orePos) -
isAdjacentToAir
-
checkNeighbors
public static boolean checkNeighbors(Function<BlockPos, BlockState> blockGetter, BlockPos pos, Predicate<BlockState> predicate) -
shouldSkipAirCheck
-