Search in sources :

Example 6 with IIntegratedCircuitPart

use of com.bluepowermod.api.gate.IIntegratedCircuitPart in project BluePower by Qmunity.

the class GateIntegratedCircuit method readUpdateData.

@Override
public void readUpdateData(DataInput buffer, int channel) throws IOException {
    super.readUpdateData(buffer, channel);
    getWorld().markBlockRangeForRenderUpdate(getX(), getY(), getZ(), getX(), getY(), getZ());
    if (channel < 10)
        return;
    int c = channel - 10;
    int x = c % getSize();
    int z = (c - x) / getSize();
    if (!buffer.readBoolean())
        return;
    String type = buffer.readUTF();
    IPart p = getPart(x, z);
    if (p == null)
        setPart(x, z, (IIntegratedCircuitPart) (p = PartRegistry.createPart(type, true)));
    if (p == null) {
        // buffer.skipBytes(buffer.readInt());
        return;
    }
    updateChannel = buffer.readInt();
    // byte[] data = new byte[buffer.readInt()];
    // buffer.readFully(data, 0, data.length);
    // ByteArrayInputStream bais = new ByteArrayInputStream(data, 0, data.length);
    // DataInputStream buf = new DataInputStream(bais);
    p.readUpdateData(buffer, updateChannel);
}
Also used : IPart(uk.co.qmunity.lib.part.IPart) IIntegratedCircuitPart(com.bluepowermod.api.gate.IIntegratedCircuitPart)

Aggregations

IIntegratedCircuitPart (com.bluepowermod.api.gate.IIntegratedCircuitPart)6 IPart (uk.co.qmunity.lib.part.IPart)3 IGateComponent (com.bluepowermod.api.gate.IGateComponent)1 ItemPart (com.bluepowermod.item.ItemPart)1 SideOnly (cpw.mods.fml.relauncher.SideOnly)1 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)1 IIcon (net.minecraft.util.IIcon)1 IPartTicking (uk.co.qmunity.lib.part.IPartTicking)1 Rotation (uk.co.qmunity.lib.transform.Rotation)1 Scale (uk.co.qmunity.lib.transform.Scale)1 Translation (uk.co.qmunity.lib.transform.Translation)1 Vec2d (uk.co.qmunity.lib.vec.Vec2d)1 Vec3dCube (uk.co.qmunity.lib.vec.Vec3dCube)1