Advertisement
jayhillx

setHeartColors error

Nov 5th, 2020 (edited)
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. @SubscribeEvent
  2. public void setHeartColors(RenderGameOverlayEvent overlayEvent) {
  3. if (overlayEvent.getType().equals(RenderGameOverlayEvent.ElementType.HEALTH)) {
  4. overlayEvent.setCanceled(true);
  5. if (maxHealth == 4) {
  6. Minecraft mc = Minecraft.getInstance();
  7. mc.getTextureManager().bindTexture(BLUE_HEARTS);
  8. bind(BLUE_HEARTS);
  9. }
  10. if (maxHealth == 6) {
  11. Minecraft mc = Minecraft.getInstance();
  12. mc.getTextureManager().bindTexture(GREEN_HEARTS);
  13. bind(GREEN_HEARTS);
  14. }
  15. if (maxHealth == 8) {
  16. Minecraft mc = Minecraft.getInstance();
  17. mc.getTextureManager().bindTexture(ORANGE_HEARTS);
  18. bind(ORANGE_HEARTS);
  19. }
  20. }
  21. }
  22.  
  23. private void bind(ResourceLocation res) {
  24. Minecraft mc = Minecraft.getInstance();
  25. mc.getTextureManager().bindTexture(res);
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement