Add a method to the SnowyScreen companion object
This commit is contained in:
parent
73624dbf2d
commit
203ea34ee7
|
@ -5,6 +5,13 @@ import net.minecraft.client.gui.screens.Screen
|
|||
import net.minecraft.network.chat.TranslatableComponent
|
||||
|
||||
abstract class SnowyScreen(translatableString: String = "screen.snowy.gui", private val willPauseScreen: Boolean = false): Screen(TranslatableComponent(translatableString)) {
|
||||
companion object {
|
||||
fun fromRenderable(r: Renderable, x: Int, y: Int, width: Int, height: Int): Element {
|
||||
return object: Element(x.toDouble(), y.toDouble(), width, height) {
|
||||
override fun render(poseStack: PoseStack?) = r.render(poseStack)
|
||||
}
|
||||
}
|
||||
}
|
||||
open val components: MutableSet<Element>? = null
|
||||
override fun render(poseStack: PoseStack?, i: Int, j: Int, f: Float) {
|
||||
if (poseStack != null) {
|
||||
|
|
Loading…
Reference in New Issue