Skip to content
This repository has been archived by the owner on Jun 14, 2022. It is now read-only.

Commit

Permalink
Tweak nag and version checker
Browse files Browse the repository at this point in the history
  • Loading branch information
williewillus committed Mar 12, 2016
1 parent 2172d78 commit 8f67094
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/main/java/vazkii/botania/common/Botania.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ public void preInit(FMLPreInitializationEvent event) {
MinecraftForge.EVENT_BUS.register(this);
}

@SubscribeEvent // todo temporary nag, remove when merging back into master
@SubscribeEvent
public void nagUnofficial(PlayerEvent.PlayerLoggedInEvent evt) {
EntityPlayer player = evt.player;

IChatComponent message = new ChatComponentTranslation("botaniamisc.unofficial.nag");
message.setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED).setUnderlined(true));
message.setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED));

IChatComponent message2 = new ChatComponentTranslation("botaniamisc.unofficial.report");
message2.setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@
package vazkii.botania.common.core.version;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;

import net.minecraftforge.common.MinecraftForge;

public class ThreadVersionChecker extends Thread {

private static final String LINK = "https://raw.githubusercontent.com/williewillus/Botania/MC18/version/" + MinecraftForge.MC_VERSION + ".txt";

public ThreadVersionChecker() {
setName("Botania Version Checker Thread");
setDaemon(true);
Expand All @@ -26,12 +29,9 @@ public ThreadVersionChecker() {

@Override
public void run() {
try {
URL url = new URL("https://raw.githubusercontent.com/williewillus/Botania/MC18/version/" + MinecraftForge.MC_VERSION + ".txt");
BufferedReader r = new BufferedReader(new InputStreamReader(url.openStream()));
try(BufferedReader r = new BufferedReader(new InputStreamReader(new URL(LINK).openStream()))) {
VersionChecker.onlineVersion = r.readLine();
r.close();
} catch(Exception e) {
} catch(IOException e) {
e.printStackTrace();
}
VersionChecker.doneChecking = true;
Expand Down

0 comments on commit 8f67094

Please sign in to comment.