year 2024, forge still fires events for gui layers which are not rendered
This commit is contained in:
parent
aac28a4704
commit
c4b7f6e78e
@ -331,10 +331,12 @@ object MatteryGUI {
|
|||||||
fun onLayerRenderEvent(event: RenderGuiLayerEvent.Pre) {
|
fun onLayerRenderEvent(event: RenderGuiLayerEvent.Pre) {
|
||||||
val gui = minecraft.gui
|
val gui = minecraft.gui
|
||||||
|
|
||||||
if (event.name == VanillaGuiLayers.FOOD_LEVEL || event.name == VanillaGuiLayers.AIR_LEVEL) {
|
if (minecraft.gameMode?.canHurtPlayer() == true && !minecraft.options.hideGui) {
|
||||||
renderFoodAndAir(event, gui)
|
if (event.name == VanillaGuiLayers.FOOD_LEVEL || event.name == VanillaGuiLayers.AIR_LEVEL) {
|
||||||
} else if (event.name == VanillaGuiLayers.PLAYER_HEALTH) {
|
renderFoodAndAir(event, gui)
|
||||||
renderPlayerHealth(event, gui)
|
} else if (event.name == VanillaGuiLayers.PLAYER_HEALTH) {
|
||||||
|
renderPlayerHealth(event, gui)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user