Provide direct set operator
This commit is contained in:
parent
a73ad5484d
commit
bc2cfccffe
@ -23,11 +23,15 @@ import java.util.function.Predicate
|
|||||||
* and actual implementations of this interface are likely to provide efficient method implementations in place of derived/emulated ones.
|
* and actual implementations of this interface are likely to provide efficient method implementations in place of derived/emulated ones.
|
||||||
*/
|
*/
|
||||||
interface IEnhancedContainer : IContainer, RecipeInput, Iterable<ItemStack>, StackedContentsCompatible {
|
interface IEnhancedContainer : IContainer, RecipeInput, Iterable<ItemStack>, StackedContentsCompatible {
|
||||||
// provide non-ambiguous "get" operator
|
// provide non-ambiguous get and set operators
|
||||||
operator fun get(slot: Int): ItemStack {
|
operator fun get(slot: Int): ItemStack {
|
||||||
return getItem(slot)
|
return getItem(slot)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
operator fun set(slot: Int, value: ItemStack) {
|
||||||
|
setItem(slot, value)
|
||||||
|
}
|
||||||
|
|
||||||
fun containerSlot(slot: Int): IContainerSlot {
|
fun containerSlot(slot: Int): IContainerSlot {
|
||||||
return IContainerSlot.Simple(slot, this)
|
return IContainerSlot.Simple(slot, this)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user