From 435eec1dfe0aec63d22875fb2189e69d2b1fa999 Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Sat, 18 Mar 2017 12:09:58 +1000 Subject: + Added a delay to the mod update message upon login, so it's easier to see. + Added more Smoke and visual FX to the Primed Mining Explosives explosion. % Tweaked Primed Mining Explosive Renderer. + Added a randFloat to MathUtils.java. --- .../core/handler/events/LoginEventHandler.java | 29 ++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'src/Java/gtPlusPlus/core/handler/events') diff --git a/src/Java/gtPlusPlus/core/handler/events/LoginEventHandler.java b/src/Java/gtPlusPlus/core/handler/events/LoginEventHandler.java index 0666acc7fa..b787acd02d 100644 --- a/src/Java/gtPlusPlus/core/handler/events/LoginEventHandler.java +++ b/src/Java/gtPlusPlus/core/handler/events/LoginEventHandler.java @@ -1,6 +1,6 @@ package gtPlusPlus.core.handler.events; -import java.util.UUID; +import java.util.*; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.PlayerEvent; @@ -45,7 +45,7 @@ public class LoginEventHandler { Utils.LOG_INFO("Latest version is: "+CORE.MASTER_VERSION); } Utils.LOG_INFO("You currently have: "+CORE.VERSION); - PlayerUtils.messagePlayer(this.localPlayerRef, "You're not using the latest recommended version of GT++, consider updating."); + ShortTimer(this.localPlayerRef, 20); } else { Utils.LOG_INFO("You're using the latest recommended version of GT++."); @@ -100,5 +100,30 @@ public class LoginEventHandler { } } + + //Handles notifying the player about a version update. + public Timer ShortTimer(EntityPlayer localPlayer, final int seconds) { + Timer timer; + timer = new Timer(); + timer.schedule(new NotifyPlayer(localPlayer), seconds * 1000); + return timer; + } + + //Timer Task for notifying the player. + class NotifyPlayer extends TimerTask { + final EntityPlayer toMessage; + public NotifyPlayer(EntityPlayer localPlayer) { + toMessage = localPlayer; + } + + @Override + public void run() { + if (toMessage != null){ + if (toMessage instanceof EntityPlayerMP){ + PlayerUtils.messagePlayer(toMessage, "You're not using the latest recommended version of GT++, consider updating."); + } + } + } + } } \ No newline at end of file -- cgit