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