бордеры хочу.
This commit is contained in:
parent
693075d600
commit
ad3a3d94c4
@ -166,6 +166,9 @@ dependencies {
|
||||
val botarium_id: String by project
|
||||
val ad_astra_id: String by project
|
||||
val worldedit_id: String by project
|
||||
val item_borders_id: String by project
|
||||
val iceberg_id: String by project
|
||||
val prism_lib_id: String by project
|
||||
val cloth_config_version: String by project
|
||||
val condensed_creative_version: String by project
|
||||
|
||||
@ -190,6 +193,11 @@ dependencies {
|
||||
runtimeOnly("me.shedaniel.cloth:cloth-config-neoforge:${cloth_config_version}")
|
||||
implementation("io.wispforest:condensed_creative-neoforge:${condensed_creative_version}")
|
||||
|
||||
compileOnly("curse.maven:item-borders-513769:${item_borders_id}")
|
||||
// implementation("curse.maven:item-borders-513769:${item_borders_id}")
|
||||
// runtimeOnly("curse.maven:iceberg-520110:${iceberg_id}")
|
||||
// runtimeOnly("curse.maven:prism-lib-638111:${prism_lib_id}")
|
||||
|
||||
// runtimeOnly("curse.maven:worldedit-225608:${worldedit_fileid}")
|
||||
// runtimeOnly("at.ridgo8.moreoverlays:MoreOverlays-updated:${more_overlays_version}")
|
||||
|
||||
|
@ -32,6 +32,9 @@ resourceful_config_id=4576455
|
||||
jade_id=5591256
|
||||
configured_id=4462894
|
||||
worldedit_id=4807512
|
||||
item_borders_id=5591010
|
||||
iceberg_id=5750025
|
||||
prism_lib_id=5625115
|
||||
cloth_config_version=15.0.130
|
||||
condensed_creative_version=3.4.1+1.21
|
||||
|
||||
|
@ -13,6 +13,8 @@ import ru.dbotthepony.mc.otm.client.minecraft
|
||||
import ru.dbotthepony.mc.otm.client.render.Widgets18
|
||||
import ru.dbotthepony.mc.otm.client.screen.MatteryScreen
|
||||
import ru.dbotthepony.mc.otm.client.screen.panels.EditablePanel
|
||||
import ru.dbotthepony.mc.otm.compat.itemborders.isItemBordersLoaded
|
||||
import ru.dbotthepony.mc.otm.compat.itemborders.renderSlotBorder
|
||||
import javax.annotation.Nonnull
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
@ -101,6 +103,14 @@ open class SlotPanel<out S : MatteryScreen<*>, out T : Slot>(
|
||||
} else {
|
||||
slotBackgroundEmpty?.render(graphics, 0f, 0f, canvasWidth = width, canvasHeight = height)
|
||||
}
|
||||
} else {
|
||||
// TODO: pre и post ивенты отрисовки слотов для нормальной регистрации компатов? это супер костыль
|
||||
if (isItemBordersLoaded) {
|
||||
graphics.pose.pushPose()
|
||||
graphics.pose.translate(-slot.x.toDouble() + 1.0, -slot.y.toDouble() + 1.0, 0.0)
|
||||
renderSlotBorder(graphics, slot)
|
||||
graphics.pose.popPose()
|
||||
}
|
||||
}
|
||||
|
||||
renderRegular(graphics, itemstack, countOverride)
|
||||
|
@ -0,0 +1,15 @@
|
||||
package ru.dbotthepony.mc.otm.compat.itemborders
|
||||
|
||||
import com.anthonyhilyard.itemborders.ItemBorders
|
||||
import net.minecraft.world.inventory.Slot
|
||||
import net.neoforged.fml.ModList
|
||||
import ru.dbotthepony.mc.otm.client.render.MGUIGraphics
|
||||
|
||||
val isItemBordersLoaded by lazy {
|
||||
ModList.get().isLoaded("itemborders")
|
||||
}
|
||||
|
||||
fun renderSlotBorder(graphics: MGUIGraphics, slot: Slot) {
|
||||
check(isItemBordersLoaded) { "Item Borders is not loaded!" }
|
||||
ItemBorders.renderBorder(graphics.pose, slot)
|
||||
}
|
Loading…
Reference in New Issue
Block a user