aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/firmament/util/GetRectangle.kt
blob: 261c97a8d7cc74d449b9c8558c27a4161a9601da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
 * SPDX-FileCopyrightText: 2023 Linnea Gräf <nea@nea.moe>
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

package moe.nea.firmament.util

import me.shedaniel.math.Rectangle
import moe.nea.firmament.mixins.accessor.AccessorHandledScreen
import net.minecraft.client.gui.screen.ingame.HandledScreen

fun HandledScreen<*>.getRectangle(): Rectangle {
    this as AccessorHandledScreen
    return Rectangle(
        getX_Firmament(),
        getY_Firmament(),
        getBackgroundWidth_Firmament(),
        getBackgroundHeight_Firmament()
    )
}