From 59c5ef6b1f9f9ab58645ea7a45f4b9a1e3619072 Mon Sep 17 00:00:00 2001
From: blalp <26471229+blalp@users.noreply.github.com>
Date: Wed, 3 Feb 2021 18:34:48 -0800
Subject: [PATCH] 2.0.7
---
pom.xml | 2 +-
.../blalp/sftautorestart/sponge/SFTAutoRestart.java | 12 ++++--------
.../sftautorestart/sponge/VoteRestartCommand.java | 2 +-
src/main/resources/plugin.yml | 2 +-
4 files changed, 7 insertions(+), 11 deletions(-)
diff --git a/pom.xml b/pom.xml
index bf5b55a..015d3a3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
com.blalp
sftautorestart
-2.0.7-dev
+2.0.7
jar
SFTAutoRestart
diff --git a/src/main/java/com/blalp/sftautorestart/sponge/SFTAutoRestart.java b/src/main/java/com/blalp/sftautorestart/sponge/SFTAutoRestart.java
index 9e63eea..f52ef81 100755
--- a/src/main/java/com/blalp/sftautorestart/sponge/SFTAutoRestart.java
+++ b/src/main/java/com/blalp/sftautorestart/sponge/SFTAutoRestart.java
@@ -32,7 +32,7 @@
import ninja.leaping.configurate.commented.CommentedConfigurationNode;
import ninja.leaping.configurate.loader.ConfigurationLoader;
-@Plugin(id = "sftautorestart", name = "SFTAutoRestart", version = "2.0.7-dev", description = "Vote and Autorestart.")
+@Plugin(id = "sftautorestart", name = "SFTAutoRestart", version = "2.0.7", description = "Vote and Autorestart.")
public class SFTAutoRestart implements CommandExecutor {
// thanks to
// https://github.com/FuzzyWuzzie/SimpleRestart/blob/master/src/main/java/com/hamaluik/SimpleRestart/SimpleRestart.java
@@ -221,14 +221,10 @@ public static void handleRestart(Player sender,String[] args){
@Listener
public void onChat(MessageChannelEvent.Chat event) {
if(event.getCause().containsType(Player.class)) {
- if(event.getMessage().toPlain().equalsIgnoreCase("restart")){
- SFTAutoRestart.handleRestart(event.getCause().first(Player.class).get(),new String[]{});
- } else if (event.getMessage().toPlain().equalsIgnoreCase("don't restart")){
+ if(event.getRawMessage().toPlain().equalsIgnoreCase("restart")){
+ SFTAutoRestart.handleRestart(event.getCause().first(Player.class).get(),new String[]{"true"});
+ } else if (event.getRawMessage().toPlain().equalsIgnoreCase("don't restart")){
SFTAutoRestart.handleRestart(event.getCause().first(Player.class).get(), new String[]{"false"});
- } else {
- System.out.println(event.getOriginalMessage().toPlain());
- System.out.println(event.getMessage().toPlain());
- System.out.println(event.getRawMessage().toPlain());
}
}
}
diff --git a/src/main/java/com/blalp/sftautorestart/sponge/VoteRestartCommand.java b/src/main/java/com/blalp/sftautorestart/sponge/VoteRestartCommand.java
index 9341450..3023d15 100644
--- a/src/main/java/com/blalp/sftautorestart/sponge/VoteRestartCommand.java
+++ b/src/main/java/com/blalp/sftautorestart/sponge/VoteRestartCommand.java
@@ -20,7 +20,7 @@ public CommandResult execute(CommandSource src, CommandContext context) throws C
if(context.hasAny("args")) {
args = context.getOne(Text.of("args")).get().split(" ");
} else {
- args = new String[]{};
+ args = new String[]{"true"};
}
SFTAutoRestart.handleRestart((Player)src.getCommandSource().get(), args);
}
diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml
index fa82266..864d50d 100755
--- a/src/main/resources/plugin.yml
+++ b/src/main/resources/plugin.yml
@@ -1,6 +1,6 @@
name: SFTAutoRestart
main: com.blalp.sftautorestart.SFTAutoRestart
-version: 2.0.7-dev
+version: 2.0.7
commands:
autorestart: