Java 类net.minecraft.world.storage.loot.functions.SetNBT 实例源码

项目:PurificatiMagicae    文件:PapyrusRegistry.java   
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"));
}
项目:BetterBeginningsReborn    文件:LootUtil.java   
public static SetNBT createSetNBT(NBTTagCompound nbt)
   {
return new SetNBT(NO_CONDITIONS, nbt);
   }
项目:EnderIO    文件:LootManager.java   
private @Nonnull SetNBT setNBT(ItemStack stack) {
  return new SetNBT(NO_CONDITIONS, NullHelper.first(stack.getTagCompound(), new NBTTagCompound()));
}