Class CrucibleUtil

java.lang.Object
com.hbm_m.util.CrucibleUtil

public class CrucibleUtil extends Object
Port of the 1.7.10 com.hbm.util.CrucibleUtil. The original casts a hitscan straight down to find a pouring target; here we scan block positions downward until we hit the first non-air block.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static net.minecraft.core.BlockPos
    getPouringTarget(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos startPos, int range)
    Finds the first non-air block from startPos (inclusive) downward within range and returns its position if its block entity is an ICrucibleAcceptor, else null.
    static int
    pourSingleStack(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos startPos, int range, MaterialStack stack)
    Standard pouring: finds a target below startPos and pours the stack into it.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CrucibleUtil

      public CrucibleUtil()
  • Method Details

    • getPouringTarget

      @Nullable public static net.minecraft.core.BlockPos getPouringTarget(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos startPos, int range)
      Finds the first non-air block from startPos (inclusive) downward within range and returns its position if its block entity is an ICrucibleAcceptor, else null.
    • pourSingleStack

      public static int pourSingleStack(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos startPos, int range, MaterialStack stack)
      Standard pouring: finds a target below startPos and pours the stack into it. Modifies the passed stack. Returns the amount that was actually poured. "Safe" semantics of the original (safe = true): nothing is lost when no valid target exists, pouring simply does not happen.