mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-13 03:07:34 +00:00
43 lines
1.2 KiB
Java
43 lines
1.2 KiB
Java
package noppes.npcs.client;
|
|
|
|
import java.io.BufferedReader;
|
|
import java.io.InputStreamReader;
|
|
import java.net.URL;
|
|
import java.net.URLConnection;
|
|
|
|
import net.minecraft.client.Minecraft;
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
import net.minecraft.event.ClickEvent;
|
|
import net.minecraft.event.ClickEvent.Action;
|
|
import net.minecraft.util.ChatComponentTranslation;
|
|
|
|
public class VersionChecker extends Thread{
|
|
private int revision = 15;
|
|
public VersionChecker(){
|
|
|
|
}
|
|
public void run(){
|
|
String name = '\u00A7'+ "2CustomNpcs" + '\u00A7' + "f";
|
|
String link = '\u00A7'+"9"+'\u00A7' + "nClick here";
|
|
String text = name +" installed. For more info " + link;
|
|
|
|
EntityPlayer player;
|
|
try{
|
|
player = Minecraft.getMinecraft().thePlayer;
|
|
}
|
|
catch(NoSuchMethodError e){
|
|
return;
|
|
}
|
|
while((player = Minecraft.getMinecraft().thePlayer) == null){
|
|
try {
|
|
Thread.sleep(2000);
|
|
} catch (InterruptedException e) {
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
ChatComponentTranslation message = new ChatComponentTranslation(text);
|
|
message.getChatStyle().setChatClickEvent(new ClickEvent(Action.OPEN_URL, "http://www.kodevelopment.nl/minecraft/customnpcs/"));
|
|
player.addChatMessage(message);
|
|
}
|
|
}
|