Posted July 8, 201411 yr im making an item that is supposed to have a two layered texture, where the second one is transparent and also glow in the dark (only if shouldGlow is true). i have managed to do this with an entity, but i cant figure out how to do it with an item model. please help! this is the renderer code: public class RenderPlasmidHand implements IItemRenderer { private final ResourceLocation steveTextures = new ResourceLocation("textures/entity/steve.png"); private boolean hasEve; private int cooldown; private String plasmid; private boolean hasPlasmid; public boolean shouldGlow; private String texture; protected ModelPlasmidHand model; public RenderPlasmidHand(boolean shouldGlow) { this.model = new ModelPlasmidHand(); this.shouldGlow = shouldGlow; } @Override public boolean handleRenderType(ItemStack itemstack, ItemRenderType itemrendertype) { if(itemrendertype == ItemRenderType.EQUIPPED_FIRST_PERSON) { return /*itemstack.stackTagCompound.getBoolean("PlayerHasPlasmid") || */true; } else { return false; } } @Override public void renderItem(ItemRenderType itemrendertype, ItemStack itemstack, Object... data) { this.cooldown = itemstack.stackTagCompound.getInteger("Cooldown"); this.hasEve = itemstack.stackTagCompound.getInteger("PlayerEve") > 0; this.hasPlasmid = itemstack.stackTagCompound.getBoolean("PlayerHasPlasmid"); this.texture = itemstack.stackTagCompound.getString("PlayerTextre"); this.plasmid = itemstack.stackTagCompound.getString("Plasmid"); if(/*this.hasPlasmid || */true) { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(this.steveTextures); GL11.glTranslatef(0.3F, 0.2F, -1.7F); GL11.glRotatef(180F, 0F, 0F, 1F); GL11.glRotatef(-90F, 0F, 1F, 0F); GL11.glRotatef(0F, 1F, 0F, 0F); this.model.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, hasEve && cooldown <= 0); GL11.glPopMatrix(); GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("bioshock:textures/entity/plasmids/plasmid_" + this.plasmid + ".png")); GL11.glEnable(GL11.GL_BLEND); if(this.shouldGlow) { GL11.glDisable(GL11.GL_LIGHTING); } //OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)(61680 % 65536) / 1.0F, (float)(61680 / 65536) / 1.0F); this.model.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, hasEve && cooldown <= 0); if(this.shouldGlow) { GL11.glEnable(GL11.GL_LIGHTING); } GL11.glPopMatrix(); } } @Override public boolean shouldUseRenderHelper(ItemRenderType itemrendertype, ItemStack itemstack, ItemRendererHelper arg2) { return false; } } http://www.planetminecraft.com/member/sigurd4 I'm making the bioshock mod!
July 8, 201411 yr Author bump. anyone? http://www.planetminecraft.com/member/sigurd4 I'm making the bioshock mod!
July 8, 201411 yr Author oops i just realized i had forgot to set the GL11 translation to the second layer. haha http://www.planetminecraft.com/member/sigurd4 I'm making the bioshock mod!
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.