Package com.petrolpark.util
Class OreHelper
java.lang.Object
com.petrolpark.util.OreHelper
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final List<net.minecraft.world.level.levelgen.placement.PlacedFeature> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final net.minecraft.core.BlockPosgetCenterPos(net.minecraft.world.level.Level level, net.minecraft.world.phys.Vec3 origin, net.minecraft.world.phys.Vec3 direction, net.minecraft.world.level.levelgen.feature.ConfiguredFeature<?, ?> oreFeature) static final OptionalIntgetVerticalDistanceToClosestPlacement(net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos targetPos, net.minecraft.world.level.levelgen.placement.PlacedFeature placedFeature) For an Ore feature, generate every attempted placement position and find the closest one to the given BlockPos vertically.static final voidonBreakBlock(net.neoforged.neoforge.event.level.BlockEvent.BreakEvent event) static final voidonTagsUpdated(net.neoforged.neoforge.event.TagsUpdatedEvent event) static final voidplaceRandomOre(net.minecraft.server.level.ServerLevel level, net.minecraft.world.phys.Vec3 origin, net.minecraft.world.phys.Vec3 direction) Place a random ore blob hidden behind a block from the player, weighted for the appropriate y level
-
Field Details
-
PLACEABLE_ORE_FEATURES
public static final List<net.minecraft.world.level.levelgen.placement.PlacedFeature> PLACEABLE_ORE_FEATURES
-
-
Constructor Details
-
OreHelper
public OreHelper()
-
-
Method Details
-
onTagsUpdated
public static final void onTagsUpdated(net.neoforged.neoforge.event.TagsUpdatedEvent event) -
onBreakBlock
public static final void onBreakBlock(net.neoforged.neoforge.event.level.BlockEvent.BreakEvent event) -
placeRandomOre
public static final void placeRandomOre(net.minecraft.server.level.ServerLevel level, net.minecraft.world.phys.Vec3 origin, net.minecraft.world.phys.Vec3 direction) Place a random ore blob hidden behind a block from the player, weighted for the appropriate y level- Parameters:
level-origin- Where to originate the attempted placementdirection- The direction the ore should be from this origin
-
getVerticalDistanceToClosestPlacement
public static final OptionalInt getVerticalDistanceToClosestPlacement(net.minecraft.server.level.ServerLevel level, net.minecraft.core.BlockPos targetPos, net.minecraft.world.level.levelgen.placement.PlacedFeature placedFeature) For an Ore feature, generate every attempted placement position and find the closest one to the given BlockPos vertically. More common ores for the given y level (e.g. coal near the surface) will on expectation be closer, so will appear more often.- Parameters:
level-targetPos-placedFeature-
-
getCenterPos
public static final net.minecraft.core.BlockPos getCenterPos(net.minecraft.world.level.Level level, net.minecraft.world.phys.Vec3 origin, net.minecraft.world.phys.Vec3 direction, net.minecraft.world.level.levelgen.feature.ConfiguredFeature<?, ?> oreFeature)
-