From b99feff3d82d69768459255ae3131e8de3d9ab3f Mon Sep 17 00:00:00 2001 From: Dream-Master Date: Mon, 4 Jul 2016 17:46:17 +0200 Subject: [PATCH] make GT trigger ic2 achievements (Blood Asp) --- .../GT_MetaTileEntity_ProcessingArray.java | 11 ++++- .../common/tools/GT_Tool_Chainsaw_LV.java | 2 +- .../common/tools/GT_Tool_Drill_HV.java | 2 +- .../common/tools/GT_Tool_Drill_LV.java | 2 +- .../loaders/misc/GT_Achievements.java | 47 ++++++++++++++----- 5 files changed, 48 insertions(+), 16 deletions(-) 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 1b9dbc56..c6188b97 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 @@ -184,7 +184,16 @@ 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()]); ArrayList tFluidList = getStoredFluids(); 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 ca118b6d..1dcffcf1 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 @@ -88,7 +88,7 @@ public class GT_Tool_Chainsaw_LV public void onToolCrafted(ItemStack aStack, EntityPlayer aPlayer) { 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 73d12d9d..405ef567 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 @@ -43,7 +43,7 @@ public class GT_Tool_Drill_HV public void onToolCrafted(ItemStack aStack, EntityPlayer aPlayer) { 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 2413c1ba..65f51157 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 @@ -98,7 +98,7 @@ public class GT_Tool_Drill_LV aPlayer.triggerAchievement(AchievementList.buildPickaxe); 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..a3e15199 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; @@ -175,16 +176,16 @@ public class GT_Achievements { registerAchievement("fullefficiency", 10, 10, ItemList.Generator_Plasma_ZPMV.get(1, new Object[]{}), "tothelimit", false); registerAchievement("denseaspossible", 8, 10, ItemList.FusionComputer_UV.get(1, new Object[]{}), "fullefficiency", false); registerAchievement("whatnow", 6, 10, ItemList.ZPM2.get(1, new Object[]{}), "denseaspossible", false); - + if(Loader.isModLoaded("NotEnoughItems") && GT_Mod.gregtechproxy.mHideUnusedOres){ - for (int i = 1; i < GregTech_API.sGeneratedMaterials.length; i++) { - if (GregTech_API.sGeneratedMaterials[i] != null) { - if(!oreList.contains(GregTech_API.sGeneratedMaterials[i])){ - codechicken.nei.api.API.hideItem(GT_OreDictUnificator.get(OrePrefixes.ore, GregTech_API.sGeneratedMaterials[i], 1)); - } + for (int i = 1; i < GregTech_API.sGeneratedMaterials.length; i++) { + if (GregTech_API.sGeneratedMaterials[i] != null) { + if(!oreList.contains(GregTech_API.sGeneratedMaterials[i])){ + codechicken.nei.api.API.hideItem(GT_OreDictUnificator.get(OrePrefixes.ore, GregTech_API.sGeneratedMaterials[i], 1)); + } + } } } - } if (GT_Mod.gregtechproxy.mAchievements) { AchievementPage.registerAchievementPage(new AchievementPage("GregTech 5", (Achievement[]) this.achievementList.values().toArray( new Achievement[this.achievementList.size()]))); @@ -251,9 +252,9 @@ public class GT_Achievements { } // if (this.achievementList.containsKey(textId)) { // if(this.issuedAchievements.containsKey((entityplayer.getDisplayName()+textId))){ -// return; +// return; // }else{ -// this.issuedAchievements.put((entityplayer.getDisplayName()+textId), true); +// this.issuedAchievements.put((entityplayer.getDisplayName()+textId), true); entityplayer.triggerAchievement((StatBase) this.achievementList.get(textId)); // } // } @@ -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.")) { @@ -447,7 +464,7 @@ public class GT_Achievements { issueAchievement(player, "newmetal"); } if(data.mMaterial.mMaterial != Materials.Gunpowder){ - issueAchievement(player, "cleandust"); + issueAchievement(player, "cleandust"); } } else if (data.mPrefix == OrePrefixes.ore || data.mPrefix == OrePrefixes.oreBlackgranite || data.mPrefix == OrePrefixes.oreEndstone || data.mPrefix == OrePrefixes.oreNetherrack || data.mPrefix == OrePrefixes.oreRedgranite) { @@ -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"); @@ -514,7 +535,9 @@ public class GT_Achievements { issueAchievement(player, "whatnow"); } } else if (stack.getUnlocalizedName().equals("gt.Thoriumcell")) { - issueAchievement(player, "newfuel"); - } + 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");} } }