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) {
13571357 if (!entity) return Local<Value>();
13581358
13591359 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+ }
13651363 return arr;
13661364 }
13671365 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) {
29172917 if (!player) return Local<Value>();
29182918
29192919 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+ }
29252923 return arr;
29262924 }
29272925 CATCH (" Fail in getAllTags!" );
You can’t perform that action at this time.
0 commit comments