pw-js-world 0.0.5-dev.24aedef → 0.0.5-dev.46673a2
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/{cm → dist}/Block.d.ts +3 -3
- package/dist/Block.js +161 -0
- package/{cm → dist}/BufferReader.js +13 -8
- package/{esm → dist}/Helper.d.ts +4 -4
- package/{cm → dist}/Helper.js +15 -15
- package/{esm → dist}/Player.d.ts +1 -1
- package/{esm → dist}/types/index.d.ts +2 -2
- package/esm.mjs +33 -0
- package/lib/Block.ts +217 -0
- package/lib/BufferReader.ts +770 -0
- package/lib/Constants.ts +4 -0
- package/lib/Helper.ts +593 -0
- package/{cm/Player.d.ts → lib/Player.ts} +111 -16
- package/{esm/index.d.ts → lib/index.ts} +6 -0
- package/lib/types/index.d.ts +49 -0
- package/package.json +7 -6
- package/cm/Block.js +0 -161
- package/cm/Helper.d.ts +0 -115
- package/esm/Block.d.ts +0 -117
- package/esm/Block.js +0 -156
- package/esm/BufferReader.d.ts +0 -324
- package/esm/BufferReader.js +0 -669
- package/esm/Constants.d.ts +0 -4
- package/esm/Constants.js +0 -6
- package/esm/Helper.js +0 -490
- package/esm/Player.js +0 -110
- package/esm/index.js +0 -8
- package/tsconfig-cm.json +0 -8
- package/tsconfig-esm.json +0 -8
- /package/{cm → dist}/BufferReader.d.ts +0 -0
- /package/{cm → dist}/Constants.d.ts +0 -0
- /package/{cm → dist}/Constants.js +0 -0
- /package/{cm → dist}/Player.js +0 -0
- /package/{cm → dist}/index.d.ts +0 -0
- /package/{cm → dist}/index.js +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ProtoGen } from "pw-js-api";
|
|
2
|
-
import type { Point } from "./types
|
|
2
|
+
import type { Point } from "./types";
|
|
3
|
+
|
|
3
4
|
export interface IPlayer {
|
|
4
5
|
/**
|
|
5
6
|
* ID of the player.
|
|
@@ -27,7 +28,7 @@ export interface IPlayer {
|
|
|
27
28
|
isFriend: boolean;
|
|
28
29
|
/**
|
|
29
30
|
* Position of the user.
|
|
30
|
-
*
|
|
31
|
+
*
|
|
31
32
|
* Note: This helper does not simulate physics so positions will always be inaccurate.
|
|
32
33
|
*/
|
|
33
34
|
position?: Point;
|
|
@@ -43,15 +44,18 @@ export interface IPlayer {
|
|
|
43
44
|
* current world state.
|
|
44
45
|
*/
|
|
45
46
|
states: IPlayerWorldState;
|
|
47
|
+
|
|
46
48
|
/**
|
|
47
49
|
* List of active effects the player has.
|
|
48
50
|
*/
|
|
49
51
|
effects: PlayerEffect[];
|
|
52
|
+
|
|
50
53
|
/**
|
|
51
54
|
* If this player is the bot.
|
|
52
55
|
*/
|
|
53
56
|
isMe: boolean;
|
|
54
57
|
}
|
|
58
|
+
|
|
55
59
|
export interface IPlayerRights {
|
|
56
60
|
/**
|
|
57
61
|
* If the player has edit rights.
|
|
@@ -74,6 +78,7 @@ export interface IPlayerRights {
|
|
|
74
78
|
*/
|
|
75
79
|
availableCommands: string[];
|
|
76
80
|
}
|
|
81
|
+
|
|
77
82
|
export interface IPlayerWorldState {
|
|
78
83
|
/**
|
|
79
84
|
* Number of gold coins the player has.
|
|
@@ -116,6 +121,7 @@ export interface IPlayerWorldState {
|
|
|
116
121
|
*/
|
|
117
122
|
teamId: number;
|
|
118
123
|
}
|
|
124
|
+
|
|
119
125
|
export interface IPlayerEffect {
|
|
120
126
|
/**
|
|
121
127
|
* The ID of the effect.
|
|
@@ -130,6 +136,7 @@ export interface IPlayerEffect {
|
|
|
130
136
|
*/
|
|
131
137
|
strength?: number;
|
|
132
138
|
}
|
|
139
|
+
|
|
133
140
|
export default class Player {
|
|
134
141
|
/**
|
|
135
142
|
* ID of the player.
|
|
@@ -157,7 +164,7 @@ export default class Player {
|
|
|
157
164
|
isFriend: boolean;
|
|
158
165
|
/**
|
|
159
166
|
* Position of the user.
|
|
160
|
-
*
|
|
167
|
+
*
|
|
161
168
|
* Note: This helper does not simulate physics so positions will always be inaccurate.
|
|
162
169
|
*/
|
|
163
170
|
position?: Point;
|
|
@@ -168,30 +175,100 @@ export default class Player {
|
|
|
168
175
|
/**
|
|
169
176
|
* Rights
|
|
170
177
|
*/
|
|
171
|
-
rights
|
|
178
|
+
rights!: IPlayerRights;
|
|
172
179
|
/**
|
|
173
180
|
* current world state.
|
|
174
181
|
*/
|
|
175
|
-
states
|
|
182
|
+
states!: IPlayerWorldState;
|
|
183
|
+
|
|
176
184
|
/**
|
|
177
185
|
* List of active effects the player has.
|
|
178
186
|
*/
|
|
179
|
-
effects:
|
|
187
|
+
effects:PlayerEffect[] = [];
|
|
188
|
+
|
|
180
189
|
/**
|
|
181
190
|
* If this player is the bot.
|
|
182
191
|
*/
|
|
183
|
-
isMe: boolean;
|
|
184
|
-
|
|
192
|
+
isMe: boolean = false;
|
|
193
|
+
|
|
194
|
+
constructor(props: ProtoGen.PlayerProperties, states?: IPlayerWorldState | boolean) {
|
|
195
|
+
this.accountId = props.accountId;
|
|
196
|
+
this.face = props.face;
|
|
197
|
+
this.isFriend = props.isFriend;
|
|
198
|
+
this.isWorldOwner = props.isWorldOwner;
|
|
199
|
+
this.playerId = props.playerId;
|
|
200
|
+
this.position = props.position ? {
|
|
201
|
+
x: props.position.x,
|
|
202
|
+
y: props.position.y
|
|
203
|
+
} : undefined;
|
|
204
|
+
|
|
205
|
+
if (!props.rights) this.resetRights();
|
|
206
|
+
else this.rights = {
|
|
207
|
+
availableCommands: props.rights.availableCommands,
|
|
208
|
+
canChangeWorldSettings: props.rights.canChangeWorldSettings,
|
|
209
|
+
canEdit: props.rights.canEdit,
|
|
210
|
+
canGod: props.rights.canGod,
|
|
211
|
+
canToggleMinimap: props.rights.canToggleMinimap,
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
this.role = props.role;
|
|
215
|
+
this.username = props.username;
|
|
216
|
+
|
|
217
|
+
if (typeof states === "boolean") {
|
|
218
|
+
this.isMe = states;
|
|
219
|
+
states = undefined;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
if (!states) {
|
|
223
|
+
// Could be bot via init that don't get states.
|
|
224
|
+
this.resetState()
|
|
225
|
+
} else this.states = {
|
|
226
|
+
coinsBlue: states.coinsBlue,
|
|
227
|
+
coinsGold: states.coinsGold,
|
|
228
|
+
collectedItems: states.collectedItems.map(v => ({ x: v.x, y: v.y })),
|
|
229
|
+
deaths: states.deaths,
|
|
230
|
+
godmode: states.godmode,
|
|
231
|
+
hasGoldCrown: states.hasGoldCrown,
|
|
232
|
+
hasSilverCrown: states.hasSilverCrown,
|
|
233
|
+
modmode: states.modmode,
|
|
234
|
+
switches: states.switches,
|
|
235
|
+
teamId: states.teamId,
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
|
|
185
239
|
/**
|
|
186
240
|
* This is destructive, this is only for on reset packet.
|
|
187
241
|
*/
|
|
188
|
-
resetState()
|
|
242
|
+
resetState() {
|
|
243
|
+
this.states = {
|
|
244
|
+
coinsBlue: 0,
|
|
245
|
+
coinsGold: 0,
|
|
246
|
+
collectedItems: [],
|
|
247
|
+
deaths: 0,
|
|
248
|
+
godmode: false,
|
|
249
|
+
hasGoldCrown: false,
|
|
250
|
+
hasSilverCrown: false,
|
|
251
|
+
modmode: false,
|
|
252
|
+
switches: new Array(1000).fill(false),
|
|
253
|
+
teamId: 0,
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
189
257
|
/**
|
|
190
258
|
* Destructive.
|
|
191
259
|
*/
|
|
192
|
-
resetRights()
|
|
260
|
+
resetRights() {
|
|
261
|
+
this.rights = {
|
|
262
|
+
availableCommands: [],
|
|
263
|
+
canChangeWorldSettings: false,
|
|
264
|
+
canEdit: false,
|
|
265
|
+
canGod: false,
|
|
266
|
+
canToggleMinimap: false
|
|
267
|
+
}
|
|
268
|
+
}
|
|
193
269
|
}
|
|
194
|
-
|
|
270
|
+
|
|
271
|
+
export class PlayerEffect {
|
|
195
272
|
/**
|
|
196
273
|
* The ID of the effect.
|
|
197
274
|
*/
|
|
@@ -208,15 +285,33 @@ export declare class PlayerEffect {
|
|
|
208
285
|
* The time the effect occurred.
|
|
209
286
|
*/
|
|
210
287
|
triggeredAt: number;
|
|
211
|
-
|
|
288
|
+
|
|
289
|
+
constructor(effect: IPlayerEffect, triggeredAt?: number) {
|
|
290
|
+
this.effectId = effect.effectId;
|
|
291
|
+
this.duration = effect.duration;
|
|
292
|
+
this.strength = effect.strength;
|
|
293
|
+
|
|
294
|
+
this.triggeredAt = triggeredAt ?? Date.now();
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
|
|
212
298
|
/**
|
|
213
299
|
* Note: If this effect is non timed, this will always return false.
|
|
214
300
|
*/
|
|
215
|
-
get hasExpired()
|
|
301
|
+
get hasExpired() {
|
|
302
|
+
if (this.duration === undefined) return false;
|
|
303
|
+
|
|
304
|
+
return Date.now() > (this.triggeredAt + this.duration);
|
|
305
|
+
}
|
|
306
|
+
|
|
216
307
|
/**
|
|
217
308
|
* Milliseconds showing how long before this expires.
|
|
218
|
-
*
|
|
309
|
+
*
|
|
219
310
|
* Note: If this effect is non timed, this will return infinity.
|
|
220
311
|
*/
|
|
221
|
-
get remaining()
|
|
222
|
-
|
|
312
|
+
get remaining() {
|
|
313
|
+
if (this.duration === undefined) return Infinity;
|
|
314
|
+
|
|
315
|
+
return Math.max(0, Date.now() - (this.triggeredAt + this.duration));
|
|
316
|
+
}
|
|
317
|
+
}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
export type * from "./types/index.d.ts";
|
|
2
2
|
export { default as PWGameWorldHelper } from "./Helper.js";
|
|
3
|
+
|
|
3
4
|
export { ComponentTypeHeader, default as BufferReader } from "./BufferReader.js";
|
|
5
|
+
|
|
4
6
|
export { default as Block, BlockArgsHeadings } from "./Block.js";
|
|
7
|
+
|
|
5
8
|
export { default as Player, PlayerEffect, IPlayer, IPlayerEffect, IPlayerRights, IPlayerWorldState } from "./Player.js";
|
|
9
|
+
|
|
6
10
|
export * as Constants from "./Constants.js";
|
|
11
|
+
|
|
12
|
+
// import * from "./Helper";
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// I cba so all of the typings will go here
|
|
2
|
+
|
|
3
|
+
import Block from "../Block";
|
|
4
|
+
import Player, { IPlayerEffect, IPlayerRights } from "../Player";
|
|
5
|
+
|
|
6
|
+
type Point = { x: number, y: number };
|
|
7
|
+
|
|
8
|
+
export interface SendableBlockPacket {
|
|
9
|
+
/**
|
|
10
|
+
* If true, just leave one position
|
|
11
|
+
*/
|
|
12
|
+
isFillOperation: boolean;
|
|
13
|
+
blockId: number;
|
|
14
|
+
layer: number;
|
|
15
|
+
/**
|
|
16
|
+
* Note: (I THINK) 250 positions limit.
|
|
17
|
+
*/
|
|
18
|
+
positions: Point[];
|
|
19
|
+
extraFields?: Uint8Array;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type BlockArg = (string | number | bigint | boolean | Buffer);
|
|
23
|
+
|
|
24
|
+
export type PWGameHook = {
|
|
25
|
+
worldBlockPlacedPacket: { player: Player, oldBlocks: Block[], newBlocks: Block[] },
|
|
26
|
+
playerJoinedPacket: { player: Player },
|
|
27
|
+
playerLeftPacket: { player: Player },
|
|
28
|
+
playerInitPacket: { player: Player },
|
|
29
|
+
playerFacePacket: { player: Player, oldFace: number },
|
|
30
|
+
playerModModePacket: { player: Player, oldState: boolean },
|
|
31
|
+
playerGodModePacket: { player: Player, oldState: boolean },
|
|
32
|
+
playerAddEffectPacket: { player: Player, effect: IPlayerEffect },
|
|
33
|
+
playerRemoveEffectPacket: { player: Player, effect: IPlayerEffect },
|
|
34
|
+
playerResetEffectsPacket: { player: Player, effects: IPlayerEffect[] },
|
|
35
|
+
playerMovedPacket: { player: Player },
|
|
36
|
+
playerResetPacket: { player: Player },
|
|
37
|
+
playerRespawnPacket: { player: Player },
|
|
38
|
+
playerUpdateRightsPacket: { player: Player, rights: IPlayerRights },
|
|
39
|
+
playerTeamUpdatePacket: { player: Player, oldTeam: number },
|
|
40
|
+
playerCountersUpdatePacket: { player: Player, oldState: { coinsBlue: number, coinsGold: number, deaths: number } },
|
|
41
|
+
playerTeleportedPacket: { player: Player },
|
|
42
|
+
globalSwitchChangedPacket: { player: Player },
|
|
43
|
+
globalSwitchResetPacket: { player: Player },
|
|
44
|
+
playerLocalSwitchChangedPacket: { player: Player },
|
|
45
|
+
playerLocalSwitchResetPacket: { player: Player },
|
|
46
|
+
playerChatPacket: { player: Player },
|
|
47
|
+
playerDirectMessagePacket: { player: Player },
|
|
48
|
+
playerTouchBlockPacket: { player: Player },
|
|
49
|
+
};
|
package/package.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pw-js-world",
|
|
3
|
-
"version": "0.0.5-dev.
|
|
3
|
+
"version": "0.0.5-dev.46673a2",
|
|
4
4
|
"description": "An optional package for PW-JS-Api, aims to serve world purposes.",
|
|
5
|
+
"main": "lib/index.ts",
|
|
5
6
|
"exports": {
|
|
6
|
-
"
|
|
7
|
-
"import": "./esm
|
|
8
|
-
"require": "./
|
|
7
|
+
"bun": "./dist/index.js",
|
|
8
|
+
"import": "./esm.mjs",
|
|
9
|
+
"require": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts"
|
|
9
11
|
},
|
|
10
12
|
"keywords": [
|
|
11
13
|
"PixelWalker",
|
|
@@ -34,7 +36,6 @@
|
|
|
34
36
|
},
|
|
35
37
|
"scripts": {
|
|
36
38
|
"test": "bun test/index.ts",
|
|
37
|
-
"build
|
|
38
|
-
"build": "rimraf cm esm && npm run build:ts && ncp lib/types esm/types"
|
|
39
|
+
"build": "rimraf dist && tsc -p tsconfig.json && ncp lib/types dist/types"
|
|
39
40
|
}
|
|
40
41
|
}
|
package/cm/Block.js
DELETED
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BlockArgsHeadings = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pw_js_api_1 = require("pw-js-api");
|
|
6
|
-
const BufferReader_js_1 = tslib_1.__importStar(require("./BufferReader.js"));
|
|
7
|
-
class Block {
|
|
8
|
-
constructor(bId, args) {
|
|
9
|
-
this.args = [];
|
|
10
|
-
if (typeof bId === "number")
|
|
11
|
-
this.bId = bId;
|
|
12
|
-
else {
|
|
13
|
-
this.bId = pw_js_api_1.BlockNames[bId];
|
|
14
|
-
}
|
|
15
|
-
if (args)
|
|
16
|
-
this.args = args;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* I mean... Just use .args.length !== 0 to see if it has args.
|
|
20
|
-
*
|
|
21
|
-
* But anyway, this will return true if there is at least one args, otherwise false.
|
|
22
|
-
*/
|
|
23
|
-
hasArgs() {
|
|
24
|
-
return this.args.length !== 0;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* For helper.
|
|
28
|
-
*
|
|
29
|
-
* This is in Block class for organisation.
|
|
30
|
-
*
|
|
31
|
-
* This will deserialise by using the reader to get the block ID then retrieve the args, if applicable.
|
|
32
|
-
*/
|
|
33
|
-
static deserialize(reader) {
|
|
34
|
-
return new Block(reader.readUInt32LE()).deserializeArgs(reader);
|
|
35
|
-
}
|
|
36
|
-
deserializeArgs(reader, flag = false) {
|
|
37
|
-
var _a;
|
|
38
|
-
const format = exports.BlockArgsHeadings[this.name];
|
|
39
|
-
for (let i = 0; i < ((_a = format === null || format === void 0 ? void 0 : format.length) !== null && _a !== void 0 ? _a : 0); i++) {
|
|
40
|
-
if (flag) {
|
|
41
|
-
reader.expectUInt8(format[i]);
|
|
42
|
-
}
|
|
43
|
-
this.args[i] = reader.read(format[i], !flag);
|
|
44
|
-
}
|
|
45
|
-
return this;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* For helper.
|
|
49
|
-
*
|
|
50
|
-
* This is in Block class for organisation.
|
|
51
|
-
*/
|
|
52
|
-
static deserializeArgs(blockId, reader, flag = false) {
|
|
53
|
-
var _a;
|
|
54
|
-
const format = exports.BlockArgsHeadings[pw_js_api_1.BlockNames[blockId]];
|
|
55
|
-
const args = [];
|
|
56
|
-
for (let i = 0; i < ((_a = format === null || format === void 0 ? void 0 : format.length) !== null && _a !== void 0 ? _a : 0); i++) {
|
|
57
|
-
if (flag) {
|
|
58
|
-
reader.expectUInt8(format[i]);
|
|
59
|
-
}
|
|
60
|
-
args[i] = reader.read(format[i], !flag);
|
|
61
|
-
}
|
|
62
|
-
return args;
|
|
63
|
-
}
|
|
64
|
-
static serializeArgs(bId, args, options) {
|
|
65
|
-
var _a;
|
|
66
|
-
options || (options = {
|
|
67
|
-
endian: "little",
|
|
68
|
-
writeId: true,
|
|
69
|
-
readTypeByte: false,
|
|
70
|
-
});
|
|
71
|
-
const buffer = [];
|
|
72
|
-
if (options.writeId) {
|
|
73
|
-
const idBuffer = Buffer.alloc(4);
|
|
74
|
-
idBuffer.writeUInt32LE(bId);
|
|
75
|
-
buffer.push(idBuffer);
|
|
76
|
-
}
|
|
77
|
-
const blockData = (_a = exports.BlockArgsHeadings[pw_js_api_1.BlockNames[bId]]) !== null && _a !== void 0 ? _a : [];
|
|
78
|
-
for (let i = 0, len = blockData.length; i < len; i++) {
|
|
79
|
-
const entry = BufferReader_js_1.default.Dynamic(blockData[i], args[i]);
|
|
80
|
-
buffer.push(entry);
|
|
81
|
-
}
|
|
82
|
-
return Buffer.concat(buffer);
|
|
83
|
-
}
|
|
84
|
-
toPacket(pos, y, layer) {
|
|
85
|
-
if (typeof pos === "number") {
|
|
86
|
-
pos = [{
|
|
87
|
-
x: pos, y
|
|
88
|
-
}];
|
|
89
|
-
layer = layer !== null && layer !== void 0 ? layer : 0;
|
|
90
|
-
}
|
|
91
|
-
else
|
|
92
|
-
layer = y !== null && y !== void 0 ? y : 0;
|
|
93
|
-
return {
|
|
94
|
-
isFillOperation: false,
|
|
95
|
-
blockId: this.bId,
|
|
96
|
-
layer,
|
|
97
|
-
positions: pos,
|
|
98
|
-
extraFields: Block.serializeArgs(this.bId, this.args, { endian: "big", writeId: false, readTypeByte: true })
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* This will return the block name in UPPER_CASE form.
|
|
103
|
-
*
|
|
104
|
-
* For eg EFFECTS_INVULNERABILITY.
|
|
105
|
-
*/
|
|
106
|
-
get name() {
|
|
107
|
-
return pw_js_api_1.BlockNames[this.bId];
|
|
108
|
-
}
|
|
109
|
-
clone(obj = false) {
|
|
110
|
-
if (obj === true)
|
|
111
|
-
return { bId: this.bId, args: this.args, name: this.name };
|
|
112
|
-
return new Block(this.bId, this.args);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
exports.default = Block;
|
|
116
|
-
/**
|
|
117
|
-
* This mapping contains definitions of block data which require additional
|
|
118
|
-
* arguments to be sent or received with.
|
|
119
|
-
*/
|
|
120
|
-
exports.BlockArgsHeadings = {
|
|
121
|
-
COIN_GOLD_DOOR: [BufferReader_js_1.ComponentTypeHeader.Int32],
|
|
122
|
-
COIN_BLUE_DOOR: [BufferReader_js_1.ComponentTypeHeader.Int32],
|
|
123
|
-
COIN_GOLD_GATE: [BufferReader_js_1.ComponentTypeHeader.Int32],
|
|
124
|
-
COIN_BLUE_GATE: [BufferReader_js_1.ComponentTypeHeader.Int32],
|
|
125
|
-
EFFECTS_JUMP_HEIGHT: [BufferReader_js_1.ComponentTypeHeader.Int32],
|
|
126
|
-
EFFECTS_FLY: [BufferReader_js_1.ComponentTypeHeader.Boolean],
|
|
127
|
-
EFFECTS_SPEED: [BufferReader_js_1.ComponentTypeHeader.Int32],
|
|
128
|
-
EFFECTS_INVULNERABILITY: [BufferReader_js_1.ComponentTypeHeader.Boolean],
|
|
129
|
-
EFFECTS_CURSE: [BufferReader_js_1.ComponentTypeHeader.Int32],
|
|
130
|
-
EFFECTS_ZOMBIE: [BufferReader_js_1.ComponentTypeHeader.Int32],
|
|
131
|
-
EFFECTS_GRAVITYFORCE: [BufferReader_js_1.ComponentTypeHeader.Int32],
|
|
132
|
-
EFFECTS_MULTI_JUMP: [BufferReader_js_1.ComponentTypeHeader.Int32],
|
|
133
|
-
// gravity effects no data
|
|
134
|
-
// effects off
|
|
135
|
-
// effects zombie
|
|
136
|
-
TOOL_PORTAL_WORLD_SPAWN: [BufferReader_js_1.ComponentTypeHeader.Int32],
|
|
137
|
-
SIGN_NORMAL: [BufferReader_js_1.ComponentTypeHeader.String],
|
|
138
|
-
SIGN_RED: [BufferReader_js_1.ComponentTypeHeader.String],
|
|
139
|
-
SIGN_GREEN: [BufferReader_js_1.ComponentTypeHeader.String],
|
|
140
|
-
SIGN_BLUE: [BufferReader_js_1.ComponentTypeHeader.String],
|
|
141
|
-
SIGN_GOLD: [BufferReader_js_1.ComponentTypeHeader.String],
|
|
142
|
-
PORTAL: [BufferReader_js_1.ComponentTypeHeader.Int32, BufferReader_js_1.ComponentTypeHeader.Int32, BufferReader_js_1.ComponentTypeHeader.Int32],
|
|
143
|
-
PORTAL_INVISIBLE: [BufferReader_js_1.ComponentTypeHeader.Int32, BufferReader_js_1.ComponentTypeHeader.Int32, BufferReader_js_1.ComponentTypeHeader.Int32],
|
|
144
|
-
PORTAL_WORLD: [BufferReader_js_1.ComponentTypeHeader.String, BufferReader_js_1.ComponentTypeHeader.Int32],
|
|
145
|
-
SWITCH_LOCAL_TOGGLE: [BufferReader_js_1.ComponentTypeHeader.Int32],
|
|
146
|
-
SWITCH_LOCAL_ACTIVATOR: [BufferReader_js_1.ComponentTypeHeader.Int32, BufferReader_js_1.ComponentTypeHeader.Boolean],
|
|
147
|
-
SWITCH_LOCAL_RESETTER: [BufferReader_js_1.ComponentTypeHeader.Boolean],
|
|
148
|
-
SWITCH_LOCAL_DOOR: [BufferReader_js_1.ComponentTypeHeader.Int32],
|
|
149
|
-
SWITCH_LOCAL_GATE: [BufferReader_js_1.ComponentTypeHeader.Int32],
|
|
150
|
-
SWITCH_GLOBAL_TOGGLE: [BufferReader_js_1.ComponentTypeHeader.Int32],
|
|
151
|
-
SWITCH_GLOBAL_ACTIVATOR: [BufferReader_js_1.ComponentTypeHeader.Int32, BufferReader_js_1.ComponentTypeHeader.Boolean],
|
|
152
|
-
SWITCH_GLOBAL_RESETTER: [BufferReader_js_1.ComponentTypeHeader.Boolean],
|
|
153
|
-
SWITCH_GLOBAL_DOOR: [BufferReader_js_1.ComponentTypeHeader.Int32],
|
|
154
|
-
SWITCH_GLOBAL_GATE: [BufferReader_js_1.ComponentTypeHeader.Int32],
|
|
155
|
-
HAZARD_DEATH_DOOR: [BufferReader_js_1.ComponentTypeHeader.Int32],
|
|
156
|
-
HAZARD_DEATH_GATE: [BufferReader_js_1.ComponentTypeHeader.Int32],
|
|
157
|
-
NOTE_DRUM: [BufferReader_js_1.ComponentTypeHeader.ByteArray],
|
|
158
|
-
NOTE_PIANO: [BufferReader_js_1.ComponentTypeHeader.ByteArray],
|
|
159
|
-
NOTE_GUITAR: [BufferReader_js_1.ComponentTypeHeader.ByteArray],
|
|
160
|
-
};
|
|
161
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQmxvY2suanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9saWIvQmxvY2sudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUFBLHlDQUF1QztBQUV2Qyw2RUFBc0U7QUFHdEUsTUFBcUIsS0FBSztJQUl0QixZQUFZLEdBQXFDLEVBQUUsSUFBaUI7UUFGcEUsU0FBSSxHQUFlLEVBQUUsQ0FBQztRQUdsQixJQUFJLE9BQU8sR0FBRyxLQUFLLFFBQVE7WUFBRSxJQUFJLENBQUMsR0FBRyxHQUFHLEdBQUcsQ0FBQzthQUN2QyxDQUFDO1lBQ0YsSUFBSSxDQUFDLEdBQUcsR0FBRyxzQkFBVSxDQUFDLEdBQUcsQ0FBQyxDQUFDO1FBQy9CLENBQUM7UUFFRCxJQUFJLElBQUk7WUFBRSxJQUFJLENBQUMsSUFB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UFDO0NBQ3RDLENBQUMifQ==
|
package/cm/Helper.d.ts
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { BlockNames, Hook } from "pw-js-api";
|
|
2
|
-
import type { ProtoGen } from "pw-js-api";
|
|
3
|
-
import Block from "./Block.js";
|
|
4
|
-
import Player from "./Player.js";
|
|
5
|
-
import { LayerType } from "./Constants.js";
|
|
6
|
-
import type { BlockArg, Point, PWGameHook, SendableBlockPacket } from "./types/index.js";
|
|
7
|
-
/**
|
|
8
|
-
* To use this helper, you must first create an instance of this,
|
|
9
|
-
*
|
|
10
|
-
* then: <PWGameClient>.addCallback("raw", helper.onRawPacketRecv)
|
|
11
|
-
*/
|
|
12
|
-
export default class PWGameWorldHelper {
|
|
13
|
-
/**
|
|
14
|
-
* Arrays of blocks (by layer, x, y)
|
|
15
|
-
*/
|
|
16
|
-
blocks: [Block[][], Block[][]];
|
|
17
|
-
players: Map<number, Player>;
|
|
18
|
-
globalSwitches: boolean[];
|
|
19
|
-
private _meta?;
|
|
20
|
-
private _width;
|
|
21
|
-
private _height;
|
|
22
|
-
private _init;
|
|
23
|
-
private _selfPlayerId;
|
|
24
|
-
/**
|
|
25
|
-
* The current world's width.
|
|
26
|
-
*
|
|
27
|
-
* If you didn't put the hook before init, this may throw error.
|
|
28
|
-
*/
|
|
29
|
-
get width(): number;
|
|
30
|
-
/**
|
|
31
|
-
* The current world's height.
|
|
32
|
-
*
|
|
33
|
-
* If you didn't put the hook before init, this may throw error.
|
|
34
|
-
*/
|
|
35
|
-
get height(): number;
|
|
36
|
-
/**
|
|
37
|
-
* The current world's metadata.
|
|
38
|
-
*
|
|
39
|
-
* If you didn't put the hook before init, this may throw error.
|
|
40
|
-
*/
|
|
41
|
-
get meta(): ProtoGen.WorldMeta | null;
|
|
42
|
-
/**
|
|
43
|
-
* If this helper is ready. When it's false, the helper will not return anything for any of the packets.
|
|
44
|
-
*/
|
|
45
|
-
get initialised(): boolean;
|
|
46
|
-
/**
|
|
47
|
-
* The bot's player object.
|
|
48
|
-
*
|
|
49
|
-
* If you didn't put the hook before init, this may throw error.
|
|
50
|
-
*/
|
|
51
|
-
get botPlayer(): Player;
|
|
52
|
-
/**
|
|
53
|
-
* The bot's player id in the world.
|
|
54
|
-
*
|
|
55
|
-
* If you didn't put the hook before init, this may throw error.
|
|
56
|
-
*/
|
|
57
|
-
get botPlayerId(): number;
|
|
58
|
-
/**
|
|
59
|
-
* This must go in .use() of the main PW-JS-API Game Client class.
|
|
60
|
-
*
|
|
61
|
-
* <PWGameClient>.use(<PWGameWorldHelper>.receiveHook)
|
|
62
|
-
*
|
|
63
|
-
* DO NOT PUT () AFTER RECEIVEHOOK
|
|
64
|
-
*/
|
|
65
|
-
receiveHook: Hook<PWGameHook>;
|
|
66
|
-
/**
|
|
67
|
-
* Internal function.
|
|
68
|
-
*/
|
|
69
|
-
private initialise;
|
|
70
|
-
/**
|
|
71
|
-
* Internal function.
|
|
72
|
-
*/
|
|
73
|
-
private deserialize;
|
|
74
|
-
private convertSwitchState;
|
|
75
|
-
/**
|
|
76
|
-
* Internal function, this triggers when the world gets cleared.
|
|
77
|
-
*
|
|
78
|
-
* Clears the blocks map and promptly fill it with empty except the border which becomes basci gray.
|
|
79
|
-
*/
|
|
80
|
-
private clear;
|
|
81
|
-
/**
|
|
82
|
-
* Gets the block at the position.
|
|
83
|
-
*
|
|
84
|
-
* Difference between this and using this.blocks directly is that this function will validate the positions and the layer.
|
|
85
|
-
*/
|
|
86
|
-
getBlockAt(pos: Point, l: LayerType): Block;
|
|
87
|
-
getBlockAt(x: number | Point, y: number, l: LayerType): Block;
|
|
88
|
-
/**
|
|
89
|
-
* Player ID.
|
|
90
|
-
*
|
|
91
|
-
* The main bot player is excluded from the criteria.
|
|
92
|
-
*/
|
|
93
|
-
getPlayer(id: number, isAccount?: false): Player | undefined;
|
|
94
|
-
/**
|
|
95
|
-
* Username is case insensitive.
|
|
96
|
-
*
|
|
97
|
-
* The main bot player is excluded from the criteria.
|
|
98
|
-
*/
|
|
99
|
-
getPlayer(username: string, isAccount?: false): Player | undefined;
|
|
100
|
-
/**
|
|
101
|
-
* The ID of the account (must have second parameter set to true)
|
|
102
|
-
*
|
|
103
|
-
* The main bot player is excluded from the criteria.
|
|
104
|
-
*/
|
|
105
|
-
getPlayer(accountId: string, isAccount: true): Player | undefined;
|
|
106
|
-
/**
|
|
107
|
-
* Returns the list of current players in the world.
|
|
108
|
-
*/
|
|
109
|
-
getPlayers(): Player[];
|
|
110
|
-
/**
|
|
111
|
-
* For now this is slightly limited, but this will ONLY create a sendable packet which you must then send it yourself.
|
|
112
|
-
*/
|
|
113
|
-
createBlockPacket(blockId: number | BlockNames | keyof typeof BlockNames, layer: LayerType, pos: Point | Point[], ...args: BlockArg[]): SendableBlockPacket;
|
|
114
|
-
createBlockPacket(block: Block, layer: LayerType, pos: Point | Point[]): SendableBlockPacket;
|
|
115
|
-
}
|