Skip to content

Commit

Permalink
Refactor region commands and make the necessary ones run in the backg…
Browse files Browse the repository at this point in the history
…round.
  • Loading branch information
sk89q committed Aug 15, 2014
1 parent a35cb92 commit 28c538e
Show file tree
Hide file tree
Showing 13 changed files with 1,228 additions and 1,720 deletions.
Expand Up @@ -30,7 +30,7 @@

import static com.google.common.base.Preconditions.checkNotNull;

class AsyncCommandHelper {
public class AsyncCommandHelper {

private final ListenableFuture<?> future;
private final WorldGuardPlugin plugin;
Expand Down
Expand Up @@ -30,7 +30,7 @@
/**
* Command-related utility methods.
*/
final class CommandUtils {
public final class CommandUtils {

private CommandUtils() {
}
Expand All @@ -41,7 +41,7 @@ private CommandUtils() {
* @param owner the owner object
* @return a name
*/
static String getOwnerName(@Nullable Object owner) {
public static String getOwnerName(@Nullable Object owner) {
if (owner == null) {
return "?";
} else if (owner instanceof Player) {
Expand All @@ -62,7 +62,7 @@ static String getOwnerName(@Nullable Object owner) {
* @param sender the sender
* @return a function
*/
static Function<String, ?> messageFunction(final CommandSender sender) {
public static Function<String, ?> messageFunction(final CommandSender sender) {
return new Function<String, Object>() {
@Override
public Object apply(@Nullable String s) {
Expand Down
Expand Up @@ -28,14 +28,14 @@

import static com.google.common.base.Preconditions.checkNotNull;

class FutureProgressListener implements Runnable {
public class FutureProgressListener implements Runnable {

private static final Timer timer = new Timer();
private static final int MESSAGE_DELAY = 1000;

private final MessageTimerTask task;

FutureProgressListener(CommandSender sender, String message) {
public FutureProgressListener(CommandSender sender, String message) {
checkNotNull(sender);
checkNotNull(message);

Expand Down
Expand Up @@ -28,7 +28,7 @@

import static com.google.common.base.Preconditions.checkNotNull;

class MessageFutureCallback<V> implements FutureCallback<V> {
public class MessageFutureCallback<V> implements FutureCallback<V> {

private final WorldGuardPlugin plugin;
private final CommandSender sender;
Expand Down Expand Up @@ -57,15 +57,15 @@ public void onFailure(@Nullable Throwable throwable) {
sender.sendMessage(ChatColor.RED + failure + ": " + plugin.convertThrowable(throwable));
}

static class Builder {
public static class Builder {
private final WorldGuardPlugin plugin;
private final CommandSender sender;
@Nullable
private String success;
@Nullable
private String failure;

Builder(WorldGuardPlugin plugin, CommandSender sender) {
public Builder(WorldGuardPlugin plugin, CommandSender sender) {
checkNotNull(plugin);
checkNotNull(sender);

Expand Down
Expand Up @@ -25,7 +25,7 @@

import static com.google.common.base.Preconditions.checkNotNull;

class MessageTimerTask extends TimerTask {
public class MessageTimerTask extends TimerTask {

private final CommandSender sender;
private final String message;
Expand Down
Expand Up @@ -19,6 +19,8 @@

package com.sk89q.worldguard.bukkit.commands;

import com.sk89q.worldguard.bukkit.commands.region.MemberCommands;
import com.sk89q.worldguard.bukkit.commands.region.RegionCommands;
import org.bukkit.command.CommandSender;

import com.sk89q.minecraft.util.commands.Command;
Expand All @@ -35,7 +37,7 @@ public ProtectionCommands(WorldGuardPlugin plugin) {
}

@Command(aliases = {"region", "regions", "rg"}, desc = "Region management commands")
@NestedCommand({RegionCommands.class, RegionMemberCommands.class})
@NestedCommand({RegionCommands.class, MemberCommands.class})
public void region(CommandContext args, CommandSender sender) {}

@Command(aliases = {"worldguard", "wg"}, desc = "WorldGuard commands")
Expand Down

This file was deleted.

0 comments on commit 28c538e

Please sign in to comment.