@@ -0,0 +1,1557 @@
+package info.u_team.u_team_test.global_loot_modifier;%0A%0Aimport java.util.List;%0Aimport java.util.stream.Collectors;%0A%0Aimport com.google.gson.JsonObject;%0A%0Aimport net.minecraft.inventory.Inventory;%0Aimport net.minecraft.item.ItemStack;%0Aimport net.minecraft.item.crafting.*;%0Aimport net.minecraft.util.ResourceLocation;%0Aimport net.minecraft.world.storage.loot.LootContext;%0Aimport net.minecraft.world.storage.loot.conditions.ILootCondition;%0Aimport net.minecraftforge.common.loot.*;%0Aimport net.minecraftforge.items.ItemHandlerHelper;%0A%0Apublic class AutoSmeltLootModifier extends LootModifier %7B%0A%09%0A%09private AutoSmeltLootModifier(ILootCondition%5B%5D conditions) %7B%0A%09%09super(conditions);%0A%09%7D%0A%09%0A%09@Override%0A%09protected List%3CItemStack%3E doApply(List%3CItemStack%3E generatedLoot, LootContext context) %7B%0A%09%09return generatedLoot.stream().map(stack -%3E smeltItem(stack, context)).collect(Collectors.toList());%0A%09%7D%0A%09%0A%09private static ItemStack smeltItem(ItemStack stack, LootContext context) %7B%0A%09%09return context.getWorld().getRecipeManager().getRecipe(IRecipeType.SMELTING, new Inventory(stack), context.getWorld()).map(FurnaceRecipe::getRecipeOutput).filter(itemStack -%3E !itemStack.isEmpty()).map(itemStack -%3E ItemHandlerHelper.copyStackWithSize(itemStack, stack.getCount() * itemStack.getCount())).orElse(stack);%0A%09%7D%0A%09%0A%09public static class Serializer extends GlobalLootModifierSerializer%3CAutoSmeltLootModifier%3E %7B%0A%09%09%0A%09%09@Override%0A%09%09public AutoSmeltLootModifier read(ResourceLocation name, JsonObject json, ILootCondition%5B%5D conditions) %7B%0A%09%09%09return new AutoSmeltLootModifier(conditions);%0A%09%09%7D%0A%09%7D%0A%09%0A%7D%0A

Add auto smelt loot modifier