Search in sources :

Example 1 with Filter

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));
}
Also used : Filter(mcjty.rftoolsdim.config.Filter) IFilterBuilder(mcjty.rftoolsdim.api.dimlet.IFilterBuilder) ISettingsBuilder(mcjty.rftoolsdim.api.dimlet.ISettingsBuilder) Settings(mcjty.rftoolsdim.config.Settings)

Example 2 with Filter

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);
}
Also used : Filter(mcjty.rftoolsdim.config.Filter) Settings(mcjty.rftoolsdim.config.Settings)

Example 3 with Filter

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));
    }
}
Also used : Filter(mcjty.rftoolsdim.config.Filter) Settings(mcjty.rftoolsdim.config.Settings)

Aggregations

Filter (mcjty.rftoolsdim.config.Filter)3 Settings (mcjty.rftoolsdim.config.Settings)3 IFilterBuilder (mcjty.rftoolsdim.api.dimlet.IFilterBuilder)1 ISettingsBuilder (mcjty.rftoolsdim.api.dimlet.ISettingsBuilder)1