rock-mod 0.13.0 → 0.15.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/server/entities/altv/entity/AltVEntity.d.ts +2 -0
- package/dist/server/entities/altv/entity/AltVEntity.js +6 -0
- package/dist/server/entities/common/entity/IEntity.d.ts +2 -0
- package/dist/server/entities/mock/entity/MockEntity.d.ts +3 -0
- package/dist/server/entities/mock/entity/MockEntity.js +8 -0
- package/dist/server/entities/ragemp/baseObject/RageBaseObject.js +8 -1
- package/dist/server/entities/ragemp/entity/RageEntity.d.ts +2 -0
- package/dist/server/entities/ragemp/entity/RageEntity.js +6 -0
- package/package.json +1 -1
|
@@ -10,4 +10,6 @@ export declare abstract class AltVEntity<T extends Entity> extends AltVWorldObje
|
|
|
10
10
|
protected constructor(options: IAltVEntityOptions<T>);
|
|
11
11
|
setModel(value: string): void;
|
|
12
12
|
setRotation(value: Vector3D): void;
|
|
13
|
+
getNetData(name: string): unknown;
|
|
14
|
+
setNetData(name: string, value: unknown): void;
|
|
13
15
|
}
|
|
@@ -22,5 +22,11 @@ class AltVEntity extends AltVWorldObject_1.AltVWorldObject {
|
|
|
22
22
|
setRotation(value) {
|
|
23
23
|
this.mpEntity.rot = new Vector3(value);
|
|
24
24
|
}
|
|
25
|
+
getNetData(name) {
|
|
26
|
+
return this.mpEntity.getSyncedMeta(name);
|
|
27
|
+
}
|
|
28
|
+
setNetData(name, value) {
|
|
29
|
+
this.mpEntity.setSyncedMeta({ name, value });
|
|
30
|
+
}
|
|
25
31
|
}
|
|
26
32
|
exports.AltVEntity = AltVEntity;
|
|
@@ -8,9 +8,12 @@ export interface IMockEntityOptions extends IMockWorldObjectOptions {
|
|
|
8
8
|
export declare abstract class MockEntity extends MockWorldObject implements IEntity {
|
|
9
9
|
private _model;
|
|
10
10
|
private _rotation;
|
|
11
|
+
private _netData;
|
|
11
12
|
get model(): number;
|
|
12
13
|
get rotation(): Vector3D;
|
|
13
14
|
protected constructor(options: IMockEntityOptions);
|
|
14
15
|
setModel(value: string): void;
|
|
15
16
|
setRotation(value: Vector3D): void;
|
|
17
|
+
getNetData(name: string): unknown;
|
|
18
|
+
setNetData(name: string, value: unknown): void;
|
|
16
19
|
}
|
|
@@ -7,6 +7,7 @@ const RockMod_1 = require("../../../RockMod");
|
|
|
7
7
|
class MockEntity extends MockWorldObject_1.MockWorldObject {
|
|
8
8
|
_model;
|
|
9
9
|
_rotation;
|
|
10
|
+
_netData;
|
|
10
11
|
get model() {
|
|
11
12
|
return this._model;
|
|
12
13
|
}
|
|
@@ -18,6 +19,7 @@ class MockEntity extends MockWorldObject_1.MockWorldObject {
|
|
|
18
19
|
super(options);
|
|
19
20
|
this._model = options.model;
|
|
20
21
|
this._rotation = options.rotation;
|
|
22
|
+
this._netData = new Map();
|
|
21
23
|
}
|
|
22
24
|
setModel(value) {
|
|
23
25
|
this._model = RockMod_1.RockMod.instance.utils.hash(value);
|
|
@@ -25,5 +27,11 @@ class MockEntity extends MockWorldObject_1.MockWorldObject {
|
|
|
25
27
|
setRotation(value) {
|
|
26
28
|
this._rotation = value;
|
|
27
29
|
}
|
|
30
|
+
getNetData(name) {
|
|
31
|
+
return this._netData.get(name);
|
|
32
|
+
}
|
|
33
|
+
setNetData(name, value) {
|
|
34
|
+
this._netData.set(name, value);
|
|
35
|
+
}
|
|
28
36
|
}
|
|
29
37
|
exports.MockEntity = MockEntity;
|
|
@@ -2,7 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RageBaseObject = void 0;
|
|
4
4
|
// RAGEMP BUG: event 'entityDestroyed' is not callable
|
|
5
|
-
const unsupportedRageEntityTypes = new Set([
|
|
5
|
+
const unsupportedRageEntityTypes = new Set([
|
|
6
|
+
"blip",
|
|
7
|
+
"colshape",
|
|
8
|
+
"marker",
|
|
9
|
+
"object",
|
|
10
|
+
"ped",
|
|
11
|
+
"vehicle",
|
|
12
|
+
]);
|
|
6
13
|
class RageBaseObject {
|
|
7
14
|
_mpEntity;
|
|
8
15
|
get id() {
|
|
@@ -9,4 +9,6 @@ export declare abstract class RageEntity<T extends EntityMp> extends RageWorldOb
|
|
|
9
9
|
protected constructor(options: IRageEntityOptions<T>);
|
|
10
10
|
setModel(value: string): void;
|
|
11
11
|
setRotation(value: Vector3D): void;
|
|
12
|
+
getNetData(name: string): unknown;
|
|
13
|
+
setNetData(name: string, value: unknown): void;
|
|
12
14
|
}
|
|
@@ -20,5 +20,11 @@ class RageEntity extends RageWorldObject_1.RageWorldObject {
|
|
|
20
20
|
setRotation(value) {
|
|
21
21
|
this.mpEntity.rotation = new mp.Vector3(value);
|
|
22
22
|
}
|
|
23
|
+
getNetData(name) {
|
|
24
|
+
return this.mpEntity.getVariable(name);
|
|
25
|
+
}
|
|
26
|
+
setNetData(name, value) {
|
|
27
|
+
this.mpEntity.setVariable(name, value);
|
|
28
|
+
}
|
|
23
29
|
}
|
|
24
30
|
exports.RageEntity = RageEntity;
|
package/package.json
CHANGED