Skip to content

Commit

Permalink
2.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
blalp committed Feb 4, 2021
1 parent 5dd5956 commit 59c5ef6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>com.blalp</groupId>
<artifactId>sftautorestart</artifactId>
<version>2.0.7-dev</version>
<version>2.0.7</version>
<packaging>jar</packaging>

<name>SFTAutoRestart</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public CommandResult execute(CommandSource src, CommandContext context) throws C
if(context.hasAny("args")) {
args = context.<String>getOne(Text.of("args")).get().split(" ");
} else {
args = new String[]{};
args = new String[]{"true"};
}
SFTAutoRestart.handleRestart((Player)src.getCommandSource().get(), args);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: SFTAutoRestart
main: com.blalp.sftautorestart.SFTAutoRestart
version: 2.0.7-dev
version: 2.0.7

commands:
autorestart:
Expand Down

0 comments on commit 59c5ef6

Please sign in to comment.