Currently RegisterGuiLayersEvent only allows for adding new gui layers.
Would be great if existing layers could be replaced / wrapped.
My use case is e.g. wrapping a layer with a PoseStack::pushPose/popPose call for applying a translation.
Right now this can be done via RenderGuiLayerEvent.Pre, but that requires manually rendering the layer and subsequently cancelling the event to prevent default rendering. The issue with that is it doesn't stack when done by multiple mods.
Fabric also supports this in their new GuiLayer api: https://github.com/FabricMC/fabric/blob/f3a2fccadc3ada58e505adf75a62658a74a6b0c4/fabric-rendering-v1/src/client/java/net/fabricmc/fabric/api/client/rendering/v1/LayeredDrawerWrapper.java#L152
(although I'd recommend against being able to provide a new identifier for the replacement layer as Fabric does, as it will break mods expecting a layer under the original identifier to be present)
Currently
RegisterGuiLayersEventonly allows for adding new gui layers.Would be great if existing layers could be replaced / wrapped.
My use case is e.g. wrapping a layer with a PoseStack::pushPose/popPose call for applying a translation.
Right now this can be done via
RenderGuiLayerEvent.Pre, but that requires manually rendering the layer and subsequently cancelling the event to prevent default rendering. The issue with that is it doesn't stack when done by multiple mods.Fabric also supports this in their new GuiLayer api: https://github.com/FabricMC/fabric/blob/f3a2fccadc3ada58e505adf75a62658a74a6b0c4/fabric-rendering-v1/src/client/java/net/fabricmc/fabric/api/client/rendering/v1/LayeredDrawerWrapper.java#L152
(although I'd recommend against being able to provide a new identifier for the replacement layer as Fabric does, as it will break mods expecting a layer under the original identifier to be present)