Advertisement
jayhillx

ClientAnimalEvents

Apr 5th, 2022
1,135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.78 KB | None | 0 0
  1. @Mod.EventBusSubscriber(modid = Wildlife.MOD_ID, bus = Mod.EventBusSubscriber.Bus.FORGE, value = Dist.CLIENT)
  2. public class ClientAnimalEvents {
  3.     public static final ResourceLocation BAMBOO_ICONS = new ResourceLocation(Wildlife.MOD_ID, "textures/gui/bamboo.png");
  4.     public static ForgeIngameGui INSTANCE = new ForgeIngameGui(Minecraft.getInstance());
  5.  
  6.     @SubscribeEvent
  7.     public void renderHunger(RenderGameOverlayEvent.PreLayer event) {
  8.         // Replace vanilla hunger bar texture.
  9.         if (event.getOverlay() == ForgeIngameGui.FOOD_LEVEL_ELEMENT) {
  10.             INSTANCE.setupOverlayRenderState(true, false, BAMBOO_ICONS);
  11.             INSTANCE.renderFood(event.getWindow().getScreenWidth(), event.getWindow().getScreenHeight(), event.getMatrixStack());
  12.         }
  13.     }
  14.  
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement