Closed mushroomhostage closed 12 years ago
The kick message can easily be fixed by configuration: https://github.com/mushroomhostage/exphc/commit/8dc3425fd46a61a65d90279ae6b0107f3b8bd299
To change the kick-when-dead message:
--- a/com/Evilgeniuses/Hardcore/SpawnEventListener.java
+++ b/com/Evilgeniuses/Hardcore/SpawnEventListener.java
@@ -6,6 +6,7 @@ import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerLoginEvent;
import org.bukkit.event.player.PlayerLoginEvent.Result;
+import java.util.Date;
public class SpawnEventListener implements Listener {
@@ -23,8 +24,14 @@ public class SpawnEventListener implements Listener {
String playerName = event.getPlayer().getName();
this._plugin.log(playerName + " is trying to log in.");
if(this._plugin.getDeadPlayerList().isPlayerDead(playerName, true)) {
- String livedate = this._plugin.getDeadPlayerList().whenWillPlayerLive(playerName).toString();
- event.setKickMessage("You will be dead until " + livedate);
+ Date livedate = this._plugin.getDeadPlayerList().whenWillPlayerLive(playerName);
+
+ long duration = livedate.getTime() - System.currentTimeMillis();
+ int seconds = (int)(duration / 1000);
+ int minutes = seconds / 60;
+ seconds %= 60;
+
+ event.setKickMessage("You will be dead for "+minutes+" minutes, "+seconds+" seconds");
event.setResult(Result.KICK_BANNED);
this._plugin.log(playerName + " was not allowed to login for being dead until " + livedate + ".");
}
Patched HardcoreMC_2.6.2.jar as above. Much, much better. Tested locally. Copied to server, will take effect after next restart.
The Hardcore plugin uses timestamps, with the server's time zone, which is confusing: "You have died. You will be dead until:Sat Aug 04 13:27:54 PDT 2012" - see http://www.mcportcentral.co.za/index.php?topic=1875.msg19388#msg19388 .
Besides the missing space after the ":", this should be changed to instead just show how long it will be until they can come back.