Fix mekanism energy getting above potential IMatteryEnergyStorage
This commit is contained in:
parent
ca32929f3c
commit
b2e50a6c1b
@ -49,6 +49,7 @@ import ru.dbotthepony.mc.otm.core.collect.SupplierList
|
||||
import ru.dbotthepony.mc.otm.core.collect.WeakHashSet
|
||||
import ru.dbotthepony.mc.otm.core.forValidRefs
|
||||
import ru.dbotthepony.mc.otm.core.get
|
||||
import ru.dbotthepony.mc.otm.core.ifPresentK
|
||||
import ru.dbotthepony.mc.otm.core.immutableList
|
||||
import ru.dbotthepony.mc.otm.core.math.BlockRotation
|
||||
import ru.dbotthepony.mc.otm.core.math.RelativeSide
|
||||
@ -273,7 +274,9 @@ abstract class MatteryBlockEntity(p_155228_: BlockEntityType<*>, p_155229_: Bloc
|
||||
}
|
||||
|
||||
override fun get(): LazyOptional<IEnergyStorage> {
|
||||
return actualMekanism ?: regular.get()
|
||||
val get = regular.get()
|
||||
get.ifPresentK { if (it is IMatteryEnergyStorage) return get }
|
||||
return actualMekanism ?: get
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user