Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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!

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.