File tree Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -1357,11 +1357,9 @@ Local<Value> EntityClass::getAllTags(const Arguments& args) {
1357
1357
if (!entity) return Local<Value>();
1358
1358
1359
1359
Local<Array> arr = Array::newArray ();
1360
- CompoundTag tag = CompoundTag ();
1361
- entity->save (tag);
1362
- tag.at (" tags" ).get <ListTag>().forEachCompoundTag ([&arr](const CompoundTag& tag) {
1363
- arr.add (String::newString (tag.toString ()));
1364
- });
1360
+ for (auto tag : entity->getTags ()) {
1361
+ arr.add (String::newString (tag));
1362
+ }
1365
1363
return arr;
1366
1364
}
1367
1365
CATCH (" Fail in getAllTags!" );
Original file line number Diff line number Diff line change @@ -2917,11 +2917,9 @@ Local<Value> PlayerClass::getAllTags(const Arguments& args) {
2917
2917
if (!player) return Local<Value>();
2918
2918
2919
2919
Local<Array> arr = Array::newArray ();
2920
- CompoundTag tag = CompoundTag ();
2921
- player->save (tag);
2922
- tag.at (" Tags" ).get <ListTag>().forEachCompoundTag ([&arr](const CompoundTag& tag) {
2923
- arr.add (String::newString (tag.toString ()));
2924
- });
2920
+ for (auto tag : player->getTags ()) {
2921
+ arr.add (String::newString (tag));
2922
+ }
2925
2923
return arr;
2926
2924
}
2927
2925
CATCH (" Fail in getAllTags!" );
You can’t perform that action at this time.
0 commit comments