Files
Serenity-Coords/src/main/java/event/GUIEvent.java
Ryan Macham 2ad58d62a9
Some checks failed
Build / build (push) Has been cancelled
Initial 1.0. Release
2026-04-16 19:46:51 +01:00

29 lines
1.1 KiB
Java

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);
}
}