Skip to content
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

Merged
merged 8 commits into from
Jul 9, 2017
Merged

#499 - Implement toggledownfall, spawnpoint, setidletimeout and setworldspawn #523

merged 8 commits into from
Jul 9, 2017

Conversation

FlorentClarret
Copy link
Member

@FlorentClarret FlorentClarret commented Jul 8, 2017

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.

@aramperes aramperes self-requested a review July 8, 2017 23:14
}

if (timeout <= 0) {
sender.sendMessage(ChatColor.RED + "Timeout has to be positive");
Copy link
Member

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.");
Copy link
Member

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.");
Copy link
Member

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()) {
Copy link
Member

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());

@aramperes aramperes mentioned this pull request Jul 8, 2017
53 tasks
@FlorentClarret FlorentClarret changed the title #499 - Implement toggledownfall, spawnpoint and setidletimeout #499 - Implement toggledownfall, spawnpoint, setidletimeout and setworldspawn Jul 9, 2017
@aramperes aramperes merged commit 1a3a37b into GlowstoneMC:master Jul 9, 2017
@aramperes
Copy link
Member

Thank you again for your contribution!

@FlorentClarret FlorentClarret deleted the 499_commandline branch July 9, 2017 18:25
Postremus pushed a commit to MyPlayPlanet/Glowstone that referenced this pull request Jul 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants