From d32c361903f8ab9a238a2fcdbb5694a2ea917620 Mon Sep 17 00:00:00 2001 From: xLuxy <67131061+xLuxy@users.noreply.github.com> Date: Thu, 7 Mar 2024 14:14:54 +0100 Subject: [PATCH] fix(server): Add missing .all and getByID for VirtualEntityGroup --- server/js/entity.js | 1 + server/src/classes/VirtualEntityGroup.cpp | 2 ++ types/server/index.d.ts | 4 ++++ types/server/package.json | 2 +- 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/server/js/entity.js b/server/js/entity.js index 346f22d9c..0c122423e 100644 --- a/server/js/entity.js +++ b/server/js/entity.js @@ -2,3 +2,4 @@ const { addAllGetter } = requireBinding("shared/entity.js"); addAllGetter(alt.VoiceChannel, alt.Enums.BaseObjectType.VOICE_CHANNEL); +addAllGetter(alt.VirtualEntityGroup, alt.Enums.BaseObjectType.VIRTUAL_ENTITY_GROUP); diff --git a/server/src/classes/VirtualEntityGroup.cpp b/server/src/classes/VirtualEntityGroup.cpp index ece959840..8266ae8cf 100644 --- a/server/src/classes/VirtualEntityGroup.cpp +++ b/server/src/classes/VirtualEntityGroup.cpp @@ -6,4 +6,6 @@ extern js::Class sharedVirtualEntityGroupClass; extern js::Class virtualEntityGroupClass("VirtualEntityGroup", &sharedVirtualEntityGroupClass, nullptr, [](js::ClassTemplate& tpl) { tpl.BindToType(alt::IBaseObject::Type::VIRTUAL_ENTITY_GROUP); + + tpl.GetByID(); }); diff --git a/types/server/index.d.ts b/types/server/index.d.ts index 9fe564a64..a1bb1a0d7 100644 --- a/types/server/index.d.ts +++ b/types/server/index.d.ts @@ -768,6 +768,8 @@ declare module "@altv/server" { export abstract class VirtualEntityGroup extends BaseObject { readonly maxEntitiesInStream: number; + static readonly all: ReadonlyArray; + public onCreate?(opts: altShared.VirtualEntityGroupCreateOptions): void; public onDestroy?(): void; @@ -775,6 +777,8 @@ declare module "@altv/server" { static setFactory(factory: typeof VirtualEntityGroup): void; static getFactory(): T; + + static getByID(id: number): VirtualEntityGroup | null; } export abstract class VirtualEntity extends WorldObject { diff --git a/types/server/package.json b/types/server/package.json index 272ddadbb..02c10afd4 100644 --- a/types/server/package.json +++ b/types/server/package.json @@ -1,6 +1,6 @@ { "name": "@altv/server", - "version": "0.0.36", + "version": "0.0.37", "description": "This package contains the type definitions for the alt:V JS module v2 server types", "types": "index.d.ts", "files": [