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 final BlockPosprivate static final BlockBehaviour.StatePredicateprivate final intstatic final intstatic final intprivate static final intprivate static final intprivate final intprivate final Directionprivate static final floatprivate static final doubleprivate final int -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivatePortalShape(Direction.Axis pAxis, int pNumPortalBlocks, Direction pRightDir, BlockPos pBottomLeft, int pWidth, int pHeight) -
Method Summary
Modifier and TypeMethodDescriptionprivate static BlockPoscalculateBottomLeft(BlockGetter pLevel, Direction pDirection, BlockPos pPos) private static intcalculateHeight(BlockGetter pLevel, BlockPos pPos, Direction pDirection, int pWidth, org.apache.commons.lang3.mutable.MutableInt pPortalBlocks) private static intcalculateWidth(BlockGetter pLevel, BlockPos pBottomLeft, Direction pDirection) voidcreatePortalBlocks(LevelAccessor pLevel) static PortalShapefindAnyShape(BlockGetter pLevel, BlockPos pBottomLeft, Direction.Axis pAxis) static Vec3findCollisionFreePosition(Vec3 pPos, ServerLevel pLevel, Entity pEntity, EntityDimensions pDimensions) static Optional<PortalShape> findEmptyPortalShape(LevelAccessor pLevel, BlockPos pBottomLeft, Direction.Axis pAxis) static Optional<PortalShape> findPortalShape(LevelAccessor pLevel, BlockPos pBottomLeft, Predicate<PortalShape> pPredicate, Direction.Axis pAxis) private static intgetDistanceUntilEdgeAboveFrame(BlockGetter pLevel, BlockPos pPos, Direction pDirection) private static intgetDistanceUntilTop(BlockGetter pLevel, BlockPos pPos, Direction pDirection, BlockPos.MutableBlockPos pCheckPos, int pWidth, org.apache.commons.lang3.mutable.MutableInt pPortalBlocks) static Vec3getRelativePosition(BlockUtil.FoundRectangle pFoundRectangle, Direction.Axis pAxis, Vec3 pPos, EntityDimensions pEntityDimensions) private static booleanhasTopFrame(BlockGetter pLevel, BlockPos pPos, Direction pDirection, BlockPos.MutableBlockPos pCheckPos, int pWidth, int pDistanceUntilTop) booleanprivate static booleanisEmpty(BlockState pState) 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:
-
axis
-
rightDir
-
numPortalBlocks
private final int numPortalBlocks -
bottomLeft
-
height
private final int height -
width
private final int width
-
-
Constructor Details
-
PortalShape
private PortalShape(Direction.Axis pAxis, int pNumPortalBlocks, Direction pRightDir, BlockPos pBottomLeft, int pWidth, int pHeight)
-
-
Method Details
-
findEmptyPortalShape
public static Optional<PortalShape> findEmptyPortalShape(LevelAccessor pLevel, BlockPos pBottomLeft, Direction.Axis pAxis) -
findPortalShape
public static Optional<PortalShape> findPortalShape(LevelAccessor pLevel, BlockPos pBottomLeft, Predicate<PortalShape> pPredicate, Direction.Axis pAxis) -
findAnyShape
public static PortalShape findAnyShape(BlockGetter pLevel, BlockPos pBottomLeft, Direction.Axis pAxis) -
calculateBottomLeft
@Nullable private static BlockPos calculateBottomLeft(BlockGetter pLevel, Direction pDirection, BlockPos pPos) -
calculateWidth
-
getDistanceUntilEdgeAboveFrame
private static int getDistanceUntilEdgeAboveFrame(BlockGetter pLevel, BlockPos pPos, Direction pDirection) -
calculateHeight
private static int calculateHeight(BlockGetter pLevel, BlockPos pPos, Direction pDirection, int pWidth, org.apache.commons.lang3.mutable.MutableInt pPortalBlocks) -
hasTopFrame
private static boolean hasTopFrame(BlockGetter pLevel, BlockPos pPos, Direction pDirection, BlockPos.MutableBlockPos pCheckPos, int pWidth, int pDistanceUntilTop) -
getDistanceUntilTop
private static int getDistanceUntilTop(BlockGetter pLevel, BlockPos pPos, Direction pDirection, BlockPos.MutableBlockPos pCheckPos, int pWidth, org.apache.commons.lang3.mutable.MutableInt pPortalBlocks) -
isEmpty
-
isValid
public boolean isValid() -
createPortalBlocks
-
isComplete
public boolean isComplete() -
getRelativePosition
public static Vec3 getRelativePosition(BlockUtil.FoundRectangle pFoundRectangle, Direction.Axis pAxis, Vec3 pPos, EntityDimensions pEntityDimensions) -
findCollisionFreePosition
public static Vec3 findCollisionFreePosition(Vec3 pPos, ServerLevel pLevel, Entity pEntity, EntityDimensions pDimensions)
-