diff --git a/build.properties b/build.properties index 0459df700..e3936d9e8 100644 --- a/build.properties +++ b/build.properties @@ -1,7 +1,7 @@ minecraft.version=1.7.10 forge.version=10.13.2.1236 -oc.version=1.4.2 +oc.version=1.4.3 oc.subversion=dev ae2.version=rv1-stable-1 diff --git a/src/main/resources/application.conf b/src/main/resources/application.conf index 3986610f7..214e5835c 100644 --- a/src/main/resources/application.conf +++ b/src/main/resources/application.conf @@ -131,6 +131,9 @@ opencomputers { # happen. startupDelay: 0.25 + # The maximum size of the byte array that can be stored on EEPROMs. + eepromSize: 4096 + # The sizes of the six levels of RAM, in kilobytes. This list must # contain exactly six entries, or it will be ignored. Note that while # there are six levels of RAM, they still fall into the three tiers of diff --git a/src/main/scala/li/cil/oc/Settings.scala b/src/main/scala/li/cil/oc/Settings.scala index 40d35ff3d..2cc8f06f5 100644 --- a/src/main/scala/li/cil/oc/Settings.scala +++ b/src/main/scala/li/cil/oc/Settings.scala @@ -55,6 +55,7 @@ class Settings(val config: Config) { val threads = config.getInt("computer.threads") max 1 val timeout = config.getDouble("computer.timeout") max 0 val startupDelay = config.getDouble("computer.startupDelay") max 0.05 + val eepromSize = config.getInt("computer.eepromSize") max 0 val ramSizes = Array(config.getIntList("computer.ramSizes"): _*) match { case Array(tier1, tier2, tier3, tier4, tier5, tier6) => Array(tier1: Int, tier2: Int, tier3: Int, tier4: Int, tier5: Int, tier6: Int) diff --git a/src/main/scala/li/cil/oc/server/component/EEPROM.scala b/src/main/scala/li/cil/oc/server/component/EEPROM.scala index 7d668d125..d0a252b2c 100644 --- a/src/main/scala/li/cil/oc/server/component/EEPROM.scala +++ b/src/main/scala/li/cil/oc/server/component/EEPROM.scala @@ -30,7 +30,7 @@ class EEPROM extends prefab.ManagedEnvironment { return result(Unit, "not enough energy") } val newData = args.checkByteArray(0) - if (newData.length > 4 * 1024) throw new IllegalArgumentException("not enough space") + if (newData.length > Settings.get.eepromSize) throw new IllegalArgumentException("not enough space") data = newData context.pause(2) // deliberately slow to discourage use as normal storage medium null