Advertisement
jayhillx

[Wildlife] renderHunger

Apr 5th, 2022
1,170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.69 KB | None | 0 0
  1. public static final ResourceLocation BAMBOO_ICONS = new ResourceLocation(Wildlife.MOD_ID, "textures/gui/bamboo.png");
  2.     public static ForgeIngameGui INSTANCE = new ForgeIngameGui(Minecraft.getInstance());
  3.  
  4.     @SubscribeEvent(priority = EventPriority.LOW)
  5.     public static void renderHunger(RenderGameOverlayEvent.PreLayer event) {
  6.         // Replace vanilla hunger bar texture.
  7.         if (event.getOverlay() == ForgeIngameGui.FOOD_LEVEL_ELEMENT) {
  8.  
  9.             RenderSystem.setShaderTexture(0, BAMBOO_ICONS);
  10.             INSTANCE.renderFood(event.getWindow().getScreenWidth(), event.getWindow().getScreenHeight(), event.getMatrixStack());
  11.             event.setCanceled(true);
  12.         }
  13.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement