Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
9b0a378
Refactor global variable usage to constants change client cache from …
Skidamek Jan 24, 2026
6d3a981
Integrate FileMetadataCache for ModpackContent generation and improve…
Skidamek Jan 24, 2026
ac0d01a
Refactor FileInspection to use FileMetadataCache for hash retrieval
Skidamek Jan 24, 2026
f43f1ad
Update ModpackContentItems to include forceCopy field and enhance log…
Skidamek Jan 24, 2026
5010029
Update fabric-loom plugin version to 1.15-SNAPSHOT
Skidamek Jan 24, 2026
94bb725
Try revert to putAll instead of overwrite
Skidamek Jan 24, 2026
29e3f2f
Refactor FileMetadataCache to support shared cache instances and impr…
Skidamek Jan 25, 2026
af07cae
Cleanup FileMetadataCache
Skidamek Jan 25, 2026
a76e27b
Add ModFileCache reduces boot time by 40%
Skidamek Jan 25, 2026
a63537b
stuf
Skidamek Jan 25, 2026
1743bfc
lesser evil
Skidamek Jan 26, 2026
c0c9a54
Fix nested services regression
Skidamek Jan 26, 2026
497ddab
temporary ugly path mapping fix
Skidamek Jan 28, 2026
bad575b
Annotate FetchManager as nullable and handle it
Skidamek Jan 28, 2026
b46f79f
rethrow e and handle null downloadmanager in case
Skidamek Jan 30, 2026
0b653e5
Implement nix-store like file management
Skidamek Jan 30, 2026
a74bee9
Make sure the file exists before trying to link from it
Skidamek Jan 30, 2026
710551f
Improve isUpdate performance
Skidamek Feb 1, 2026
3072fa8
Rewrite speedometer to make metrics smoother
Skidamek Feb 9, 2026
13f5f1e
Implement clever file download scheduler to avoid "The Tail of Death"…
Skidamek Feb 9, 2026
318994c
Reuse single HTTP client among other smaller improvements
Skidamek Feb 9, 2026
f7e7f12
Improve speedometer a little
Skidamek Feb 9, 2026
f64ec1c
run mo/cf fetches in parallel and randomize url order outputs
Skidamek Feb 10, 2026
547dfdc
add whacky protocol version negotiation
Skidamek Feb 10, 2026
97c11fb
change cache dir
Skidamek Feb 11, 2026
97603f3
ahahagah
Skidamek Feb 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ val deps = listOf(
"com.google.code.gson:gson:2.13.2",
"org.bouncycastle:bcpkix-jdk18on:1.82",
"org.apache.httpcomponents.client5:httpclient5:5.5.1",
"org.tomlj:tomlj:1.1.1"
"org.tomlj:tomlj:1.1.1",
"com.h2database:h2-mvstore:2.4.240"
)

dependencies {
// minecraft/loaders uses these, so we cant just implement them because it wont resolve in gradle
deps.forEach { compileOnly(it) }
deps.forEach { runtimeOnly(it) }
deps.forEach { testImplementation(it) }

testImplementation("org.junit.jupiter:junit-jupiter:6.0.1")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@

import java.nio.file.Path;

public class GlobalVariables {
// More or less constants
// TODO cleanup
public class Constants {
public static final Logger LOGGER = LogManager.getLogger("AutoModpack");
public static final String MOD_ID = "automodpack"; // For real its "automodpack_mod" but we use this for resource locations etc.
public static Boolean DEBUG = false;
Expand All @@ -30,6 +32,7 @@ public class GlobalVariables {
public static Jsons.ClientConfigFieldsV2 clientConfig;
public static Jsons.KnownHostsFields knownHosts;
public static final Path automodpackDir = Path.of("automodpack");
public static final Path storeDir = automodpackDir.resolve("store");
public static final Path hostModpackDir = automodpackDir.resolve("host-modpack");
// TODO More server modpacks
// Main - required
Expand All @@ -39,6 +42,9 @@ public class GlobalVariables {
public static Path hostModpackContentFile = hostModpackDir.resolve("automodpack-content.json");
public static Path serverConfigFile = automodpackDir.resolve("automodpack-server.json");
public static Path clientLocalMetadataFile = automodpackDir.resolve("automodpack-client-metadata.json");
public static Path cacheDir = automodpackDir.resolve("cache");
public static Path hashCacheDBFile = cacheDir.resolve("hash-cache.db");
public static Path modCacheDBFile = cacheDir.resolve("mod-cache.db");
public static Path clientDummyFilesFile = automodpackDir.resolve("automodpack-dummy-files.json");
public static Path clientDeletionTimeStamps = automodpackDir.resolve("automodpack-deletion-timestamps-files.json");
public static Path serverCoreConfigFile = automodpackDir.resolve("automodpack-core.json");
Expand Down
3 changes: 1 addition & 2 deletions core/src/main/java/pl/skidam/automodpack_core/Server.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
import pl.skidam.automodpack_core.protocol.netty.NettyServer;

import java.nio.file.Path;
import java.util.ArrayList;
import java.util.HashSet;

import static pl.skidam.automodpack_core.GlobalVariables.*;
import static pl.skidam.automodpack_core.Constants.*;

public class Server {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import java.security.SecureRandom;
import java.util.Base64;

import static pl.skidam.automodpack_core.GlobalVariables.*;
import static pl.skidam.automodpack_core.Constants.*;

public class Secrets {
public static class Secret { // unfortunately has to be a class instead of record because of older gson version in 1.18 mc
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package pl.skidam.automodpack_core.auth;

import pl.skidam.automodpack_core.GlobalVariables;
import pl.skidam.automodpack_core.Constants;
import pl.skidam.automodpack_core.config.ConfigTools;
import pl.skidam.automodpack_core.config.Jsons;

Expand Down Expand Up @@ -52,8 +52,8 @@ public void save(String key, Secrets.Secret secret) throws IllegalArgumentExcept
}
}

private static final SecretsCache hostSecrets = new SecretsCache(GlobalVariables.serverSecretsFile);
private static final SecretsCache clientSecrets = new SecretsCache(GlobalVariables.clientSecretsFile);
private static final SecretsCache hostSecrets = new SecretsCache(Constants.serverSecretsFile);
private static final SecretsCache clientSecrets = new SecretsCache(Constants.clientSecretsFile);

public static Map.Entry<String, Secrets.Secret> getHostSecret(String secret) {
hostSecrets.load();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import java.nio.file.Path;
import java.nio.file.StandardOpenOption;

import static pl.skidam.automodpack_core.GlobalVariables.*;
import static pl.skidam.automodpack_core.Constants.*;

public class ConfigTools {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.util.*;
import java.util.regex.Pattern;

import static pl.skidam.automodpack_core.GlobalVariables.*;
import static pl.skidam.automodpack_core.Constants.*;

public class ConfigUtils {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public ModpackContentItem(String file, String size, String type, boolean editabl

@Override
public String toString() {
return String.format("ModpackContentItems(file=%s, size=%s, type=%s, editable=%s, sha1=%s, murmur=%s)", file, size, type, editable, sha1, murmur);
return String.format("ModpackContentItems(file=%s, size=%s, type=%s, editable=%s, forceCopy=%s, sha1=%s, murmur=%s)", file, size, type, editable, forceCopy, sha1, murmur);
}

// if the relative file path is the same, we consider the items equal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
package pl.skidam.automodpack_core.loader;

import pl.skidam.automodpack_core.utils.FileInspection;

import java.util.Collection;

public interface LoaderManagerService {
enum ModPlatform { FABRIC, QUILT, FORGE, NEOFORGE }
enum EnvironmentType { CLIENT, SERVER, UNIVERSAL }

ModPlatform getPlatformType();
Collection<FileInspection.Mod> getModList();
boolean isModLoaded(String modId);
String getLoaderVersion();
EnvironmentType getEnvironmentType();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package pl.skidam.automodpack_core.loader;

import pl.skidam.automodpack_core.utils.FileInspection;
import pl.skidam.automodpack_core.utils.cache.FileMetadataCache;

import java.nio.file.Path;
import java.util.List;

public interface ModpackLoaderService {
void loadModpack(List<Path> modpackMods);
List<FileInspection.Mod> getModpackNestedConflicts(Path modpackDir); // Returns list of mods from the modpack Dir that are conflicting with the mods from standard mods dir
List<FileInspection.Mod> getModpackNestedConflicts(Path modpackDir, FileMetadataCache cache); // Returns list of mods from the modpack Dir that are conflicting with the mods from standard mods dir
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
package pl.skidam.automodpack_core.loader;

import pl.skidam.automodpack_core.utils.FileInspection;

import java.util.Collection;

public class NullLoaderManager implements LoaderManagerService {
@Override
public ModPlatform getPlatformType() {
Expand All @@ -15,11 +11,6 @@ public boolean isModLoaded(String modId) {
return false;
}

@Override
public Collection<FileInspection.Mod> getModList() {
return null;
}

@Override
public String getLoaderVersion() {
return null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package pl.skidam.automodpack_core.loader;

import pl.skidam.automodpack_core.utils.FileInspection;
import pl.skidam.automodpack_core.utils.cache.FileMetadataCache;

import java.nio.file.Path;
import java.util.List;
Expand All @@ -13,7 +14,7 @@ public void loadModpack(List<Path> modpackMods) {
}

@Override
public List<FileInspection.Mod> getModpackNestedConflicts(Path modpackDir) {
public List<FileInspection.Mod> getModpackNestedConflicts(Path modpackDir, FileMetadataCache cache) {
throw new AssertionError("Loader class not found");
}
}
Loading