Search in sources :

Example 1 with BPPartFaceRotate

use of com.bluepowermod.part.BPPartFaceRotate in project BluePower by Qmunity.

the class GateNullCell method writeUpdateData.

@Override
public void writeUpdateData(DataOutput buffer, int channel) throws IOException {
    super.writeUpdateData(buffer, channel);
    if (channel == -1) {
        buffer.writeBoolean(typeA != null);
        if (typeA != null) {
            buffer.writeInt(typeA.ordinal());
            buffer.writeBoolean(bundledA);
        }
        buffer.writeBoolean(typeB != null);
        if (typeB != null) {
            buffer.writeInt(typeB.ordinal());
            buffer.writeBoolean(bundledB);
        }
    }
    if (channel == 1 || channel == -1) {
        buffer.writeByte(powerA);
    }
    if (channel == 2 || channel == -1) {
        buffer.writeByte(powerB);
    }
    if (channel == 3 || channel == -1) {
        for (ForgeDirection d : ForgeDirection.VALID_DIRECTIONS) {
            IConnection<IRedstoneDevice> c = redstoneConnections.getConnectionOnSide(d);
            buffer.writeBoolean(c != null && c.getB() instanceof GateNullCell && (getType(d) == 1 || ((BPPartFaceRotate) c.getB()).getRotation() % 2 == getRotation() % 2));
        }
    }
}
Also used : BPPartFaceRotate(com.bluepowermod.part.BPPartFaceRotate) ForgeDirection(net.minecraftforge.common.util.ForgeDirection) IRedstoneDevice(com.bluepowermod.api.wire.redstone.IRedstoneDevice)

Aggregations

IRedstoneDevice (com.bluepowermod.api.wire.redstone.IRedstoneDevice)1 BPPartFaceRotate (com.bluepowermod.part.BPPartFaceRotate)1 ForgeDirection (net.minecraftforge.common.util.ForgeDirection)1