Inline container.set/get
This commit is contained in:
parent
c4e7b8ff15
commit
7053769e26
@ -17,10 +17,14 @@ import ru.dbotthepony.mc.otm.core.collect.nonEmpty
|
|||||||
import ru.dbotthepony.mc.otm.core.isNotEmpty
|
import ru.dbotthepony.mc.otm.core.isNotEmpty
|
||||||
import kotlin.math.roundToInt
|
import kotlin.math.roundToInt
|
||||||
|
|
||||||
operator fun Container.set(index: Int, value: ItemStack) = setItem(index, value)
|
@Suppress("nothing_to_inline")
|
||||||
operator fun Container.get(index: Int): ItemStack = getItem(index)
|
inline operator fun Container.set(index: Int, value: ItemStack) = setItem(index, value)
|
||||||
|
|
||||||
operator fun IFluidHandler.get(index: Int) = getFluidInTank(index)
|
@Suppress("nothing_to_inline")
|
||||||
|
inline operator fun Container.get(index: Int): ItemStack = getItem(index)
|
||||||
|
|
||||||
|
@Suppress("nothing_to_inline")
|
||||||
|
inline operator fun IFluidHandler.get(index: Int) = getFluidInTank(index)
|
||||||
|
|
||||||
fun Container.addItem(stack: ItemStack, range: IntRange, simulate: Boolean = false): ItemStack {
|
fun Container.addItem(stack: ItemStack, range: IntRange, simulate: Boolean = false): ItemStack {
|
||||||
if (this is MatteryContainer) {
|
if (this is MatteryContainer) {
|
||||||
|
Loading…
Reference in New Issue
Block a user