Search in sources :

Example 1 with IFrequency

use of com.bluepowermod.api.wireless.IFrequency in project BluePower by Qmunity.

the class GuiGateWireless method getFrequencies.

private List<Frequency> getFrequencies() {
    List<Frequency> frequencies = new ArrayList<Frequency>();
    for (IFrequency f : WirelessManager.CLIENT_INSTANCE.getFrequencies()) {
        if (f.getAccessibility().ordinal() == filterAccessLevel.value || filterAccessLevel.value == 3 || filterAccessLevel.value == 4)
            if (f.getFrequencyName().toLowerCase().contains(filter.toLowerCase()))
                frequencies.add((Frequency) f);
    }
    Collections.sort(frequencies, new FrequencySorter(this));
    return frequencies;
}
Also used : IFrequency(com.bluepowermod.api.wireless.IFrequency) ArrayList(java.util.ArrayList) Frequency(com.bluepowermod.part.gate.wireless.Frequency) IFrequency(com.bluepowermod.api.wireless.IFrequency)

Example 2 with IFrequency

use of com.bluepowermod.api.wireless.IFrequency in project BluePower by Qmunity.

the class MessageWirelessFrequencySync method write.

@Override
public void write(DataOutput buffer) throws IOException {
    List<IFrequency> frequencies = null;
    if (player == null || player.capabilities.isCreativeMode) {
        frequencies = WirelessManager.COMMON_INSTANCE.getFrequencies();
    } else {
        frequencies = new ArrayList<IFrequency>();
        frequencies.addAll(WirelessManager.COMMON_INSTANCE.getAvailableRedstoneFrequencies(player));
        frequencies.addAll(WirelessManager.COMMON_INSTANCE.getAvailableBundledFrequencies(player));
    }
    buffer.writeInt(frequencies.size());
    for (IFrequency f : frequencies) ((Frequency) f).writeToBuffer(buffer);
}
Also used : IFrequency(com.bluepowermod.api.wireless.IFrequency)

Aggregations

IFrequency (com.bluepowermod.api.wireless.IFrequency)2 Frequency (com.bluepowermod.part.gate.wireless.Frequency)1 ArrayList (java.util.ArrayList)1