3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-12-25 15:50:12 +01:00

Update VV usage

Dieser Commit ist enthalten in:
KennyTV 2021-05-20 18:34:05 +02:00
Ursprung 0e15a98472
Commit 1201c2979b
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B
3 geänderte Dateien mit 14 neuen und 10 gelöschten Zeilen

Datei anzeigen

@ -28,6 +28,8 @@ import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.minecraft.Environment; import com.viaversion.viaversion.api.minecraft.Environment;
import com.viaversion.viaversion.api.minecraft.chunks.Chunk; import com.viaversion.viaversion.api.minecraft.chunks.Chunk;
import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection; import com.viaversion.viaversion.api.minecraft.chunks.ChunkSection;
import com.viaversion.viaversion.api.minecraft.chunks.ChunkSectionLight;
import com.viaversion.viaversion.api.minecraft.chunks.ChunkSectionLightImpl;
import com.viaversion.viaversion.api.minecraft.entities.Entity1_14Types; import com.viaversion.viaversion.api.minecraft.entities.Entity1_14Types;
import com.viaversion.viaversion.api.minecraft.entities.EntityType; import com.viaversion.viaversion.api.minecraft.entities.EntityType;
import com.viaversion.viaversion.api.minecraft.item.Item; import com.viaversion.viaversion.api.minecraft.item.Item;
@ -439,27 +441,29 @@ public class BlockItemPackets1_14 extends com.viaversion.viabackwards.api.rewrit
ChunkSection section = chunk.getSections()[i]; ChunkSection section = chunk.getSections()[i];
if (section == null) continue; if (section == null) continue;
ChunkSectionLight sectionLight = new ChunkSectionLightImpl();
section.setLight(sectionLight);
if (chunkLight == null) { if (chunkLight == null) {
section.setBlockLight(ChunkLightStorage.FULL_LIGHT); sectionLight.setBlockLight(ChunkLightStorage.FULL_LIGHT);
if (clientWorld.getEnvironment() == Environment.NORMAL) { if (clientWorld.getEnvironment() == Environment.NORMAL) {
section.setSkyLight(ChunkLightStorage.FULL_LIGHT); sectionLight.setSkyLight(ChunkLightStorage.FULL_LIGHT);
} }
} else { } else {
final byte[] blockLight = chunkLight.getBlockLight()[i]; byte[] blockLight = chunkLight.getBlockLight()[i];
section.setBlockLight(blockLight != null ? blockLight : ChunkLightStorage.FULL_LIGHT); sectionLight.setBlockLight(blockLight != null ? blockLight : ChunkLightStorage.FULL_LIGHT);
if (clientWorld.getEnvironment() == Environment.NORMAL) { if (clientWorld.getEnvironment() == Environment.NORMAL) {
final byte[] skyLight = chunkLight.getSkyLight()[i]; byte[] skyLight = chunkLight.getSkyLight()[i];
section.setSkyLight(skyLight != null ? skyLight : ChunkLightStorage.FULL_LIGHT); sectionLight.setSkyLight(skyLight != null ? skyLight : ChunkLightStorage.FULL_LIGHT);
} }
} }
if (Via.getConfig().isNonFullBlockLightFix() && section.getNonAirBlocksCount() != 0 && section.hasBlockLight()) { if (Via.getConfig().isNonFullBlockLightFix() && section.getNonAirBlocksCount() != 0 && sectionLight.hasBlockLight()) {
for (int x = 0; x < 16; x++) { for (int x = 0; x < 16; x++) {
for (int y = 0; y < 16; y++) { for (int y = 0; y < 16; y++) {
for (int z = 0; z < 16; z++) { for (int z = 0; z < 16; z++) {
int id = section.getFlatBlock(x, y, z); int id = section.getFlatBlock(x, y, z);
if (Protocol1_14To1_13_2.MAPPINGS.getNonFullBlocks().contains(id)) { if (Protocol1_14To1_13_2.MAPPINGS.getNonFullBlocks().contains(id)) {
section.getBlockLightNibbleArray().set(x, y, z, 0); sectionLight.getBlockLightNibbleArray().set(x, y, z, 0);
} }
} }
} }

Datei anzeigen

@ -137,7 +137,7 @@ public class Protocol1_16_4To1_17 extends BackwardsProtocol<ClientboundPackets1_
} }
}); });
new StatisticsRewriter(this, null).register(ClientboundPackets1_17.STATISTICS); new StatisticsRewriter(this, entityPackets::getOldEntityId).register(ClientboundPackets1_17.STATISTICS);
registerClientbound(ClientboundPackets1_17.RESOURCE_PACK, new PacketRemapper() { registerClientbound(ClientboundPackets1_17.RESOURCE_PACK, new PacketRemapper() {
@Override @Override

Datei anzeigen

@ -3,7 +3,7 @@ metadata.format.version = "1.0"
[versions] [versions]
# ViaVersion # ViaVersion
viaver = "4.0.0-21w19a-SNAPSHOT" viaver = "4.0.0-21w20a-SNAPSHOT"
# Common provided # Common provided
netty = "4.0.20.Final" netty = "4.0.20.Final"