mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-24 09:18:14 +00:00
fix(Grasscutter.java): Exclude compiled protos package from being scanned by reflections
This commit is contained in:
parent
d0e3720748
commit
655016c92e
@ -29,13 +29,15 @@ import lombok.*;
|
||||
import org.jline.reader.*;
|
||||
import org.jline.terminal.*;
|
||||
import org.reflections.Reflections;
|
||||
import org.reflections.util.ConfigurationBuilder;
|
||||
import org.reflections.util.FilterBuilder;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public final class Grasscutter {
|
||||
public static final File configFile = new File("./config.json");
|
||||
public static final Reflections reflector = new Reflections("emu.grasscutter");
|
||||
@Getter private static final Logger logger = (Logger) LoggerFactory.getLogger(Grasscutter.class);
|
||||
|
||||
public static final Reflections reflector;
|
||||
@Getter public static ConfigContainer config;
|
||||
|
||||
@Getter @Setter private static Language language;
|
||||
@ -75,6 +77,15 @@ public final class Grasscutter {
|
||||
var mongoLogger = (Logger) LoggerFactory.getLogger("org.mongodb.driver");
|
||||
mongoLogger.setLevel(Level.OFF);
|
||||
|
||||
// Configure the reflector.
|
||||
reflector = new Reflections(
|
||||
new ConfigurationBuilder()
|
||||
.forPackage("emu.grasscutter")
|
||||
.filterInputsBy(new FilterBuilder()
|
||||
.includePackage("emu.grasscutter")
|
||||
.excludePackage("emu.grasscutter.net.proto"))
|
||||
);
|
||||
|
||||
// Load server configuration.
|
||||
Grasscutter.loadConfig();
|
||||
// Attempt to update configuration.
|
||||
|
Loading…
Reference in New Issue
Block a user