protected void writeSettingToNBT(NBTTagCompound nbtRoot) { NbtValue.FILTER_BLACKLIST.setBoolean(nbtRoot, blacklist); NbtValue.FILTER_META.setBoolean(nbtRoot, matchMeta); NbtValue.FILTER_NBT.setBoolean(nbtRoot, matchNBT); NbtValue.FILTER_OREDICT.setBoolean(nbtRoot, useOreDict); NbtValue.FILTER_STICKY.setBoolean(nbtRoot, sticky); }
public static void setActive(@Nonnull ItemStack item, boolean active) { MAGNET_ACTIVE.setBoolean(item, active); }
public @Nullable NBTTagCompound setBooleanCopy(@Nullable NBTTagCompound tag, boolean value) { return tag != null ? setBoolean(tag.copy(), value) : null; }
public @Nonnull ItemStack setBooleanCopy(@Nonnull ItemStack stack, boolean value) { return setBoolean(stack.copy(), value); }
@Override public void writeToNBT(@Nonnull NBTTagCompound nbtRoot) { NbtValue.FILTER_BLACKLIST.setBoolean(nbtRoot, isBlacklist); NbtValue.FILTER_META.setBoolean(nbtRoot, matchMeta); NbtValue.FILTER_NBT.setBoolean(nbtRoot, matchNBT); NbtValue.FILTER_OREDICT.setBoolean(nbtRoot, useOreDict); NbtValue.FILTER_STICKY.setBoolean(nbtRoot, sticky); NbtValue.FILTER_ADVANCED.setBoolean(nbtRoot, isAdvanced); NbtValue.FILTER_LIMITED.setBoolean(nbtRoot, isLimited); NbtValue.FILTER_BIG.setBoolean(nbtRoot, isBig); NbtValue.FILTER_DAMAGE.setInt(nbtRoot, damageMode.ordinal()); NBTTagList tagList = new NBTTagList(); items.apply(new Callback<ItemStack>() { @Override public void apply(@Nonnull ItemStack item) { NBTTagCompound itemTag = new NBTTagCompound(); if (Prep.isValid(item)) { item.writeToNBT(itemTag); tagList.appendTag(itemTag); } } }); nbtRoot.setTag("items", tagList); }
@Override public @Nonnull ActionResult<ItemStack> onItemRightClick(@Nonnull World worldIn, @Nonnull EntityPlayer playerIn, @Nonnull EnumHand handIn) { final ItemStack stack = playerIn.getHeldItem(handIn); if (EnergyUpgradeManager.loadFromItem(stack) != null) { if (!worldIn.isRemote) { NbtValue.ENABLED.setBoolean(stack, !NbtValue.ENABLED.getBoolean(stack)); playerIn.sendStatusMessage((NbtValue.ENABLED.getBoolean(stack) ? Lang.INVCHARGER_ENABLED : Lang.INVCHARGER_DISABLED).toChatServer(), true); } return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack); } return super.onItemRightClick(worldIn, playerIn, handIn); }
@Override public void writeToNBT(@Nonnull NBTTagCompound nbtRoot) { NbtValue.FILTER_BLACKLIST.setBoolean(nbtRoot, isBlacklist); NBTTagList fluidList = new NBTTagList(); int index = 0; for (FluidStack f : fluids) { NBTTagCompound fRoot = new NBTTagCompound(); if (f != null) { fRoot.setInteger("index", index); f.writeToNBT(fRoot); fluidList.appendTag(fRoot); } index++; } nbtRoot.setTag("fluids", fluidList); }
NbtValue.FAKE.setBoolean(stack, true);