Fixed NoClassDefError on Bungee

This commit is contained in:
Rsl1122 2017-10-29 12:41:20 +02:00
parent 7ff481d610
commit 3236c61820
2 changed files with 11 additions and 5 deletions

View File

@ -7,6 +7,7 @@ import com.djrapitops.plugin.command.SubCommand;
import com.djrapitops.plugin.task.AbsRunnable; import com.djrapitops.plugin.task.AbsRunnable;
import main.java.com.djrapitops.plan.Log; import main.java.com.djrapitops.plan.Log;
import main.java.com.djrapitops.plan.Permissions; import main.java.com.djrapitops.plan.Permissions;
import main.java.com.djrapitops.plan.Plan;
import main.java.com.djrapitops.plan.api.IPlan; import main.java.com.djrapitops.plan.api.IPlan;
import main.java.com.djrapitops.plan.data.WebUser; import main.java.com.djrapitops.plan.data.WebUser;
import main.java.com.djrapitops.plan.database.tables.SecurityTable; import main.java.com.djrapitops.plan.database.tables.SecurityTable;
@ -14,8 +15,6 @@ import main.java.com.djrapitops.plan.locale.Locale;
import main.java.com.djrapitops.plan.locale.Msg; import main.java.com.djrapitops.plan.locale.Msg;
import main.java.com.djrapitops.plan.utilities.Check; import main.java.com.djrapitops.plan.utilities.Check;
import main.java.com.djrapitops.plan.utilities.PassEncryptUtil; import main.java.com.djrapitops.plan.utilities.PassEncryptUtil;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.core.Logger;
/** /**
* Command for registering web users. * Command for registering web users.
@ -40,8 +39,10 @@ public class RegisterCommand extends SubCommand {
Locale.get(Msg.CMD_USG_WEB_REGISTER).toString(), Locale.get(Msg.CMD_USG_WEB_REGISTER).toString(),
"<password> [name] [access lvl]"); "<password> [name] [access lvl]");
this.plugin = plugin; this.plugin = plugin;
if (plugin instanceof Plan) {
setupFilter(); setupFilter();
} }
}
@Override @Override
public String[] addHelp() { public String[] addHelp() {
@ -140,7 +141,6 @@ public class RegisterCommand extends SubCommand {
* Setups the command console output filter * Setups the command console output filter
*/ */
private void setupFilter() { private void setupFilter() {
Logger logger = (Logger) LogManager.getRootLogger(); new RegisterCommandFilter().registerFilter();
logger.addFilter(new RegisterCommandFilter());
} }
} }

View File

@ -2,6 +2,7 @@ package main.java.com.djrapitops.plan.command.commands;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import org.apache.logging.log4j.Level; import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Marker; import org.apache.logging.log4j.Marker;
import org.apache.logging.log4j.core.LogEvent; import org.apache.logging.log4j.core.LogEvent;
import org.apache.logging.log4j.core.Logger; import org.apache.logging.log4j.core.Logger;
@ -20,6 +21,11 @@ public class RegisterCommandFilter extends AbstractFilter {
private final Set<String> censoredCommands = ImmutableSet.of("/plan web register", "/plan webuser register", "/plan register"); private final Set<String> censoredCommands = ImmutableSet.of("/plan web register", "/plan webuser register", "/plan register");
public void registerFilter() {
Logger logger = (Logger) LogManager.getRootLogger();
logger.addFilter(this);
}
@Override @Override
public Result filter(LogEvent event) { public Result filter(LogEvent event) {
if (event == null) { if (event == null) {