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
Modifier and TypeClassDescriptionstatic interface
static class
-
Field Summary
Fields inherited from class net.minecraft.world.phys.shapes.VoxelShape
shape
-
Constructor Summary
ModifierConstructorDescriptionprotected
VoxelShapeComponents
(Collection<org.apache.commons.lang3.tuple.Pair<net.minecraft.world.phys.shapes.VoxelShape, VoxelShapeComponents.IComponent>> entries, String stateId) -
Method Summary
Modifier and TypeMethodDescriptionclip
(net.minecraft.world.phys.Vec3 startVec, net.minecraft.world.phys.Vec3 endVec, net.minecraft.core.BlockPos pos) double
collideX
(net.minecraft.core.AxisCycle rotation, net.minecraft.world.phys.AABB axisAlignedBB, double range) 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) 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) void
forAllBoxes
(net.minecraft.world.phys.shapes.Shapes.DoubleLineConsumer consumer) void
forAllEdges
(net.minecraft.world.phys.shapes.Shapes.DoubleLineConsumer consumer) it.unimi.dsi.fastutil.doubles.DoubleList
getCoords
(net.minecraft.core.Direction.Axis axis) boolean
isEmpty()
Iterator
<net.minecraft.world.phys.shapes.VoxelShape> iterator()
double
max
(net.minecraft.core.Direction.Axis axis) double
max
(net.minecraft.core.Direction.Axis axis, double a, double b) double
min
(net.minecraft.core.Direction.Axis axis) net.minecraft.world.phys.shapes.VoxelShape
move
(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.Methods inherited from class net.minecraft.world.phys.shapes.VoxelShape
bounds, closestPointTo, collide, findIndex, get, getFaceShape, min, optimize, singleEncompassing, toAabbs, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.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:
min
in classnet.minecraft.world.phys.shapes.VoxelShape
-
max
public double max(net.minecraft.core.Direction.Axis axis) - Overrides:
max
in classnet.minecraft.world.phys.shapes.VoxelShape
-
getCoords
public it.unimi.dsi.fastutil.doubles.DoubleList getCoords(net.minecraft.core.Direction.Axis axis) - Specified by:
getCoords
in classnet.minecraft.world.phys.shapes.VoxelShape
-
isEmpty
public boolean isEmpty()- Overrides:
isEmpty
in classnet.minecraft.world.phys.shapes.VoxelShape
-
move
public net.minecraft.world.phys.shapes.VoxelShape move(double x, double y, double z) - Overrides:
move
in classnet.minecraft.world.phys.shapes.VoxelShape
-
forAllEdges
public void forAllEdges(net.minecraft.world.phys.shapes.Shapes.DoubleLineConsumer consumer) - Overrides:
forAllEdges
in classnet.minecraft.world.phys.shapes.VoxelShape
-
forAllBoxes
public void forAllBoxes(net.minecraft.world.phys.shapes.Shapes.DoubleLineConsumer consumer) - Overrides:
forAllBoxes
in classnet.minecraft.world.phys.shapes.VoxelShape
-
max
public double max(net.minecraft.core.Direction.Axis axis, double a, double b) - Overrides:
max
in 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:
clip
in classnet.minecraft.world.phys.shapes.VoxelShape
-
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.
-
collideX
public double collideX(net.minecraft.core.AxisCycle rotation, net.minecraft.world.phys.AABB axisAlignedBB, double range) - Overrides:
collideX
in classnet.minecraft.world.phys.shapes.VoxelShape
-