Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

Commit

Permalink
Fix crash at startup
Browse files Browse the repository at this point in the history
  • Loading branch information
Raft08 committed Jan 18, 2024
1 parent 14e3b4e commit 1d43e72
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 12 deletions.
1 change: 0 additions & 1 deletion src/main/java/fr/atlasworld/network/core/AtlasNetwork.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ public static AtlasNetwork getInstance() {
public void start() {
LOGGER.info("Loading AtlasNetwork..");

ServerFileSources.initialize(SystemServerManager.getInstance());
PermissionDelegateImpl.init(); // Register delegate.

SystemModuleManager.INSTANCE.loadModules(this); // Load Modules
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,8 @@ public class ServerFileSources {
public static final ServerFileSource FILE = new LocalServerFileSource();
public static final ServerFileSource STRING = new StringServerFileSource();

private static SystemServerManager serverManager;

public static void initialize(SystemServerManager serverManager) {
if (ServerFileSources.serverManager != null)
throw new UnsupportedOperationException("Server File Sources are already initialized.");

serverManager.registerFileSource("file", FILE);
serverManager.registerFileSource("string", STRING);
}

public static ServerFileSource get(String fileType) {
ServerFileSource source = serverManager.getFileSource(fileType);
ServerFileSource source = SystemServerManager.getInstance().getFileSource(fileType);

if (source == null)
throw new InvalidConfigurationException("Could not find file type '" + fileType + "'.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ public static void load(AtlasNetworkServer server) {
instance = new SystemServerManager(configuration, server);

instance.registerFileSource("file", ServerFileSources.FILE);
instance.registerFileSource("string", ServerFileSources.STRING);
}

public static void init() {
Expand Down

0 comments on commit 1d43e72

Please sign in to comment.