UNPKG

earthmc

Version:

An unofficial EarthMC library providing handy methods and extensive info.

414 lines 10.8 kB
import type { Location, Prettify, StrictPoint2D, ArrNums, ArrBools, HexString } from '../types/index.js'; export type BaseEntityStatus = Prettify<{ isPublic: boolean; isOpen: boolean; isNeutral: boolean; }>; export type RawEntity = Prettify<{ uuid: string; status: RawEntityStatus; stats: RawEntityStats; ranks?: { [key: string]: string[]; }; }>; export type RawEntityStatus = Partial<BaseEntityStatus & { isCapital: boolean; isOverClaimed: boolean; isRuined: boolean; isOnline: boolean; isNPC: boolean; }>; export type RawEntityStats = Prettify<{ maxTownBlocks?: number; numTownBlocks?: number; numResidents?: number; balance: number; }>; export type RawTownPerms = Prettify<{ resident: boolean; nation: boolean; ally: boolean; outsider: boolean; }>; export type RawFlagPerms = Prettify<{ pvp: boolean; explosion: boolean; fire: boolean; mobs: boolean; }>; export interface RawEntityPerms<PermsType> { flagPerms: RawFlagPerms; rnaoPerms: { buildPerms: PermsType; destroyPerms: PermsType; switchPerms: PermsType; itemUsePerms: PermsType; }; } export type RawEntitySpawn = Prettify<Location & { world: string; pitch?: number; yaw?: number; }>; export type RawTownCoordinates = Prettify<{ spawn: RawEntitySpawn; home: number[]; townBlocks: { x: number[]; z: number[]; }; }>; export type RawTown = Prettify<RawEntity & { name: string; board: string; mayor: string; founder: string; mapColorHexCode: string; nation?: string; timestamps?: Timestamps; perms: Prettify<RawEntityPerms<RawTownPerms>>; coordinates: RawTownCoordinates; residents: string[]; trusted?: string[]; outlaws?: string[]; }>; export type RawNation = Prettify<RawEntity & { name: string; board?: string; king: string; capital: string; mapColorHexCode: string; timestamps?: Timestamps; towns: string[]; residents: string[]; allies?: string[]; enemies?: string[]; }>; export type Timestamps = Prettify<{ joinedNationAt?: number; joinedTownAt?: number; registered: number; lastOnline?: number; }>; export type RawResident = Prettify<RawEntity & { name: string; title: string; surname: string; town?: string; nation?: string; timestamps?: Timestamps; perms: RawEntityPerms<boolean[]>; friends?: string[]; }>; export interface RawServerInfoV2 { world: { hasStorm: boolean; isThundering: boolean; time: number; fullTime: number; }; players: { maxPlayers: number; numOnlineTownless: number; numOnlinePlayers: number; }; stats: { numResidents: number; numTownless: number; numTowns: number; numNations: number; numTownBlocks: number; }; } export type RequestBodyV3<T> = { query: T; template?: any; [key: string]: any; }; export interface RawEntityV3 { name: string; uuid: string; } export type MoonPhaseV3 = 'FIRST_QUARTER' | 'FULL_MOON' | 'LAST_QUARTER' | 'NEW_MOON' | 'WANING_CRESCENT' | 'WANING_GIBBOUS' | 'WAXING_CRESCENT' | 'WAXING_GIBBOUS'; export interface RawServerInfoV3 { version: string; moonPhase: MoonPhaseV3; timestamps: { newDayTime: number; serverTimeOfDay: number; }; status: { hasStorm: boolean; isThundering: boolean; }; stats: { time: number; fullTime: number; maxPlayers: number; numOnlinePlayers: number; numOnlineNomads: number; numResidents: number; numNomads: number; numTowns: number; numTownBlocks: number; numNations: number; numQuarters: number; numCuboids: number; }; voteParty: { target: number; numRemaining: number; }; } export type RawPlayerStatsV3 = typeof rawPlayerStatsTemplate; export declare const rawPlayerStatsTemplate: { readonly player_kills: 0; readonly mob_kills: 0; readonly deaths: 0; readonly damage_taken: 0; readonly damage_dealt: 0; readonly damage_resisted: 0; readonly damage_absorbed: 0; readonly damage_dealt_resisted: 0; readonly damage_dealt_absorbed: 0; readonly damage_blocked_by_shield: 0; readonly interact_with_crafting_table: 0; readonly interact_with_smithing_table: 0; readonly interact_with_cartography_table: 0; readonly interact_with_furnace: 0; readonly interact_with_blast_furnace: 0; readonly interact_with_smoker: 0; readonly interact_with_stonecutter: 0; readonly interact_with_grindstone: 0; readonly interact_with_anvil: 0; readonly interact_with_loom: 0; readonly interact_with_lectern: 0; readonly interact_with_beacon: 0; readonly interact_with_campfire: 0; readonly interact_with_brewingstand: 0; readonly inspect_dispenser: 0; readonly inspect_dropper: 0; readonly inspect_hopper: 0; readonly open_enderchest: 0; readonly open_chest: 0; readonly open_barrel: 0; readonly open_shulker_box: 0; readonly traded_with_villager: 0; readonly talked_to_villager: 0; readonly total_world_time: 0; readonly play_time: 0; readonly sneak_time: 0; readonly time_since_rest: 0; readonly time_since_death: 0; readonly raid_win: 0; readonly raid_trigger: 0; readonly walk_one_cm: 0; readonly sprint_one_cm: 0; readonly boat_one_cm: 0; readonly swim_one_cm: 0; readonly fall_one_cm: 0; readonly walk_on_water_one_cm: 0; readonly walk_under_water_one_cm: 0; readonly horse_one_cm: 0; readonly minecart_one_cm: 0; readonly aviate_one_cm: 0; readonly crouch_one_cm: 0; readonly climb_one_cm: 0; readonly pig_one_cm: 0; readonly fly_one_cm: 0; readonly strider_one_cm: 0; readonly clean_banner: 0; readonly clean_shulker_box: 0; readonly clean_armor: 0; readonly animals_bred: 0; readonly fish_caught: 0; readonly play_record: 0; readonly play_noteblock: 0; readonly tune_noteblock: 0; readonly jump: 0; readonly bell_ring: 0; readonly eat_cake_slice: 0; readonly sleep_in_bed: 0; readonly trigger_trapped_chest: 0; readonly fill_cauldron: 0; readonly use_cauldron: 0; readonly target_hit: 0; readonly drop_count: 0; readonly pot_flower: 0; readonly leave_game: 0; readonly enchant_item: 0; }; export interface RawQuarterResponseV3 { name: string; uuid: string; type: "APARTMENT" | "INN" | "STATION"; creator: string; owner?: Partial<RawEntityV3>; town: RawEntityV3; nation: RawEntityV3; timestamps: { registered: number; claimedAt?: number; }; status: { isEmbassy: boolean; isForSale: boolean; }; stats: { price?: number; volume: number; numCuboids: number; particleSize?: number; }; color: ArrNums<4>; trusted: RawEntityV3[]; cuboids: QuarterCuboidV3[]; } export interface QuarterCuboidV3 { cornerOne: ArrNums<3>; cornerTwo: ArrNums<3>; } export interface DiscordReqObjectV3 { type: 'minecraft' | 'discord'; target: string; } export interface DiscordResObjectV3 { id: string; uuid: string; } export type LocationReqObjectV3 = [number, number] | number[]; export interface LocationResObjectV3 { location: Partial<StrictPoint2D>; isWilderness: boolean; town?: Partial<RawEntityV3>; nation?: Partial<RawEntityV3>; } export interface RawPlayerV3 extends RawEntityV3 { title?: string; surname?: string; formattedName: string; about?: string; town?: Partial<RawEntityV3>; nation?: Partial<RawEntityV3>; timestamps: { registered: number; joinedTownAt?: number; lastOnline?: number; }; status: { isOnline: boolean; isNPC: boolean; isMayor: boolean; isKing: boolean; hasTown: boolean; hasNation: boolean; }; stats: { balance: number; numFriends: number; }; perms: { build: ArrBools<4>; destroy: ArrBools<4>; switch: ArrBools<4>; itemUse: ArrBools<4>; flags: RawFlagPerms; }; ranks?: { townRanks: string[]; nationRanks: string[]; }; friends: RawEntityV3[]; } export interface RawTownV3 extends RawEntityV3 { board: string; founder: string; wiki?: string; mayor: RawEntityV3; nation?: Partial<RawEntityV3>; timestamps: { registered: number; joinedNationAt?: number; ruinedAt?: number; }; status: BaseEntityStatus & { isCapital: boolean; isOverClaimed: boolean; isRuined: boolean; isForSale: boolean; hasNation: boolean; hasOverclaimShield: boolean; canOutsidersSpawn: boolean; }; stats: { numTownBlocks: number; maxTownBlocks: number; bonusBlocks: number; numResidents: number; numTrusted: number; numOutlaws: number; balance: number; forSalePrice?: number; }; perms: { build: ArrBools<4>; destroy: ArrBools<4>; switch: ArrBools<4>; itemUse: ArrBools<4>; flags: RawFlagPerms; }; coordinates: { spawn: RawEntitySpawn; homeBlock: ArrNums<2>; townBlocks: ArrNums<2>[]; }; residents: RawEntityV3[]; trusted: RawEntityV3[]; outlaws: RawEntityV3[]; quarters: RawEntityV3[]; ranks: { Councillor: RawEntityV3[]; Builder: RawEntityV3[]; Recruiter: RawEntityV3[]; Police: RawEntityV3[]; 'Tax-exempt': RawEntityV3[]; Treasurer: RawEntityV3[]; Realtor: RawEntityV3[]; Settler: RawEntityV3[]; }; } export interface RawNationV3 extends RawEntityV3 { board?: string; dynmapColor: HexString; dynmapOutline: HexString; wiki?: string; king: RawEntityV3; capital: RawEntityV3; timestamps: { registered: number; }; status: BaseEntityStatus; stats: { numTownBlocks: number; numResidents: number; numTowns: number; numAllies: number; numEnemies: number; balance: number; }; coordinates: { spawn: RawEntitySpawn; }; residents: RawEntityV3[]; towns: RawEntityV3[]; allies: RawEntityV3[]; enemies: RawEntityV3[]; sanctioned: RawEntityV3[]; ranks: { Chancellor: RawEntityV3[]; Colonist: RawEntityV3[]; Diplomat: RawEntityV3[]; }; } //# sourceMappingURL=oapi.d.ts.map