public void addNotImportantToTable(LootTable table) { List<LootEntry> entrs = new ArrayList<>(); for (PapyrusData p : getPapyruses()) { if (!p.isImportant()) { NBTTagCompound tag = new NBTTagCompound(); tag.setString("papyrus_id", p.getPapyrusId()); entrs.add(new LootEntryItem(ItemRegistry.papyrus, 1, 1, new LootFunction[]{new SetNBT(new LootCondition[]{}, tag)}, new LootCondition[]{}, p.getPapyrusId())); } } table.addPool(new LootPool(entrs.toArray(new LootEntry[]{}), new LootCondition[]{}, new RandomValueRange(0, 1), new RandomValueRange(0), "papyruses")); }
public static SetNBT createSetNBT(NBTTagCompound nbt) { return new SetNBT(NO_CONDITIONS, nbt); }
private @Nonnull SetNBT setNBT(ItemStack stack) { return new SetNBT(NO_CONDITIONS, NullHelper.first(stack.getTagCompound(), new NBTTagCompound())); }