Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void tweakThaumcraft() {
- if(Loader.isModLoaded("Thaumcraft")) {
- removeThaumcraftLoot();
- addThaumcraftLoot();
- addThaumcraftRecipes();
- }
- }
- private static void addThaumcraftRecipes() {
- ThaumcraftApi.addCrucibleRecipe("ALCHEMICALMANUFACTURE", new ItemStack(Items.lava_bucket)
- , new ItemStack(Items.bucket), (new AspectList()).merge(Aspect.FIRE, 64).add(Aspect.EARTH, 16).add(Aspect.ENTROPY, 16)
- );
- }
- private static void addThaumcraftLoot() {
- //Tweak "vanilla" TC loot
- ThaumcraftApi.addLootBagItem(new ItemStack(Items.diamond), 2, new int[] { 0 });
- ThaumcraftApi.addLootBagItem(new ItemStack(Items.diamond), 10, new int[] { 1, 2 });
- ThaumcraftApi.addLootBagItem(new ItemStack(Items.emerald), 5, new int[] { 0 });
- ThaumcraftApi.addLootBagItem(new ItemStack(Items.emerald), 15, new int[] { 1, 2 });
- ThaumcraftApi.addLootBagItem(new ItemStack(Items.gold_ingot), 20, new int[] { 0, 1, 2 });
- //Vanilla items
- ThaumcraftApi.addLootBagItem(new ItemStack(Items.quartz), 60, new int[] { 0, 1, 2 });
- ThaumcraftApi.addLootBagItem(new ItemStack(Items.quartz), 30, new int[] { 0, 1, 2 });
- ThaumcraftApi.addLootBagItem(new ItemStack(Items.glowstone_dust), 30, new int[] { 0, 1, 2 });
- ThaumcraftApi.addLootBagItem(new ItemStack(Items.redstone), 50, new int[] { 0, 1, 2 });
- ThaumcraftApi.addLootBagItem(new ItemStack(Items.dye, 1, 4), 40, new int[] { 0, 1, 2 });
- //TC items
- //Great wood sapling
- ItemStack lootItemStack = thaumcraft.api.ItemApi.getBlock("blockCustomPlant", 0);
- ThaumcraftApi.addLootBagItem(lootItemStack, 5, new int[] { 0 });
- ThaumcraftApi.addLootBagItem(lootItemStack, 10, new int[] { 1, 2 });
- //Silver wood sapling
- lootItemStack = thaumcraft.api.ItemApi.getBlock("blockCustomPlant", 1);
- ThaumcraftApi.addLootBagItem(lootItemStack, 2, new int[] { 0 });
- ThaumcraftApi.addLootBagItem(lootItemStack, 5, new int[] { 1, 2 });
- //Amber gem
- lootItemStack = thaumcraft.api.ItemApi.getItem("itemResource", 6);
- ThaumcraftApi.addLootBagItem(lootItemStack, 15, new int[] { 0, 1, 2 });
- //Quicksilver drop
- lootItemStack = thaumcraft.api.ItemApi.getItem("itemResource", 3);
- ThaumcraftApi.addLootBagItem(lootItemStack, 25, new int[] { 0, 1, 2 });
- //AE shit
- if(Loader.isModLoaded("appliedenergistics2")) {
- addAEShit();
- }
- }
- private static void addAEShit() {
- IMaterials aeMaterials = appeng.api.AEApi.instance().definitions().materials();
- ItemStack lootItemStack = aeMaterials.certusQuartzCrystal().maybeStack(1).get();
- if(lootItemStack != null) {
- ThaumcraftApi.addLootBagItem(lootItemStack, 60, new int[] { 0, 1, 2 });
- ThaumcraftApi.addLootBagItem(lootItemStack, 30, new int[] { 0, 1, 2 });
- }
- lootItemStack = aeMaterials.certusQuartzCrystalCharged().maybeStack(1).get();
- if(lootItemStack != null) {
- ThaumcraftApi.addLootBagItem(lootItemStack, 20, new int[] { 0, 1, 2 });
- }
- lootItemStack = aeMaterials.siliconPrint().maybeStack(1).get();
- if(lootItemStack != null) {
- ThaumcraftApi.addLootBagItem(lootItemStack, 20, new int[] { 0, 1, 2 });
- }
- lootItemStack = aeMaterials.siliconPress().maybeStack(1).get();
- if(lootItemStack != null) {
- ThaumcraftApi.addLootBagItem(lootItemStack, 2, new int[] { 1 });
- ThaumcraftApi.addLootBagItem(lootItemStack, 10, new int[] { 2 });
- }
- lootItemStack = aeMaterials.calcProcessorPress().maybeStack(1).get();
- if(lootItemStack != null) {
- ThaumcraftApi.addLootBagItem(lootItemStack, 2, new int[] { 1 });
- ThaumcraftApi.addLootBagItem(lootItemStack, 10, new int[] { 2 });
- }
- lootItemStack = aeMaterials.engProcessorPress().maybeStack(1).get();
- if(lootItemStack != null) {
- ThaumcraftApi.addLootBagItem(lootItemStack, 2, new int[] { 1 });
- ThaumcraftApi.addLootBagItem(lootItemStack, 10, new int[] { 2 });
- }
- lootItemStack = aeMaterials.logicProcessorPress().maybeStack(1).get();
- if(lootItemStack != null) {
- ThaumcraftApi.addLootBagItem(lootItemStack, 2, new int[] { 1 });
- ThaumcraftApi.addLootBagItem(lootItemStack, 10, new int[] { 2 });
- }
- }
- private static void removeThaumcraftLoot() {
- ArrayList<WeightedRandomLoot> currentBagList = WeightedRandomLoot.lootBagCommon;
- Item lootItem;
- for(int bagType = 0; bagType <= 2; bagType++) {
- if(bagType == 1) {
- currentBagList = WeightedRandomLoot.lootBagUncommon;
- } else if(bagType == 2) {
- currentBagList = WeightedRandomLoot.lootBagRare;
- }
- for(int lootIndex = 0; lootIndex < currentBagList.size(); lootIndex++) {
- lootItem = currentBagList.get(lootIndex).item.getItem();
- if(lootItem == Items.diamond
- || lootItem == Items.emerald
- || lootItem == Items.gold_ingot
- || lootItem == Items.emerald
- // || lootItem == new ItemStack(ConfigItems.itemResource, 1, 18).getItem()
- ) {
- if(bagType == 0) {
- WeightedRandomLoot.lootBagCommon.remove(lootIndex);
- } else if(bagType == 1) {
- WeightedRandomLoot.lootBagUncommon.remove(lootIndex);
- } else if(bagType == 2) {
- WeightedRandomLoot.lootBagRare.remove(lootIndex);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement