Compare commits

...
3 Commits
Author SHA1 Message Date
Alexdoru 4bbf1ee05e fix log file path (#28) 2026-03-30 23:34:47 -04:00
Alexdoru c0e567f326 Fix commands leaking server (#27) 2026-03-26 12:41:30 +01:00
Alexdoru db6a83b2c0 Fix memory leak in MTLogger (#26) 2026-03-23 22:49:50 +01:00
3 changed files with 8 additions and 4 deletions

No files matched your search

@@ -38,6 +38,10 @@ public class MTLogger implements ILogger {
unprocessed.clear();
}
public void clearPlayers() {
players.clear();
}
@Override
public void logCommand(String message) {
for (ILogger logger : loggers) {
@@ -98,8 +98,7 @@ public class MineTweakerMod {
new MCFormatter(),
new MCVanilla());
MineTweakerImplementationAPI.logger
.addLogger(new FileLogger(new File("logs" + File.pathSeparator + "minetweaker.log")));
MineTweakerImplementationAPI.logger.addLogger(new FileLogger(new File("logs/minetweaker.log")));
MineTweakerImplementationAPI.platform = MCPlatformFunctions.INSTANCE;
File globalDir = new File("scripts");
@@ -192,5 +191,6 @@ public class MineTweakerMod {
public void onServerStopped(FMLServerStoppedEvent ev) {
MineTweakerImplementationAPI.onServerStop();
MineTweakerImplementationAPI.setScriptProvider(scriptsGlobal);
MineTweakerImplementationAPI.logger.clearPlayers();
}
}
@@ -80,7 +80,7 @@ public class MCServer extends AbstractServer {
}
}
private class MCCommand implements ICommand {
private static class MCCommand implements ICommand {
private final String name;
private final String usage;
@@ -148,7 +148,7 @@ public class MCServer extends AbstractServer {
}
}
private class AddCommandAction implements IUndoableAction {
private static class AddCommandAction implements IUndoableAction {
private final ICommand command;