Search in sources :

Example 1 with ParentedLootEntry

use of net.minecraft.loot.ParentedLootEntry in project Mekanism by mekanism.

the class LootTableModifierReloadListener method modifyEntry.

private static boolean modifyEntry(LootEntry entry, ITag<Item> shearsTag) {
    boolean modified = false;
    if (entry instanceof ParentedLootEntry) {
        // If the entry is a parented loot entry, check if any of the child entries need their conditions modified
        for (LootEntry child : PARENTED_LOOT_ENTRY_CHILDREN.getValue((ParentedLootEntry) entry)) {
            modified |= modifyEntry(child, shearsTag);
        }
    }
    // Check if the entry has any conditions that need modifying. This will happen for all entry types including parented ones
    modified |= modifyConditions(LOOT_ENTRY_CONDITIONS.getValue(entry), shearsTag);
    // in a different way but there isn't much that can be done about that
    return modified;
}
Also used : ParentedLootEntry(net.minecraft.loot.ParentedLootEntry) ParentedLootEntry(net.minecraft.loot.ParentedLootEntry) LootEntry(net.minecraft.loot.LootEntry)

Aggregations

LootEntry (net.minecraft.loot.LootEntry)1 ParentedLootEntry (net.minecraft.loot.ParentedLootEntry)1