use of mcjty.rftoolsdim.config.Filter in project RFToolsDimensions by McJty.
the class DimletConfigurationManager method addRule.
@Override
public void addRule(IFilterBuilder filterBuilder, ISettingsBuilder settingsBuilder) {
Filter filter = ((Filter.Builder) filterBuilder).build();
Settings settings = ((Settings.Builder) settingsBuilder).build();
rules.add(Pair.of(filter, settings));
}
use of mcjty.rftoolsdim.config.Filter in project RFToolsDimensions by McJty.
the class PacketSyncRules method toBytes.
@Override
public void toBytes(ByteBuf buf) {
buf.writeInt(rules.size());
for (Pair<Filter, Settings> rule : rules) {
Filter filter = rule.getLeft();
Settings settings = rule.getRight();
filter.toBytes(buf);
settings.toBytes(buf);
}
Logging.log("Rules packet size: " + buf.writerIndex() + " of " + buf.array().length);
}
use of mcjty.rftoolsdim.config.Filter in project RFToolsDimensions by McJty.
the class PacketSyncRules method fromBytes.
@Override
public void fromBytes(ByteBuf buf) {
int size = buf.readInt();
rules = new ArrayList<>(size);
for (int i = 0; i < size; i++) {
Filter filter = new Filter(buf);
Settings settings = new Settings(buf);
rules.add(Pair.of(filter, settings));
}
}
Aggregations