Search in sources :

Example 1 with LootParameterSet

use of net.minecraft.loot.LootParameterSet in project VariousOddities by Lyinginbedmon.

the class VOLootProvider method addLootTable.

private void addLootTable(String location, LootTable.Builder lootTable, LootParameterSet lootParameterSet) {
    if (location.startsWith("inject/")) {
        String actualLocation = location.replace("inject/", "");
        Preconditions.checkArgument(existingFileHelper.exists(new ResourceLocation("loot_tables/" + actualLocation + ".json"), ResourcePackType.SERVER_DATA), "Loot table %s does not exist in any known data pack", actualLocation);
    }
    tables.add(Pair.of(() -> lootBuilder -> lootBuilder.accept(new ResourceLocation(Reference.ModInfo.MOD_ID, location), lootTable), lootParameterSet));
}
Also used : TableLootEntry(net.minecraft.loot.TableLootEntry) LootTable(net.minecraft.loot.LootTable) StandaloneLootEntry(net.minecraft.loot.StandaloneLootEntry) ValidationTracker(net.minecraft.loot.ValidationTracker) Item(net.minecraft.item.Item) Supplier(java.util.function.Supplier) LootTableManager(net.minecraft.loot.LootTableManager) ArrayList(java.util.ArrayList) ResourcePackType(net.minecraft.resources.ResourcePackType) Map(java.util.Map) BiConsumer(java.util.function.BiConsumer) LootParameterSet(net.minecraft.loot.LootParameterSet) DataGenerator(net.minecraft.data.DataGenerator) VOLootTables(com.lying.variousoddities.init.VOLootTables) LootTableProvider(net.minecraft.data.LootTableProvider) LootParameterSets(net.minecraft.loot.LootParameterSets) SetCount(net.minecraft.loot.functions.SetCount) VOItems(com.lying.variousoddities.init.VOItems) ConstantRange(net.minecraft.loot.ConstantRange) Reference(com.lying.variousoddities.reference.Reference) ItemLootEntry(net.minecraft.loot.ItemLootEntry) Items(net.minecraft.item.Items) ExistingFileHelper(net.minecraftforge.common.data.ExistingFileHelper) Pair(com.mojang.datafixers.util.Pair) Consumer(java.util.function.Consumer) List(java.util.List) RandomValueRange(net.minecraft.loot.RandomValueRange) LootPool(net.minecraft.loot.LootPool) ResourceLocation(net.minecraft.util.ResourceLocation) Preconditions(com.google.common.base.Preconditions) LootEntry(net.minecraft.loot.LootEntry) ResourceLocation(net.minecraft.util.ResourceLocation)

Aggregations

Preconditions (com.google.common.base.Preconditions)1 VOItems (com.lying.variousoddities.init.VOItems)1 VOLootTables (com.lying.variousoddities.init.VOLootTables)1 Reference (com.lying.variousoddities.reference.Reference)1 Pair (com.mojang.datafixers.util.Pair)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Map (java.util.Map)1 BiConsumer (java.util.function.BiConsumer)1 Consumer (java.util.function.Consumer)1 Supplier (java.util.function.Supplier)1 DataGenerator (net.minecraft.data.DataGenerator)1 LootTableProvider (net.minecraft.data.LootTableProvider)1 Item (net.minecraft.item.Item)1 Items (net.minecraft.item.Items)1 ConstantRange (net.minecraft.loot.ConstantRange)1 ItemLootEntry (net.minecraft.loot.ItemLootEntry)1 LootEntry (net.minecraft.loot.LootEntry)1 LootParameterSet (net.minecraft.loot.LootParameterSet)1 LootParameterSets (net.minecraft.loot.LootParameterSets)1