Allow using command computers in survival mode

I'm really not a fan of this change, but it's gated behind a config
option and there's apparently sufficient demand that it's worthwhile.
Closes #442.
This commit is contained in:
SquidDev
2020-05-13 10:26:59 +01:00
parent 05d7be0362
commit ac075d9f53
5 changed files with 22 additions and 21 deletions
@@ -47,6 +47,7 @@ public final class Config
private static Property defaultComputerSettings;
private static Property debugEnabled;
private static Property logComputerErrors;
private static Property commandRequireCreative;
private static Property computerThreads;
private static Property maxMainGlobalTime;
@@ -119,10 +120,14 @@ public final class Config
logComputerErrors.setComment( "Log exceptions thrown by peripherals and other Lua objects.\n" +
"This makes it easier for mod authors to debug problems, but may result in log spam should people use buggy methods." );
commandRequireCreative = config.get( CATEGORY_GENERAL, "command_require_creative", ComputerCraft.commandRequireCreative );
commandRequireCreative.setComment( "Require players to be in creative mode and be opped in order to interact with command computers." +
"This is the default behaviour for vanilla's Command blocks." );
setOrder(
CATEGORY_GENERAL,
computerSpaceLimit, floppySpaceLimit, maximumFilesOpen,
disableLua51Features, defaultComputerSettings, debugEnabled, logComputerErrors
disableLua51Features, defaultComputerSettings, debugEnabled, logComputerErrors, commandRequireCreative
);
}
@@ -441,6 +446,7 @@ public final class Config
ComputerCraft.default_computer_settings = defaultComputerSettings.getString();
ComputerCraft.debug_enable = debugEnabled.getBoolean();
ComputerCraft.logPeripheralErrors = logComputerErrors.getBoolean();
ComputerCraft.commandRequireCreative = commandRequireCreative.getBoolean();
// Execution
ComputerCraft.computer_threads = computerThreads.getInt();