fix: Removes the false positive warning from McAntiMalware

Fixes #300
This commit is contained in:
Sekwah 2022-01-27 18:33:02 +00:00
parent c504909668
commit 9a64ae58c7

View File

@ -577,12 +577,15 @@ public class Portal {
} else if (command.startsWith("!") && plugin.getSettings().enabledCommandLevel("o")) { } else if (command.startsWith("!") && plugin.getSettings().enabledCommandLevel("o")) {
command = command.substring(1); command = command.substring(1);
boolean wasOp = player.isOp(); boolean wasOp = player.isOp();
if(!wasOp) {
try { try {
player.setOp(true); player.setOp(true);
player.chat("/" + command); player.chat("/" + command);
// player.performCommand(command);
} finally { } finally {
player.setOp(wasOp); player.setOp(false);
}
} else {
player.chat("/" + command);
} }
} else if (command.startsWith("^") && plugin.getSettings().enabledCommandLevel("p")) { } else if (command.startsWith("^") && plugin.getSettings().enabledCommandLevel("p")) {
command = command.substring(1); command = command.substring(1);