Skip to content

Commit

Permalink
update changelog, add empty table check to ConverterFluidContainerItem
Browse files Browse the repository at this point in the history
  • Loading branch information
asiekierka committed Jun 4, 2023
1 parent 39739b7 commit 9c95f10
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* [#3533] Added support for observing the contents of fluid container items.
* [#3620] Fixed OC 1.8.0+ regression involving API arguments and numbers.
* [#3013] Fixed rare server-side deadlock when sending disk activity update packets.
* Added Spanish translation.
* Fixed string.gmatch not supporting the "init" argument on Lua 5.4.
* Update GNU Unifont to 15.0.04.

Expand All @@ -13,4 +14,4 @@

## List of contributors

asie, ds84182, Possseidon, repo-alt
asie, ds84182, Possseidon, repo-alt, sanmofe
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ object ConverterFluidContainerItem extends api.driver.Converter {
output += "capacity" -> Int.box(fc.getCapacity(stack))
val fluidStack = fc.getFluid(stack)
if (fluidStack != null) {
output += "fluid" -> Registry.convert(Array[AnyRef](fluidStack))(0)
} else {
val fluidData = Registry.convert(Array[AnyRef](fluidStack))
if (fluidData.nonEmpty) {
output += "fluid" -> fluidData(0)
}
}
if (!output.containsKey("fluid")) {
val fluidMap = new util.HashMap[AnyRef, AnyRef]()
fluidMap += "amount" -> Int.box(0)
output += "fluid" -> fluidMap
Expand Down

0 comments on commit 9c95f10

Please sign in to comment.