use of net.minecraft.util.text.Style in project Pearcel-Mod by MiningMark48.
the class EventOnJoin method onJoin.
@SubscribeEvent
public void onJoin(TickEvent.PlayerTickEvent e) {
if (!PearcelMod.haveWarnedVersionOutOfDate && e.player.world.isRemote) {
if (!PearcelMod.versionChecker.isLatestVersion()) {
ClickEvent versionCheckClickEvent = new ClickEvent(ClickEvent.Action.OPEN_URL, "https://minecraft.curseforge.com/projects/pearcel-mod");
e.player.sendMessage(new TextComponentString(TextFormatting.YELLOW + Translate.toLocal("chat.versionChecker.outOfDate") + TextFormatting.AQUA + " v" + PearcelMod.versionChecker.getLatestVersion()).setStyle(new Style().setClickEvent(versionCheckClickEvent)));
PearcelMod.haveWarnedVersionOutOfDate = true;
}
}
if (!JoinMessageWikiSent && e.player.world.isRemote) {
// TODO: Make config setting for message
ClickEvent versionCheckClickEvent = new ClickEvent(ClickEvent.Action.OPEN_URL, "http://miningmark48.xyz/pearcelmod");
e.player.sendMessage(new TextComponentString(TextFormatting.GREEN + Translate.toLocal("chat.joinMessage.wiki")).setStyle(new Style().setClickEvent(versionCheckClickEvent)));
JoinMessageWikiSent = true;
}
}
Aggregations