Class TubeSpline
java.lang.Object
com.petrolpark.util.ClampedCubicSpline
com.petrolpark.compat.create.core.tube.TubeSpline
A Clamped Cubic Spline with each end in the middle of a Block Face
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Set<net.minecraft.core.BlockPos>final BlockFacestatic final intstatic final doublestatic final doublefinal doubleprotected TubeSpline.TubePlacementResultfinal doublefinal BlockFaceprotected booleanFields inherited from class com.petrolpark.util.ClampedCubicSpline
controlPoints, endTangent, occupiedVolume, points, segmentLength, startTangent, tangents, totalLength -
Constructor Summary
ConstructorsConstructorDescriptionTubeSpline(BlockFace start, BlockFace end, double maxAngle, double segmentLength, double segmentRadius) TubeSpline(BlockFace start, BlockFace end, List<net.minecraft.world.phys.Vec3> middleControlPoints, double maxAngle, double segmentLength, double segmentRadius) -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckBlocked(net.minecraft.world.level.Level level, Consumer<net.minecraft.core.BlockPos> forEachObstructingBlock) booleancheckCanAfford(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.Item requiredItem, ITubeBlock block) protected voidforEachSegment(int index, net.minecraft.world.phys.Vec3 point, net.minecraft.world.phys.Vec3 tangent) Set<net.minecraft.core.BlockPos>List<net.minecraft.world.phys.Vec3>net.minecraft.world.phys.AABBvoidvoidvalidate(net.minecraft.world.level.Level level, net.minecraft.world.entity.player.Player player, net.minecraft.world.item.Item requiredItem, ITubeBlock block) Methods inherited from class com.petrolpark.util.ClampedCubicSpline
addControlPoint, addInterpolatedControlPoint, getControlPoints, getEndTangent, getLength, getPoints, getStartTangent, getTangents, moveControlPoint, removeControlPoint
-
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
-
end
-
maxAngle
public final double maxAngle -
segmentRadius
public final double segmentRadius -
tooSharp
protected boolean tooSharp -
blockedPositions
-
result
-
-
Constructor Details
-
TubeSpline
-
TubeSpline
-
-
Method Details
-
recalculate
public void recalculate()- Overrides:
recalculatein classClampedCubicSpline
-
forEachSegment
protected void forEachSegment(int index, net.minecraft.world.phys.Vec3 point, net.minecraft.world.phys.Vec3 tangent) - Overrides:
forEachSegmentin classClampedCubicSpline
-
getMiddleControlPoints
-
getBlockedPositions
-
getOccupiedVolume
public net.minecraft.world.phys.AABB getOccupiedVolume()- Overrides:
getOccupiedVolumein classClampedCubicSpline
-
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)
-