3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-26 08:10:09 +01:00

More optimization

Dieser Commit ist enthalten in:
creeper123123321 2018-07-25 18:12:38 -03:00
Ursprung 6608877ef0
Commit 73ee2498e8
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 0AC57D54786721D1

Datei anzeigen

@ -215,21 +215,29 @@ public class WorldPackets {
if (section == null) if (section == null)
continue; continue;
boolean willStoreAnyBlock = false;
for (int p = 0; p < section.getPalette().size(); p++) { for (int p = 0; p < section.getPalette().size(); p++) {
int old = section.getPalette().get(p); int old = section.getPalette().get(p);
section.getPalette().set(p, toNewId(old)); int newId = toNewId(old);
if (storage.isWelcome(newId)) {
willStoreAnyBlock = true;
}
section.getPalette().set(p, newId);
} }
for (int x = 0; x < 16; x++) { if (willStoreAnyBlock) {
for (int y = 0; y < 16; y++) { for (int x = 0; x < 16; x++) {
for (int z = 0; z < 16; z++) { for (int y = 0; y < 16; y++) {
int block = section.getBlock(x, y, z); for (int z = 0; z < 16; z++) {
if (storage.isWelcome(block)) { int block = section.getBlock(x, y, z);
storage.store(new Position( if (storage.isWelcome(block)) {
(long) (x + (chunk.getX() << 4)), storage.store(new Position(
(long) (y + (i << 4)), (long) (x + (chunk.getX() << 4)),
(long) (z + (chunk.getZ() << 4)) (long) (y + (i << 4)),
), block); (long) (z + (chunk.getZ() << 4))
), block);
}
} }
} }
} }