net.minecraft.world.biome.source.BiomeArray Java Examples

The following examples show how to use net.minecraft.world.biome.source.BiomeArray. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MixinClientChunkManager.java    From multiconnect with MIT License 6 votes vote down vote up
@Inject(method = "loadChunkFromPacket", at = @At("RETURN"))
private void onLoadChunkFromPacket(int x, int z, BiomeArray biomes, PacketByteBuf buf, CompoundTag heightmaps, int verticalStripBitmask, boolean bl, CallbackInfoReturnable<WorldChunk> ci) {
    if (ConnectionInfo.protocolVersion <= Protocols.V1_12_2) {
        if (ci.getReturnValue() != null) {
            synchronized (LOCK) {
                UpgradeData upgradeData = ChunkUpgrader.fixChunk(ci.getReturnValue());
                ((IUpgradableChunk) ci.getReturnValue()).multiconnect_setClientUpgradeData(upgradeData);
                for (int dx = -1; dx <= 1; dx++) {
                    for (int dz = -1; dz <= 1; dz++) {
                        WorldChunk chunk = getChunk(x + dx, z + dz, ChunkStatus.FULL, false);
                        if (chunk != null)
                            ((IUpgradableChunk) chunk).multiconnect_onNeighborLoaded();
                    }
                }
            }
        }
    }
}
 
Example #2
Source File: MixinClientChunkManager.java    From multiconnect with MIT License 5 votes vote down vote up
@Inject(method = "loadChunkFromPacket", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/chunk/WorldChunk;getSectionArray()[Lnet/minecraft/world/chunk/ChunkSection;"))
private void recalculateHeightmaps(int x, int z, BiomeArray biomeArray, PacketByteBuf buf, CompoundTag tag, int verticalStripMask, boolean bl, CallbackInfoReturnable<WorldChunk> ci) {
    if (ConnectionInfo.protocolVersion <= Protocols.V1_13_2) {
        WorldChunk chunk = this.chunk.get();
        for (ChunkSection section : chunk.getSectionArray()) {
            if (section != null) {
                section.calculateCounts();
            }
        }
        Heightmap.populateHeightmaps(chunk, CLIENT_HEIGHTMAPS);
    }
    this.chunk.set(null);
}
 
Example #3
Source File: MixinClientChunkManager.java    From multiconnect with MIT License 5 votes vote down vote up
@Inject(method = "loadChunkFromPacket", at = @At("RETURN"))
private void onLoadChunkFromPacket(int x, int z, BiomeArray biomeArray, PacketByteBuf buf, CompoundTag heightmaps, int verticalStripMask, boolean bl, CallbackInfoReturnable<WorldChunk> ci) {
    if (ConnectionInfo.protocolVersion <= Protocols.V1_14_4) {
        if (ci.getReturnValue() != null) {
            Biome[] biomeData = PendingBiomeData.getPendingBiomeData(x, z);
            if (biomeData != null) {
                ((IBiomeStorage_1_14_4) ci.getReturnValue()).multiconnect_setBiomeArray_1_14_4(biomeData);
                PendingBiomeData.setPendingBiomeData(x, z, null);
            }
        }
    }
}
 
Example #4
Source File: MixinClientChunkManager.java    From multiconnect with MIT License 4 votes vote down vote up
@Inject(method = "loadChunkFromPacket", at = @At(value = "INVOKE", target = "Lorg/apache/logging/log4j/Logger;warn(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V", ordinal = 0, remap = false), cancellable = true)
private void cancelErrorMessage(int x, int z, BiomeArray biomeArray, PacketByteBuf buf, CompoundTag tag, int verticalStripMask, boolean bl, CallbackInfoReturnable<WorldChunk> ci) {
    if (ConnectionInfo.protocolVersion <= Protocols.V1_13_2 && !PendingChunkDataPackets.isProcessingQueuedPackets())
        ci.setReturnValue(null);
}