mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-11-10 02:13:04 +00:00
Add support for proxying HTTP requests (#1461)
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
package dan200.computercraft;
|
||||
|
||||
import com.electronwill.nightconfig.core.file.FileConfig;
|
||||
import dan200.computercraft.api.ComputerCraftAPI;
|
||||
import dan200.computercraft.api.ForgeComputerCraftAPI;
|
||||
import dan200.computercraft.api.detail.ForgeDetailRegistries;
|
||||
@@ -94,10 +95,12 @@ public final class ComputerCraft {
|
||||
private static void syncConfig(ModConfig config) {
|
||||
if (!config.getModId().equals(ComputerCraftAPI.MOD_ID)) return;
|
||||
|
||||
var path = config.getConfigData() instanceof FileConfig fileConfig ? fileConfig.getNioPath() : null;
|
||||
|
||||
if (config.getType() == ModConfig.Type.SERVER && ((ForgeConfigFile) ConfigSpec.serverSpec).spec().isLoaded()) {
|
||||
ConfigSpec.syncServer();
|
||||
ConfigSpec.syncServer(path);
|
||||
} else if (config.getType() == ModConfig.Type.CLIENT) {
|
||||
ConfigSpec.syncClient();
|
||||
ConfigSpec.syncClient(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ public final class ForgeConfigFile implements ConfigFile {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConfigFile build(Runnable onChange) {
|
||||
public ConfigFile build(ConfigListener onChange) {
|
||||
var spec = builder.build();
|
||||
entries.stream().forEach(x -> {
|
||||
if (x instanceof ValueImpl<?> value) value.owner = spec;
|
||||
|
||||
Reference in New Issue
Block a user