mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-26 23:13:15 +00:00
Cache resource listing calls in resource packs (#8829)
* Make the resource lookups cached. * Include configurability and handle patch cleanup. * Document and comment the cache manager. * Make thread selection configurable. * Implement a configurable loading mechanic that falls back to default behaviour when the config is not bound yet. * Use boolean supplier and fix wildcard import. * Clean up the VPR since this is more elegant. * Clean up the VPR since this is more elegant. * Address review comments. * Address more review comments. * Fix formatting on `getSource` * Address comments by ichtt * Adapt to pups requests. * Stupid idea. * Attempt this again with a copy on write list. * Fix a concurrency and loading issue. * Fix #8813 Checks if the paths are valid resource paths. * Move the new methods on vanilla Patch.
This commit is contained in:
1 parent
57f45eaca0
commit
b70d99489b
10 files changed
+594
-30
No files matched your search
@@ -83,10 +83,33 @@ public class ForgeConfig {
|
||||
* General configuration that doesn't need to be synchronized but needs to be available before server startup
|
||||
*/
|
||||
public static class Common {
|
||||
public final BooleanValue cachePackAccess;
|
||||
public final BooleanValue indexVanillaPackCachesOnThread;
|
||||
public final BooleanValue indexModPackCachesOnThread;
|
||||
|
||||
Common(ForgeConfigSpec.Builder builder) {
|
||||
builder.comment("General configuration settings")
|
||||
.push("general");
|
||||
|
||||
cachePackAccess = builder
|
||||
.comment("Set this to true to cache resource listings in resource and data packs")
|
||||
.translation("forge.configgui.cachePackAccess")
|
||||
.worldRestart()
|
||||
.define("cachePackAccess", true);
|
||||
|
||||
indexVanillaPackCachesOnThread = builder
|
||||
.comment("Set this to true to index vanilla resource and data packs on thread")
|
||||
.translation("forge.configgui.indexVanillaPackCachesOnThread")
|
||||
.worldRestart()
|
||||
.define("indexVanillaPackCachesOnThread", false);
|
||||
|
||||
indexModPackCachesOnThread = builder
|
||||
.comment("Set this to true to index mod resource and data packs on thread")
|
||||
.translation("forge.configgui.indexModPackCachesOnThread")
|
||||
.worldRestart()
|
||||
.define("indexModPackCachesOnThread", false);
|
||||
|
||||
|
||||
builder.pop();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,10 +5,16 @@
|
||||
|
||||
package net.minecraftforge.common.extensions;
|
||||
|
||||
import net.minecraft.server.packs.PackType;
|
||||
|
||||
public interface IForgePackResources
|
||||
{
|
||||
default boolean isHidden()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
default void initForNamespace(final String nameSpace) {}
|
||||
|
||||
default void init(final PackType packType) {}
|
||||
}
|
||||
Reference in new issue
Block a user