aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/GT_Client.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gregtech/common/GT_Client.java')
-rw-r--r--src/main/java/gregtech/common/GT_Client.java45
1 files changed, 41 insertions, 4 deletions
diff --git a/src/main/java/gregtech/common/GT_Client.java b/src/main/java/gregtech/common/GT_Client.java
index 7d3f687b28..839dcd2367 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;
@@ -73,12 +75,17 @@ public class GT_Client extends GT_Proxy
private final List mMoltenNegB;
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 boolean mAnimationDirection;
-
+ private boolean isFirstClientPlayerTick;
+ private String mMessage;
public GT_Client() {
mCapeRenderer = new GT_CapeRenderer(mCapeList);
mAnimationTick = 0L;
mAnimationDirection = false;
+ isFirstClientPlayerTick = true;
+ mMessage = "";
mPosR = Arrays.asList(new Materials[]{
/**Materials.ChargedCertusQuartz, **/Materials.Enderium, Materials.Vinteum, Materials.Uranium235, Materials.InfusedGold, Materials.Plutonium241, Materials.NaquadahEnriched, Materials.Naquadria, Materials.InfusedOrder, Materials.Force,
Materials.Pyrotheum, Materials.Sunnarium, Materials.Glowstone, Materials.Thaumium, Materials.InfusedVis, Materials.InfusedAir, Materials.InfusedFire, Materials.FierySteel, Materials.Firestone
@@ -264,7 +271,7 @@ public class GT_Client extends GT_Proxy
public void run() {
try {
- GT_Log.out.println("Skip: GT_Mod: Downloading Cape List.");
+ GT_Log.out.println("GT_Mod: Downloading Cape List.");
@SuppressWarnings("resource")
Scanner tScanner = new Scanner(new URL("http://gregtech.overminddl1.com/com/gregoriust/gregtech/supporterlist.txt").openStream());
while (tScanner.hasNextLine()) {
@@ -275,8 +282,28 @@ public class GT_Client extends GT_Proxy
}
} catch (Throwable e) {
}
+ try {
+ GT_Log.out.println("GT New Horizons: Downloading Cape List.");
+ @SuppressWarnings("resource")
+ Scanner tScanner = new Scanner(new URL("https://raw.githubusercontent.com/GTNewHorizons/CustomGTCapeHook-Cape-List/master/capes.txt").openStream());
+ while (tScanner.hasNextLine()) {
+ String tName = tScanner.nextLine();
+ if (tName.contains(":")) {
+ int splitLocation = tName.indexOf(":");
+ String username = tName.substring(0, splitLocation);
+ if (!this.mCapeList.contains(username.toLowerCase()) && !this.mCapeList.contains(tName.toLowerCase())) {
+ this.mCapeList.add(tName.toLowerCase());
+ }
+ } else {
+ if (!this.mCapeList.contains(tName.toLowerCase())) {
+ this.mCapeList.add(tName.toLowerCase());
+ }
+ }
+ }
+ } catch (Throwable e) {
+ }
/**try {
- GT_Log.out.println("Skip: GT_Mod: Downloading News.");
+ GT_Log.out.println("GT_Mod: Downloading News.");
@SuppressWarnings("resource")
Scanner tScanner = new Scanner(new URL("http://files.minecraftforge.net/maven/com/gregoriust/gregtech/message.txt").openStream());
while (tScanner.hasNextLine()) {
@@ -294,6 +321,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<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
@@ -564,4 +601,4 @@ public class GT_Client extends GT_Proxy
return 0;
}
}
-} \ No newline at end of file
+}