diff --git a/src/main/java/haneki/cloverclear/command/CmdInfo.java b/src/main/java/haneki/cloverclear/command/CmdInfo.java index b65fc4d..7010b66 100644 --- a/src/main/java/haneki/cloverclear/command/CmdInfo.java +++ b/src/main/java/haneki/cloverclear/command/CmdInfo.java @@ -1,6 +1,7 @@ package haneki.cloverclear.command; import com.feed_the_beast.ftblib.lib.command.CmdBase; +import haneki.cloverclear.handler.ClearEventHandler; import haneki.cloverclear.handler.ConfigHandler; import haneki.cloverclear.util.ClearUtil; import net.minecraft.command.CommandException; @@ -19,7 +20,8 @@ public void execute(MinecraftServer server, ICommandSender sender, String[] args StringBuilder content = new StringBuilder(); content.append("[CloverClear]\n"); content.append("time : ").append(ConfigHandler.setting.time).append("s ") - .append("waringtime : ").append(ConfigHandler.setting.warningTime).append("s"); + .append("waringtime : ").append(ConfigHandler.setting.warningTime).append("s ") + .append("nextclear : ").append(ClearEventHandler.timer/20).append("s"); content.append("\n[Whitelist-item] : "); for (String item:ClearUtil.itemWhitelist){ diff --git a/src/main/java/haneki/cloverclear/command/CmdSetTime.java b/src/main/java/haneki/cloverclear/command/CmdSetTime.java index 91e1bf6..332c329 100644 --- a/src/main/java/haneki/cloverclear/command/CmdSetTime.java +++ b/src/main/java/haneki/cloverclear/command/CmdSetTime.java @@ -1,6 +1,7 @@ package haneki.cloverclear.command; import com.feed_the_beast.ftblib.lib.command.CmdBase; +import haneki.cloverclear.handler.ClearEventHandler; import haneki.cloverclear.handler.ConfigHandler; import net.minecraft.command.CommandException; import net.minecraft.command.ICommandSender; @@ -20,6 +21,7 @@ public void execute(MinecraftServer server, ICommandSender sender, String[] args }else { if (args[0].matches("^[1-9]\\d*$")){ ConfigHandler.setTime(Integer.parseInt(args[0])); + ClearEventHandler.resetTimer(); sender.sendMessage(new TextComponentString("Cycle has been set to " + args[0] + " seconds.")); }else { sender.sendMessage(new TextComponentString("NaN")); diff --git a/src/main/java/haneki/cloverclear/config/Setting.java b/src/main/java/haneki/cloverclear/config/Setting.java index 214260a..fe151d5 100644 --- a/src/main/java/haneki/cloverclear/config/Setting.java +++ b/src/main/java/haneki/cloverclear/config/Setting.java @@ -4,9 +4,9 @@ public class Setting { @Config.Comment({"Time in seconds between each clear"}) - public int time = 600; + public int time = 300; @Config.Comment({"Time in seconds clear is announced to chat before-hand, set to zero to disable warning"}) - public int warningTime = 30; + public int warningTime = 10; @Config.Comment({"Set to false to disable item clearing"}) public boolean clearItems = true; diff --git a/src/main/java/haneki/cloverclear/handler/ClearEventHandler.java b/src/main/java/haneki/cloverclear/handler/ClearEventHandler.java index 883b9d3..3b56b5e 100644 --- a/src/main/java/haneki/cloverclear/handler/ClearEventHandler.java +++ b/src/main/java/haneki/cloverclear/handler/ClearEventHandler.java @@ -47,4 +47,8 @@ public void onServerTick(TickEvent.ServerTickEvent event) { } } } + + public static void resetTimer(){ + timer = ConfigHandler.setting.time * 20; + } }