Class VoxelShapeComponents
java.lang.Object
net.minecraft.world.phys.shapes.VoxelShape
org.cyclops.integrateddynamics.core.block.VoxelShapeComponents
- All Implemented Interfaces:
Iterable<net.minecraft.world.phys.shapes.VoxelShape>
public class VoxelShapeComponents
extends net.minecraft.world.phys.shapes.VoxelShape
implements Iterable<net.minecraft.world.phys.shapes.VoxelShape>
A
VoxelShape that contains one or more VoxelShapeComponents.IComponent.
These components are used to handle ray tracing on seperate components.
Consequently, ray trace results on this object may be safely cast to BlockRayTraceResultComponent
so that the targeted component may be retrieved.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic class -
Field Summary
Fields inherited from class net.minecraft.world.phys.shapes.VoxelShape
shape -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedVoxelShapeComponents(Collection<org.apache.commons.lang3.tuple.Pair<net.minecraft.world.phys.shapes.VoxelShape, VoxelShapeComponents.IComponent>> entries, String stateId) -
Method Summary
Modifier and TypeMethodDescriptionstatic net.minecraft.world.phys.BlockHitResultaabbClip(Iterable<net.minecraft.world.phys.AABB> boxes, net.minecraft.world.phys.Vec3 start, net.minecraft.world.phys.Vec3 end, net.minecraft.core.BlockPos pos, net.minecraft.world.phys.Vec3 posVec) clip(net.minecraft.world.phys.Vec3 startVec, net.minecraft.world.phys.Vec3 endVec, net.minecraft.core.BlockPos pos) clipVec(net.minecraft.world.phys.Vec3 startVec, net.minecraft.world.phys.Vec3 endVec, net.minecraft.core.BlockPos pos, net.minecraft.world.phys.Vec3 posVec) doublecollideX(net.minecraft.core.AxisCycle rotation, net.minecraft.world.phys.AABB axisAlignedBB, double range) static VoxelShapeComponentscreate(net.minecraft.world.level.block.state.BlockState blockState, net.minecraft.world.level.BlockGetter world, net.minecraft.core.BlockPos blockPos, net.minecraft.world.phys.shapes.CollisionContext selectionContext, List<VoxelShapeComponents.IComponent> components) protected static net.minecraft.world.phys.shapes.DiscreteVoxelShapecreateInnerPart(Collection<org.apache.commons.lang3.tuple.Pair<net.minecraft.world.phys.shapes.VoxelShape, VoxelShapeComponents.IComponent>> entries) voidforAllBoxes(net.minecraft.world.phys.shapes.Shapes.DoubleLineConsumer consumer) voidforAllEdges(net.minecraft.world.phys.shapes.Shapes.DoubleLineConsumer consumer) it.unimi.dsi.fastutil.doubles.DoubleListgetCoords(net.minecraft.core.Direction.Axis axis) booleanisEmpty()Iterator<net.minecraft.world.phys.shapes.VoxelShape> iterator()doublemax(net.minecraft.core.Direction.Axis axis) doublemax(net.minecraft.core.Direction.Axis axis, double a, double b) doublemin(net.minecraft.core.Direction.Axis axis) net.minecraft.world.phys.shapes.VoxelShapemove(double x, double y, double z) rayTrace(net.minecraft.core.BlockPos pos, net.minecraft.world.entity.Entity entity) Do a ray trace for the current look direction of the player.protected BlockRayTraceResultComponentrayTraceInner(net.minecraft.core.BlockPos pos, net.minecraft.world.entity.Entity entity) Do a ray trace for the current look direction of the player.protected BlockRayTraceResultComponentrayTraceInnerVec(net.minecraft.core.BlockPos pos, net.minecraft.world.entity.Entity entity, net.minecraft.world.phys.Vec3 posVec) Do a ray trace for the current look direction of the player.net.minecraft.world.phys.BlockHitResultshapeClipVec(net.minecraft.world.phys.shapes.VoxelShape shape, net.minecraft.world.phys.Vec3 startVec, net.minecraft.world.phys.Vec3 endVec, net.minecraft.core.BlockPos pos, net.minecraft.world.phys.Vec3 posVec) Methods inherited from class net.minecraft.world.phys.shapes.VoxelShape
bounds, closestPointTo, collide, equals, findIndex, get, getFaceShape, isCubeLike, min, move, move, optimize, singleEncompassing, toAabbs, toStringMethods inherited from class Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
VoxelShapeComponents
protected VoxelShapeComponents(Collection<org.apache.commons.lang3.tuple.Pair<net.minecraft.world.phys.shapes.VoxelShape, VoxelShapeComponents.IComponent>> entries, String stateId)
-
-
Method Details
-
createInnerPart
protected static net.minecraft.world.phys.shapes.DiscreteVoxelShape createInnerPart(Collection<org.apache.commons.lang3.tuple.Pair<net.minecraft.world.phys.shapes.VoxelShape, VoxelShapeComponents.IComponent>> entries) -
create
public static VoxelShapeComponents create(net.minecraft.world.level.block.state.BlockState blockState, net.minecraft.world.level.BlockGetter world, net.minecraft.core.BlockPos blockPos, net.minecraft.world.phys.shapes.CollisionContext selectionContext, List<VoxelShapeComponents.IComponent> components) -
getStateId
-
iterator
-
min
public double min(net.minecraft.core.Direction.Axis axis) - Overrides:
minin classnet.minecraft.world.phys.shapes.VoxelShape
-
max
public double max(net.minecraft.core.Direction.Axis axis) - Overrides:
maxin classnet.minecraft.world.phys.shapes.VoxelShape
-
getCoords
public it.unimi.dsi.fastutil.doubles.DoubleList getCoords(net.minecraft.core.Direction.Axis axis) - Specified by:
getCoordsin classnet.minecraft.world.phys.shapes.VoxelShape
-
isEmpty
public boolean isEmpty()- Overrides:
isEmptyin classnet.minecraft.world.phys.shapes.VoxelShape
-
move
public net.minecraft.world.phys.shapes.VoxelShape move(double x, double y, double z) - Overrides:
movein classnet.minecraft.world.phys.shapes.VoxelShape
-
forAllEdges
public void forAllEdges(net.minecraft.world.phys.shapes.Shapes.DoubleLineConsumer consumer) - Overrides:
forAllEdgesin classnet.minecraft.world.phys.shapes.VoxelShape
-
forAllBoxes
public void forAllBoxes(net.minecraft.world.phys.shapes.Shapes.DoubleLineConsumer consumer) - Overrides:
forAllBoxesin classnet.minecraft.world.phys.shapes.VoxelShape
-
max
public double max(net.minecraft.core.Direction.Axis axis, double a, double b) - Overrides:
maxin classnet.minecraft.world.phys.shapes.VoxelShape
-
clip
@Nullable public BlockRayTraceResultComponent clip(net.minecraft.world.phys.Vec3 startVec, net.minecraft.world.phys.Vec3 endVec, net.minecraft.core.BlockPos pos) - Overrides:
clipin classnet.minecraft.world.phys.shapes.VoxelShape
-
clipVec
@Nullable public BlockRayTraceResultComponent clipVec(net.minecraft.world.phys.Vec3 startVec, net.minecraft.world.phys.Vec3 endVec, net.minecraft.core.BlockPos pos, net.minecraft.world.phys.Vec3 posVec) -
shapeClipVec
@Nullable public net.minecraft.world.phys.BlockHitResult shapeClipVec(net.minecraft.world.phys.shapes.VoxelShape shape, net.minecraft.world.phys.Vec3 startVec, net.minecraft.world.phys.Vec3 endVec, net.minecraft.core.BlockPos pos, net.minecraft.world.phys.Vec3 posVec) -
aabbClip
@Nullable public static net.minecraft.world.phys.BlockHitResult aabbClip(Iterable<net.minecraft.world.phys.AABB> boxes, net.minecraft.world.phys.Vec3 start, net.minecraft.world.phys.Vec3 end, net.minecraft.core.BlockPos pos, net.minecraft.world.phys.Vec3 posVec) -
rayTrace
@Nullable public BlockRayTraceResultComponent rayTrace(net.minecraft.core.BlockPos pos, @Nullable net.minecraft.world.entity.Entity entity) Do a ray trace for the current look direction of the player.- Parameters:
pos- The block position to perform a ray trace for.entity- The entity.- Returns:
- A holder object with information on the ray tracing.
-
rayTraceInner
@Nullable protected BlockRayTraceResultComponent rayTraceInner(net.minecraft.core.BlockPos pos, @Nullable net.minecraft.world.entity.Entity entity) Do a ray trace for the current look direction of the player.- Parameters:
pos- The block position to perform a ray trace for.entity- The entity.- Returns:
- A holder object with information on the ray tracing.
-
rayTraceInnerVec
@Nullable protected BlockRayTraceResultComponent rayTraceInnerVec(net.minecraft.core.BlockPos pos, @Nullable net.minecraft.world.entity.Entity entity, net.minecraft.world.phys.Vec3 posVec) Do a ray trace for the current look direction of the player.- Parameters:
pos- The block position to perform a ray trace for.entity- The entity.- Returns:
- A holder object with information on the ray tracing.
-
collideX
public double collideX(net.minecraft.core.AxisCycle rotation, net.minecraft.world.phys.AABB axisAlignedBB, double range) - Overrides:
collideXin classnet.minecraft.world.phys.shapes.VoxelShape
-