mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 07:06:44 +01:00
Added op + deop aliases (trusted)
This commit is contained in:
parent
790bb4e948
commit
f8db0ceec5
@ -100,8 +100,7 @@ public class PlotSettings {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @deprecated
|
||||
* @return biome at plot loc
|
||||
*/
|
||||
public Biome getBiome() {
|
||||
return PlotHelper.getPlotBottomLoc(plot.getWorld(), plot.getId()).add(1, 0, 1).getBlock().getBiome();
|
||||
|
@ -127,6 +127,8 @@ public enum Command {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
OP("op", "admin"),
|
||||
DEOP("deop", "deadmin"),
|
||||
BAN("ban", "block"),
|
||||
UNBAN("unban", "unblock"),
|
||||
TP("tp", "tp");
|
||||
|
@ -0,0 +1,33 @@
|
||||
package com.intellectualcrafters.plot.commands;
|
||||
|
||||
import com.intellectualcrafters.plot.C;
|
||||
import com.intellectualcrafters.plot.PlayerFunctions;
|
||||
import com.intellectualcrafters.plot.Plot;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
* Created 2014-11-09 for PlotSquared
|
||||
*
|
||||
* @author Citymonstret
|
||||
*/
|
||||
public class DEOP extends SubCommand {
|
||||
|
||||
public DEOP() {
|
||||
super(Command.DEOP, "Alis for /plot trusted remove", "/plot deop [player]", CommandCategory.ACTIONS, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(Player plr, String... args) {
|
||||
if (args.length < 1) {
|
||||
return PlayerFunctions.sendMessage(plr, "&cUsage: &c" + usage);
|
||||
}
|
||||
if (!PlayerFunctions.isInPlot(plr)) {
|
||||
return sendMessage(plr, C.NOT_IN_PLOT);
|
||||
}
|
||||
Plot plot = PlayerFunctions.getCurrentPlot(plr);
|
||||
if (!plot.hasRights(plr)) {
|
||||
return sendMessage(plr, C.NO_PLOT_PERMS);
|
||||
}
|
||||
return plr.performCommand("plot trusted remove " + args[0]);
|
||||
}
|
||||
}
|
@ -46,7 +46,7 @@ public class MainCommand implements CommandExecutor, TabCompleter {
|
||||
public static final String
|
||||
MAIN_PERMISSION = "plots.use";
|
||||
|
||||
private static SubCommand[] _subCommands = new SubCommand[]{new Ban(), new Unban(), new Claim(), new Paste(), new Copy(), new Clipboard(), new Auto(), new Home(), new Visit(), new TP(), new Set(), new Clear(), new Delete(), new SetOwner(), new Denied(), new Helpers(), new Trusted(), new Info(), new list(), new Help(), new Debug(), new Schematic(), new plugin(), new Inventory(), new Purge(), new Reload(), new Merge(), new Unlink(), new Kick(), new Setup(), new DebugClaimTest(), new Inbox(), new Comment(), new Swap(), new MusicSubcommand()};
|
||||
private static SubCommand[] _subCommands = new SubCommand[]{new Ban(), new Unban(), new OP(), new DEOP(), new Claim(), new Paste(), new Copy(), new Clipboard(), new Auto(), new Home(), new Visit(), new TP(), new Set(), new Clear(), new Delete(), new SetOwner(), new Denied(), new Helpers(), new Trusted(), new Info(), new list(), new Help(), new Debug(), new Schematic(), new plugin(), new Inventory(), new Purge(), new Reload(), new Merge(), new Unlink(), new Kick(), new Setup(), new DebugClaimTest(), new Inbox(), new Comment(), new Swap(), new MusicSubcommand()};
|
||||
|
||||
public static ArrayList<SubCommand> subCommands = new ArrayList<SubCommand>() {
|
||||
{
|
||||
|
@ -0,0 +1,33 @@
|
||||
package com.intellectualcrafters.plot.commands;
|
||||
|
||||
import com.intellectualcrafters.plot.C;
|
||||
import com.intellectualcrafters.plot.PlayerFunctions;
|
||||
import com.intellectualcrafters.plot.Plot;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
* Created 2014-11-09 for PlotSquared
|
||||
*
|
||||
* @author Citymonstret
|
||||
*/
|
||||
public class OP extends SubCommand {
|
||||
|
||||
public OP() {
|
||||
super(Command.OP, "Alis for /plot trusted add", "/plot op [player]", CommandCategory.ACTIONS, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(Player plr, String... args) {
|
||||
if (args.length < 1) {
|
||||
return PlayerFunctions.sendMessage(plr, "&cUsage: &c" + usage);
|
||||
}
|
||||
if (!PlayerFunctions.isInPlot(plr)) {
|
||||
return sendMessage(plr, C.NOT_IN_PLOT);
|
||||
}
|
||||
Plot plot = PlayerFunctions.getCurrentPlot(plr);
|
||||
if (!plot.hasRights(plr)) {
|
||||
return sendMessage(plr, C.NO_PLOT_PERMS);
|
||||
}
|
||||
return plr.performCommand("plot trusted add " + args[0]);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user