src/modernnet/types

Source   Edit  

Types

Identifier = object
  namespace*, value*: string
An MC identifier. Source   Edit  
Position = object
Stores a position to an entity within a world. Source   Edit  
PositionFormat = enum
  XYZ = 0, XZY
An enum that allows for users to choose how a Position is encoded/decoded. Source   Edit  

Procs

proc `$`(i: Identifier): string {....raises: [], tags: [], forbids: [].}
Get an identifier as a string. Source   Edit  
func fromJsonHook(uuid: var UUID; node: JsonNode) {....raises: [ValueError],
    tags: [], forbids: [].}
Converts a UUID from JSON. Source   Edit  
proc fromPos(pos: Position; format = XZY): int64 {.
    ...raises: [MnInvalidPositionConstructionError], tags: [], forbids: [].}
Returns an int64 from a Position, by default uses XZY, as that is what is used for modern MC versions (1.14+). Source   Edit  
proc new(_: typedesc[Identifier]; identStr: string): Identifier
Constructs a minecraft identifier from a string Source   Edit  
func toJsonHook(uuid: UUID): JsonNode {....raises: [], tags: [], forbids: [].}
Converts a UUID to JSON. Source   Edit  
proc toPos(val: int64; format = XZY): Position {....raises: [], tags: [],
    forbids: [].}
Parses an int64 value to get the position, by default uses XZY, as that is what is used for modern MC versions (1.14+). Source   Edit  
func x(pos: Position): int32 {....raises: [], tags: [], forbids: [].}
Gets the X value of a position. Source   Edit  
func y(pos: Position): int16 {....raises: [], tags: [], forbids: [].}
Gets the Y value of a position. Source   Edit  
func z(pos: Position): int32 {....raises: [], tags: [], forbids: [].}
Gets the Z value of a position. Source   Edit