sanity checks for some command params
rollback/redo of chat or kills is not possible
This commit is contained in:
1 parent
19762691d0
commit
759cd230a1
1 file changed
+24
@@ -634,6 +634,18 @@ public class CommandsHandler implements CommandExecutor {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
|
if(params.bct == BlockChangeType.CHAT) {
|
||||||
|
sender.sendMessage(ChatColor.RED + "Chat cannot be rolled back");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(params.bct == BlockChangeType.KILLS) {
|
||||||
|
sender.sendMessage(ChatColor.RED + "Kills cannot be rolled back");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(params.sum != SummarizationMode.NONE) {
|
||||||
|
sender.sendMessage(ChatColor.RED + "Cannot rollback summarized changes");
|
||||||
|
return;
|
||||||
|
}
|
||||||
params.needCoords = true;
|
params.needCoords = true;
|
||||||
params.needType = true;
|
params.needType = true;
|
||||||
params.needData = true;
|
params.needData = true;
|
||||||
@@ -712,6 +724,18 @@ public class CommandsHandler implements CommandExecutor {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
|
if(params.bct == BlockChangeType.CHAT) {
|
||||||
|
sender.sendMessage(ChatColor.RED + "Chat cannot be redone");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(params.bct == BlockChangeType.KILLS) {
|
||||||
|
sender.sendMessage(ChatColor.RED + "Kills cannot be redone");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(params.sum != SummarizationMode.NONE) {
|
||||||
|
sender.sendMessage(ChatColor.RED + "Cannot redo summarized changes");
|
||||||
|
return;
|
||||||
|
}
|
||||||
params.needCoords = true;
|
params.needCoords = true;
|
||||||
params.needType = true;
|
params.needType = true;
|
||||||
params.needData = true;
|
params.needData = true;
|
||||||
|
|||||||
Reference in new issue
Block a user