|
39 | 39 | #include "mc/network/packet/LevelChunkPacket.h" |
40 | 40 | #include "mc/network/packet/ModalFormRequestPacket.h" |
41 | 41 | #include "mc/network/packet/RemoveObjectivePacket.h" |
42 | | -#include "mc/network/packet/ScorePacketInfo.h" |
43 | 42 | #include "mc/network/packet/SetDisplayObjectivePacket.h" |
44 | 43 | #include "mc/network/packet/SetScorePacket.h" |
45 | 44 | #include "mc/network/packet/SetTitlePacket.h" |
|
78 | 77 | #include "mc/world/scores/ScoreInfo.h" |
79 | 78 | #include "mc/world/scores/Scoreboard.h" |
80 | 79 | #include "mc/world/scores/ScoreboardId.h" |
| 80 | +#include "mc/network/packet/ScorePacketInfo.h" |
81 | 81 |
|
82 | 82 | #include <algorithm> |
83 | 83 | #include <climits> |
@@ -2194,20 +2194,18 @@ Local<Value> PlayerClass::setSidebar(const Arguments& args) { |
2194 | 2194 | SetDisplayObjectivePacket |
2195 | 2195 | disObjPkt("sidebar", "FakeScoreObj", args[0].asString().toString(), "dummy", (ObjectiveSortOrder)sortOrder); |
2196 | 2196 | disObjPkt.sendTo(*player); |
2197 | | - // todo: fix it |
2198 | | - |
2199 | | - // std::vector<ScorePacketInfo> info; |
2200 | | - // for (auto& i : data) { |
2201 | | - // ScorePacketInfo pktInfo; |
2202 | | - // pktInfo.mScoreboardId->mRawID = i.second; |
2203 | | - // pktInfo.mObjectiveName = "FakeScoreObj"; |
2204 | | - // pktInfo.mIdentityType = IdentityDefinition::Type::FakePlayer; |
2205 | | - // pktInfo.mScoreValue = i.second; |
2206 | | - // pktInfo.mFakePlayerName = i.first; |
2207 | | - // info.emplace_back(pktInfo); |
2208 | | - // } |
2209 | | - // SetScorePacket setPkt = SetScorePacket::change(info); |
2210 | | - // setPkt.sendTo(*player); |
| 2197 | + std::vector<ScorePacketInfo> info; |
| 2198 | + for (auto& i : data) { |
| 2199 | + ScorePacketInfo pktInfo; |
| 2200 | + pktInfo.mScoreboardId->mRawID = i.second; |
| 2201 | + pktInfo.mObjectiveName = "FakeScoreObj"; |
| 2202 | + pktInfo.mIdentityType = IdentityDefinition::Type::FakePlayer; |
| 2203 | + pktInfo.mScoreValue = i.second; |
| 2204 | + pktInfo.mFakePlayerName = i.first; |
| 2205 | + info.emplace_back(pktInfo); |
| 2206 | + } |
| 2207 | + SetScorePacket setPkt = SetScorePacket::change(info); |
| 2208 | + setPkt.sendTo(*player); |
2211 | 2209 | return Boolean::newBoolean(true); |
2212 | 2210 | } |
2213 | 2211 | CATCH("Fail in setSidebar!") |
|
0 commit comments