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