Starting to convert commands to a smarter system :3

This commit is contained in:
Sauilitired
2015-07-26 20:50:54 +02:00
parent 6b229ac504
commit e1c8dcc4be
57 changed files with 1443 additions and 726 deletions

View File

@ -31,6 +31,7 @@ import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.config.Settings;
import com.intellectualcrafters.plot.database.DBFunc;
import com.intellectualsites.commands.callers.CommandCaller;
import com.plotsquared.bukkit.listeners.PlotListener;
import com.intellectualcrafters.plot.object.BlockLoc;
import com.intellectualcrafters.plot.object.ChunkLoc;
@ -1421,6 +1422,15 @@ public class MainUtil {
return sendMessage(plr, msg, true);
}
public static boolean sendCallerMessage(final CommandCaller plr, final String msg) {
if (plr.getSuperCaller() instanceof PlotPlayer) {
sendMessage((PlotPlayer) plr.getSuperCaller(), msg);
} else {
sendConsoleMessage(msg);
}
return true;
}
public static void sendConsoleMessage(String msg) {
sendMessage(null, msg);
}
@ -1507,6 +1517,15 @@ public class MainUtil {
return lines.toArray(new String[lines.size()]);
}
public static boolean sendCallerMessage(final CommandCaller caller, final C c, final String... args) {
if (caller.getSuperCaller() instanceof PlotPlayer) {
sendMessage((PlotPlayer) caller.getSuperCaller(), c, args);
} else {
sendConsoleMessage(c, args);
}
return true;
}
/**
* Send a message to the player
*