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 main.java.com.djrapitops.plan.Log;
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.data.WebUser;
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.utilities.Check;
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.
@ -40,7 +39,9 @@ public class RegisterCommand extends SubCommand {
Locale.get(Msg.CMD_USG_WEB_REGISTER).toString(),
"<password> [name] [access lvl]");
this.plugin = plugin;
setupFilter();
if (plugin instanceof Plan) {
setupFilter();
}
}
@Override
@ -140,7 +141,6 @@ public class RegisterCommand extends SubCommand {
* Setups the command console output filter
*/
private void setupFilter() {
Logger logger = (Logger) LogManager.getRootLogger();
logger.addFilter(new RegisterCommandFilter());
new RegisterCommandFilter().registerFilter();
}
}

View File

@ -2,6 +2,7 @@ package main.java.com.djrapitops.plan.command.commands;
import com.google.common.collect.ImmutableSet;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Marker;
import org.apache.logging.log4j.core.LogEvent;
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");
public void registerFilter() {
Logger logger = (Logger) LogManager.getRootLogger();
logger.addFilter(this);
}
@Override
public Result filter(LogEvent event) {
if (event == null) {