mmm-0.1.0.0: Minecraft 1.21.4 implementation in Haskell
Copyright(c) axionbuster 2025
LicenseBSD-3-Clause
Safe HaskellNone
LanguageGHC2021

M.Position

Description

Implements the packed integer Position format used by Minecraft Java Edition, including encoding and decoding of 3D coordinates into a compact Int64 representation.

Synopsis

Documentation

newtype Position Source #

Deserialized position representation

Constructors

Position 

Fields

Instances

Instances details
Data Position Source # 
Instance details

Defined in M.Position

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Position -> c Position #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Position #

toConstr :: Position -> Constr #

dataTypeOf :: Position -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Position) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Position) #

gmapT :: (forall b. Data b => b -> b) -> Position -> Position #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Position -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Position -> r #

gmapQ :: (forall d. Data d => d -> u) -> Position -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Position -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Position -> m Position #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Position -> m Position #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Position -> m Position #

Generic Position Source # 
Instance details

Defined in M.Position

Associated Types

type Rep Position 
Instance details

Defined in M.Position

type Rep Position = D1 ('MetaData "Position" "M.Position" "mmm-0.1.0.0-oCDsNp3EBL2JzoyA6cTai" 'True) (C1 ('MetaCons "Position" 'PrefixI 'True) (S1 ('MetaSel ('Just "getposition") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (V3 Int32))))

Methods

from :: Position -> Rep Position x #

to :: Rep Position x -> Position #

Read Position Source # 
Instance details

Defined in M.Position

Show Position Source # 
Instance details

Defined in M.Position

NFData Position Source # 
Instance details

Defined in M.Position

Methods

rnf :: Position -> () #

Eq Position Source # 
Instance details

Defined in M.Position

Ord Position Source # 
Instance details

Defined in M.Position

Hashable Position Source # 
Instance details

Defined in M.Position

Pack Position Source # 
Instance details

Defined in M.Position

Unpack Position Source # 
Instance details

Defined in M.Position

Methods

unpack :: forall (st :: ZeroBitType) r. Parser st r Position Source #

Lift Position Source # 
Instance details

Defined in M.Position

Methods

lift :: Quote m => Position -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => Position -> Code m Position #

type Rep Position Source # 
Instance details

Defined in M.Position

type Rep Position = D1 ('MetaData "Position" "M.Position" "mmm-0.1.0.0-oCDsNp3EBL2JzoyA6cTai" 'True) (C1 ('MetaCons "Position" 'PrefixI 'True) (S1 ('MetaSel ('Just "getposition") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (V3 Int32))))

encodeposition :: Position -> Int64 Source #

encode a Position into a packed Int64

decodeposition :: Int64 -> Position Source #

decode a packed Int64 into a Position

posapply :: (Int32 -> Int32) -> Position -> Position Source #

apply a function to the x, y, and z components of a Position

posapplyv :: (V3 Int32 -> V3 Int32) -> Position -> Position Source #

apply a function to the x, y, and z components of a Position