Moving some commands

This commit is contained in:
NotMyFault
2019-04-21 19:01:49 +02:00
parent f56460c9ac
commit 43fec813b8
5 changed files with 79 additions and 158 deletions

View File

@ -15,9 +15,17 @@ import org.bukkit.plugin.java.JavaPlugin;
*/
public class VoxelSniper extends JavaPlugin {
private static VoxelSniper instance;
private SniperManager sniperManager = new SniperManager(this);
private final VoxelSniperListener voxelSniperListener = new VoxelSniperListener(this);
private SniperManager sniperManager = new SniperManager(this);
private VoxelSniperConfiguration voxelSniperConfiguration;
private Brushes brushManager = new Brushes();
/**
* @return {@link VoxelSniper}
*/
public static VoxelSniper getInstance() {
return VoxelSniper.instance;
}
/**
* Returns {@link com.thevoxelbox.voxelsniper.Brushes} for current instance.
@ -28,15 +36,6 @@ public class VoxelSniper extends JavaPlugin {
return brushManager;
}
private Brushes brushManager = new Brushes();
/**
* @return {@link VoxelSniper}
*/
public static VoxelSniper getInstance() {
return VoxelSniper.instance;
}
/**
* Returns object for accessing global VoxelSniper options.
*
@ -67,7 +66,7 @@ public class VoxelSniper extends JavaPlugin {
return voxelSniperListener.onCommand((Player) sender, arguments, command.getName());
}
getLogger().info("Only Players can execute commands.");
getLogger().info("Only players can execute VoxelSniper commands.");
return true;
}

View File

@ -1,5 +1,6 @@
package com.thevoxelbox.voxelsniper.command;
import com.boydti.fawe.config.BBC;
import com.thevoxelbox.voxelsniper.Sniper;
import com.thevoxelbox.voxelsniper.VoxelSniper;
import com.thevoxelbox.voxelsniper.api.command.VoxelCommand;
@ -21,12 +22,12 @@ public class VoxelUndoCommand extends VoxelCommand {
int amount = Integer.parseInt(args[0]);
sniper.undo(amount);
} catch (NumberFormatException exception) {
player.sendMessage("Error while parsing amount of undo. Number format exception.");
player.sendMessage(BBC.getPrefix() + "Number expected; string given.");
}
} else {
sniper.undo();
}
plugin.getLogger().info("Player \"" + player.getName() + "\" used /u");
// plugin.getLogger().info("Player \"" + player.getName() + "\" used /u");
return true;
}
}