49 lines
1.4 KiB
Kotlin
49 lines
1.4 KiB
Kotlin
package net.shadowfacts.phycon.block.terminal
|
|
|
|
import com.mojang.blaze3d.systems.RenderSystem
|
|
import net.minecraft.client.util.math.MatrixStack
|
|
import net.minecraft.entity.player.PlayerInventory
|
|
import net.minecraft.text.Text
|
|
import net.minecraft.util.Identifier
|
|
import net.shadowfacts.phycon.PhysicalConnectivity
|
|
|
|
/**
|
|
* @author shadowfacts
|
|
*/
|
|
class CraftingTerminalScreen(
|
|
handler: CraftingTerminalScreenHandler,
|
|
playerInv: PlayerInventory,
|
|
title: Text,
|
|
): AbstractTerminalScreen<CraftingTerminalBlockEntity, CraftingTerminalScreenHandler>(
|
|
handler,
|
|
playerInv,
|
|
title,
|
|
259,
|
|
252,
|
|
) {
|
|
|
|
companion object {
|
|
private val BACKGROUND_1 = Identifier(PhysicalConnectivity.MODID, "textures/gui/crafting_terminal_1.png")
|
|
private val BACKGROUND_2 = Identifier(PhysicalConnectivity.MODID, "textures/gui/crafting_terminal_2.png")
|
|
}
|
|
|
|
override val backgroundTexture = BACKGROUND_1
|
|
|
|
override fun createViewController(): AbstractTerminalViewController<*, *, *> {
|
|
return CraftingTerminalViewController(this, handler)
|
|
}
|
|
|
|
override fun drawBackgroundTexture(matrixStack: MatrixStack) {
|
|
RenderSystem.color4f(1f, 1f, 1f, 1f)
|
|
client!!.textureManager.bindTexture(BACKGROUND_1)
|
|
val x = (width - backgroundWidth) / 2
|
|
val y = (height - backgroundHeight) / 2
|
|
drawTexture(matrixStack, x, y, 0, 0, 256, 252)
|
|
|
|
client!!.textureManager.bindTexture(BACKGROUND_2)
|
|
drawTexture(matrixStack, x + 256, y, 0, 0, 3, 252)
|
|
}
|
|
|
|
|
|
}
|