package com.zivilon.cindercore.mixins;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Dynamic;
import org.spongepowered.asm.mixin.Shadow;
import net.minecraft.network.play.server.S26PacketMapChunkBulk;

@Mixin(S26PacketMapChunkBulk.class)
public abstract class MixinS26PacketMapChunkBulk {

    @Shadow private int[] field_149266_a; // X Coordinates
    @Shadow private int[] field_149264_b; // Z Coordinates

    // I have no idea but these are needed to decode the packet
    @Shadow private int[] field_149265_c;
    @Shadow private int[] field_149262_d;
    @Shadow private byte[][] field_149260_f;

    @Dynamic // Get Chunk X coordinates in packet
    public int func_149255_a(int index) {
        return this.field_149266_a[index];
    }

    @Dynamic // Get Chunk Z coordinates in packet
    public int func_149253_b(int index) {
        return this.field_149264_b[index];
    }

    @Dynamic // Get length of coordinate array (i.e. get number of chunks)
    public int func_149254_d() {
        return this.field_149266_a.length;
    }

    // I have no idea but these are needed to decode the packet
    @Dynamic
    public byte[] func_149256_c(int p_149256_1_) {
        return this.field_149260_f[p_149256_1_];
    }
    @Dynamic
    public int[] func_149252_e() {
        return this.field_149265_c;
    }
    @Dynamic
    public int[] func_149257_f() {
        return this.field_149262_d;
    }

}