mirror of
				https://github.com/SquidDev-CC/CC-Tweaked
				synced 2025-10-31 21:52:59 +00:00 
			
		
		
		
	Put some braces back
These blocks were not strictly needed but helped readability. I didn't mean for the reformatter to change them while dealing with the "this" problem. It also removed some braces in switch statements but who cares.
This commit is contained in:
		| @@ -223,6 +223,7 @@ public final class Generator<T> | |||||||
|             mw.visitEnd(); |             mw.visitEnd(); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  |         { | ||||||
|             MethodVisitor mw = cw.visitMethod( ACC_PUBLIC, METHOD_NAME, methodDesc, null, EXCEPTIONS ); |             MethodVisitor mw = cw.visitMethod( ACC_PUBLIC, METHOD_NAME, methodDesc, null, EXCEPTIONS ); | ||||||
|             mw.visitCode(); |             mw.visitCode(); | ||||||
|  |  | ||||||
| @@ -276,6 +277,7 @@ public final class Generator<T> | |||||||
|  |  | ||||||
|             mw.visitMaxs( 0, 0 ); |             mw.visitMaxs( 0, 0 ); | ||||||
|             mw.visitEnd(); |             mw.visitEnd(); | ||||||
|  |         } | ||||||
|  |  | ||||||
|         cw.visitEnd(); |         cw.visitEnd(); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -32,8 +32,7 @@ public class CommentedConfigSpec extends ConfigSpec | |||||||
|     @Override |     @Override | ||||||
|     public int correct( Config config ) |     public int correct( Config config ) | ||||||
|     { |     { | ||||||
|         return correct( config, ( action, path, incorrectValue, correctedValue ) -> { |         return correct( config, ( action, path, incorrectValue, correctedValue ) -> { } ); | ||||||
|         } ); |  | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|   | |||||||
| @@ -56,7 +56,7 @@ public final class Config | |||||||
|         System.setProperty( "nightconfig.preserveInsertionOrder", "true" ); |         System.setProperty( "nightconfig.preserveInsertionOrder", "true" ); | ||||||
|  |  | ||||||
|         serverSpec = new CommentedConfigSpec(); |         serverSpec = new CommentedConfigSpec(); | ||||||
|         // General computers |         { // General computers | ||||||
|             serverSpec.comment( "computer_space_limit", |             serverSpec.comment( "computer_space_limit", | ||||||
|                 "The disk space limit for computers and turtles, in bytes" ); |                 "The disk space limit for computers and turtles, in bytes" ); | ||||||
|             serverSpec.define( "computer_space_limit", ComputerCraft.computerSpaceLimit ); |             serverSpec.define( "computer_space_limit", ComputerCraft.computerSpaceLimit ); | ||||||
| @@ -93,8 +93,9 @@ public final class Config | |||||||
|                 "Require players to be in creative mode and be opped in order to interact with command computers." + |                 "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." ); |                     "This is the default behaviour for vanilla's Command blocks." ); | ||||||
|             serverSpec.define( "command_require_creative", ComputerCraft.commandRequireCreative ); |             serverSpec.define( "command_require_creative", ComputerCraft.commandRequireCreative ); | ||||||
|  |         } | ||||||
|  |  | ||||||
|         // Execution |         { // Execution | ||||||
|             serverSpec.comment( "execution", |             serverSpec.comment( "execution", | ||||||
|                 "Controls execution behaviour of computers. This is largely intended for fine-tuning " + |                 "Controls execution behaviour of computers. This is largely intended for fine-tuning " + | ||||||
|                     "servers, and generally shouldn't need to be touched" ); |                     "servers, and generally shouldn't need to be touched" ); | ||||||
| @@ -116,8 +117,9 @@ public final class Config | |||||||
|                     "Note, we will quite possibly go over this limit, as there's no way to tell how long a will take " + |                     "Note, we will quite possibly go over this limit, as there's no way to tell how long a will take " + | ||||||
|                     "- this aims to be the upper bound of the average time." ); |                     "- this aims to be the upper bound of the average time." ); | ||||||
|             serverSpec.defineInRange( "execution.max_main_computer_time", (int) TimeUnit.NANOSECONDS.toMillis( ComputerCraft.maxMainComputerTime ), 1, Integer.MAX_VALUE ); |             serverSpec.defineInRange( "execution.max_main_computer_time", (int) TimeUnit.NANOSECONDS.toMillis( ComputerCraft.maxMainComputerTime ), 1, Integer.MAX_VALUE ); | ||||||
|  |         } | ||||||
|  |  | ||||||
|         // HTTP |         { // HTTP | ||||||
|             serverSpec.comment( "http", "Controls the HTTP API" ); |             serverSpec.comment( "http", "Controls the HTTP API" ); | ||||||
|  |  | ||||||
|             serverSpec.comment( "http.enabled", |             serverSpec.comment( "http.enabled", | ||||||
| @@ -145,8 +147,9 @@ public final class Config | |||||||
|             serverSpec.comment( "http.max_websockets", |             serverSpec.comment( "http.max_websockets", | ||||||
|                 "The number of websockets a computer can have open at one time. Set to 0 for unlimited." ); |                 "The number of websockets a computer can have open at one time. Set to 0 for unlimited." ); | ||||||
|             serverSpec.defineInRange( "http.max_websockets", ComputerCraft.httpMaxWebsockets, 1, Integer.MAX_VALUE ); |             serverSpec.defineInRange( "http.max_websockets", ComputerCraft.httpMaxWebsockets, 1, Integer.MAX_VALUE ); | ||||||
|  |         } | ||||||
|  |  | ||||||
|         // Peripherals |         { // Peripherals | ||||||
|             serverSpec.comment( "peripheral", "Various options relating to peripherals." ); |             serverSpec.comment( "peripheral", "Various options relating to peripherals." ); | ||||||
|  |  | ||||||
|             serverSpec.comment( "peripheral.command_block_enabled", |             serverSpec.comment( "peripheral.command_block_enabled", | ||||||
| @@ -182,8 +185,9 @@ public final class Config | |||||||
|                     "in a single tick. \n" + |                     "in a single tick. \n" + | ||||||
|                     "Set to 0 to disable." ); |                     "Set to 0 to disable." ); | ||||||
|             serverSpec.defineInRange( "peripheral.monitor_bandwidth", (int) ComputerCraft.monitorBandwidth, 0, Integer.MAX_VALUE ); |             serverSpec.defineInRange( "peripheral.monitor_bandwidth", (int) ComputerCraft.monitorBandwidth, 0, Integer.MAX_VALUE ); | ||||||
|  |         } | ||||||
|  |  | ||||||
|         // Turtles |         { // Turtles | ||||||
|             serverSpec.comment( "turtle", "Various options relating to turtles." ); |             serverSpec.comment( "turtle", "Various options relating to turtles." ); | ||||||
|  |  | ||||||
|             serverSpec.comment( "turtle.need_fuel", |             serverSpec.comment( "turtle.need_fuel", | ||||||
| @@ -208,7 +212,9 @@ public final class Config | |||||||
|             serverSpec.comment( "turtle.disabled_actions", |             serverSpec.comment( "turtle.disabled_actions", | ||||||
|                 "A list of turtle actions which are disabled." ); |                 "A list of turtle actions which are disabled." ); | ||||||
|             serverSpec.defineList( "turtle.disabled_actions", Collections.emptyList(), x -> x instanceof String && getAction( (String) x ) != null ); |             serverSpec.defineList( "turtle.disabled_actions", Collections.emptyList(), x -> x instanceof String && getAction( (String) x ) != null ); | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         { // Terminal sizes | ||||||
|             serverSpec.comment( "term_sizes", "Configure the size of various computer's terminals.\n" + |             serverSpec.comment( "term_sizes", "Configure the size of various computer's terminals.\n" + | ||||||
|                 "Larger terminals require more bandwidth, so use with care." ); |                 "Larger terminals require more bandwidth, so use with care." ); | ||||||
|  |  | ||||||
| @@ -223,6 +229,7 @@ public final class Config | |||||||
|             serverSpec.comment( "term_sizes.monitor", "Maximum size of monitors (in blocks)" ); |             serverSpec.comment( "term_sizes.monitor", "Maximum size of monitors (in blocks)" ); | ||||||
|             serverSpec.defineInRange( "term_sizes.monitor.width", ComputerCraft.monitorWidth, 1, 32 ); |             serverSpec.defineInRange( "term_sizes.monitor.width", ComputerCraft.monitorWidth, 1, 32 ); | ||||||
|             serverSpec.defineInRange( "term_sizes.monitor.height", ComputerCraft.monitorHeight, 1, 32 ); |             serverSpec.defineInRange( "term_sizes.monitor.height", ComputerCraft.monitorHeight, 1, 32 ); | ||||||
|  |         } | ||||||
|  |  | ||||||
|         clientSpec = new CommentedConfigSpec(); |         clientSpec = new CommentedConfigSpec(); | ||||||
|  |  | ||||||
| @@ -331,7 +338,7 @@ public final class Config | |||||||
|             ComputerCraft.floppySpaceLimit = serverConfig.<Integer>get( "floppy_space_limit" ); |             ComputerCraft.floppySpaceLimit = serverConfig.<Integer>get( "floppy_space_limit" ); | ||||||
|             ComputerCraft.maximumFilesOpen = serverConfig.<Integer>get( "maximum_open_files" ); |             ComputerCraft.maximumFilesOpen = serverConfig.<Integer>get( "maximum_open_files" ); | ||||||
|             ComputerCraft.disableLua51Features = serverConfig.<Boolean>get( "disable_lua51_features" ); |             ComputerCraft.disableLua51Features = serverConfig.<Boolean>get( "disable_lua51_features" ); | ||||||
|             ComputerCraft.defaultComputerSettings = serverConfig.get( "default_computer_settings" ); |             ComputerCraft.defaultComputerSettings = serverConfig.<String>get( "default_computer_settings" ); | ||||||
|             ComputerCraft.debugEnable = serverConfig.<Boolean>get( "debug_enabled" ); |             ComputerCraft.debugEnable = serverConfig.<Boolean>get( "debug_enabled" ); | ||||||
|             ComputerCraft.logComputerErrors = serverConfig.<Boolean>get( "log_computer_errors" ); |             ComputerCraft.logComputerErrors = serverConfig.<Boolean>get( "log_computer_errors" ); | ||||||
|             ComputerCraft.commandRequireCreative = serverConfig.<Boolean>get( "command_require_creative" ); |             ComputerCraft.commandRequireCreative = serverConfig.<Boolean>get( "command_require_creative" ); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 ToadDev
					ToadDev