mirror of
https://github.com/unmojang/node-minecraft-protocol.git
synced 2025-10-02 23:52:07 -04:00
Fix team scoreboard
Because the team scoreboard values are optional, they should not always be included in the written response.
This commit is contained in:
parent
a885ab9de2
commit
95bacd4bfd
@ -1275,8 +1275,10 @@ function createPacketBuffer(packetId, state, params, isServer) {
|
|||||||
offset = writeVarInt(packetId, buffer, offset);
|
offset = writeVarInt(packetId, buffer, offset);
|
||||||
packet.forEach(function(fieldInfo) {
|
packet.forEach(function(fieldInfo) {
|
||||||
var value = params[fieldInfo.name];
|
var value = params[fieldInfo.name];
|
||||||
if(typeof value === "undefined") value = 0; // TODO : Why ?
|
if (!fieldInfo.condition || fieldInfo.condition(params)) {
|
||||||
offset = write(value, buffer, offset, fieldInfo, params);
|
if(typeof value === "undefined") value = 0; // TODO : Why ?
|
||||||
|
offset = write(value, buffer, offset, fieldInfo, params);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user