This commit is contained in:
DBotThePony 2024-01-09 13:53:39 +07:00
commit 562e6c509f
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -50,7 +50,7 @@ abstract class AbstractMatteryFluidHandler : IFluidHandler {
val fluid = fluid
if (fluid.isEmpty || fluid.isFluidEqual(resource)) {
val new = (fluid.amount + resource.amount).coerceAtMost(capacity)
val new = (fluid.amount.toLong() + resource.amount.toLong()).coerceAtMost(capacity.toLong()).toInt()
if (new <= fluid.amount) return 0
if (action.execute()) {
@ -86,7 +86,7 @@ abstract class AbstractMatteryFluidHandler : IFluidHandler {
if (fluid.isEmpty) {
return FluidStack.EMPTY
} else {
val new = (fluid.amount - maxDrain).coerceAtLeast(0)
val new = (fluid.amount.toLong() - maxDrain.toLong()).coerceAtLeast(0L).toInt()
if (action.execute()) {
if (new == 0) {