mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-17 03:05:30 -04:00
Added converter for fluid tank properties.
This commit is contained in:
parent
c751b9ed4b
commit
ff4a6f9aa1
@ -0,0 +1,22 @@
|
|||||||
|
package li.cil.oc.integration.minecraft
|
||||||
|
|
||||||
|
import java.util
|
||||||
|
|
||||||
|
import li.cil.oc.api
|
||||||
|
import net.minecraftforge.fluids
|
||||||
|
|
||||||
|
import scala.collection.convert.WrapAsScala._
|
||||||
|
|
||||||
|
object ConverterFluidTankProperties extends api.driver.Converter {
|
||||||
|
override def convert(value: AnyRef, output: util.Map[AnyRef, AnyRef]) =
|
||||||
|
value match {
|
||||||
|
case properties: fluids.capability.IFluidTankProperties =>
|
||||||
|
output += "capacity" -> Int.box(properties.getCapacity)
|
||||||
|
val fluid = properties.getContents
|
||||||
|
if (fluid != null) {
|
||||||
|
ConverterFluidStack.convert(fluid, output)
|
||||||
|
}
|
||||||
|
else output += "amount" -> Int.box(0)
|
||||||
|
case _ =>
|
||||||
|
}
|
||||||
|
}
|
@ -46,6 +46,7 @@ object ModMinecraft extends ModProxy with RedstoneProvider {
|
|||||||
|
|
||||||
Driver.add(ConverterFluidStack)
|
Driver.add(ConverterFluidStack)
|
||||||
Driver.add(ConverterFluidTankInfo)
|
Driver.add(ConverterFluidTankInfo)
|
||||||
|
Driver.add(ConverterFluidTankProperties)
|
||||||
Driver.add(ConverterItemStack)
|
Driver.add(ConverterItemStack)
|
||||||
Driver.add(ConverterNBT)
|
Driver.add(ConverterNBT)
|
||||||
Driver.add(ConverterWorld)
|
Driver.add(ConverterWorld)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user