-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ts
33 lines (26 loc) · 1.07 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { MinecraftPacketIds } from "bdsx/bds/packetids";
import { PacketIdToType } from "bdsx/bds/packets";
import { events } from "bdsx/event";
import { DataStorage } from "./src/data/DataStorage";
import { PacketListener } from "./src/listener/PacketListener";
import { NetworkStackLatencyWrapper } from "./src/wrappers/Wrappers";
events.serverOpen.on(() => {
PacketListener.init();
DataStorage.init();
// Override some packets if needed
PacketIdToType[MinecraftPacketIds.NetworkStackLatency] = NetworkStackLatencyWrapper;
PacketIdToType[MinecraftPacketIds.NetworkStackLatency].ID = MinecraftPacketIds.NetworkStackLatency;
log("Esoteric has been enabled");
system = server.registerSystem(0, 0);
});
events.serverClose.on(() => {
log("Esoteric is disabling");
});
export function sleep(time: number) {
return new Promise(res => setTimeout(res, time));
}
export function log(message: any) {
console.log("<Esoteric> " + message);
}
export const esotericPath: string = process.cwd() + "/../esoteric/resources";
export var system: IVanillaServerSystem;