Advertisement
jayhillx

HeartColors.class

Oct 20th, 2020
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. import net.minecraft.client.Minecraft;
  2. import net.minecraft.util.ResourceLocation;
  3. import net.minecraftforge.client.event.RenderGameOverlayEvent;
  4. import net.minecraftforge.client.gui.ForgeIngameGui;
  5. import net.minecraftforge.eventbus.api.SubscribeEvent;
  6.  
  7. public class HeartColors extends ForgeIngameGui {
  8.  
  9. public static final ResourceLocation BLUE_HEARTS = new ResourceLocation("xlifehealth:textures/gui/blue_hearts.png");
  10.  
  11. public HeartColors() { super(Minecraft.getInstance()); }
  12.  
  13. @SubscribeEvent
  14. public static void setBlueHearts(RenderGameOverlayEvent event) {
  15. if (event.getType() == RenderGameOverlayEvent.ElementType.HEALTH) {
  16. Minecraft mc = Minecraft.getInstance();
  17. mc.getTextureManager().bindTexture(BLUE_HEARTS);
  18.  
  19. }
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement