Search in sources :

Example 1 with IWirelessGate

use of com.bluepowermod.part.gate.wireless.IWirelessGate 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);
}
Also used : ITilePartHolder(uk.co.qmunity.lib.part.ITilePartHolder) IPart(uk.co.qmunity.lib.part.IPart) IWirelessGate(com.bluepowermod.part.gate.wireless.IWirelessGate) Frequency(com.bluepowermod.part.gate.wireless.Frequency)

Aggregations

Frequency (com.bluepowermod.part.gate.wireless.Frequency)1 IWirelessGate (com.bluepowermod.part.gate.wireless.IWirelessGate)1 IPart (uk.co.qmunity.lib.part.IPart)1 ITilePartHolder (uk.co.qmunity.lib.part.ITilePartHolder)1