rock-mod 0.15.0 → 0.16.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/player/AltVPlayer.d.ts +1 -0
- package/dist/server/entities/altv/player/AltVPlayer.js +3 -0
- package/dist/server/entities/common/colshape/IColshapesManager.d.ts +1 -3
- package/dist/server/entities/common/player/IPlayer.d.ts +1 -0
- package/dist/server/entities/mock/player/MockPlayer.d.ts +1 -0
- package/dist/server/entities/mock/player/MockPlayer.js +3 -0
- package/dist/server/entities/ragemp/colshape/RageColshape.d.ts +2 -0
- package/dist/server/entities/ragemp/colshape/RageColshapesManager.js +5 -5
- package/dist/server/entities/ragemp/player/RagePlayer.d.ts +1 -0
- package/dist/server/entities/ragemp/player/RagePlayer.js +3 -0
- package/dist/server/entities/ragemp/worldObject/RageWorldObject.d.ts +3 -1
- package/dist/server/entities/ragemp/worldObject/RageWorldObject.js +6 -1
- package/package.json +1 -1
|
@@ -46,5 +46,6 @@ export declare class AltVPlayer extends AltVEntity<Player> implements IPlayer {
|
|
|
46
46
|
kick(reason?: string): void;
|
|
47
47
|
playAnimation(dictionary: string, name: string, speed: number, flag: number): void;
|
|
48
48
|
stopAnimation(): void;
|
|
49
|
+
removeFromVehicle(): void;
|
|
49
50
|
}
|
|
50
51
|
export {};
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { type IWorldObjectCreateOptions, type IWorldObjectsManager } from "../worldObject";
|
|
2
2
|
import { type IColshape } from "./IColshape";
|
|
3
|
-
import { type IVector2D } from "../../../../shared/common/utils";
|
|
4
3
|
import { type ICircleColshape } from "./ICircleColshape";
|
|
5
4
|
import { type ICuboidColshape } from "./ICuboidColshape";
|
|
6
5
|
import { type ICylinderColshape } from "./ICylinderColshape";
|
|
7
6
|
import { type IRectangleColshape } from "./IRectangleColshape";
|
|
8
7
|
import { type ISphereColshape } from "./ISphereColshape";
|
|
9
8
|
import { type IPlayer } from "../player";
|
|
10
|
-
export interface ICircleColshapeCreateOptions extends
|
|
11
|
-
position: IVector2D;
|
|
9
|
+
export interface ICircleColshapeCreateOptions extends IWorldObjectCreateOptions {
|
|
12
10
|
range: number;
|
|
13
11
|
}
|
|
14
12
|
export interface ICuboidColshapeCreateOptions extends IWorldObjectCreateOptions {
|
|
@@ -137,5 +137,8 @@ class MockPlayer extends MockEntity_1.MockEntity {
|
|
|
137
137
|
stopAnimation() {
|
|
138
138
|
throw new Error("Not implemented: stopAnimation");
|
|
139
139
|
}
|
|
140
|
+
removeFromVehicle() {
|
|
141
|
+
throw new Error("Not implemented removeFromVehicle");
|
|
142
|
+
}
|
|
140
143
|
}
|
|
141
144
|
exports.MockPlayer = MockPlayer;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { type IRageWorldObjectOptions, RageWorldObject } from "../worldObject/RageWorldObject";
|
|
2
|
+
import { type IVector3D } from "../../../../shared";
|
|
2
3
|
export interface IRageColshapeOptions extends IRageWorldObjectOptions<ColshapeMp> {
|
|
4
|
+
position: IVector3D;
|
|
3
5
|
}
|
|
4
6
|
export declare abstract class RageColshape extends RageWorldObject<ColshapeMp> {
|
|
5
7
|
protected constructor(options: IRageColshapeOptions);
|
|
@@ -35,7 +35,7 @@ class RageColshapesManager extends RageWorldObjectsManager_1.RageWorldObjectsMan
|
|
|
35
35
|
const { x, y } = position;
|
|
36
36
|
const mpEntity = mp.colshapes.newCircle(x, y, range, dimension);
|
|
37
37
|
mpEntity.isExists = () => mp.colshapes.exists(mpEntity);
|
|
38
|
-
const colshape = new RageCircleColshape_1.RageCircleColshape({ mpEntity });
|
|
38
|
+
const colshape = new RageCircleColshape_1.RageCircleColshape({ mpEntity, position });
|
|
39
39
|
this.registerBaseObject(colshape);
|
|
40
40
|
return colshape;
|
|
41
41
|
}
|
|
@@ -44,7 +44,7 @@ class RageColshapesManager extends RageWorldObjectsManager_1.RageWorldObjectsMan
|
|
|
44
44
|
const { x, y, z } = position;
|
|
45
45
|
const mpEntity = mp.colshapes.newCuboid(x, y, z, width, depth, height, dimension);
|
|
46
46
|
mpEntity.isExists = () => mp.colshapes.exists(mpEntity);
|
|
47
|
-
const colshape = new RageCuboidColshape_1.RageCuboidColshape({ mpEntity });
|
|
47
|
+
const colshape = new RageCuboidColshape_1.RageCuboidColshape({ mpEntity, position });
|
|
48
48
|
this.registerBaseObject(colshape);
|
|
49
49
|
return colshape;
|
|
50
50
|
}
|
|
@@ -53,7 +53,7 @@ class RageColshapesManager extends RageWorldObjectsManager_1.RageWorldObjectsMan
|
|
|
53
53
|
const { x, y, z } = position;
|
|
54
54
|
const mpEntity = mp.colshapes.newTube(x, y, z, height, range, dimension);
|
|
55
55
|
mpEntity.isExists = () => mp.colshapes.exists(mpEntity);
|
|
56
|
-
const colshape = new RageCylinderColshape_1.RageCylinderColshape({ mpEntity });
|
|
56
|
+
const colshape = new RageCylinderColshape_1.RageCylinderColshape({ mpEntity, position });
|
|
57
57
|
this.registerBaseObject(colshape);
|
|
58
58
|
return colshape;
|
|
59
59
|
}
|
|
@@ -62,7 +62,7 @@ class RageColshapesManager extends RageWorldObjectsManager_1.RageWorldObjectsMan
|
|
|
62
62
|
const { x, y } = position;
|
|
63
63
|
const mpEntity = mp.colshapes.newRectangle(x, y, width, height, dimension);
|
|
64
64
|
mpEntity.isExists = () => mp.colshapes.exists(mpEntity);
|
|
65
|
-
const colshape = new RageRectangleColshape_1.RageRectangleColshape({ mpEntity });
|
|
65
|
+
const colshape = new RageRectangleColshape_1.RageRectangleColshape({ mpEntity, position });
|
|
66
66
|
this.registerBaseObject(colshape);
|
|
67
67
|
return colshape;
|
|
68
68
|
}
|
|
@@ -71,7 +71,7 @@ class RageColshapesManager extends RageWorldObjectsManager_1.RageWorldObjectsMan
|
|
|
71
71
|
const { x, y, z } = position;
|
|
72
72
|
const mpEntity = mp.colshapes.newSphere(x, y, z, range, dimension);
|
|
73
73
|
mpEntity.isExists = () => mp.colshapes.exists(mpEntity);
|
|
74
|
-
const colshape = new RageSphereColshape_1.RageSphereColshape({ mpEntity });
|
|
74
|
+
const colshape = new RageSphereColshape_1.RageSphereColshape({ mpEntity, position });
|
|
75
75
|
this.registerBaseObject(colshape);
|
|
76
76
|
return colshape;
|
|
77
77
|
}
|
|
@@ -44,5 +44,6 @@ export declare class RagePlayer extends RageEntity<PlayerMp> implements IPlayer
|
|
|
44
44
|
kick(reason?: string): void;
|
|
45
45
|
playAnimation(dictionary: string, name: string, speed: number, flag: number): void;
|
|
46
46
|
stopAnimation(): void;
|
|
47
|
+
removeFromVehicle(): void;
|
|
47
48
|
}
|
|
48
49
|
export {};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { type IWorldObject } from "../../common/worldObject/IWorldObject";
|
|
2
2
|
import { type IRageBaseObjectOptions, RageBaseObject } from "../baseObject/RageBaseObject";
|
|
3
|
-
import { Vector3D } from "../../../../shared/common/utils/math/Vectors";
|
|
3
|
+
import { type IVector3D, Vector3D } from "../../../../shared/common/utils/math/Vectors";
|
|
4
4
|
export interface IRageWorldObjectOptions<T extends EntityMp> extends IRageBaseObjectOptions<T> {
|
|
5
|
+
position?: IVector3D;
|
|
5
6
|
}
|
|
6
7
|
export declare abstract class RageWorldObject<T extends EntityMp> extends RageBaseObject<T> implements IWorldObject {
|
|
8
|
+
private _position?;
|
|
7
9
|
get position(): Vector3D;
|
|
8
10
|
get dimension(): number;
|
|
9
11
|
protected constructor(options: IRageWorldObjectOptions<T>);
|
|
@@ -4,8 +4,9 @@ exports.RageWorldObject = void 0;
|
|
|
4
4
|
const RageBaseObject_1 = require("../baseObject/RageBaseObject");
|
|
5
5
|
const Vectors_1 = require("../../../../shared/common/utils/math/Vectors");
|
|
6
6
|
class RageWorldObject extends RageBaseObject_1.RageBaseObject {
|
|
7
|
+
_position;
|
|
7
8
|
get position() {
|
|
8
|
-
const { x, y, z } = this.mpEntity.position;
|
|
9
|
+
const { x, y, z } = this.mpEntity.position ?? this._position;
|
|
9
10
|
return new Vectors_1.Vector3D(x, y, z);
|
|
10
11
|
}
|
|
11
12
|
get dimension() {
|
|
@@ -13,8 +14,12 @@ class RageWorldObject extends RageBaseObject_1.RageBaseObject {
|
|
|
13
14
|
}
|
|
14
15
|
constructor(options) {
|
|
15
16
|
super(options);
|
|
17
|
+
if (options.position)
|
|
18
|
+
this._position = options.position;
|
|
16
19
|
}
|
|
17
20
|
setPosition(value) {
|
|
21
|
+
if (this._position)
|
|
22
|
+
this._position = value;
|
|
18
23
|
this.mpEntity.position = new mp.Vector3(value);
|
|
19
24
|
}
|
|
20
25
|
setDimension(value) {
|
package/package.json
CHANGED