diff options
author | Technus <daniel112092@gmail.com> | 2016-11-24 12:24:55 +0100 |
---|---|---|
committer | Technus <daniel112092@gmail.com> | 2016-11-24 12:24:55 +0100 |
commit | 0cedc2195a0ef2cff6009743d16ef318fa1a324a (patch) | |
tree | 3dad94cd5d1876e4a2d5c4bee2b5a5361fc29b22 /src/main/java/gregtech/common | |
parent | a650dc425c7294d1a1963a41302611e2dd07f08d (diff) | |
download | GT5-Unofficial-0cedc2195a0ef2cff6009743d16ef318fa1a324a.tar.gz GT5-Unofficial-0cedc2195a0ef2cff6009743d16ef318fa1a324a.tar.bz2 GT5-Unofficial-0cedc2195a0ef2cff6009743d16ef318fa1a324a.zip |
Achievement based unlocking done.
Diffstat (limited to 'src/main/java/gregtech/common')
-rw-r--r-- | src/main/java/gregtech/common/GT_Client.java | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/main/java/gregtech/common/GT_Client.java b/src/main/java/gregtech/common/GT_Client.java index 9db8786767..7463893366 100644 --- a/src/main/java/gregtech/common/GT_Client.java +++ b/src/main/java/gregtech/common/GT_Client.java @@ -26,6 +26,7 @@ import gregtech.api.util.GT_Utility; import gregtech.common.entities.GT_Entity_Arrow; import gregtech.common.entities.GT_Entity_Arrow_Potion; import gregtech.common.render.*; +import gregtech.loaders.misc.GT_Achievements; import gregtech.nei.NEI_GT_Config; import ic2.api.tile.IWrenchable; import net.minecraft.block.Block; @@ -33,6 +34,8 @@ import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; +import net.minecraft.stats.Achievement; +import net.minecraft.stats.StatFileWriter; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChatComponentText; import net.minecraft.world.World; @@ -77,7 +80,7 @@ public class GT_Client extends GT_Proxy private final List mMoltenNegA = Arrays.asList(new Object[0]); private long mAnimationTick; /**This is the place to def the value used below**/ - //private long afterSomeTime; + private long afterSomeTime; private boolean mAnimationDirection; private boolean isFirstClientPlayerTick; private String mMessage; @@ -287,6 +290,18 @@ public class GT_Client extends GT_Proxy @SubscribeEvent public void onPlayerTickEventClient(TickEvent.PlayerTickEvent aEvent) { if ((aEvent.side.isClient()) && (aEvent.phase == TickEvent.Phase.END) && (!aEvent.player.isDead)) { + /**Something on the lines of this works for recipe visibility toggling**/ + /**yes just change the mHidden thing, rest is done by custom NEI configurer GT_NEI_AssLineHandler**/ + afterSomeTime++; + if(afterSomeTime>=100L){ + afterSomeTime=0; + StatFileWriter sfw= Minecraft.getMinecraft().thePlayer.getStatFileWriter(); + try { + for(GT_Recipe recipe:GT_Recipe.GT_Recipe_Map.sAssemblylineFakeRecipes.mRecipeList){ + recipe.mHidden=!sfw.hasAchievementUnlocked(GT_Mod.achievements.getAchievement(recipe.getOutput(0).getUnlocalizedName())); + } + }catch (Exception e){} + } ArrayList<GT_PlayedSound> tList = new ArrayList(); for (Map.Entry<GT_PlayedSound, Integer> tEntry : GT_Utility.sPlayedSoundMap.entrySet()) { if (tEntry.getValue().intValue() < 0) {//Integer -> Integer -> int? >_<, fix @@ -362,17 +377,6 @@ public class GT_Client extends GT_Proxy public void onClientTickEvent(cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent aEvent) { if (aEvent.phase == cpw.mods.fml.common.gameevent.TickEvent.Phase.END) { mAnimationTick++; - /**Something on the lines of this works for recipe visibility toggling**/ - /**yes just change the mHidden thing, rest is done by custom NEI configurer GT_NEI_AssLineHandler**/ - //if(!isFirstClientPlayerTick)afterSomeTime++; - //if(afterSomeTime>=600L){ - // afterSomeTime=0; - // try { - // for (GT_Recipe recipe : GT_Recipe.GT_Recipe_Map.sAssemblylineFakeRecipes.mRecipeList) { - // recipe.mHidden ^= true; - // } - // }catch (Exception e){} - //} if (mAnimationTick % 50L == 0L) {mAnimationDirection = !mAnimationDirection;} int tDirection = mAnimationDirection ? 1 : -1; |