• 0

    posted a message on [1.12] [Solved] Need help with GUI Overlay Rendering

    The code I have does render but it is distorted and not in a scale-able position(Stays in one spot no matter the game resolution). Not sure how to set the image alignment to the bottom left


    EDIT:Solved



    public class GuiHPOverlay extends Gui 
    {
    	private final ResourceLocation hp = new ResourceLocation(Reference.MODID + ":textures/gui/hp_overlay.png");
    	private final int tex_width = 128, tex_height = 12, bar_width = 100, bar_height = 7;
    	
    	@SubscribeEvent
    	public void renderHPOverlay(RenderGameOverlayEvent event) 
    	{
    		if (event.getType() == RenderGameOverlayEvent.ElementType.TEXT) 
    		{
    			Minecraft mc = Minecraft.getMinecraft();
    			mc.renderEngine.bindTexture(hp);
    			float oneUnit = (float)bar_width / mc.player.getMaxHealth();
    			int currentWidth = (int)(oneUnit * mc.player.getHealth());
    			drawTexturedModalRect(10, 240, 0, 0, tex_width, tex_height);
    			drawTexturedModalRect(35, 240, 27, tex_height, currentWidth, bar_height);
    		}
    	}
    	
    	@SubscribeEvent
    	public void hideHealth(RenderGameOverlayEvent event) 
    	{
    		if (event.getType() == RenderGameOverlayEvent.ElementType.HEALTH && event.isCancelable())
    		{
    			event.setCanceled(true);
    		}
    	}
    }

    Posted in: Modification Development
  • 0

    posted a message on Problems with potions on food[SOLVED]

    Thank you that worked perfectly. Who knew it would be that easy

    Posted in: Modification Development
  • 0

    posted a message on Problems with potions on food[SOLVED]

    public class ItemFoods extends ItemFood implements IhasModelpublic class ItemFoods extends ItemFood implements IhasModel{ private PotionEffect[] effects;
    public ItemFoods(String name, int amount, float saturation, boolean isWolfFood, PotionEffect...potionEffects) { super(amount, saturation, isWolfFood); this.setUnlocalizedName(name); this.setRegistryName(name); this.effects = potionEffects; this.setCreativeTab(Main.tabFood); ItemInit.ITEMS.add(this); } @Override protected void onFoodEaten(ItemStack stack, World worldIn, EntityPlayer player) { if(!worldIn.isRemote) { for(PotionEffect effect : effects) { player.addPotionEffect(effect); } return; } } @Override public void registerModels() { Main.proxy.registerItemRenderer(this, 0, "inventory"); }
    }

    Posted in: Modification Development
  • 0

    posted a message on Problems with potions on food[SOLVED]

    Hey guys I'm having trouble with my mod. I have potion effects on a couple foods(Regen and nausea) Whenever I eat the foods I get the potion effects the first time, but then nothing any other time. Is it a client issue or something else?

    Posted in: Modification Development
  • 0

    posted a message on DIVINE JOURNEY 1.5.7 | Expert Pack | 1140 Modified recipes | 800 Quests | One goal | 2 modes: EASY and HARD

    It may just be a bug on the twitch/curse launcher, but when I try to update to 1.4.0 it updates but shows that it is still 1.3.5 Updates with no errors

    Posted in: Mod Packs
  • 0

    posted a message on Custom crafting table in 1.11.2 Help!

    Okay so I know now what I need, but I don't know how they are set up. I know how the Block class should be set up but that's all

    Posted in: Modification Development
  • 0

    posted a message on Custom crafting table in 1.11.2 Help!

    What do you mean when you say handler,and packets?

    Posted in: Modification Development
  • 0

    posted a message on Custom crafting table in 1.11.2 Help!

    Hey everyone, I'm developing a mod for minecraft 1.11.2, and I need some help. Can someone explain how to code a crafting table? I need to know what code I need for say a 5x5 crafting table. Ask any questions for more info by comment or pm me.

    Thank you!

    Posted in: Modification Development
  • 0

    posted a message on DIVINE JOURNEY 1.5.7 | Expert Pack | 1140 Modified recipes | 800 Quests | One goal | 2 modes: EASY and HARD

    Do you think you could add some decoration type mods such as Malisis Doors, Ztones?

    Posted in: Mod Packs
  • To post a comment, please or register a new account.