use of com.bluepowermod.part.gate.wireless.Frequency in project BluePower by Qmunity.
the class MessageWirelessSaveFreq method read.
@Override
public void read(DataInput buffer) throws IOException {
freq = new Frequency();
freq.readFromBuffer(buffer);
freq = (Frequency) WirelessManager.COMMON_INSTANCE.getFrequency(freq.getAccessibility(), freq.getFrequencyName(), freq.getOwner());
freq.setAccessibility(Accessibility.values()[buffer.readInt()]);
freq.setFrequency(buffer.readUTF());
}
use of com.bluepowermod.part.gate.wireless.Frequency in project BluePower by Qmunity.
the class MessageWirelessFrequencySync method read.
@Override
public void read(DataInput buffer) throws IOException {
int amt = buffer.readInt();
for (int i = 0; i < amt; i++) {
Frequency f = new Frequency();
f.readFromBuffer(buffer);
frequencies.add(f);
}
}
use of com.bluepowermod.part.gate.wireless.Frequency in project BluePower by Qmunity.
the class MessageWirelessNewFreq method handleServerSide.
@Override
public void handleServerSide(EntityPlayer player) {
Frequency freq = (Frequency) WirelessManager.COMMON_INSTANCE.registerFrequency(player, name, acc, bundled);
ITilePartHolder h = MultipartCompatibility.getPartHolder(player.worldObj, x, y, z);
if (h == null)
return;
IWirelessGate p = null;
for (IPart pa : h.getParts()) if (pa instanceof IWirelessGate && ((IWirelessGate) pa).getFace() == face)
p = (IWirelessGate) pa;
if (p == null)
return;
p.setFrequency(freq);
BPNetworkHandler.INSTANCE.sendTo(new MessageWirelessFrequencySync(player), (EntityPlayerMP) player);
}
Aggregations