Remove new statistics

This commit is contained in:
KennyTV 2020-06-08 09:39:10 +02:00
parent 5ff7767353
commit 3bda6dd503
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B

View File

@ -130,6 +130,35 @@ public class Protocol1_15_2To1_16 extends BackwardsProtocol<ClientboundPackets1_
}
});
registerOutgoing(ClientboundPackets1_16.STATISTICS, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
int size = wrapper.passthrough(Type.VAR_INT);
int newSize = size;
for (int i = 0; i < size; i++) {
int categoryId = wrapper.read(Type.VAR_INT);
int statisticId = wrapper.read(Type.VAR_INT);
// New statistics
if (statisticId > 49) {
wrapper.read(Type.VAR_INT);
newSize--;
continue;
}
wrapper.write(Type.VAR_INT, categoryId);
wrapper.write(Type.VAR_INT, statisticId);
wrapper.passthrough(Type.VAR_INT); // value
}
if (newSize != size) {
wrapper.set(Type.VAR_INT, 0, newSize);
}
});
}
});
new TagRewriter(this, id -> BackwardsMappings.blockMappings.getNewId(id), id -> {
Integer oldId = MappingData.oldToNewItems.inverse().get(id);
return oldId != null ? oldId : -1;