Remove MatteryCraftingContainer usage

This commit is contained in:
DBotThePony 2025-03-14 18:33:44 +07:00
parent d0904da1db
commit 621661c9fe
Signed by: DBot
GPG Key ID: DCC23B5715498507
3 changed files with 3 additions and 24 deletions

View File

@ -31,7 +31,6 @@ import ru.dbotthepony.mc.otm.config.MachinesConfig
import ru.dbotthepony.mc.otm.container.CombinedContainer
import ru.dbotthepony.mc.otm.container.EnhancedContainer
import ru.dbotthepony.mc.otm.container.IEnhancedCraftingContainer
import ru.dbotthepony.mc.otm.container.MatteryCraftingContainer
import ru.dbotthepony.mc.otm.container.util.slotIterator
import ru.dbotthepony.mc.otm.core.TranslatableComponent
import ru.dbotthepony.mc.otm.core.collect.map

View File

@ -1,21 +0,0 @@
package ru.dbotthepony.mc.otm.container
import net.minecraft.world.inventory.CraftingContainer
import net.minecraft.world.item.ItemStack
open class MatteryCraftingContainer(listener: ContainerListener, private val width: Int, private val height: Int) : MatteryContainer(listener, width * height), CraftingContainer {
constructor(listener: () -> Unit, width: Int, height: Int) : this({ _, _, _ -> listener.invoke() }, width, height)
constructor(width: Int, height: Int) : this(EmptyListener, width, height)
final override fun getWidth(): Int {
return width
}
final override fun getHeight(): Int {
return height
}
final override fun getItems(): MutableList<ItemStack> {
return toList()
}
}

View File

@ -77,7 +77,8 @@ import ru.dbotthepony.mc.otm.capability.drive.IMatteryDrive
import ru.dbotthepony.mc.otm.client.isShiftDown
import ru.dbotthepony.mc.otm.client.minecraft
import ru.dbotthepony.mc.otm.config.ClientConfig
import ru.dbotthepony.mc.otm.container.MatteryCraftingContainer
import ru.dbotthepony.mc.otm.container.EnhancedContainer
import ru.dbotthepony.mc.otm.container.IEnhancedCraftingContainer
import ru.dbotthepony.mc.otm.container.util.stream
import ru.dbotthepony.mc.otm.core.ResourceLocation
import ru.dbotthepony.mc.otm.core.TextComponent
@ -500,7 +501,7 @@ object MatterManager {
height = it.value.ingredients.size.coerceAtLeast(height)
}
val container = MatteryCraftingContainer(width, height)
val container = IEnhancedCraftingContainer.Wrapper(EnhancedContainer.Simple(width * height), width, height)
val realIngredients = ArrayList<ArrayList<RecipeEntry>>()
for (c in it.value.ingredients.indices) {