Class TubeSpline

java.lang.Object
com.petrolpark.util.ClampedCubicSpline
com.petrolpark.compat.create.core.tube.TubeSpline

public class TubeSpline extends ClampedCubicSpline
A Clamped Cubic Spline with each end in the middle of a Block Face
  • Field Details

    • MAX_LENGTH

      public static final double MAX_LENGTH
      See Also:
    • MAX_VOLUME

      public static final double MAX_VOLUME
      See Also:
    • MAX_CONTROL_POINTS

      public static final int MAX_CONTROL_POINTS
      See Also:
    • start

      public final BlockFace start
    • end

      public final BlockFace end
    • maxAngle

      public final double maxAngle
    • segmentRadius

      public final double segmentRadius
    • tooSharp

      protected boolean tooSharp
    • blockedPositions

      protected Set<net.minecraft.core.BlockPos> blockedPositions
    • result

  • Constructor Details

    • TubeSpline

      public TubeSpline(BlockFace start, BlockFace end, double maxAngle, double segmentLength, double segmentRadius)
    • TubeSpline

      public TubeSpline(BlockFace start, BlockFace end, List<net.minecraft.world.phys.Vec3> middleControlPoints, double maxAngle, double segmentLength, double segmentRadius)
  • Method Details

    • recalculate

      public void recalculate()
      Overrides:
      recalculate in class ClampedCubicSpline
    • forEachSegment

      protected void forEachSegment(int index, net.minecraft.world.phys.Vec3 point, net.minecraft.world.phys.Vec3 tangent)
      Overrides:
      forEachSegment in class ClampedCubicSpline
    • getMiddleControlPoints

      public List<net.minecraft.world.phys.Vec3> getMiddleControlPoints()
    • getBlockedPositions

      public Set<net.minecraft.core.BlockPos> getBlockedPositions()
    • getOccupiedVolume

      public net.minecraft.world.phys.AABB getOccupiedVolume()
      Overrides:
      getOccupiedVolume in class ClampedCubicSpline
    • getProvider

      public TubeSpline.Provider getProvider()
    • getResult

      public TubeSpline.TubePlacementResult getResult()
    • validate

      public void validate(net.minecraft.world.level.Level level, net.minecraft.world.entity.player.Player player, net.minecraft.world.item.Item requiredItem, ITubeBlock block)
    • checkBlocked

      public boolean checkBlocked(net.minecraft.world.level.Level level, Consumer<net.minecraft.core.BlockPos> forEachObstructingBlock)
    • checkCanAfford

      public boolean checkCanAfford(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.Item requiredItem, ITubeBlock block)