30 lines
927 B
Kotlin
30 lines
927 B
Kotlin
package net.shadowfacts.phycon.plugin.rei
|
|
|
|
import me.shedaniel.math.Rectangle
|
|
import me.shedaniel.rei.api.BaseBoundsHandler
|
|
import me.shedaniel.rei.api.DisplayHelper
|
|
import me.shedaniel.rei.api.plugins.REIPluginV0
|
|
import net.minecraft.client.MinecraftClient
|
|
import net.minecraft.util.Identifier
|
|
import net.shadowfacts.phycon.block.terminal.TerminalScreen
|
|
|
|
/**
|
|
* @author shadowfacts
|
|
*/
|
|
object PhyConPlugin: REIPluginV0 {
|
|
const val MODID = "phycon_rei"
|
|
|
|
override fun getPluginIdentifier() = Identifier(MODID, "rei_plugin")
|
|
|
|
override fun registerBounds(helper: DisplayHelper) {
|
|
BaseBoundsHandler.getInstance().registerExclusionZones(TerminalScreen::class.java) {
|
|
val screen = MinecraftClient.getInstance().currentScreen as TerminalScreen
|
|
val button = screen.terminalVC.sortMode
|
|
val rect = button.convert(button.bounds, to = null)
|
|
listOf(
|
|
Rectangle(rect.left.toInt(), rect.top.toInt(), 20, 20)
|
|
)
|
|
}
|
|
}
|
|
}
|