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);
}
Aggregations