use of com.bluepowermod.api.wireless.IWirelessDevice in project BluePower by Qmunity.
the class Frequency method writeToBuffer.
public void writeToBuffer(DataOutput buf) throws IOException {
buf.writeInt(accessibility.ordinal());
buf.writeUTF(owner.toString());
buf.writeUTF(ownerName.toString());
buf.writeUTF(frequency.toString());
buf.writeBoolean(isBundled());
int amt = 0;
for (IWirelessDevice d : WirelessManager.COMMON_INSTANCE.getDevices()) if (d.getFrequency() != null && d.getFrequency().equals(this))
amt++;
buf.writeInt(amt);
}
use of com.bluepowermod.api.wireless.IWirelessDevice in project BluePower by Qmunity.
the class GateTransceiver method propagate.
@Override
public Collection<Entry<IConnection<IRedstoneDevice>, Boolean>> propagate(ForgeDirection fromSide) {
List<Entry<IConnection<IRedstoneDevice>, Boolean>> l = new ArrayList<Entry<IConnection<IRedstoneDevice>, Boolean>>();
if (frequency == null)
return l;
l.add(new Pair<IConnection<IRedstoneDevice>, Boolean>(getRedstoneConnectionCache().getConnectionOnSide(fromSide), false));
for (IWirelessDevice d : WirelessManager.COMMON_INSTANCE.getDevices()) {
if (d != this && d.getFrequency() != null && d.getFrequency().equals(getFrequency())) {
if (d instanceof GateTransceiver) {
IConnection<IRedstoneDevice> c = ((GateTransceiver) d).getRedstoneConnectionCache().getConnectionOnSide(((GateTransceiver) d).front().getForgeDirection());
if (c != null)
l.add(new Pair<IConnection<IRedstoneDevice>, Boolean>(c, false));
}
}
}
return l;
}
use of com.bluepowermod.api.wireless.IWirelessDevice in project BluePower by Qmunity.
the class WirelessManager method unregisterFrequency.
@Override
public void unregisterFrequency(IFrequency frequency) {
frequencies.remove(frequency);
redstoneFrequencies.remove(frequency);
bundledFrequencies.remove(frequency);
for (IWirelessDevice d : devices) if (d.getFrequency() != null && d.getFrequency().equals(frequency))
d.setFrequency(null);
}
Aggregations