Advertisement
Guest User

Untitled

a guest
Dec 17th, 2015
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.20 KB | None | 0 0
  1. public static void tweakThaumcraft() {
  2. if(Loader.isModLoaded("Thaumcraft")) {
  3. removeThaumcraftLoot();
  4. addThaumcraftLoot();
  5. addThaumcraftRecipes();
  6. }
  7. }
  8.  
  9. private static void addThaumcraftRecipes() {
  10. ThaumcraftApi.addCrucibleRecipe("ALCHEMICALMANUFACTURE", new ItemStack(Items.lava_bucket)
  11. , new ItemStack(Items.bucket), (new AspectList()).merge(Aspect.FIRE, 64).add(Aspect.EARTH, 16).add(Aspect.ENTROPY, 16)
  12. );
  13. }
  14.  
  15. private static void addThaumcraftLoot() {
  16.  
  17. //Tweak "vanilla" TC loot
  18. ThaumcraftApi.addLootBagItem(new ItemStack(Items.diamond), 2, new int[] { 0 });
  19. ThaumcraftApi.addLootBagItem(new ItemStack(Items.diamond), 10, new int[] { 1, 2 });
  20. ThaumcraftApi.addLootBagItem(new ItemStack(Items.emerald), 5, new int[] { 0 });
  21. ThaumcraftApi.addLootBagItem(new ItemStack(Items.emerald), 15, new int[] { 1, 2 });
  22. ThaumcraftApi.addLootBagItem(new ItemStack(Items.gold_ingot), 20, new int[] { 0, 1, 2 });
  23.  
  24. //Vanilla items
  25. ThaumcraftApi.addLootBagItem(new ItemStack(Items.quartz), 60, new int[] { 0, 1, 2 });
  26. ThaumcraftApi.addLootBagItem(new ItemStack(Items.quartz), 30, new int[] { 0, 1, 2 });
  27. ThaumcraftApi.addLootBagItem(new ItemStack(Items.glowstone_dust), 30, new int[] { 0, 1, 2 });
  28. ThaumcraftApi.addLootBagItem(new ItemStack(Items.redstone), 50, new int[] { 0, 1, 2 });
  29. ThaumcraftApi.addLootBagItem(new ItemStack(Items.dye, 1, 4), 40, new int[] { 0, 1, 2 });
  30.  
  31. //TC items
  32. //Great wood sapling
  33. ItemStack lootItemStack = thaumcraft.api.ItemApi.getBlock("blockCustomPlant", 0);
  34. ThaumcraftApi.addLootBagItem(lootItemStack, 5, new int[] { 0 });
  35. ThaumcraftApi.addLootBagItem(lootItemStack, 10, new int[] { 1, 2 });
  36.  
  37. //Silver wood sapling
  38. lootItemStack = thaumcraft.api.ItemApi.getBlock("blockCustomPlant", 1);
  39. ThaumcraftApi.addLootBagItem(lootItemStack, 2, new int[] { 0 });
  40. ThaumcraftApi.addLootBagItem(lootItemStack, 5, new int[] { 1, 2 });
  41.  
  42. //Amber gem
  43. lootItemStack = thaumcraft.api.ItemApi.getItem("itemResource", 6);
  44. ThaumcraftApi.addLootBagItem(lootItemStack, 15, new int[] { 0, 1, 2 });
  45.  
  46. //Quicksilver drop
  47. lootItemStack = thaumcraft.api.ItemApi.getItem("itemResource", 3);
  48. ThaumcraftApi.addLootBagItem(lootItemStack, 25, new int[] { 0, 1, 2 });
  49.  
  50. //AE shit
  51. if(Loader.isModLoaded("appliedenergistics2")) {
  52. addAEShit();
  53. }
  54. }
  55.  
  56. private static void addAEShit() {
  57. IMaterials aeMaterials = appeng.api.AEApi.instance().definitions().materials();
  58.  
  59. ItemStack lootItemStack = aeMaterials.certusQuartzCrystal().maybeStack(1).get();
  60. if(lootItemStack != null) {
  61. ThaumcraftApi.addLootBagItem(lootItemStack, 60, new int[] { 0, 1, 2 });
  62. ThaumcraftApi.addLootBagItem(lootItemStack, 30, new int[] { 0, 1, 2 });
  63. }
  64.  
  65. lootItemStack = aeMaterials.certusQuartzCrystalCharged().maybeStack(1).get();
  66. if(lootItemStack != null) {
  67. ThaumcraftApi.addLootBagItem(lootItemStack, 20, new int[] { 0, 1, 2 });
  68. }
  69.  
  70. lootItemStack = aeMaterials.siliconPrint().maybeStack(1).get();
  71. if(lootItemStack != null) {
  72. ThaumcraftApi.addLootBagItem(lootItemStack, 20, new int[] { 0, 1, 2 });
  73. }
  74.  
  75. lootItemStack = aeMaterials.siliconPress().maybeStack(1).get();
  76. if(lootItemStack != null) {
  77. ThaumcraftApi.addLootBagItem(lootItemStack, 2, new int[] { 1 });
  78. ThaumcraftApi.addLootBagItem(lootItemStack, 10, new int[] { 2 });
  79. }
  80.  
  81. lootItemStack = aeMaterials.calcProcessorPress().maybeStack(1).get();
  82. if(lootItemStack != null) {
  83. ThaumcraftApi.addLootBagItem(lootItemStack, 2, new int[] { 1 });
  84. ThaumcraftApi.addLootBagItem(lootItemStack, 10, new int[] { 2 });
  85. }
  86.  
  87. lootItemStack = aeMaterials.engProcessorPress().maybeStack(1).get();
  88. if(lootItemStack != null) {
  89. ThaumcraftApi.addLootBagItem(lootItemStack, 2, new int[] { 1 });
  90. ThaumcraftApi.addLootBagItem(lootItemStack, 10, new int[] { 2 });
  91. }
  92.  
  93. lootItemStack = aeMaterials.logicProcessorPress().maybeStack(1).get();
  94. if(lootItemStack != null) {
  95. ThaumcraftApi.addLootBagItem(lootItemStack, 2, new int[] { 1 });
  96. ThaumcraftApi.addLootBagItem(lootItemStack, 10, new int[] { 2 });
  97. }
  98. }
  99.  
  100. private static void removeThaumcraftLoot() {
  101. ArrayList<WeightedRandomLoot> currentBagList = WeightedRandomLoot.lootBagCommon;
  102. Item lootItem;
  103.  
  104. for(int bagType = 0; bagType <= 2; bagType++) {
  105. if(bagType == 1) {
  106. currentBagList = WeightedRandomLoot.lootBagUncommon;
  107. } else if(bagType == 2) {
  108. currentBagList = WeightedRandomLoot.lootBagRare;
  109. }
  110.  
  111. for(int lootIndex = 0; lootIndex < currentBagList.size(); lootIndex++) {
  112.  
  113. lootItem = currentBagList.get(lootIndex).item.getItem();
  114. if(lootItem == Items.diamond
  115. || lootItem == Items.emerald
  116. || lootItem == Items.gold_ingot
  117. || lootItem == Items.emerald
  118. // || lootItem == new ItemStack(ConfigItems.itemResource, 1, 18).getItem()
  119. ) {
  120. if(bagType == 0) {
  121. WeightedRandomLoot.lootBagCommon.remove(lootIndex);
  122. } else if(bagType == 1) {
  123. WeightedRandomLoot.lootBagUncommon.remove(lootIndex);
  124. } else if(bagType == 2) {
  125. WeightedRandomLoot.lootBagRare.remove(lootIndex);
  126. }
  127. }
  128. }
  129. }
  130. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement