From ca0b8f396e038e58c54f616c969c994ba185cc5c Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Sat, 2 Jul 2016 22:35:29 +0200 Subject: [PATCH] make GT trigger ic2 achievements --- .../GT_MetaTileEntity_ProcessingArray.java | 9 +++++++ .../common/tools/GT_Tool_Chainsaw_LV.java | 1 + .../common/tools/GT_Tool_Drill_HV.java | 1 + .../common/tools/GT_Tool_Drill_LV.java | 1 + .../loaders/misc/GT_Achievements.java | 25 ++++++++++++++++++- 5 files changed, 36 insertions(+), 1 deletion(-) diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java index 1ea1711a..0217918e 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ProcessingArray.java @@ -168,6 +168,15 @@ public class GT_MetaTileEntity_ProcessingArray extends GT_MetaTileEntity_MultiBl if (mInventory[1].getUnlocalizedName().endsWith("5")) { tTier = 5; } + if (mInventory[1].getUnlocalizedName().endsWith("6")) { + tTier = 6; + } + if (mInventory[1].getUnlocalizedName().endsWith("7")) { + tTier = 7; + } + if (mInventory[1].getUnlocalizedName().endsWith("8")) { + tTier = 8; + } ItemStack[] tInputs = (ItemStack[]) tInputList.toArray(new ItemStack[tInputList.size()]); diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_LV.java b/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_LV.java index 273bd7b6..a1acbf10 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_LV.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Chainsaw_LV.java @@ -89,6 +89,7 @@ public class GT_Tool_Chainsaw_LV super.onToolCrafted(aStack, aPlayer); try { GT_Mod.instance.achievements.issueAchievement(aPlayer, "brrrr"); + GT_Mod.instance.achievements.issueAchievement(aPlayer, "buildChainsaw"); } catch (Exception e) { } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Drill_HV.java b/src/main/java/gregtech/common/tools/GT_Tool_Drill_HV.java index d51644f5..b9aaf72f 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Drill_HV.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Drill_HV.java @@ -44,6 +44,7 @@ public class GT_Tool_Drill_HV super.onToolCrafted(aStack, aPlayer); try { GT_Mod.instance.achievements.issueAchievement(aPlayer, "highpowerdrill"); + GT_Mod.instance.achievements.issueAchievement(aPlayer, "buildDDrill"); } catch (Exception e) { } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Drill_LV.java b/src/main/java/gregtech/common/tools/GT_Tool_Drill_LV.java index f8167687..8d70cf2a 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Drill_LV.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Drill_LV.java @@ -99,6 +99,7 @@ public class GT_Tool_Drill_LV aPlayer.triggerAchievement(AchievementList.buildBetterPickaxe); try { GT_Mod.instance.achievements.issueAchievement(aPlayer, "driltime"); + GT_Mod.instance.achievements.issueAchievement(aPlayer, "buildDrill"); } catch (Exception e) { } } diff --git a/src/main/java/gregtech/loaders/misc/GT_Achievements.java b/src/main/java/gregtech/loaders/misc/GT_Achievements.java index 87e18a98..46bb8165 100644 --- a/src/main/java/gregtech/loaders/misc/GT_Achievements.java +++ b/src/main/java/gregtech/loaders/misc/GT_Achievements.java @@ -16,6 +16,7 @@ import gregtech.api.util.GT_Log; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.common.items.GT_MetaGenerated_Tool_01; +import ic2.core.Ic2Items; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; @@ -291,6 +292,8 @@ public class GT_Achievements { } if (stack.getUnlocalizedName().equals("ic2.itemPartIndustrialDiamond")) { issueAchievement(player, "artificaldia"); + issueAchievement(player, "buildCoalDiamond"); + } } @@ -335,6 +338,7 @@ public class GT_Achievements { issueAchievement(player, "magneticiron"); } else if (stack.getUnlocalizedName().equals("gt.metaitem.01.32600")) { issueAchievement(player, "lvmotor"); + issueAchievement(player, "buildCable"); } else if (stack.getUnlocalizedName().equals("gt.metaitem.01.32610")) { issueAchievement(player, "pumpcover"); } else if (stack.getUnlocalizedName().equals("gt.metaitem.01.32630")) { @@ -359,10 +363,17 @@ public class GT_Achievements { issueAchievement(player, "highpressure"); } else if (stack.getUnlocalizedName().equals("gt.blockmachines.bronzemachine.macerator")) { issueAchievement(player, "macerator"); + issueAchievement(player, "buildMacerator"); } else if (stack.getUnlocalizedName().equals("gt.blockmachines.bronzemachine.alloysmelter")) { issueAchievement(player, "alloysmelter"); + issueAchievement(player, "buildElecFurnace"); + if(stack.getUnlocalizedName().equals("gt.blockmachines.bronzemachine.alloysmelter.tier.3")){ + issueAchievement(player, "buildIndFurnace"); + } } else if (stack.getUnlocalizedName().equals("gt.blockmachines.bronzemachine.extractor")) { issueAchievement(player, "extract"); + issueAchievement(player, "buildCompressor"); + issueAchievement(player, "buildExtractor"); } else if (stack.getUnlocalizedName().startsWith("gt.blockmachines.automation.superbuffer.tier.")) { issueAchievement(player, "superbuffer"); } else if (stack.getUnlocalizedName().startsWith("gt.blockmachines.quantum.tank.tier.")) { @@ -373,8 +384,13 @@ public class GT_Achievements { issueAchievement(player, "cheapermac"); } else if (stack.getUnlocalizedName().startsWith("gt.blockmachines.automation.chestbuffer.tier.")) { issueAchievement(player, "buffer"); + issueAchievement(player, "buildBatBox"); + if(stack.getUnlocalizedName().startsWith("gt.blockmachines.automation.chestbuffer.tier.3")){ + issueAchievement(player, "buildMFE"); + } } else if (stack.getUnlocalizedName().startsWith("gt.blockmachines.basicgenerator.steamturbine.tier.")) { issueAchievement(player, "steampower"); + issueAchievement(player, "buildGenerator"); } else if (stack.getUnlocalizedName().equals("gt.blockmachines.basicmachine.pump.tier.03")) { issueAchievement(player, "slurp"); } else if (stack.getUnlocalizedName().startsWith("gt.blockmachines.basicmachine.assembler.tier.")) { @@ -399,6 +415,7 @@ public class GT_Achievements { issueAchievement(player, "amplifier"); } else if (stack.getUnlocalizedName().startsWith("gt.blockmachines.basicmachine.massfab.tier.")) { issueAchievement(player, "universal"); + issueAchievement(player, "buildMassFab"); } else if (stack.getUnlocalizedName().startsWith("gt.blockmachines.basicgenerator.naquadah.tier.")) { issueAchievement(player, "alienpower"); } else if (stack.getUnlocalizedName().startsWith("gt.blockmachines.basicmachine.replicator.tier.")) { @@ -456,6 +473,10 @@ public class GT_Achievements { if (data.getAllMaterialStacks().get(i).mMaterial == Materials.AnyIron) { issueAchievement(player, "iron"); } + if(data.getAllMaterialStacks().get(i).mMaterial == Materials.Copper||data.getAllMaterialStacks().get(i).mMaterial == Materials.Tin){ + issueAchievement(event.entityPlayer, "mineOre"); + } + } } else if (data.mPrefix == OrePrefixes.crushed) { issueAchievement(player, "crushed"); @@ -515,6 +536,8 @@ public class GT_Achievements { } } else if (stack.getUnlocalizedName().equals("gt.Thoriumcell")) { issueAchievement(player, "newfuel"); - } + }else if ((stack.getItem() == Ic2Items.quantumBodyarmor.getItem()) || (stack.getItem() == Ic2Items.quantumBoots.getItem()) || + (stack.getItem() == Ic2Items.quantumHelmet.getItem()) || (stack.getItem() == Ic2Items.quantumLeggings.getItem())) { + issueAchievement(player, "buildQArmor");} } }