Posted December 21, 20159 yr I ran another version of Forge 1.7.10 with NO custom potion at all. Now I realize that the potion shadow effect is there on all potions even with no mod at all. I doubt this is a forge bug there must be something I have done that would cause this shadow effect behind potion icons but I have no idea where to look. .. Anybody know what could cause this ... check out the shadow effect around the icon when you click on an item ... http://s2.postimg.org/7265u8ph5/2015_12_21_16_30_01.png[/img] I used renderInventoryEffect to create custom potion icon and I get this shadow effect when I click on items . . . Also, whenever I use my potion it wipes out other potion effects but not vice versa. package com.glistre.glistremod.effects; import java.util.ArrayList; import java.util.List; import org.lwjgl.opengl.GL11; import com.glistre.glistremod.GlistreMod; import com.glistre.glistremod.items.ItemRegistry; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.ITextureObject; import net.minecraft.entity.EntityLivingBase; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.ResourceLocation; public class PoisonProtectEffect extends Potion { //substring goes over to the right how ever many you specify, //and sets that as the new start. so 1 in this case... AKA if you don't put the slash at the beginning //and just make it modid + "textures/folder/icon.png" substring isn't required... or it may even require a colon to specify the domain so modid + ":" + "textures/folder/icon.png" public static final ResourceLocation icon = new ResourceLocation("glistremod:textures/gui/potionicon.png"); /** ID value of the potion this effect matches. */ private int potionID; /** The duration of the potion effect */ private int duration; /** The amplifier of the potion effect */ private int amplifier; /** Whether the potion is a splash potion */ private List<ItemStack> curativeItems; private int width; private int height; private int u; private int v; public PoisonProtectEffect(int potionID, boolean bad, int potionColor) { super(potionID, bad, potionColor); } //this will put Minecraft Icons for potions use renderInventoryEffect don't use this /* @Override public Potion setIconIndex(int x, int y) { super.setIconIndex(x, y); return this; }*/ @Override public boolean hasStatusIcon() { return false; } @Override public void performEffect(EntityLivingBase entity, int strength) { super.performEffect(entity, strength); entity.removePotionEffect(Potion.poison.id); entity.getActivePotionEffect(GlistreMod.poisonProtectPotion).getDuration(), 6)); } @Override public boolean isReady(int ticksLeft, int amplifier){ int k = (5 >> amplifier); return k < 1 || ticksLeft % k == 0; } @Override // @SideOnly(Side.CLIENT) public void renderInventoryEffect(int x, int y, PotionEffect effect, net.minecraft.client.Minecraft mc){ if (effect.getPotionID() == 31){ GL11.glEnable(GL11.GL_BLEND); mc.renderEngine.bindTexture(icon); // drawTextureModalRect(xscreen, yscreen, utexture, vtexture, width, height) mc.currentScreen.drawTexturedModalRect(x + 6, y + 7, u + 9, v + 9, 18, 18); GL11.glDisable(GL11.GL_BLEND); } } public int getStatusIconIndex(){ // ITextureObject texture = Minecraft.getMinecraft().renderEngine.getTexture(icon); Minecraft.getMinecraft().renderEngine.bindTexture(icon); return super.getStatusIconIndex(); } public boolean isBadEffect(){ return false; } public int getPotionID() { return this.potionID; } }
December 25, 20159 yr Author bump is this possibly a bug? it does the same thing with vanilla potions even with no items, no blocks, nothing modding, just the basic install and setup for Forge modding with eclipse does not do this in vanilla minecraft 1.7.10 Can anyone confirm or deny the shadow effect in their mod? If no one else has this I will post my main mod file and see what is wrong with my setup thanks
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.