From 42fd476ff72b523bbed59b210101163c52a99570 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Tue, 23 Aug 2016 23:21:20 -0400 Subject: [PATCH] some more small changes --- src/iie/HelloWorld.java | 62 ++++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 29 deletions(-) diff --git a/src/iie/HelloWorld.java b/src/iie/HelloWorld.java index 32d7a4b..c78b584 100644 --- a/src/iie/HelloWorld.java +++ b/src/iie/HelloWorld.java @@ -18,51 +18,55 @@ public class HelloWorld implements CommandExecutor { public boolean onCommand(CommandSender sender, Command label, String command, String[] args) { // TODO Auto-generated method stub - sender.sendMessage("WELL, AT LEAST THIS WORKS"); + + + + + + + //sender.sendMessage("WELL, AT LEAST THIS WORKS"); + if (sender instanceof Player){ - - sender.sendMessage("sender IS instanceof Player"); - + //sender.sendMessage("sender IS instanceof Player"); long currentTime = System.currentTimeMillis(); String playername = sender.getName(); long deathTime = 0; - - if (plugin.deathMap.get(playername) != null){ - - deathTime = Long.parseLong(plugin.deathMap.get(playername)); - - }else{ - - sender.sendMessage("you have never died in hardcore"); - + + if (plugin.deathMap.get(playername) != null){ + deathTime = Long.parseLong(plugin.deathMap.get(playername)); + }else{ + sender.sendMessage("you have never died in hardcore"); Player player = (Player) sender; World hardcoreWorld = player.getServer().getWorld("hardcore"); Location location = new Location(hardcoreWorld, 1280, 71, -179); - player.teleport(location); + player.teleport(location); } - - sender.sendMessage(playername); - sender.sendMessage(String.valueOf(deathTime)); - sender.sendMessage(String.valueOf(currentTime)); - if (currentTime - deathTime >= 86400000){ - - sender.sendMessage("more than 24 hours have passed since you died in hardcore last"); - + //sender.sendMessage(playername); + //sender.sendMessage(String.valueOf(deathTime)); + //sender.sendMessage(String.valueOf(currentTime)); + + + if (currentTime - deathTime >= 86400000 && deathTime != 0){ + sender.sendMessage((86400000 - (currentTime - deathTime) ) /3600000 + " hours have passed since you died in hardcore last"); Player player = (Player) sender; World hardcoreWorld = player.getServer().getWorld("hardcore"); Location location = new Location(hardcoreWorld, 1280, 71, -179); player.teleport(location); - - }else{ - sender.sendMessage("you are dead for the next " + (86400000 - (currentTime - deathTime) ) /3600000 + " hours"); + }else{ + sender.sendMessage("you are dead for the next " + (86400000 - (currentTime - deathTime) ) /3600000 + " hours"); } - }else{ - - sender.sendMessage("You must be a player to use this command!"); - + + }else{ + sender.sendMessage("You must be a player to use this command!"); } + + + + + + return false; }