Interface IBlockPosOffsetEnum
public interface IBlockPosOffsetEnum
-
Method Summary
Modifier and TypeMethodDescriptionstatic <E extends Enum<E> & IBlockPosOffsetEnum>
EfromOffset(Class<E> enumClass, net.minecraft.core.BlockPos offset, @Nullable net.minecraft.core.Direction direction, E fallback) Returns an enum value of type E based on its BlockPos offsetdefault net.minecraft.core.BlockPosFunction<net.minecraft.core.BlockPos, net.minecraft.core.BlockPos> A cleaner way to signify an offset.static net.minecraft.world.level.block.RotationrotationFromDirection(net.minecraft.core.Direction direction) Rotates a BlockPos
-
Method Details
-
getOffsetFunction
Function<net.minecraft.core.BlockPos, net.minecraft.core.BlockPos> getOffsetFunction()A cleaner way to signify an offset. Example:ENUM_VALUE(BlockPos::north) ENUM_VALUE2(pos -> pos.above().north())
-
getOffset
default net.minecraft.core.BlockPos getOffset() -
fromOffset
static <E extends Enum<E> & IBlockPosOffsetEnum> E fromOffset(Class<E> enumClass, net.minecraft.core.BlockPos offset, @Nullable net.minecraft.core.Direction direction, E fallback) Returns an enum value of type E based on its BlockPos offset- Type Parameters:
E- Your enum.Class, probably used in a BlockState- Parameters:
enumClass- The .class of the enum this is implemented onfallback- Default value for when the offset doesn't match any other value
-
rotationFromDirection
static net.minecraft.world.level.block.Rotation rotationFromDirection(net.minecraft.core.Direction direction) Rotates a BlockPos
-