Remove confusing function, rename everything to add
This commit is contained in:
parent
9dfb534f9a
commit
066921c981
@ -164,19 +164,13 @@ open class ContainerProxy(containers: Stream<Pair<Container, Iterator<Int>>>) :
|
||||
return this
|
||||
}
|
||||
|
||||
fun ofRange(container: Container, from: Int = 0, to: Int = container.containerSize - 1): Builder {
|
||||
check(!built) { "Already built!" }
|
||||
values.add(container to (from .. to).iterator())
|
||||
return this
|
||||
}
|
||||
|
||||
fun of(container: Container, slots: Iterator<Int>): Builder {
|
||||
fun add(container: Container, slots: Iterator<Int>): Builder {
|
||||
check(!built) { "Already built!" }
|
||||
values.add(container to slots)
|
||||
return this
|
||||
}
|
||||
|
||||
fun of(container: Container, slots: Iterable<Int>): Builder {
|
||||
fun add(container: Container, slots: Iterable<Int>): Builder {
|
||||
check(!built) { "Already built!" }
|
||||
values.add(container to slots.iterator())
|
||||
return this
|
||||
|
@ -2,7 +2,6 @@ package ru.dbotthepony.mc.otm.menu
|
||||
|
||||
import com.google.common.collect.ImmutableList
|
||||
import com.mojang.datafixers.util.Pair
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectAVLTreeMap
|
||||
import net.minecraft.resources.ResourceLocation
|
||||
import net.minecraft.server.level.ServerPlayer
|
||||
import net.minecraft.world.Container
|
||||
@ -14,10 +13,6 @@ import net.minecraft.world.item.enchantment.EnchantmentHelper.hasBindingCurse
|
||||
import net.minecraft.world.level.block.entity.BlockEntity
|
||||
import net.minecraftforge.network.PacketDistributor
|
||||
import ru.dbotthepony.mc.otm.capability.matteryPlayer
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.AbstractSlotPanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.Dock
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.EditablePanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.SlotPanel
|
||||
import ru.dbotthepony.mc.otm.compat.cos.cosmeticArmorSlots
|
||||
import ru.dbotthepony.mc.otm.compat.curios.isCurioSlot
|
||||
import ru.dbotthepony.mc.otm.container.ContainerProxy
|
||||
@ -165,7 +160,7 @@ abstract class MatteryMenu @JvmOverloads protected constructor(
|
||||
// trick minecraft's code into thinking that slots come from contiguous container
|
||||
val proxyBuilder = ContainerProxy.Builder()
|
||||
|
||||
proxyBuilder.of(inventory, 0 .. 35)
|
||||
proxyBuilder.add(inventory, 0 .. 35)
|
||||
|
||||
if (mattery != null && mattery.hasExoSuit) {
|
||||
proxyBuilder.add(mattery.exoSuitContainer)
|
||||
|
Loading…
Reference in New Issue
Block a user