Package net.minecraft.world.level.portal
Class PortalShape
java.lang.Object
net.minecraft.world.level.portal.PortalShape
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Direction.Axisprivate BlockPosprivate static final BlockBehaviour.StatePredicateprivate intprivate final LevelAccessorstatic final intstatic final intprivate static final intprivate static final intprivate intprivate final Directionprivate static final floatprivate static final doubleprivate final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate BlockPosprivate intprivate intvoidstatic Vec3findCollisionFreePosition(Vec3 pos, ServerLevel level, Entity entity, EntityDimensions dimensions) static Optional<PortalShape> findEmptyPortalShape(LevelAccessor level, BlockPos bottomLeft, Direction.Axis axis) static Optional<PortalShape> findPortalShape(LevelAccessor level, BlockPos bottomLeft, Predicate<PortalShape> predicate, Direction.Axis axis) private intgetDistanceUntilEdgeAboveFrame(BlockPos pos, Direction direction) private intstatic Vec3getRelativePosition(BlockUtil.FoundRectangle foundRectangle, Direction.Axis axis, Vec3 pos, EntityDimensions entityDimensions) private booleanhasTopFrame(BlockPos.MutableBlockPos pos, int distanceToTop) booleanprivate static booleanisEmpty(BlockState state) booleanisValid()
-
Field Details
-
MIN_WIDTH
private static final int MIN_WIDTH- See Also:
-
MAX_WIDTH
public static final int MAX_WIDTH- See Also:
-
MIN_HEIGHT
private static final int MIN_HEIGHT- See Also:
-
MAX_HEIGHT
public static final int MAX_HEIGHT- See Also:
-
FRAME
-
SAFE_TRAVEL_MAX_ENTITY_XY
private static final float SAFE_TRAVEL_MAX_ENTITY_XY- See Also:
-
SAFE_TRAVEL_MAX_VERTICAL_DELTA
private static final double SAFE_TRAVEL_MAX_VERTICAL_DELTA- See Also:
-
level
-
axis
-
rightDir
-
numPortalBlocks
private int numPortalBlocks -
bottomLeft
-
height
private int height -
width
private final int width
-
-
Constructor Details
-
PortalShape
-
-
Method Details
-
findEmptyPortalShape
public static Optional<PortalShape> findEmptyPortalShape(LevelAccessor level, BlockPos bottomLeft, Direction.Axis axis) -
findPortalShape
public static Optional<PortalShape> findPortalShape(LevelAccessor level, BlockPos bottomLeft, Predicate<PortalShape> predicate, Direction.Axis axis) -
calculateBottomLeft
-
calculateWidth
private int calculateWidth() -
getDistanceUntilEdgeAboveFrame
-
calculateHeight
private int calculateHeight() -
hasTopFrame
-
getDistanceUntilTop
-
isEmpty
-
isValid
public boolean isValid() -
createPortalBlocks
public void createPortalBlocks() -
isComplete
public boolean isComplete() -
getRelativePosition
public static Vec3 getRelativePosition(BlockUtil.FoundRectangle foundRectangle, Direction.Axis axis, Vec3 pos, EntityDimensions entityDimensions) -
findCollisionFreePosition
public static Vec3 findCollisionFreePosition(Vec3 pos, ServerLevel level, Entity entity, EntityDimensions dimensions)
-