SnowyGUI/common/src/main/kotlin/fr/username404/snowygui/gui/SnowyScreen.kt
Username404 2772d52217
Port to 1.20
Signed-off-by: Username404 <w.iron.zombie@gmail.com>
2024-02-25 15:45:09 +01:00

15 lines
628 B
Kotlin

package fr.username404.snowygui.gui
import net.minecraft.client.gui.GuiGraphics
import net.minecraft.client.gui.screens.Screen
import net.minecraft.network.chat.Component.translatable
abstract class SnowyScreen(translatableString: String = "screen.snowy.gui", private val willPauseScreen: Boolean = false): Screen(translatable(translatableString)) {
abstract val components: MutableCollection<Element>
override fun render(guiGraphics: GuiGraphics, i: Int, j: Int, f: Float) {
components.forEach {
it.display(guiGraphics)
}
}
override fun isPauseScreen(): Boolean = willPauseScreen
}