3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-08 17:20:24 +01:00

Replace keyset map lookups with value iterator

Dieser Commit ist enthalten in:
KennyTV 2020-04-22 21:47:14 +02:00
Ursprung 867cd4ee39
Commit a82bbc4e66
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B

Datei anzeigen

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