-
Notifications
You must be signed in to change notification settings - Fork 273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#499 - Implement toggledownfall, spawnpoint, setidletimeout and setworldspawn #523
Conversation
} | ||
|
||
if (timeout <= 0) { | ||
sender.sendMessage(ChatColor.RED + "Timeout has to be positive"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace this with The number you have entered (<Number>) is too small, it must be at least 0
} | ||
|
||
Bukkit.getServer().setIdleTimeout(timeout); | ||
Bukkit.broadcastMessage("The idle timeout has been set to '" + timeout + "' minutes."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Send this to the sender (not broadcast). The message should say Successfully set the idle timeout to <Number> minutes.
if (sender instanceof Player) { | ||
targets = ImmutableList.of((Player) sender); | ||
} else { | ||
sender.sendMessage(ChatColor.RED + "Current sender is not a player."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace this with You must specify which player you wish to perform this action on.
if (world == null) { | ||
return false; | ||
} else { | ||
if (world.hasStorm()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace this if-block with:
world.setThundering(!world.hasStorm());
world.setStorm(!world.hasStorm());
Thank you again for your contribution! |
Hi,
Another PR on the #499 issue. This time, I added toggledownfall, spawnpoint and setidletimeout.
I saw that no commands had unit tests so far. I implemented some on those three commands mainly using mockito. Tell me what you think of it, if it's really relevant or not.
Edit: I also added the /setworldspawn command.