Merge branch 'IronException-feature/closeNewChunkSaving' into features-master

This commit is contained in:
Bella 2019-12-19 19:56:58 -05:00
commit e679c4f365
1 changed files with 11 additions and 0 deletions

View File

@ -37,6 +37,7 @@ public class ChunkFinder extends Module {
private Setting<SaveOption> saveOption = register(Settings.enumBuilder(SaveOption.class).withValue(SaveOption.extraFolder).withName("Save Option").withVisibility(aBoolean -> saveNewChunks.getValue()).build());
private Setting<Boolean> saveInRegionFolder = register(Settings.booleanBuilder("In Region").withValue(false).withVisibility(aBoolean -> saveNewChunks.getValue()).build());
private Setting<Boolean> alsoSaveNormalCoords = register(Settings.booleanBuilder("Save Normal Coords").withValue(false).withVisibility(aBoolean -> saveNewChunks.getValue()).build());
private Setting<Boolean> closeFile = register(Settings.booleanBuilder("Close File").withValue(false).withVisibility(aBoolean -> saveNewChunks.getValue()).build());
private LastSetting lastSetting = new LastSetting();
private PrintWriter logWriter;
@ -107,8 +108,18 @@ public class ChunkFinder extends Module {
GL11.glTranslated(x, -(y + yOffset.getValue()), z);
}
@Override
public void onUpdate() {
if (!closeFile.getValue())
return;
closeFile.setValue(false);
Command.sendChatMessage("close file");
logWriterClose();
}
@Override
protected void onDisable() {
Command.sendChatMessage("onDisable");
logWriterClose();
chunks.clear();
}