mirror of
https://github.com/TotalFreedomMC/TF-PlotSquared.git
synced 2025-08-07 04:53:00 +00:00
Starting to convert commands to a smarter system :3
This commit is contained in:
parent
6b229ac504
commit
e1c8dcc4be
57 changed files with 1443 additions and 726 deletions
|
@ -24,6 +24,9 @@ import java.util.ArrayList;
|
|||
import java.util.HashSet;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.intellectualsites.commands.Argument;
|
||||
import com.intellectualsites.commands.CommandDeclaration;
|
||||
import com.intellectualsites.commands.callers.CommandCaller;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import com.intellectualcrafters.plot.PS;
|
||||
|
@ -40,15 +43,23 @@ import com.intellectualcrafters.plot.util.MainUtil;
|
|||
import com.intellectualcrafters.plot.util.Permissions;
|
||||
import com.plotsquared.bukkit.util.bukkit.UUIDHandler;
|
||||
|
||||
/**
|
||||
* @author Citymonstret
|
||||
*/
|
||||
@CommandDeclaration(
|
||||
command = "merge",
|
||||
aliases = {"m"},
|
||||
description = "Merge the plot you are standing on, with another plot",
|
||||
permission = "plots.merge",
|
||||
usage = "/plot merge [direction]",
|
||||
category = CommandCategory.ACTIONS,
|
||||
requiredType = PlotPlayer.class
|
||||
)
|
||||
public class Merge extends SubCommand {
|
||||
public final static String[] values = new String[] { "north", "east", "south", "west" };
|
||||
public final static String[] aliases = new String[] { "n", "e", "s", "w" };
|
||||
|
||||
public Merge() {
|
||||
super(Command.MERGE, "Merge the plot you are standing on with another plot.", "merge", CommandCategory.ACTIONS, true);
|
||||
requiredArguments = new Argument[] {
|
||||
Argument.String
|
||||
};
|
||||
}
|
||||
|
||||
public static String direction(float yaw) {
|
||||
|
@ -74,7 +85,8 @@ public class Merge extends SubCommand {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(final PlotPlayer plr, final String... args) {
|
||||
public boolean onCommand(final CommandCaller caller, final String[] args) {
|
||||
final PlotPlayer plr = (PlotPlayer) caller.getSuperCaller();
|
||||
final Location loc = plr.getLocationFull();
|
||||
final Plot plot = MainUtil.getPlot(loc);
|
||||
if (plot == null) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue