Search in sources :

Example 1 with ItemFilter

use of crazypants.enderio.base.filter.filters.ItemFilter in project EnderIO by SleepyTrousers.

the class PacketItemFilter method fromBytes.

@Override
public void fromBytes(ByteBuf buf) {
    super.fromBytes(buf);
    isSend = buf.readBoolean();
    NBTTagCompound tag = NetworkUtil.readNBTTagCompound(buf);
    filter = new ItemFilter(BasicFilterTypes.filterUpgradeAdvanced);
    filter.readFromNBT(tag);
}
Also used : IItemFilter(crazypants.enderio.base.filter.IItemFilter) ItemFilter(crazypants.enderio.base.filter.filters.ItemFilter) NBTTagCompound(net.minecraft.nbt.NBTTagCompound)

Example 2 with ItemFilter

use of crazypants.enderio.base.filter.filters.ItemFilter in project EnderIO by SleepyTrousers.

the class BasicItemFilterGui method updateButtons.

@Override
public void updateButtons() {
    super.updateButtons();
    ItemFilter activeFilter = filter;
    if (isAdvanced) {
        useNbtB.onGuiInit();
        useNbtB.setSelected(activeFilter.isMatchNBT());
        useOreDictB.onGuiInit();
        useOreDictB.setSelected(activeFilter.isUseOreDict());
        if (isStickyModeAvailable) {
            stickyB.onGuiInit();
            stickyB.setSelected(activeFilter.isSticky());
        }
        damageB.onGuiInit();
        damageB.setMode(DamageModeIconHolder.getFromMode(activeFilter.getDamageMode()));
    }
    useMetaB.onGuiInit();
    useMetaB.setSelected(activeFilter.isMatchMeta());
    if (!isLimited) {
        whiteListB.onGuiInit();
        if (activeFilter.isBlacklist()) {
            whiteListB.setIcon(IconEIO.FILTER_BLACKLIST);
            whiteListB.setToolTip(Lang.GUI_ITEM_FILTER_BLACKLIST.get());
        } else {
            whiteListB.setIcon(IconEIO.FILTER_WHITELIST);
            whiteListB.setToolTip(Lang.GUI_ITEM_FILTER_WHITELIST.get());
        }
    }
}
Also used : ItemFilter(crazypants.enderio.base.filter.filters.ItemFilter)

Example 3 with ItemFilter

use of crazypants.enderio.base.filter.filters.ItemFilter in project EnderIO by SleepyTrousers.

the class ItemBasicItemFilter method createFilterFromStack.

@Override
public IItemFilter createFilterFromStack(@Nonnull ItemStack stack) {
    ItemFilter filter = new ItemFilter(filterType);
    NBTTagCompound tag = NbtValue.FILTER.getTag(stack);
    // ^ Response to above - need to move filters to use @Store in conduits
    if (!tag.hasNoTags() || filterType == BasicFilterTypes.filterUpgradeBasic) {
        filter.readFromNBT(tag);
    }
    return filter;
}
Also used : IItemFilter(crazypants.enderio.base.filter.IItemFilter) ItemFilter(crazypants.enderio.base.filter.filters.ItemFilter) NBTTagCompound(net.minecraft.nbt.NBTTagCompound)

Aggregations

ItemFilter (crazypants.enderio.base.filter.filters.ItemFilter)3 IItemFilter (crazypants.enderio.base.filter.IItemFilter)2 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)2