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

I created new block with renderer.

This block will get another block or an item, eq  the item frame. (click right button of mouse)

 

How i can to draw icon block/item on the  sides my block ?

public class TestBlockRenderer implements ISimpleBlockRenderingHandler {

....
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z,
		Block block, int modelId, RenderBlocks renderer) {
	// TODO Auto-generated method stub

        if(ClientProxy.renderPass == 0)
        {

        	drawMytestBlock(world, Blocks.diamond_block,x,y,z);   
        	
        }
        return false;
}

public void drawMytestBlock(IBlockAccess world, Block par1Block,int x,int y, int z)
{
	        Tessellator tessellator = Tessellator.instance;
	        IIcon iicon = Blocks.diamond_block.getBlockTextureFromSide(0);

	        tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F);
	        double d0 = (double)iicon.getMinU();
	        double d1 = (double)iicon.getMinV();
	        double d2 = (double)iicon.getMaxU();
	        double d3 = (double)iicon.getMaxV();
	        double d4 = 0.0D;
	        double d5 = 0.05000000074505806D;
	        double offs=0.5-d5/2;
	        double dt=0.2D;
	        l= world.getBlockMetadata(x, y, z);
	        if (l == 5)
	        {
	            tessellator.addVertexWithUV((double)x + offs + d5, (double)(y + 1) + d4, (double)(z + 1) + d4, d0, d1);
	            tessellator.addVertexWithUV((double)x + offs+ d5, (double)(y + 0) - d4, (double)(z + 1) + d4, d0, d3);
	            tessellator.addVertexWithUV((double)x + offs + d5, (double)(y + 0) - d4, (double)(z + 0) - d4, d2, d3);
	            tessellator.addVertexWithUV((double)x + offs + d5, (double)(y + 1) + d4, (double)(z + 0) - d4, d2, d1);
                            ...
                         }
                         ....
}

 

what i need add in my code?

 

read tutorial from  this

  • Author

i rendering my block

but can't to find how add 3d icon second item/block on the side my block

found this:

 

I want so: (only need to show one item/block)

 

 

cDtOW9W.png[/img]

 

 

 

EntityItem entItem = new EntityItem(entity.getWorldObj(), 0D, 0D, 0D, yourStack);

//then translate, rotate

RenderManager.instance.renderEntityWithPosYaw(entItem, 0, 0, 0, 0, 0);

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.