PlacementUtils.java
net.minecraft.data.worldgen.placement.PlacementUtils
信息
- 全限定名:net.minecraft.data.worldgen.placement.PlacementUtils
- 类型:public class
- 包:net.minecraft.data.worldgen.placement
- 源码路径:src/main/java/net/minecraft/data/worldgen/placement/PlacementUtils.java
- 起始行号:L29
- 职责:
TODO
字段/常量
-
HEIGHTMAP- 类型:
PlacementModifier - 修饰符:
public static final - 源码定位:
L30 - 说明:
TODO
- 类型:
-
HEIGHTMAP_NO_LEAVES- 类型:
PlacementModifier - 修饰符:
public static final - 源码定位:
L31 - 说明:
TODO
- 类型:
-
HEIGHTMAP_TOP_SOLID- 类型:
PlacementModifier - 修饰符:
public static final - 源码定位:
L32 - 说明:
TODO
- 类型:
-
HEIGHTMAP_WORLD_SURFACE- 类型:
PlacementModifier - 修饰符:
public static final - 源码定位:
L33 - 说明:
TODO
- 类型:
-
HEIGHTMAP_OCEAN_FLOOR- 类型:
PlacementModifier - 修饰符:
public static final - 源码定位:
L34 - 说明:
TODO
- 类型:
-
FULL_RANGE- 类型:
PlacementModifier - 修饰符:
public static final - 源码定位:
L35 - 说明:
TODO
- 类型:
-
RANGE_10_10- 类型:
PlacementModifier - 修饰符:
public static final - 源码定位:
L36 - 说明:
TODO
- 类型:
-
RANGE_8_8- 类型:
PlacementModifier - 修饰符:
public static final - 源码定位:
L37 - 说明:
TODO
- 类型:
-
RANGE_4_4- 类型:
PlacementModifier - 修饰符:
public static final - 源码定位:
L38 - 说明:
TODO
- 类型:
-
RANGE_BOTTOM_TO_MAX_TERRAIN_HEIGHT- 类型:
PlacementModifier - 修饰符:
public static final - 源码定位:
L39 - 说明:
TODO
- 类型:
内部类/嵌套类型
- 无
构造器
- 无
方法
下面的方法块按源码顺序生成。
public static void bootstrap(BootstrapContext<PlacedFeature> context) @ L43
- 方法名:bootstrap
- 源码定位:L43
- 返回类型:void
- 修饰符:public static
参数:
- context: BootstrapContext
说明:
TODO
public static ResourceKey<PlacedFeature> createKey(String name) @ L55
- 方法名:createKey
- 源码定位:L55
- 返回类型:ResourceKey
- 修饰符:public static
参数:
- name: String
说明:
TODO
public static void register(BootstrapContext<PlacedFeature> context, ResourceKey<PlacedFeature> id, Holder<ConfiguredFeature<?,?>> feature, List<PlacementModifier> placementModifiers) @ L59
- 方法名:register
- 源码定位:L59
- 返回类型:void
- 修饰符:public static
参数:
- context: BootstrapContext
- id: ResourceKey
- feature: Holder<ConfiguredFeature>
- placementModifiers: List
说明:
TODO
public static void register(BootstrapContext<PlacedFeature> context, ResourceKey<PlacedFeature> id, Holder<ConfiguredFeature<?,?>> feature, PlacementModifier... placementModifiers) @ L68
- 方法名:register
- 源码定位:L68
- 返回类型:void
- 修饰符:public static
参数:
- context: BootstrapContext
- id: ResourceKey
- feature: Holder<ConfiguredFeature>
- placementModifiers: PlacementModifier…
说明:
TODO
public static PlacementModifier countExtra(int count, float chance, int extra) @ L77
- 方法名:countExtra
- 源码定位:L77
- 返回类型:PlacementModifier
- 修饰符:public static
参数:
- count: int
- chance: float
- extra: int
说明:
TODO
public static PlacementFilter isEmpty() @ L90
- 方法名:isEmpty
- 源码定位:L90
- 返回类型:PlacementFilter
- 修饰符:public static
参数:
- 无
说明:
TODO
public static BlockPredicateFilter filteredByBlockSurvival(Block block) @ L94
- 方法名:filteredByBlockSurvival
- 源码定位:L94
- 返回类型:BlockPredicateFilter
- 修饰符:public static
参数:
- block: Block
说明:
TODO
public static Holder<PlacedFeature> inlinePlaced(Holder<ConfiguredFeature<?,?>> configuredFeature, PlacementModifier... placedFeatures) @ L98
- 方法名:inlinePlaced
- 源码定位:L98
- 返回类型:Holder
- 修饰符:public static
参数:
- configuredFeature: Holder<ConfiguredFeature>
- placedFeatures: PlacementModifier…
说明:
TODO
public static <FC extends FeatureConfiguration,F extends Feature<FC>> Holder<PlacedFeature> inlinePlaced(F feature, FC config, PlacementModifier... placedFeatures) @ L102
- 方法名:inlinePlaced
- 源码定位:L102
- 返回类型:<FC extends FeatureConfiguration,F extends Feature
> Holder - 修饰符:public static
参数:
- feature: F
- config: FC
- placedFeatures: PlacementModifier…
说明:
TODO
public static <FC extends FeatureConfiguration,F extends Feature<FC>> Holder<PlacedFeature> onlyWhenEmpty(F feature, FC config) @ L108
- 方法名:onlyWhenEmpty
- 源码定位:L108
- 返回类型:<FC extends FeatureConfiguration,F extends Feature
> Holder - 修饰符:public static
参数:
- feature: F
- config: FC
说明:
TODO
public static <FC extends FeatureConfiguration,F extends Feature<FC>> Holder<PlacedFeature> filtered(F feature, FC config, BlockPredicate predicate) @ L112
- 方法名:filtered
- 源码定位:L112
- 返回类型:<FC extends FeatureConfiguration,F extends Feature
> Holder - 修饰符:public static
参数:
- feature: F
- config: FC
- predicate: BlockPredicate
说明:
TODO
代码
public class PlacementUtils {
public static final PlacementModifier HEIGHTMAP = HeightmapPlacement.onHeightmap(Heightmap.Types.MOTION_BLOCKING);
public static final PlacementModifier HEIGHTMAP_NO_LEAVES = HeightmapPlacement.onHeightmap(Heightmap.Types.MOTION_BLOCKING_NO_LEAVES);
public static final PlacementModifier HEIGHTMAP_TOP_SOLID = HeightmapPlacement.onHeightmap(Heightmap.Types.OCEAN_FLOOR_WG);
public static final PlacementModifier HEIGHTMAP_WORLD_SURFACE = HeightmapPlacement.onHeightmap(Heightmap.Types.WORLD_SURFACE_WG);
public static final PlacementModifier HEIGHTMAP_OCEAN_FLOOR = HeightmapPlacement.onHeightmap(Heightmap.Types.OCEAN_FLOOR);
public static final PlacementModifier FULL_RANGE = HeightRangePlacement.uniform(VerticalAnchor.bottom(), VerticalAnchor.top());
public static final PlacementModifier RANGE_10_10 = HeightRangePlacement.uniform(VerticalAnchor.aboveBottom(10), VerticalAnchor.belowTop(10));
public static final PlacementModifier RANGE_8_8 = HeightRangePlacement.uniform(VerticalAnchor.aboveBottom(8), VerticalAnchor.belowTop(8));
public static final PlacementModifier RANGE_4_4 = HeightRangePlacement.uniform(VerticalAnchor.aboveBottom(4), VerticalAnchor.belowTop(4));
public static final PlacementModifier RANGE_BOTTOM_TO_MAX_TERRAIN_HEIGHT = HeightRangePlacement.uniform(
VerticalAnchor.bottom(), VerticalAnchor.absolute(256)
);
public static void bootstrap(BootstrapContext<PlacedFeature> context) {
AquaticPlacements.bootstrap(context);
CavePlacements.bootstrap(context);
EndPlacements.bootstrap(context);
MiscOverworldPlacements.bootstrap(context);
NetherPlacements.bootstrap(context);
OrePlacements.bootstrap(context);
TreePlacements.bootstrap(context);
VegetationPlacements.bootstrap(context);
VillagePlacements.bootstrap(context);
}
public static ResourceKey<PlacedFeature> createKey(String name) {
return ResourceKey.create(Registries.PLACED_FEATURE, Identifier.withDefaultNamespace(name));
}
public static void register(
BootstrapContext<PlacedFeature> context,
ResourceKey<PlacedFeature> id,
Holder<ConfiguredFeature<?, ?>> feature,
List<PlacementModifier> placementModifiers
) {
context.register(id, new PlacedFeature(feature, List.copyOf(placementModifiers)));
}
public static void register(
BootstrapContext<PlacedFeature> context,
ResourceKey<PlacedFeature> id,
Holder<ConfiguredFeature<?, ?>> feature,
PlacementModifier... placementModifiers
) {
register(context, id, feature, List.of(placementModifiers));
}
public static PlacementModifier countExtra(int count, float chance, int extra) {
float weight = 1.0F / chance;
if (Math.abs(weight - (int)weight) > 1.0E-5F) {
throw new IllegalStateException("Chance data cannot be represented as list weight");
} else {
WeightedList<IntProvider> distribution = WeightedList.<IntProvider>builder()
.add(ConstantInt.of(count), (int)weight - 1)
.add(ConstantInt.of(count + extra), 1)
.build();
return CountPlacement.of(new WeightedListInt(distribution));
}
}
public static PlacementFilter isEmpty() {
return BlockPredicateFilter.forPredicate(BlockPredicate.ONLY_IN_AIR_PREDICATE);
}
public static BlockPredicateFilter filteredByBlockSurvival(Block block) {
return BlockPredicateFilter.forPredicate(BlockPredicate.wouldSurvive(block.defaultBlockState(), BlockPos.ZERO));
}
public static Holder<PlacedFeature> inlinePlaced(Holder<ConfiguredFeature<?, ?>> configuredFeature, PlacementModifier... placedFeatures) {
return Holder.direct(new PlacedFeature(configuredFeature, List.of(placedFeatures)));
}
public static <FC extends FeatureConfiguration, F extends Feature<FC>> Holder<PlacedFeature> inlinePlaced(
F feature, FC config, PlacementModifier... placedFeatures
) {
return inlinePlaced(Holder.direct(new ConfiguredFeature(feature, config)), placedFeatures);
}
public static <FC extends FeatureConfiguration, F extends Feature<FC>> Holder<PlacedFeature> onlyWhenEmpty(F feature, FC config) {
return filtered(feature, config, BlockPredicate.ONLY_IN_AIR_PREDICATE);
}
public static <FC extends FeatureConfiguration, F extends Feature<FC>> Holder<PlacedFeature> filtered(F feature, FC config, BlockPredicate predicate) {
return inlinePlaced(feature, config, BlockPredicateFilter.forPredicate(predicate));
}
}引用的其他类
-
- 引用位置:
参数/方法调用/返回值 - 关联成员:
Holder.direct()
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
AquaticPlacements.bootstrap()
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
CavePlacements.bootstrap()
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
EndPlacements.bootstrap()
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
MiscOverworldPlacements.bootstrap()
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
NetherPlacements.bootstrap()
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
OrePlacements.bootstrap()
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
TreePlacements.bootstrap()
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
VegetationPlacements.bootstrap()
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
VillagePlacements.bootstrap()
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
Identifier.withDefaultNamespace()
- 引用位置:
-
- 引用位置:
参数/方法调用/返回值 - 关联成员:
ResourceKey.create()
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
ConstantInt.of()
- 引用位置:
-
- 引用位置:
构造调用 - 关联成员:
WeightedListInt()
- 引用位置:
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
VerticalAnchor.aboveBottom(), VerticalAnchor.absolute(), VerticalAnchor.belowTop(), VerticalAnchor.bottom(), VerticalAnchor.top()
- 引用位置:
-
- 引用位置:
参数/方法调用 - 关联成员:
BlockPredicate.wouldSurvive()
- 引用位置:
-
- 引用位置:
参数/构造调用 - 关联成员:
ConfiguredFeature()
- 引用位置:
-
- 引用位置:
返回值
- 引用位置:
-
- 引用位置:
返回值
- 引用位置:
-
- 引用位置:
方法调用/返回值 - 关联成员:
BlockPredicateFilter.forPredicate()
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
CountPlacement.of()
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
HeightRangePlacement.uniform()
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
HeightmapPlacement.onHeightmap()
- 引用位置:
-
- 引用位置:
参数/构造调用/返回值 - 关联成员:
PlacedFeature()
- 引用位置:
-
- 引用位置:
返回值
- 引用位置:
-
- 引用位置:
参数/字段/返回值
- 引用位置: