package event; import com.aleanni.serenitycoords.SerenityCoords; import com.aleanni.serenitycoords.gui.CoordsLayer; import net.minecraft.client.DeltaTracker; import net.minecraft.client.gui.GuiGraphicsExtractor; import net.minecraft.resources.Identifier; import net.neoforged.api.distmarker.Dist; import net.neoforged.bus.api.SubscribeEvent; import net.neoforged.fml.common.EventBusSubscriber; import net.neoforged.neoforge.client.event.RegisterGuiLayersEvent; import net.neoforged.neoforge.client.gui.VanillaGuiLayers; @EventBusSubscriber(modid = SerenityCoords.MODID, value = Dist.CLIENT) public class GUIEvent { private static final Identifier LAYER_ID = Identifier.fromNamespaceAndPath(SerenityCoords.MODID, "coords_hud"); @SubscribeEvent public static void registerGuiLayers(RegisterGuiLayersEvent event) { event.registerAbove(VanillaGuiLayers.HOTBAR, LAYER_ID, GUIEvent::renderLayer); } private static void renderLayer(GuiGraphicsExtractor guiGraphics, DeltaTracker deltaTracker) { CoordsLayer.render(guiGraphics); } }