Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.mickdev.empvp.overlay;
- import com.mickdev.empvp.References;
- import com.mickdev.empvp.init.ModItems;
- import net.minecraft.client.Minecraft;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.util.ResourceLocation;
- import net.minecraftforge.client.event.RenderGameOverlayEvent;
- import net.minecraftforge.fml.common.eventhandler.EventPriority;
- import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
- import net.minecraftforge.fml.relauncher.Side;
- import net.minecraftforge.fml.relauncher.SideOnly;
- //import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.*;
- //import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.*;
- public class look {
- public static final String PROP_NAME = References.MODID + "_ExampleEntityData";
- public static class GUIRenderEventClass {
- @SideOnly (Side.CLIENT)
- @SubscribeEvent(priority = EventPriority.NORMAL)
- public void eventHandler(RenderGameOverlayEvent event) {
- if (!event.isCancelable() && event.getType() == RenderGameOverlayEvent.ElementType.HELMET) {
- int posX = (event.getResolution().getScaledWidth()) / 2;
- int posY = (event.getResolution().getScaledHeight()) / 2;
- EntityPlayer entity = Minecraft.getMinecraft().thePlayer;
- int i = (int) entity.posX;
- int j = (int) entity.posY;
- int k = (int) entity.posZ;
- int x= i;
- int y = j;
- int z = k;
- if (entity.inventory.getCurrentItem() != null && entity.inventory.getCurrentItem().getItem() == ModItems.chestlookt) {
- Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(References.MODID,"textures/gui/chestbutin.png"));
- Minecraft.getMinecraft().ingameGUI.drawTexturedModalRect(posX + (-193), posY + (-115), 0, 0, 256, 256);
- Minecraft.getMinecraft().fontRendererObj.drawString("Butin" + i + "%", posX + (-208), posY + (-108), 0xffffff);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment