File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed
Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 1818#include " mc/entity/components/ActorRotationComponent.h"
1919#include " mc/entity/components/InsideBlockComponent.h"
2020#include " mc/entity/components/IsOnHotBlockFlagComponent.h"
21+ #include " mc/entity/components/TagsComponent.h"
2122#include " mc/entity/utilities/ActorMobilityUtils.h"
2223#include " mc/legacy/ActorRuntimeID.h"
2324#include " mc/legacy/ActorUniqueID.h"
2425#include " mc/nbt/CompoundTag.h"
2526#include " mc/server/commands/CommandUtils.h"
27+ #include " mc/util/IDType.h"
2628#include " mc/world/SimpleContainer.h"
2729#include " mc/world/actor/ActorDamageByActorSource.h"
2830#include " mc/world/actor/ActorDamageSource.h"
@@ -1333,11 +1335,15 @@ Local<Value> EntityClass::getAllTags(const Arguments&) {
13331335 Actor* entity = get ();
13341336 if (!entity) return Local<Value>();
13351337
1336- Local<Array> arr = Array::newArray ();
1337- for (auto & tag : entity->getTags ()) {
1338- arr.add (String::newString (tag));
1338+ Local<Array> arr = Array::newArray ();
1339+ auto component = entity->getEntityContext ().tryGetComponent <TagsComponent<IDType<LevelTagSetIDType>>>();
1340+ if (component) {
1341+ for (auto & tag : ll::service::getLevel ()->getTagRegistry ().getTagsInSet (component->mTagSetID )) {
1342+ arr.add (String::newString (tag));
1343+ }
1344+ return arr;
13391345 }
1340- return arr ;
1346+ return Local<Value>() ;
13411347 }
13421348 CATCH (" Fail in getAllTags!" );
13431349}
Original file line number Diff line number Diff line change @@ -3,9 +3,9 @@ add_rules("mode.debug", "mode.release")
33add_repositories (" liteldev-repo https://github.com/LiteLDev/xmake-repo.git" )
44
55if is_config (" target_type" , " server" ) then
6- add_requires (" levilamina bc7d1ce00a68c34f7db9d9a276ed648608d2546a " , {configs = {target_type = " server" }})
6+ add_requires (" levilamina 1854f0518474ba4d01d9ecffa428565f10b3d26f " , {configs = {target_type = " server" }})
77else
8- add_requires (" levilamina bc7d1ce00a68c34f7db9d9a276ed648608d2546a " , {configs = {target_type = " client" }})
8+ add_requires (" levilamina 1854f0518474ba4d01d9ecffa428565f10b3d26f " , {configs = {target_type = " client" }})
99end
1010
1111add_requires (" levibuildscript" )
You can’t perform that action at this time.
0 commit comments