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 axis, int portalBlockCount, Direction rightDir, BlockPos bottomLeft, int width, int height) -
Method Summary
Modifier and TypeMethodDescriptionprivate static @Nullable BlockPoscalculateBottomLeft(BlockGetter level, Direction rightDir, BlockPos pos) private static intcalculateHeight(BlockGetter level, BlockPos bottomLeft, Direction rightDir, int width, org.apache.commons.lang3.mutable.MutableInt portalBlockCount) private static intcalculateWidth(BlockGetter level, BlockPos bottomLeft, Direction rightDir) voidcreatePortalBlocks(LevelAccessor level) static PortalShapefindAnyShape(BlockGetter level, BlockPos pos, Direction.Axis axis) static Vec3findCollisionFreePosition(Vec3 bottomCenter, ServerLevel serverLevel, Entity entity, EntityDimensions dimensions) static Optional<PortalShape> findEmptyPortalShape(LevelAccessor level, BlockPos pos, Direction.Axis preferredAxis) static Optional<PortalShape> findPortalShape(LevelAccessor level, BlockPos pos, Predicate<PortalShape> isValid, Direction.Axis preferredAxis) private static intgetDistanceUntilEdgeAboveFrame(BlockGetter level, BlockPos pos, Direction direction) private static intgetDistanceUntilTop(BlockGetter level, BlockPos bottomLeft, Direction rightDir, BlockPos.MutableBlockPos pos, int width, org.apache.commons.lang3.mutable.MutableInt portalBlockCount) static Vec3getRelativePosition(BlockUtil.FoundRectangle largestRectangleAround, Direction.Axis axis, Vec3 position, EntityDimensions dimensions) private static booleanhasTopFrame(BlockGetter level, BlockPos bottomLeft, Direction rightDir, BlockPos.MutableBlockPos pos, int width, int height) 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:
-
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 axis, int portalBlockCount, Direction rightDir, BlockPos bottomLeft, int width, int height)
-
-
Method Details
-
findEmptyPortalShape
public static Optional<PortalShape> findEmptyPortalShape(LevelAccessor level, BlockPos pos, Direction.Axis preferredAxis) -
findPortalShape
public static Optional<PortalShape> findPortalShape(LevelAccessor level, BlockPos pos, Predicate<PortalShape> isValid, Direction.Axis preferredAxis) -
findAnyShape
-
calculateBottomLeft
private static @Nullable BlockPos calculateBottomLeft(BlockGetter level, Direction rightDir, BlockPos pos) -
calculateWidth
-
getDistanceUntilEdgeAboveFrame
private static int getDistanceUntilEdgeAboveFrame(BlockGetter level, BlockPos pos, Direction direction) -
calculateHeight
private static int calculateHeight(BlockGetter level, BlockPos bottomLeft, Direction rightDir, int width, org.apache.commons.lang3.mutable.MutableInt portalBlockCount) -
hasTopFrame
private static boolean hasTopFrame(BlockGetter level, BlockPos bottomLeft, Direction rightDir, BlockPos.MutableBlockPos pos, int width, int height) -
getDistanceUntilTop
private static int getDistanceUntilTop(BlockGetter level, BlockPos bottomLeft, Direction rightDir, BlockPos.MutableBlockPos pos, int width, org.apache.commons.lang3.mutable.MutableInt portalBlockCount) -
isEmpty
-
isValid
public boolean isValid() -
createPortalBlocks
-
isComplete
public boolean isComplete() -
getRelativePosition
public static Vec3 getRelativePosition(BlockUtil.FoundRectangle largestRectangleAround, Direction.Axis axis, Vec3 position, EntityDimensions dimensions) -
findCollisionFreePosition
public static Vec3 findCollisionFreePosition(Vec3 bottomCenter, ServerLevel serverLevel, Entity entity, EntityDimensions dimensions)
-