Replace keyset map lookups with value iterator

This commit is contained in:
KennyTV 2020-04-22 21:47:14 +02:00
parent 867cd4ee39
commit a82bbc4e66
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B

View File

@ -56,8 +56,8 @@ public class WorldPackets {
}
CompoundTag heightMaps = chunk.getHeightMap();
for (String key : heightMaps.keySet()) {
LongArrayTag heightMap = heightMaps.get(key);
for (Tag heightMapTag : heightMaps) {
LongArrayTag heightMap = (LongArrayTag) heightMapTag;
int[] heightMapData = new int[256];
CompactArrayUtil.iterateCompactArray(9, heightMapData.length, heightMap.getValue(), (i, v) -> heightMapData[i] = v);
heightMap.setValue(CompactArrayUtil.createCompactArrayWithPadding(9, heightMapData.length, i -> heightMapData[i]));