@hylithiumjs.com/core 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/api.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ export declare const Message: any;
2
+ export declare const Universe: any;
3
+ export declare const Colors: any;
4
+ export declare const HytaleServer: any;
5
+ export declare const commands: any;
6
+ export declare const Hytale: any;
7
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO,KAA8B,CAAC;AACnD,eAAO,MAAM,QAAQ,KAA+B,CAAC;AACrD,eAAO,MAAM,MAAM,KAA4B,CAAC;AAChD,eAAO,MAAM,YAAY,KAAmC,CAAC;AAC7D,eAAO,MAAM,QAAQ,KAA+B,CAAC;AAGrD,eAAO,MAAM,MAAM,KAAmC,CAAC"}
package/dist/api.js ADDED
@@ -0,0 +1,9 @@
1
+ // Direct bindings to Java global objects exposed by LithiumPlugin
2
+ export const Message = globalThis.Message;
3
+ export const Universe = globalThis.Universe;
4
+ export const Colors = globalThis.Color;
5
+ export const HytaleServer = globalThis.HytaleServer;
6
+ export const commands = globalThis.commands;
7
+ // Re-export Hytale global for utility
8
+ export const Hytale = globalThis.Hytale || {};
9
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,MAAM,CAAC,MAAM,OAAO,GAAI,UAAkB,CAAC,OAAO,CAAC;AACnD,MAAM,CAAC,MAAM,QAAQ,GAAI,UAAkB,CAAC,QAAQ,CAAC;AACrD,MAAM,CAAC,MAAM,MAAM,GAAI,UAAkB,CAAC,KAAK,CAAC;AAChD,MAAM,CAAC,MAAM,YAAY,GAAI,UAAkB,CAAC,YAAY,CAAC;AAC7D,MAAM,CAAC,MAAM,QAAQ,GAAI,UAAkB,CAAC,QAAQ,CAAC;AAErD,sCAAsC;AACtC,MAAM,CAAC,MAAM,MAAM,GAAI,UAAkB,CAAC,MAAM,IAAI,EAAE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function EventListener(eventName: string): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
2
+ //# sourceMappingURL=decorators.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../src/decorators.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,IAC1B,QAAQ,GAAG,EAAE,aAAa,MAAM,EAAE,YAAY,kBAAkB,UAWpF"}
@@ -0,0 +1,13 @@
1
+ export function EventListener(eventName) {
2
+ return function (target, propertyKey, descriptor) {
3
+ // Ensure the global handlers array exists
4
+ const globalHandlers = globalThis.handlers || (globalThis.handlers = []);
5
+ // Push the handler registration
6
+ // ScriptEventRegistry.java expects objects with { eventType, callback }
7
+ globalHandlers.push({
8
+ eventType: eventName,
9
+ callback: descriptor.value
10
+ });
11
+ };
12
+ }
13
+ //# sourceMappingURL=decorators.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decorators.js","sourceRoot":"","sources":["../src/decorators.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,aAAa,CAAC,SAAiB;IAC3C,OAAO,UAAU,MAAW,EAAE,WAAmB,EAAE,UAA8B;QAC7E,0CAA0C;QAC1C,MAAM,cAAc,GAAI,UAAkB,CAAC,QAAQ,IAAI,CAAE,UAAkB,CAAC,QAAQ,GAAG,EAAE,CAAC,CAAC;QAE3F,gCAAgC;QAChC,wEAAwE;QACxE,cAAc,CAAC,IAAI,CAAC;YAChB,SAAS,EAAE,SAAS;YACpB,QAAQ,EAAE,UAAU,CAAC,KAAK;SAC7B,CAAC,CAAC;IACP,CAAC,CAAC;AACN,CAAC"}
@@ -0,0 +1,13 @@
1
+ export * from './decorators';
2
+ import { Hytale } from './api';
3
+ import type { Message as MessageType, Universe as UniverseType, Player, PlayerRef, PlayerConnectEvent, PlayerChatEvent, CommandContext } from './types';
4
+ export declare const Message: any;
5
+ export type Message = MessageType;
6
+ export declare const Universe: any;
7
+ export type Universe = UniverseType;
8
+ export declare const Colors: any;
9
+ export declare const HytaleServer: any;
10
+ export declare const commands: any;
11
+ export { Hytale };
12
+ export type { Player, PlayerRef, PlayerConnectEvent, PlayerChatEvent, CommandContext };
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAE7B,OAAO,EAAE,MAAM,EAA2H,MAAM,OAAO,CAAC;AACxJ,OAAO,KAAK,EAAE,OAAO,IAAI,WAAW,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,kBAAkB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGxJ,eAAO,MAAM,OAAO,KAAa,CAAC;AAClC,MAAM,MAAM,OAAO,GAAG,WAAW,CAAC;AAElC,eAAO,MAAM,QAAQ,KAAc,CAAC;AACpC,MAAM,MAAM,QAAQ,GAAG,YAAY,CAAC;AAEpC,eAAO,MAAM,MAAM,KAAY,CAAC;AAChC,eAAO,MAAM,YAAY,KAAY,CAAC;AACtC,eAAO,MAAM,QAAQ,KAAc,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,CAAC;AAGlB,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,kBAAkB,EAAE,eAAe,EAAE,cAAc,EAAE,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,10 @@
1
+ export * from './decorators';
2
+ import { Hytale, Message as MessageVal, Universe as UniverseVal, Colors as ColorsVal, HytaleServer as ServerVal, commands as CommandsVal } from './api';
3
+ // Export merged values and types
4
+ export const Message = MessageVal;
5
+ export const Universe = UniverseVal;
6
+ export const Colors = ColorsVal;
7
+ export const HytaleServer = ServerVal;
8
+ export const commands = CommandsVal;
9
+ export { Hytale };
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAE7B,OAAO,EAAE,MAAM,EAAE,OAAO,IAAI,UAAU,EAAE,QAAQ,IAAI,WAAW,EAAE,MAAM,IAAI,SAAS,EAAE,YAAY,IAAI,SAAS,EAAE,QAAQ,IAAI,WAAW,EAAE,MAAM,OAAO,CAAC;AAGxJ,iCAAiC;AACjC,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAAC;AAGlC,MAAM,CAAC,MAAM,QAAQ,GAAG,WAAW,CAAC;AAGpC,MAAM,CAAC,MAAM,MAAM,GAAG,SAAS,CAAC;AAChC,MAAM,CAAC,MAAM,YAAY,GAAG,SAAS,CAAC;AACtC,MAAM,CAAC,MAAM,QAAQ,GAAG,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,CAAC"}
@@ -0,0 +1,37 @@
1
+ export interface Player {
2
+ sendMessage(message: any): void;
3
+ getUsername(): string;
4
+ getDisplayName(): string;
5
+ getUUID(): string;
6
+ }
7
+ export interface PlayerRef {
8
+ getUsername(): string;
9
+ getUUID(): string;
10
+ }
11
+ export interface PlayerConnectEvent {
12
+ getPlayer(): Player;
13
+ getPlayerRef(): PlayerRef;
14
+ }
15
+ export interface PlayerChatEvent {
16
+ getPlayer(): Player;
17
+ getSender(): Player;
18
+ getContent(): string;
19
+ setMessage(message: string): void;
20
+ setCancelled(cancelled: boolean): void;
21
+ getTargets(): Player[];
22
+ }
23
+ export interface Message {
24
+ color(color: any): Message;
25
+ bold(bold: boolean): Message;
26
+ insert(message: Message): Message;
27
+ }
28
+ export interface Universe {
29
+ getPlayerCount(): number;
30
+ getPlayers(): Player[];
31
+ sendMessage(message: any): void;
32
+ }
33
+ export interface CommandContext {
34
+ sendMessage(message: string): void;
35
+ getSender(): Player;
36
+ }
37
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACnB,WAAW,CAAC,OAAO,EAAE,GAAG,GAAG,IAAI,CAAC;IAChC,WAAW,IAAI,MAAM,CAAC;IACtB,cAAc,IAAI,MAAM,CAAC;IACzB,OAAO,IAAI,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,SAAS;IACtB,WAAW,IAAI,MAAM,CAAC;IACtB,OAAO,IAAI,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB;IAC/B,SAAS,IAAI,MAAM,CAAC;IACpB,YAAY,IAAI,SAAS,CAAC;CAC7B;AAED,MAAM,WAAW,eAAe;IAC5B,SAAS,IAAI,MAAM,CAAC;IACpB,SAAS,IAAI,MAAM,CAAC;IACpB,UAAU,IAAI,MAAM,CAAC;IACrB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,YAAY,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI,CAAC;IACvC,UAAU,IAAI,MAAM,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,OAAO;IACpB,KAAK,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC;IAC3B,IAAI,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC;IAC7B,MAAM,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC;CACrC;AAED,MAAM,WAAW,QAAQ;IACrB,cAAc,IAAI,MAAM,CAAC;IACzB,UAAU,IAAI,MAAM,EAAE,CAAC;IACvB,WAAW,CAAC,OAAO,EAAE,GAAG,GAAG,IAAI,CAAC;CACnC;AAED,MAAM,WAAW,cAAc;IAC3B,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,SAAS,IAAI,MAAM,CAAC;CACvB"}
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@hylithiumjs.com/core",
3
+ "version": "1.0.0",
4
+ "description": "Core SDK for HytaleJS plugins",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "scripts": {
8
+ "build": "tsc",
9
+ "watch": "tsc --watch"
10
+ },
11
+ "keywords": [
12
+ "hytale",
13
+ "typescript",
14
+ "minecraft",
15
+ "plugin"
16
+ ],
17
+ "author": "Lithium Network",
18
+ "license": "MIT",
19
+ "devDependencies": {
20
+ "esbuild": "^0.20.0",
21
+ "typescript": "^5.9.3"
22
+ },
23
+ "files": [
24
+ "types/",
25
+ "dist/",
26
+ "README.md"
27
+ ]
28
+ }
@@ -0,0 +1,255 @@
1
+ /**
2
+ * HyLithiumJS - TypeScript Type Definitions for Hytale API
3
+ * @version 1.0.0
4
+ * @author Lithium Network
5
+ */
6
+
7
+ declare global {
8
+ /**
9
+ * API global do Hytale exposta para plugins TypeScript
10
+ */
11
+ const Hytale: {
12
+ /**
13
+ * API de logging
14
+ */
15
+ Logger: {
16
+ /**
17
+ * Log informativo
18
+ * @param message Mensagem a ser logada
19
+ */
20
+ info(message: string): void;
21
+
22
+ /**
23
+ * Log de aviso
24
+ * @param message Mensagem de aviso
25
+ */
26
+ warn(message: string): void;
27
+
28
+ /**
29
+ * Log de erro
30
+ * @param message Mensagem de erro
31
+ */
32
+ error(message: string): void;
33
+ };
34
+
35
+ /**
36
+ * API do servidor
37
+ */
38
+ Server: {
39
+ /**
40
+ * Retorna o número de jogadores online
41
+ * @returns Número de jogadores online
42
+ */
43
+ getOnlinePlayers(): number;
44
+
45
+ /**
46
+ * Envia uma mensagem broadcast para todos os jogadores
47
+ * @param message Mensagem a ser enviada
48
+ */
49
+ broadcast(message: string): void;
50
+ };
51
+
52
+ /**
53
+ * API de eventos
54
+ */
55
+ Events: {
56
+ /**
57
+ * Registra um listener para um evento
58
+ * @param eventName Nome do evento
59
+ * @param callback Callback a ser chamado quando o evento ocorrer
60
+ */
61
+ on(eventName: string, callback: (event: any) => void): void;
62
+ };
63
+
64
+ /**
65
+ * API de comandos
66
+ */
67
+ Commands: {
68
+ /**
69
+ * Registra um novo comando
70
+ * @param commandName Nome do comando
71
+ * @param callback Callback executado quando o comando é chamado
72
+ */
73
+ register(commandName: string, callback: (args: string[]) => void): void;
74
+ };
75
+ };
76
+
77
+ /**
78
+ * Console API para debugging
79
+ */
80
+ const console: {
81
+ log(...args: any[]): void;
82
+ error(...args: any[]): void;
83
+ warn(...args: any[]): void;
84
+ info(...args: any[]): void;
85
+ };
86
+ }
87
+
88
+ /**
89
+ * Interface base para plugins TypeScript
90
+ */
91
+ export interface Plugin {
92
+ /**
93
+ * Nome do plugin
94
+ */
95
+ name?: string;
96
+
97
+ /**
98
+ * Versão do plugin
99
+ */
100
+ version?: string;
101
+
102
+ /**
103
+ * Chamado quando o plugin é habilitado
104
+ */
105
+ onEnable?(): void;
106
+
107
+ /**
108
+ * Chamado quando o plugin é desabilitado
109
+ */
110
+ onDisable?(): void;
111
+ }
112
+
113
+ /**
114
+ * Informações sobre um jogador
115
+ */
116
+ export interface Player {
117
+ /**
118
+ * Nome do jogador
119
+ */
120
+ name: string;
121
+
122
+ /**
123
+ * UUID do jogador
124
+ */
125
+ uuid: string;
126
+
127
+ /**
128
+ * Envia uma mensagem ao jogador
129
+ * @param message Mensagem a ser enviada
130
+ */
131
+ sendMessage(message: string): void;
132
+
133
+ /**
134
+ * Teletransporta o jogador para uma localização
135
+ * @param x Coordenada X
136
+ * @param y Coordenada Y
137
+ * @param z Coordenada Z
138
+ */
139
+ teleport(x: number, y: number, z: number): void;
140
+ }
141
+
142
+ /**
143
+ * Representa uma localização no mundo
144
+ */
145
+ export interface Location {
146
+ /**
147
+ * Coordenada X
148
+ */
149
+ x: number;
150
+
151
+ /**
152
+ * Coordenada Y
153
+ */
154
+ y: number;
155
+
156
+ /**
157
+ * Coordenada Z
158
+ */
159
+ z: number;
160
+
161
+ /**
162
+ * Nome do mundo
163
+ */
164
+ world: string;
165
+ }
166
+
167
+ /**
168
+ * Evento base
169
+ */
170
+ export interface Event {
171
+ /**
172
+ * Nome do evento
173
+ */
174
+ name: string;
175
+
176
+ /**
177
+ * Timestamp do evento
178
+ */
179
+ timestamp: number;
180
+
181
+ /**
182
+ * Cancela o evento (se cancelável)
183
+ */
184
+ cancel?(): void;
185
+
186
+ /**
187
+ * Verifica se o evento foi cancelado
188
+ */
189
+ isCancelled?(): boolean;
190
+ }
191
+
192
+ /**
193
+ * Evento de chat
194
+ */
195
+ export interface ChatEvent extends Event {
196
+ /**
197
+ * Jogador que enviou a mensagem
198
+ */
199
+ player: Player;
200
+
201
+ /**
202
+ * Mensagem enviada
203
+ */
204
+ message: string;
205
+
206
+ /**
207
+ * Define uma nova mensagem
208
+ * @param newMessage Nova mensagem
209
+ */
210
+ setMessage(newMessage: string): void;
211
+ }
212
+
213
+ /**
214
+ * Evento de jogador entrando no servidor
215
+ */
216
+ export interface PlayerJoinEvent extends Event {
217
+ /**
218
+ * Jogador que entrou
219
+ */
220
+ player: Player;
221
+
222
+ /**
223
+ * Mensagem de entrada
224
+ */
225
+ joinMessage: string;
226
+
227
+ /**
228
+ * Define a mensagem de entrada
229
+ * @param message Nova mensagem
230
+ */
231
+ setJoinMessage(message: string): void;
232
+ }
233
+
234
+ /**
235
+ * Evento de jogador saindo do servidor
236
+ */
237
+ export interface PlayerQuitEvent extends Event {
238
+ /**
239
+ * Jogador que saiu
240
+ */
241
+ player: Player;
242
+
243
+ /**
244
+ * Mensagem de saída
245
+ */
246
+ quitMessage: string;
247
+
248
+ /**
249
+ * Define a mensagem de saída
250
+ * @param message Nova mensagem
251
+ */
252
+ setQuitMessage(message: string): void;
253
+ }
254
+
255
+ export { };