mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-07-12 15:02:52 +00:00
Add command to reload config from disk
Also bump version number, as we're relatively close to a release and it's frustrating having to bump it when putting out previews.
This commit is contained in:
parent
678462d2db
commit
20dcb32bae
@ -21,7 +21,7 @@ plugins {
|
|||||||
apply plugin: 'net.minecraftforge.gradle.forge'
|
apply plugin: 'net.minecraftforge.gradle.forge'
|
||||||
apply plugin: 'org.ajoberstar.grgit'
|
apply plugin: 'org.ajoberstar.grgit'
|
||||||
|
|
||||||
version = "1.80pr1.3"
|
version = "1.80pr1.4"
|
||||||
group = "org.squiddev"
|
group = "org.squiddev"
|
||||||
archivesBaseName = "cc-tweaked"
|
archivesBaseName = "cc-tweaked"
|
||||||
|
|
||||||
|
@ -277,6 +277,18 @@ public class ComputerCraft
|
|||||||
|
|
||||||
// Load config
|
// Load config
|
||||||
Config.config = new Configuration( event.getSuggestedConfigurationFile() );
|
Config.config = new Configuration( event.getSuggestedConfigurationFile() );
|
||||||
|
loadConfig();
|
||||||
|
|
||||||
|
// Setup network
|
||||||
|
networkEventChannel = NetworkRegistry.INSTANCE.newEventDrivenChannel( "CC" );
|
||||||
|
networkEventChannel.register( new PacketHandler() );
|
||||||
|
|
||||||
|
proxy.preInit();
|
||||||
|
turtleProxy.preInit();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void loadConfig()
|
||||||
|
{
|
||||||
Config.config.load();
|
Config.config.load();
|
||||||
|
|
||||||
Config.http_enable = Config.config.get( Configuration.CATEGORY_GENERAL, "http_enable", http_enable );
|
Config.http_enable = Config.config.get( Configuration.CATEGORY_GENERAL, "http_enable", http_enable );
|
||||||
@ -374,13 +386,6 @@ public class ComputerCraft
|
|||||||
}
|
}
|
||||||
|
|
||||||
syncConfig();
|
syncConfig();
|
||||||
|
|
||||||
// Setup network
|
|
||||||
networkEventChannel = NetworkRegistry.INSTANCE.newEventDrivenChannel( "CC" );
|
|
||||||
networkEventChannel.register( new PacketHandler() );
|
|
||||||
|
|
||||||
proxy.preInit();
|
|
||||||
turtleProxy.preInit();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void syncConfig() {
|
public static void syncConfig() {
|
||||||
|
@ -347,6 +347,20 @@ public final class CommandComputerCraft extends CommandDelegate
|
|||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
root.register( new SubCommandBase(
|
||||||
|
"reload", "Reload the ComputerCraft config file", UserLevel.OWNER_OP,
|
||||||
|
"Reload the ComputerCraft config file"
|
||||||
|
)
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void execute( @Nonnull CommandContext context, @Nonnull List<String> arguments )
|
||||||
|
{
|
||||||
|
ComputerCraft.loadConfig();
|
||||||
|
ComputerCraft.syncConfig();
|
||||||
|
context.getSender().sendMessage( new TextComponentString( "Reloaded config" ) );
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
|
||||||
|
|
||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user