Attempt to prevent early class init from config if config-reflect is loaded
This commit is contained in:
parent
60f1656dc6
commit
2225ad73ce
|
@ -16,7 +16,6 @@ import io.gitlab.jfronny.respackopts.server.ServerInstanceHolder;
|
|||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
|
@ -41,7 +40,6 @@ public class Respackopts implements ModInitializer, SaveHook {
|
|||
|
||||
public static final String ID = "respackopts";
|
||||
public static final Logger LOGGER = Logger.forName(ID);
|
||||
public static final Identifier CONF_ID = new Identifier(ID, "conf.json");
|
||||
|
||||
public static Path FALLBACK_CONF_DIR = FabricLoader.getInstance().getConfigDir().resolve(ID);
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ import io.gitlab.jfronny.respackopts.util.MetaCache;
|
|||
import io.gitlab.jfronny.respackopts.Respackopts;
|
||||
import io.gitlab.jfronny.respackopts.model.PackMeta;
|
||||
import net.minecraft.resource.*;
|
||||
import net.minecraft.util.Identifier;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
|
@ -56,15 +57,16 @@ public class ResourcePackManagerMixin {
|
|||
Respackopts.LOGGER.error("Could not read respackopts config in root for " + profileName, e);
|
||||
}
|
||||
|
||||
Identifier confId = new Identifier(Respackopts.ID, "conf.json");
|
||||
ResourceType packConfType = null;
|
||||
for (ResourceType type : ResourceType.values()) {
|
||||
if (rpi.contains(type, Respackopts.CONF_ID)) {
|
||||
if (rpi.contains(type, confId)) {
|
||||
packConfType = type;
|
||||
}
|
||||
}
|
||||
|
||||
if (packConfType != null) {
|
||||
try (InputStream is = rpi.open(packConfType, Respackopts.CONF_ID)) {
|
||||
try (InputStream is = rpi.open(packConfType, confId)) {
|
||||
rpo$readConfiguration(is, dataLocation, rpi.getName(), displayName, toRemove);
|
||||
} catch (Throwable e) {
|
||||
Respackopts.LOGGER.error("Could not initialize pack meta for " + profileName, e);
|
||||
|
|
Loading…
Reference in New Issue