Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @SubscribeEvent
- public void setHeartColors(RenderGameOverlayEvent overlayEvent) {
- if (overlayEvent.getType().equals(RenderGameOverlayEvent.ElementType.HEALTH)) {
- overlayEvent.setCanceled(true);
- if (maxHealth == 4) {
- Minecraft mc = Minecraft.getInstance();
- mc.getTextureManager().bindTexture(BLUE_HEARTS);
- bind(BLUE_HEARTS);
- }
- if (maxHealth == 6) {
- Minecraft mc = Minecraft.getInstance();
- mc.getTextureManager().bindTexture(GREEN_HEARTS);
- bind(GREEN_HEARTS);
- }
- if (maxHealth == 8) {
- Minecraft mc = Minecraft.getInstance();
- mc.getTextureManager().bindTexture(ORANGE_HEARTS);
- bind(ORANGE_HEARTS);
- }
- }
- }
- private void bind(ResourceLocation res) {
- Minecraft mc = Minecraft.getInstance();
- mc.getTextureManager().bindTexture(res);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement