Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master-MC1.7.10' into master-MC1.12
Browse files Browse the repository at this point in the history
  • Loading branch information
asiekierka committed Aug 28, 2022
2 parents dd0a94a + e84596e commit 4d4d1db
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,16 @@
* Fixed: [#2911] Inconsistent values used by getGameType() and setGameType() in Debug Card.
* (1.12.2) Fixed: [#3472] Incorrect 3D print lighting.
* Fixed: [#3226] Incorrect Hard Drive reported maximum stack size when formatted.
* Fixed: [#3084] Incorrect parsing of the 'maxSignalQueueSize' configuration option.
* Fixed: [#3184] Incorrect redstone card sides inside racks and computers.
* Fixed: [#3182] Incorrect reporting of entity inventory names in Transposer, plus other Transposer interaction issues.
* Fixed: Missing null check for Blood Magic integration.
* Fixed: [#3336] Missing null check for GregTech data stick NBTs.
* Fixed: [#3249] NullPointerException when remote terminal is missing.
* Fixed: Potential edge case crash with the Tank Controller Upgrade.
* Fixed: [#3401] 'rawSetForeground', 'rawSetBackground' not working correctly.
* Fixed: [#3265] Relay 'setStrength' unlimited upper bound. (JamesOrdner)
* (1.7.10) Fixed: [#3540] Server-side crash with Motion Sensor
* Fixed: [#1999] 'string.gsub' patterns now allow numbers.
* Fixed: [#3195] Tier 1 Wireless Cards not receiving messages.
* (1.7.10) Fixed: [#3239] Unnecessary/unwanted canEntityDestroy check in OpenComputers fake player.
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/li/cil/oc/Settings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ class Settings(val config: Config) {
val disableLocaleChanging = config.getBoolean("debug.disableLocaleChanging")

// >= 1.7.4
val maxSignalQueueSize: Int = (if (config.hasPath("computer.maxSignalQueueSize")) config.getInt("computer.maxSignalQueueSize") else 256) min 256
val maxSignalQueueSize: Int = (if (config.hasPath("computer.maxSignalQueueSize")) config.getInt("computer.maxSignalQueueSize") else 256) max 256

// >= 1.7.6
val vramSizes: Array[Double] = Array(config.getDoubleList("gpu.vramSizes"): _*) match {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,16 @@ trait WorldTankAnalytics extends WorldAware with SideRestricted {
}
}
else result(Unit, "not enabled in config")

@Callback(doc = """function(side:number):number -- Get the number of tanks available on the specified side.""")
def getTankCount(context: Context, args: Arguments): Array[AnyRef] = {
val facing = checkSideForAction(args, 0)
FluidUtils.fluidHandlerAt(position.offset(facing), facing.getOpposite) match {
case Some(handler) => handler.getTankProperties match {
case info: Array[IFluidTankProperties] => result(info.length)
case _ => result(Unit, "no tank")
}
case _ => result(Unit, "no tank")
}
}
}
5 changes: 3 additions & 2 deletions src/main/scala/li/cil/oc/util/ExtendedArguments.scala
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ object ExtendedArguments {

def checkTankProperties(handler: IFluidHandler, n: Int) = {
val tank = args.checkInteger(n) - 1
if (tank < 0 || tank >= handler.getTankProperties.length) {
val tankInfo = handler.getTankProperties
if (tankInfo == null || tank < 0 || tank >= tankInfo.length) {
throw new IllegalArgumentException("invalid tank index")
}
handler.getTankProperties()(tank)
tankInfo(tank)
}

def optTankProperties(handler: IFluidHandler, n: Int, default: IFluidTankProperties) = {
Expand Down

0 comments on commit 4d4d1db

Please sign in to comment.