package ellpeck.actuallyadditions.recipe; import ellpeck.actuallyadditions.blocks.InitBlocks; import ellpeck.actuallyadditions.items.InitItems; import ellpeck.actuallyadditions.items.metalists.TheJams; import ellpeck.actuallyadditions.items.metalists.TheSpecialDrops; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.util.WeightedRandom; import java.util.ArrayList; public class TreasureChestHandler{ public static ArrayList returns = new ArrayList(); public static void init(){ addReturn(new ItemStack(Items.diamond), 5, 1, 2); addReturn(new ItemStack(Items.iron_ingot), 30, 1, 5); addReturn(new ItemStack(Items.gold_nugget), 60, 1, 8); addReturn(new ItemStack(Items.gold_ingot), 35, 1, 3); addReturn(new ItemStack(Items.ender_pearl), 10, 1, 2); addReturn(new ItemStack(Items.emerald), 3, 1, 1); addReturn(new ItemStack(Items.experience_bottle), 5, 3, 6); addReturn(new ItemStack(InitItems.itemSpecialDrop, 1, TheSpecialDrops.SOLIDIFIED_EXPERIENCE.ordinal()), 15, 3, 6); addReturn(new ItemStack(Items.record_11), 2, 1, 1); addReturn(new ItemStack(Items.record_13), 2, 1, 1); addReturn(new ItemStack(Items.record_blocks), 2, 1, 1); addReturn(new ItemStack(Items.record_cat), 2, 1, 1); addReturn(new ItemStack(Items.record_chirp), 2, 1, 1); addReturn(new ItemStack(Items.record_far), 2, 1, 1); addReturn(new ItemStack(Items.record_mall), 2, 1, 1); addReturn(new ItemStack(Items.record_mellohi), 2, 1, 1); addReturn(new ItemStack(Items.record_stal), 2, 1, 1); addReturn(new ItemStack(Items.record_strad), 2, 1, 1); addReturn(new ItemStack(Items.record_ward), 2, 1, 1); addReturn(new ItemStack(Items.record_wait), 2, 1, 1); addReturn(new ItemStack(Items.saddle), 5, 1, 1); addReturn(new ItemStack(Items.name_tag), 20, 1, 2); addReturn(new ItemStack(InitItems.itemJams, 1, TheJams.CU_BA_RA.ordinal()), 10, 1, 2); addReturn(new ItemStack(InitItems.itemJams, 1, TheJams.GRA_KI_BA.ordinal()), 10, 1, 2); addReturn(new ItemStack(InitItems.itemJams, 1, TheJams.PL_AP_LE.ordinal()), 10, 1, 2); addReturn(new ItemStack(InitItems.itemJams, 1, TheJams.CH_AP_CI.ordinal()), 10, 1, 2); addReturn(new ItemStack(InitItems.itemJams, 1, TheJams.HO_ME_KI.ordinal()), 10, 1, 2); addReturn(new ItemStack(InitItems.itemJams, 1, TheJams.PI_CO.ordinal()), 10, 1, 2); addReturn(new ItemStack(Items.fish), 80, 1, 3); addReturn(new ItemStack(Items.fish, 1, 1), 60, 1, 3); addReturn(new ItemStack(Items.fish, 1, 2), 10, 1, 1); addReturn(new ItemStack(Items.fish, 1, 3), 40, 1, 2); } public static void addReturn(ItemStack stack, int chance, int minAmount, int maxAmount){ returns.add(new Return(stack, chance, minAmount, maxAmount)); } public static class Return extends WeightedRandom.Item{ public ItemStack returnItem; public ItemStack input; public int minAmount; public int maxAmount; public Return(ItemStack returnItem, int chance, int minAmount, int maxAmount){ super(chance); this.returnItem = returnItem; this.input = new ItemStack(InitBlocks.blockTreasureChest); this.minAmount = minAmount; this.maxAmount = maxAmount; } } }