Attempt to do stuff with flags xD

This commit is contained in:
Sauilitired
2014-10-25 14:46:04 +02:00
parent 77153e8880
commit 04b7855f6e
3 changed files with 171 additions and 271 deletions

View File

@ -360,10 +360,24 @@ public class Set extends SubCommand {
PlotHelper.adjustWallFilling(plr, plot, new PlotBlock((short) material.getId(), data));
return true;
}
StringBuilder builder = new StringBuilder();
builder.append(C.SUBCOMMAND_SET_OPTIONS_HEADER.s());
builder.append(getArgumentList(values));
PlayerFunctions.sendMessage(plr, builder.toString());
{
AbstractFlag af = new AbstractFlag("");
try {
af = new AbstractFlag(args[0].toLowerCase());
}
catch (Exception e) {
}
if (FlagManager.getFlags().contains(af) || ((PlotMain.worldGuardListener != null) && PlotMain.worldGuardListener.str_flags.contains(args[1].toLowerCase()))) {
StringBuilder a = new StringBuilder();
if(args.length > 1) {
for(int x = 1; x < args.length; x++)
a.append(" " + args[x]);
}
plr.performCommand("plot set flag " + args[0] + args);
return true;
}
}
PlayerFunctions.sendMessage(plr, C.SUBCOMMAND_SET_OPTIONS_HEADER.s() + getArgumentList(values));
return false;
}

View File

@ -157,6 +157,7 @@ public class PlotListener {
}
public static void plotExit(Player player, Plot plot) {
player.setAllowFlight(false);
{
PlayerLeavePlotEvent callEvent = new PlayerLeavePlotEvent(player, plot);
Bukkit.getPluginManager().callEvent(callEvent);