Posted October 4, 201312 yr I was able to get my custom potioneffect to render with my custom texture in the player's gui before I updated to the latest forge. Now there are methods like Minecraft.getMinecraft().renderEngine.bindTexture(par1ResourceLocation) and Minecraft.getMinecraft().renderEngine.getTexture(par1ResourceLocation) and Minecraft.getMinecraft().renderEngine.loadTexture(par1ResourceLocation, par2TextureObject). Does anyone know how to use them?
October 4, 201312 yr new ResourceLocation("modID:textures/gui/potion_icon.png") Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
October 4, 201312 yr Author I tried this but I am still not getting the image. In fact, I am not getting the name of my potion effect either.
October 4, 201312 yr You probably want to use the bindTexture(...) one. Though it would be easier to help if you showed some code.
October 4, 201312 yr Author Here is my cutom potion file : package eclipse.MoreApples.potion; import java.util.Timer; import java.util.TimerTask; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.client.renderer.texture.TextureObject; import net.minecraft.client.resources.ReloadableResourceManager; import net.minecraft.client.resources.Resource; import net.minecraft.client.resources.SimpleReloadableResourceManager; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.potion.Potion; import net.minecraft.src.ModLoader; import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.client.MinecraftForgeClient; import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.event.ForgeSubscribe; import net.minecraftforge.event.entity.living.LivingFallEvent; public class FlyingPotion extends Potion { public FlyingPotion(int par1, boolean par2, int par3) { super(par1, par2, par3); } public Potion setIconIndex(int par1, int par2) { //(3,2) is where I drew my texture in the "2D array" of textures in the inventory.png super.setIconIndex(3,2); return (Potion)this; } @Override public int getStatusIconIndex() { ResourceLocation r = new ResourceLocation("More_Apples:textures/gui/inventory.png"); TextureObject texture = Minecraft.getMinecraft().renderEngine.getTexture(r); Minecraft.getMinecraft().renderEngine.bindTexture(r); return super.getStatusIconIndex(); } } And here is what's rendering: http://www.mediafire.com/view/y4twl1jj85wddn6/2013-10-04_16.26.51.png I have also noticed something. If I give myself the potion effect, then quit the game before the potion effect runs out, it will render this: http://www.mediafire.com/view/67j1sty29ufahg9/2013-10-04_16.28.04.png
October 5, 201312 yr Author I meant that you can see the images of what's going on. The rendering problem is NOT fixed yet. Please help =)
October 6, 201312 yr Author I fixed it. I was giving the player new instances of my potion effects, but I didn't set the status icon of those potion effects.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.