Skip to content

Commit

Permalink
Merge pull request #859 from lonevox/fix-default-config-keybinds
Browse files Browse the repository at this point in the history
Fix keybinds in default options
  • Loading branch information
LatvianModder authored Jul 11, 2024
2 parents 620dc01 + dec071b commit 9e04493
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import dev.latvian.mods.kubejs.script.data.ExportablePackResources;
import dev.latvian.mods.kubejs.script.data.GeneratedData;
import dev.latvian.mods.kubejs.util.KubeJSPlugins;
import net.minecraft.SharedConstants;
import net.minecraft.Util;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.TextureAtlas;
Expand All @@ -34,7 +35,11 @@
import org.jetbrains.annotations.Nullable;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.List;
import java.util.concurrent.CompletableFuture;
Expand Down Expand Up @@ -73,7 +78,10 @@ public static void copyDefaultOptionsFile(File optionsFile) {
if (Files.exists(defOptions)) {
try {
KubeJS.LOGGER.info("Loaded default options from kubejs/config/defaultoptions.txt");
Files.copy(defOptions, optionsFile.toPath());
final PrintWriter printwriter = new PrintWriter(new OutputStreamWriter(new FileOutputStream(optionsFile), StandardCharsets.UTF_8));
printwriter.println("version:" + SharedConstants.getCurrentVersion().getWorldVersion());
printwriter.print(Files.readString(defOptions));
printwriter.close();
} catch (IOException ex) {
ex.printStackTrace();
}
Expand Down

0 comments on commit 9e04493

Please sign in to comment.