| package li.cil.oc.integration.vanilla |
| import li.cil.oc.Settings |
| import scala.collection.convert.WrapAsScala._ |
| object ConverterFluidStack extends api.driver.Converter { |
| override def convert(value: scala.Any, output: util.Map[AnyRef, AnyRef]) = |
| case stack: net.minecraftforge.fluids.FluidStack => |
| if (Settings.get.insertIdsInConverters) { |
| output += "id" -> Int.box(stack.getFluid.getID) |
| output += "amount" -> Int.box(stack.amount) |
| output += "hasTag" -> Boolean.box(stack.tag != null) |
| val fluid = stack.getFluid |
| output += "name" -> fluid.getName |
| output += "label" -> fluid.getLocalizedName(stack) |