Class OreHelper

java.lang.Object
com.petrolpark.util.OreHelper

public class OreHelper extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final List<net.minecraft.world.level.levelgen.placement.PlacedFeature>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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)
     
    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.
    static final void
    onBreakBlock(net.neoforged.neoforge.event.level.BlockEvent.BreakEvent event)
     
    static final void
    onTagsUpdated(net.neoforged.neoforge.event.TagsUpdatedEvent event)
     
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 placement
      direction - 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)