Decapitalize exopack menu/screen name
This commit is contained in:
parent
1c3001595a
commit
e57844bc1a
@ -96,7 +96,7 @@ import ru.dbotthepony.mc.otm.core.util.Savetables
|
||||
import ru.dbotthepony.mc.otm.core.util.TickList
|
||||
import ru.dbotthepony.mc.otm.core.util.UUIDValueCodec
|
||||
import ru.dbotthepony.mc.otm.core.util.VarIntValueCodec
|
||||
import ru.dbotthepony.mc.otm.menu.ExoPackInventoryMenu
|
||||
import ru.dbotthepony.mc.otm.menu.ExopackInventoryMenu
|
||||
import ru.dbotthepony.mc.otm.network.*
|
||||
import ru.dbotthepony.mc.otm.network.synchronizer.FieldSynchronizer
|
||||
import ru.dbotthepony.mc.otm.registry.AndroidFeatures
|
||||
@ -309,7 +309,7 @@ class MatteryPlayerCapability(val ply: Player) : ICapabilityProvider, INBTSerial
|
||||
}
|
||||
}).property
|
||||
|
||||
private var _exoPackMenu: ExoPackInventoryMenu? = null
|
||||
private var _exoPackMenu: ExopackInventoryMenu? = null
|
||||
set(value) {
|
||||
if (field == ply.containerMenu) { ply.closeContainer() }
|
||||
field?.actuallyRemoved()
|
||||
@ -317,19 +317,19 @@ class MatteryPlayerCapability(val ply: Player) : ICapabilityProvider, INBTSerial
|
||||
}
|
||||
|
||||
/**
|
||||
* [ExoPackInventoryMenu] which player will see when pressing inventory key
|
||||
* [ExopackInventoryMenu] which player will see when pressing inventory key
|
||||
*/
|
||||
val exoPackMenu: ExoPackInventoryMenu
|
||||
val exoPackMenu: ExopackInventoryMenu
|
||||
get() {
|
||||
if (_exoPackMenu == null) {
|
||||
_exoPackMenu = ExoPackInventoryMenu(this)
|
||||
_exoPackMenu = ExopackInventoryMenu(this)
|
||||
}
|
||||
|
||||
return _exoPackMenu!!
|
||||
}
|
||||
|
||||
fun recreateExoPackMenu() {
|
||||
_exoPackMenu = ExoPackInventoryMenu(this)
|
||||
_exoPackMenu = ExopackInventoryMenu(this)
|
||||
}
|
||||
|
||||
private var shouldSendIteration = false
|
||||
|
@ -18,7 +18,7 @@ import ru.dbotthepony.mc.otm.capability.MatteryPlayerCapability
|
||||
import ru.dbotthepony.mc.otm.capability.matteryPlayer
|
||||
import ru.dbotthepony.mc.otm.client.render.UVWindingOrder
|
||||
import ru.dbotthepony.mc.otm.client.render.Widgets18
|
||||
import ru.dbotthepony.mc.otm.client.screen.ExoPackInventoryScreen
|
||||
import ru.dbotthepony.mc.otm.client.screen.ExopackInventoryScreen
|
||||
import ru.dbotthepony.mc.otm.client.screen.MatteryScreen
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.slot.AbstractSlotPanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.util.DiscreteScrollBarPanel
|
||||
@ -95,7 +95,7 @@ private fun inventoryLogic(event: ScreenEvent.Init.Post) {
|
||||
val mouseY = minecraft.mouseHandler.ypos()
|
||||
|
||||
event.screen.onClose()
|
||||
minecraft.setScreen(ExoPackInventoryScreen(player.exoPackMenu))
|
||||
minecraft.setScreen(ExopackInventoryScreen(player.exoPackMenu))
|
||||
|
||||
InputConstants.grabOrReleaseMouse(minecraft.window.window, 212993, mouseX, mouseY)
|
||||
}).also { it.tooltips.add(TranslatableComponent("otm.gui.exopack.go_in")) })
|
||||
@ -250,6 +250,6 @@ fun onScreenOpen(event: ScreenEvent.Opening) {
|
||||
val player = minecraft.player?.matteryPlayer ?: return
|
||||
|
||||
if (player.hasExopack && event.newScreen is InventoryScreen) {
|
||||
event.newScreen = ExoPackInventoryScreen(player.exoPackMenu)
|
||||
event.newScreen = ExopackInventoryScreen(player.exoPackMenu)
|
||||
}
|
||||
}
|
||||
|
@ -22,15 +22,15 @@ import ru.dbotthepony.mc.otm.client.shouldOpenVanillaInventory
|
||||
import ru.dbotthepony.mc.otm.compat.curios.isCuriosLoaded
|
||||
import ru.dbotthepony.mc.otm.compat.curios.openCuriosScreen
|
||||
import ru.dbotthepony.mc.otm.core.math.integerDivisionDown
|
||||
import ru.dbotthepony.mc.otm.menu.ExoPackInventoryMenu
|
||||
import ru.dbotthepony.mc.otm.menu.ExopackInventoryMenu
|
||||
import ru.dbotthepony.mc.otm.network.ExoPackMenuOpen
|
||||
import ru.dbotthepony.mc.otm.network.MatteryPlayerNetworkChannel
|
||||
import yalter.mousetweaks.api.MouseTweaksDisableWheelTweak
|
||||
|
||||
@MouseTweaksDisableWheelTweak
|
||||
class ExoPackInventoryScreen(menu: ExoPackInventoryMenu) : MatteryScreen<ExoPackInventoryMenu>(menu, TranslatableComponent("otm.gui.exopack")) {
|
||||
private lateinit var mainInventoryLine: EditablePanel<ExoPackInventoryScreen>
|
||||
private lateinit var scrollPanel: DiscreteScrollBarPanel<ExoPackInventoryScreen>
|
||||
class ExopackInventoryScreen(menu: ExopackInventoryMenu) : MatteryScreen<ExopackInventoryMenu>(menu, TranslatableComponent("otm.gui.exopack")) {
|
||||
private lateinit var mainInventoryLine: EditablePanel<ExopackInventoryScreen>
|
||||
private lateinit var scrollPanel: DiscreteScrollBarPanel<ExopackInventoryScreen>
|
||||
|
||||
override fun updateInventoryRows(old: Int) {
|
||||
mainFrame!!.height = FRAME_BASE_HEIGHT + inventoryRows * AbstractSlotPanel.SIZE
|
||||
@ -82,7 +82,7 @@ class ExoPackInventoryScreen(menu: ExoPackInventoryMenu) : MatteryScreen<ExoPack
|
||||
lastScroll = new
|
||||
})
|
||||
|
||||
mainInventoryLine = object : EditablePanel<ExoPackInventoryScreen>(this@ExoPackInventoryScreen, frame, height = AbstractSlotPanel.SIZE * inventoryRows) {
|
||||
mainInventoryLine = object : EditablePanel<ExopackInventoryScreen>(this@ExopackInventoryScreen, frame, height = AbstractSlotPanel.SIZE * inventoryRows) {
|
||||
override fun mouseScrolledInner(x: Double, y: Double, scroll: Double): Boolean {
|
||||
return scrollPanel.mouseScrolledInner(x, y, scroll)
|
||||
}
|
@ -10,7 +10,7 @@ import ru.dbotthepony.mc.otm.capability.MatteryPlayerCapability
|
||||
import ru.dbotthepony.mc.otm.capability.matteryPlayer
|
||||
import ru.dbotthepony.mc.otm.client.render.Widgets8
|
||||
import ru.dbotthepony.mc.otm.client.render.sprites.sprite
|
||||
import ru.dbotthepony.mc.otm.client.screen.ExoPackInventoryScreen
|
||||
import ru.dbotthepony.mc.otm.client.screen.ExopackInventoryScreen
|
||||
import ru.dbotthepony.mc.otm.client.screen.MatteryScreen
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.button.ButtonPanel
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.button.CheckBoxLabelPanel
|
||||
@ -199,7 +199,7 @@ class EntityRendererPanel<out S : Screen> @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
override fun innerRender(graphics: GuiGraphics, mouseX: Float, mouseY: Float, partialTick: Float) {
|
||||
ExoPackInventoryScreen.ENTITY_RECTANGLE.render(graphics)
|
||||
ExopackInventoryScreen.ENTITY_RECTANGLE.render(graphics)
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
@ -33,13 +33,12 @@ import ru.dbotthepony.mc.otm.client.minecraft
|
||||
import ru.dbotthepony.mc.otm.client.screen.MatteryScreen
|
||||
import ru.dbotthepony.mc.otm.core.TranslatableComponent
|
||||
import ru.dbotthepony.mc.otm.core.toImmutableList
|
||||
import ru.dbotthepony.mc.otm.menu.ExoPackInventoryMenu
|
||||
import ru.dbotthepony.mc.otm.menu.ExopackInventoryMenu
|
||||
import ru.dbotthepony.mc.otm.registry.MItems
|
||||
import ru.dbotthepony.mc.otm.registry.MRecipes
|
||||
import java.util.*
|
||||
import java.util.stream.Collectors
|
||||
import kotlin.collections.ArrayList
|
||||
import kotlin.jvm.optionals.getOrNull
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
var isJeiLoaded = false
|
||||
@ -87,13 +86,13 @@ class JEIPlugin : IModPlugin {
|
||||
override fun registerRecipeTransferHandlers(registration: IRecipeTransferRegistration) {
|
||||
val helper = registration.transferHelper
|
||||
|
||||
registration.addRecipeTransferHandler(object : IRecipeTransferHandler<ExoPackInventoryMenu, CraftingRecipe> {
|
||||
private val transfer = helper.createUnregisteredRecipeTransferHandler(object : IRecipeTransferInfo<ExoPackInventoryMenu, CraftingRecipe> {
|
||||
override fun getContainerClass(): Class<out ExoPackInventoryMenu> {
|
||||
return ExoPackInventoryMenu::class.java
|
||||
registration.addRecipeTransferHandler(object : IRecipeTransferHandler<ExopackInventoryMenu, CraftingRecipe> {
|
||||
private val transfer = helper.createUnregisteredRecipeTransferHandler(object : IRecipeTransferInfo<ExopackInventoryMenu, CraftingRecipe> {
|
||||
override fun getContainerClass(): Class<out ExopackInventoryMenu> {
|
||||
return ExopackInventoryMenu::class.java
|
||||
}
|
||||
|
||||
override fun getMenuType(): Optional<MenuType<ExoPackInventoryMenu>> {
|
||||
override fun getMenuType(): Optional<MenuType<ExopackInventoryMenu>> {
|
||||
return Optional.empty()
|
||||
}
|
||||
|
||||
@ -101,30 +100,30 @@ class JEIPlugin : IModPlugin {
|
||||
return RecipeTypes.CRAFTING
|
||||
}
|
||||
|
||||
override fun canHandle(container: ExoPackInventoryMenu, recipe: CraftingRecipe): Boolean {
|
||||
override fun canHandle(container: ExopackInventoryMenu, recipe: CraftingRecipe): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
override fun getRecipeSlots(
|
||||
container: ExoPackInventoryMenu,
|
||||
container: ExopackInventoryMenu,
|
||||
recipe: CraftingRecipe
|
||||
): List<Slot> {
|
||||
return container.craftingSlots
|
||||
}
|
||||
|
||||
override fun getInventorySlots(
|
||||
container: ExoPackInventoryMenu,
|
||||
container: ExopackInventoryMenu,
|
||||
recipe: CraftingRecipe
|
||||
): List<Slot> {
|
||||
return container.playerInventorySlots
|
||||
}
|
||||
})
|
||||
|
||||
override fun getContainerClass(): Class<out ExoPackInventoryMenu> {
|
||||
return ExoPackInventoryMenu::class.java
|
||||
override fun getContainerClass(): Class<out ExopackInventoryMenu> {
|
||||
return ExopackInventoryMenu::class.java
|
||||
}
|
||||
|
||||
override fun getMenuType(): Optional<MenuType<ExoPackInventoryMenu>> {
|
||||
override fun getMenuType(): Optional<MenuType<ExopackInventoryMenu>> {
|
||||
return Optional.empty()
|
||||
}
|
||||
|
||||
@ -154,7 +153,7 @@ class JEIPlugin : IModPlugin {
|
||||
}
|
||||
|
||||
override fun transferRecipe(
|
||||
container: ExoPackInventoryMenu,
|
||||
container: ExopackInventoryMenu,
|
||||
recipe: CraftingRecipe,
|
||||
recipeSlots: IRecipeSlotsView,
|
||||
player: Player,
|
||||
|
@ -19,7 +19,7 @@ import ru.dbotthepony.mc.otm.network.ExoSuitMenuInitPacket
|
||||
import ru.dbotthepony.mc.otm.network.ExoSuitSlotPacket
|
||||
import ru.dbotthepony.mc.otm.network.MatteryPlayerNetworkChannel
|
||||
|
||||
class ExoPackInventoryMenu(val capability: MatteryPlayerCapability) : MatteryMenu(null, CONTAINER_ID, capability.ply.inventory) {
|
||||
class ExopackInventoryMenu(val capability: MatteryPlayerCapability) : MatteryMenu(null, CONTAINER_ID, capability.ply.inventory) {
|
||||
val craftingGrid: CraftingContainer
|
||||
val craftingSlots: List<MatterySlot>
|
||||
|
||||
@ -207,35 +207,35 @@ class ExoPackInventoryMenu(val capability: MatteryPlayerCapability) : MatteryMen
|
||||
const val CONTAINER_ID: Int = 101
|
||||
|
||||
override fun sendInitialData(container: AbstractContainerMenu, itemStacks: NonNullList<ItemStack>, carried: ItemStack, remoteDataSlots: IntArray) {
|
||||
return sendInitialData(container as ExoPackInventoryMenu, itemStacks, carried, remoteDataSlots)
|
||||
return sendInitialData(container as ExopackInventoryMenu, itemStacks, carried, remoteDataSlots)
|
||||
}
|
||||
|
||||
override fun sendSlotChange(container: AbstractContainerMenu, slotId: Int, itemStack: ItemStack) {
|
||||
return sendSlotChange(container as ExoPackInventoryMenu, slotId, itemStack)
|
||||
return sendSlotChange(container as ExopackInventoryMenu, slotId, itemStack)
|
||||
}
|
||||
|
||||
override fun sendCarriedChange(container: AbstractContainerMenu, itemStack: ItemStack) {
|
||||
return sendCarriedChange(container as ExoPackInventoryMenu, itemStack)
|
||||
return sendCarriedChange(container as ExopackInventoryMenu, itemStack)
|
||||
}
|
||||
|
||||
override fun sendDataChange(container: AbstractContainerMenu, dataSlotId: Int, shortData: Int) {
|
||||
return sendDataChange(container as ExoPackInventoryMenu, dataSlotId, shortData)
|
||||
return sendDataChange(container as ExopackInventoryMenu, dataSlotId, shortData)
|
||||
}
|
||||
|
||||
fun sendInitialData(container: ExoPackInventoryMenu, itemStacks: NonNullList<ItemStack>, carried: ItemStack, remoteDataSlots: IntArray) {
|
||||
fun sendInitialData(container: ExopackInventoryMenu, itemStacks: NonNullList<ItemStack>, carried: ItemStack, remoteDataSlots: IntArray) {
|
||||
MatteryPlayerNetworkChannel.send(container.ply as ServerPlayer, ExoSuitMenuInitPacket(itemStacks, carried, container.incrementStateId()))
|
||||
}
|
||||
|
||||
fun sendSlotChange(container: ExoPackInventoryMenu, slotId: Int, itemStack: ItemStack) {
|
||||
if (container.slots[slotId].container != container.ply.inventory || container.ply.containerMenu is ExoPackInventoryMenu)
|
||||
fun sendSlotChange(container: ExopackInventoryMenu, slotId: Int, itemStack: ItemStack) {
|
||||
if (container.slots[slotId].container != container.ply.inventory || container.ply.containerMenu is ExopackInventoryMenu)
|
||||
MatteryPlayerNetworkChannel.send(container.ply as ServerPlayer, ExoSuitSlotPacket(slotId, itemStack, container.stateId))
|
||||
}
|
||||
|
||||
fun sendCarriedChange(container: ExoPackInventoryMenu, itemStack: ItemStack) {
|
||||
fun sendCarriedChange(container: ExopackInventoryMenu, itemStack: ItemStack) {
|
||||
MatteryPlayerNetworkChannel.send(container.ply as ServerPlayer, ExoSuitCarriedPacket(itemStack, container.stateId))
|
||||
}
|
||||
|
||||
fun sendDataChange(container: ExoPackInventoryMenu, dataSlotId: Int, shortData: Int) {
|
||||
fun sendDataChange(container: ExopackInventoryMenu, dataSlotId: Int, shortData: Int) {
|
||||
throw UnsupportedOperationException("This should never be called. Dumbass")
|
||||
}
|
||||
}
|
@ -30,7 +30,7 @@ import ru.dbotthepony.mc.otm.container.set
|
||||
import ru.dbotthepony.mc.otm.core.math.RGBAColor
|
||||
import ru.dbotthepony.mc.otm.core.math.Vector
|
||||
import ru.dbotthepony.mc.otm.menu.tech.AndroidStationMenu
|
||||
import ru.dbotthepony.mc.otm.menu.ExoPackInventoryMenu
|
||||
import ru.dbotthepony.mc.otm.menu.ExopackInventoryMenu
|
||||
import ru.dbotthepony.mc.otm.registry.AndroidFeatures
|
||||
import ru.dbotthepony.mc.otm.registry.MRegistry
|
||||
import java.io.ByteArrayInputStream
|
||||
@ -274,7 +274,7 @@ class ExoSuitSlotPacket(val slotId: Int, val itemStack: ItemStack, val container
|
||||
|
||||
// don't duplicate data
|
||||
// really.
|
||||
if (mattery.exoPackMenu.slots[slotId].container == minecraft.player?.inventory && minecraft.player?.containerMenu !is ExoPackInventoryMenu)
|
||||
if (mattery.exoPackMenu.slots[slotId].container == minecraft.player?.inventory && minecraft.player?.containerMenu !is ExopackInventoryMenu)
|
||||
return@enqueueWork
|
||||
|
||||
mattery.exoPackMenu.slots[slotId].set(itemStack)
|
||||
|
@ -10,7 +10,7 @@ import ru.dbotthepony.mc.otm.capability.matteryPlayer
|
||||
import ru.dbotthepony.mc.otm.client.minecraft
|
||||
import ru.dbotthepony.mc.otm.compat.InventoryScrollPacket
|
||||
import ru.dbotthepony.mc.otm.container.ItemFilterSlotPacket
|
||||
import ru.dbotthepony.mc.otm.menu.ExoPackInventoryMenu
|
||||
import ru.dbotthepony.mc.otm.menu.ExopackInventoryMenu
|
||||
import ru.dbotthepony.mc.otm.menu.matter.CancelTaskPacket
|
||||
import ru.dbotthepony.mc.otm.menu.MatteryMenu
|
||||
import ru.dbotthepony.mc.otm.menu.matter.PatternsChangePacket
|
||||
@ -36,7 +36,7 @@ class MenuFieldPacket(val containerId: Int, val bytes: ByteArray, val length: In
|
||||
context.packetHandled = true
|
||||
|
||||
context.enqueueWork {
|
||||
if (containerId == ExoPackInventoryMenu.CONTAINER_ID) {
|
||||
if (containerId == ExopackInventoryMenu.CONTAINER_ID) {
|
||||
minecraft.player?.matteryPlayer?.exoPackMenu?.mSynchronizer?.read(ByteArrayInputStream(bytes, 0, length))
|
||||
} else {
|
||||
val menu = minecraft.player?.containerMenu as? MatteryMenu ?: return@enqueueWork
|
||||
|
Loading…
Reference in New Issue
Block a user