Skip to content

Commit

Permalink
change export directory and bump ver
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamCalculator committed Sep 19, 2024
1 parent bcea755 commit ec0e647
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ yarn_mappings=1.20.1+build.10
loader_version=0.15.3

# Mod Properties
mod_version=1.2
mod_version=1.2.1
maven_group=com.adamcalculator.pawville
archives_base_name=cheststofox

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,12 @@
import java.util.TimerTask;

public class ChestsToFox implements ClientModInitializer {
public static final int CHESTS_TO_FOX_VERSION_BUILD = 25;
public static final String CHESTS_TO_FOX_VERSION_NAME = "1.2";
public static final int CHESTS_TO_FOX_VERSION_BUILD = 26;
public static final String CHESTS_TO_FOX_VERSION_NAME = "1.2.1";


public static final Logger LOGGER = LoggerFactory.getLogger("ChestsToFox");
public static final ContainerLinker CONTAINER_LINKER = new ContainerLinker();
public static final String DIR = "config/cheststofox";
private static final Timer timer = new Timer();


Expand Down Expand Up @@ -102,7 +101,7 @@ private ActionResult clickedToBlock(World world, BlockHitResult hitResult) {
}

public static File getExportsDir() {
return new File(MinecraftClient.getInstance().runDirectory, DIR);
return new File(Config.CONFIG.workdir.replace("%MINECRAFT%", MinecraftClient.getInstance().runDirectory.getAbsolutePath()));
}

public static String getCurrentNameOfExportFile() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ private static void genericExport(CommandContext<FabricClientCommandSource> cont
final String filename = ChestsToFox.getCurrentNameOfExportFile();
final File file = new File(ChestsToFox.getExportsDir(), filename);
Files.writeFile(file, exportedString);
Text filetext = Text.literal(ChestsToFox.DIR + "/" + file.getName())
Text filetext = Text.literal(Config.CONFIG.workdir.replace("%MINECRAFT%", ".minecraft") + "/" + file.getName())
.formatted(Formatting.UNDERLINE, Formatting.ITALIC, Formatting.DARK_GREEN)
.styled(style -> style.withClickEvent(new ClickEvent(ClickEvent.Action.OPEN_FILE, ChestsToFox.getExportsDir().getAbsolutePath())));

Expand Down
7 changes: 6 additions & 1 deletion src/client/java/com/adamcalculator/cheststofox/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ public class Config {

@SerializedName("auto_close_guis")
public boolean autoCloseWhenSaving = false;
public transient int autoCloseWhenSavingDelay = 200;

@SerializedName("auto_close_delay")
public int autoCloseWhenSavingDelay = 200;

@SerializedName("work_dir")
public String workdir = "%MINECRAFT%/config/cheststofox";

public boolean isSaving() {
return savingEnable;
Expand Down

0 comments on commit ec0e647

Please sign in to comment.