From e21667d3d7ebc4f9f1fa2d190a0cca647e8c5dd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20N=C3=BCcke?= Date: Sat, 11 Jul 2015 18:38:52 +0200 Subject: [PATCH] Only for the @return comment. Too confusing. --- .../li/cil/oc/common/tileentity/traits/power/Common.scala | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/scala/li/cil/oc/common/tileentity/traits/power/Common.scala b/src/main/scala/li/cil/oc/common/tileentity/traits/power/Common.scala index 0536d12b8..d16dda0d3 100644 --- a/src/main/scala/li/cil/oc/common/tileentity/traits/power/Common.scala +++ b/src/main/scala/li/cil/oc/common/tileentity/traits/power/Common.scala @@ -38,6 +38,14 @@ trait Common extends TileEntity { !Settings.get.ignorePower && side != null && side != ForgeDirection.UNKNOWN && (if (isClient) hasConnector(side) else connector(side).isDefined) + /** + * Tries to inject the specified amount of energy into the buffer via the specified side. + * + * @param side the side to change the buffer through. + * @param amount the amount to change the buffer by. + * @param doReceive whether to actually inject energy or only simulate it. + * @return the amount of energy that was actually injected. + */ def tryChangeBuffer(side: ForgeDirection, amount: Double, doReceive: Boolean = true): Double = if (isClient || Settings.get.ignorePower) 0 else connector(side) match {