minsto

Untitled

Jul 22nd, 2017
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.95 KB | None | 0 0
  1. package com.mickdev.empvp.overlay;
  2.  
  3. import com.mickdev.empvp.References;
  4. import com.mickdev.empvp.init.ModItems;
  5.  
  6. import net.minecraft.client.Minecraft;
  7. import net.minecraft.entity.player.EntityPlayer;
  8. import net.minecraft.util.ResourceLocation;
  9. import net.minecraftforge.client.event.RenderGameOverlayEvent;
  10. import net.minecraftforge.fml.common.eventhandler.EventPriority;
  11. import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
  12. import net.minecraftforge.fml.relauncher.Side;
  13. import net.minecraftforge.fml.relauncher.SideOnly;
  14.  
  15. //import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.*;
  16.  
  17. //import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.*;
  18.  
  19. public class look {
  20.     public static final String PROP_NAME = References.MODID + "_ExampleEntityData";
  21.     public static class GUIRenderEventClass {
  22.         @SideOnly (Side.CLIENT)
  23.         @SubscribeEvent(priority = EventPriority.NORMAL)
  24.        
  25.         public void eventHandler(RenderGameOverlayEvent event) {
  26.            
  27.             if (!event.isCancelable() && event.getType() == RenderGameOverlayEvent.ElementType.HELMET) {
  28.  
  29.                 int posX = (event.getResolution().getScaledWidth()) / 2;
  30.                 int posY = (event.getResolution().getScaledHeight()) / 2;
  31.  
  32.                 EntityPlayer entity = Minecraft.getMinecraft().thePlayer;
  33.                 int i = (int) entity.posX;
  34.                 int j = (int) entity.posY;
  35.                 int k = (int) entity.posZ;
  36.                 int x= i;
  37.                 int y = j;
  38.                 int z = k;
  39.                
  40.                
  41.                 if (entity.inventory.getCurrentItem() != null && entity.inventory.getCurrentItem().getItem() == ModItems.chestlookt) {
  42.  
  43.                     Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(References.MODID,"textures/gui/chestbutin.png"));
  44.                     Minecraft.getMinecraft().ingameGUI.drawTexturedModalRect(posX + (-193), posY + (-115), 0, 0, 256, 256);
  45.                     Minecraft.getMinecraft().fontRendererObj.drawString("Butin" + i + "%", posX + (-208), posY + (-108), 0xffffff);
  46.  
  47.                 }
  48.  
  49.             }
  50.  
  51.         }
  52.         }
  53.     }
Advertisement
Add Comment
Please, Sign In to add comment