From 29c2639e835f8ca8e0b467956cb44d008af87ad8 Mon Sep 17 00:00:00 2001 From: Technus Date: Sun, 25 Jun 2017 12:19:03 +0200 Subject: [PATCH] Add refreshing code --- src/main/java/gregtech/common/GT_Client.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/java/gregtech/common/GT_Client.java b/src/main/java/gregtech/common/GT_Client.java index 7d3f687b..51264c76 100644 --- a/src/main/java/gregtech/common/GT_Client.java +++ b/src/main/java/gregtech/common/GT_Client.java @@ -18,6 +18,7 @@ import gregtech.api.interfaces.tileentity.ITurnable; import gregtech.api.metatileentity.BaseMetaPipeEntity; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_PlayedSound; +import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gregtech.common.entities.GT_Entity_Arrow; import gregtech.common.entities.GT_Entity_Arrow_Potion; @@ -28,6 +29,7 @@ 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.StatFileWriter; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.client.event.DrawBlockHighlightEvent; @@ -72,6 +74,8 @@ public class GT_Client extends GT_Proxy private final List mMoltenNegG; private final List mMoltenNegB; private final List mMoltenNegA = Arrays.asList(new Object[0]); + /**This is the place to def the value used below**/ + private long afterSomeTime; private long mAnimationTick; private boolean mAnimationDirection; @@ -294,6 +298,16 @@ 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)) { + afterSomeTime++; + if(afterSomeTime>=100L){ + afterSomeTime=0; + StatFileWriter sfw= Minecraft.getMinecraft().thePlayer.getStatFileWriter(); + try { + for(GT_Recipe recipe: GT_Recipe.GT_Recipe_Map.sAssemblylineVisualRecipes.mRecipeList){ + recipe.mHidden=!sfw.hasAchievementUnlocked(GT_Mod.achievements.getAchievement(recipe.getOutput(0).getUnlocalizedName())); + } + }catch (Exception e){} + } ArrayList tList = new ArrayList(); for (Map.Entry tEntry : GT_Utility.sPlayedSoundMap.entrySet()) { if (tEntry.getValue().intValue() < 0) {//Integer -> Integer -> int? >_<, fix