Posted September 29, 201411 yr 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
September 29, 201411 yr Hi You might find some of the topics in this link useful http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html Look at the Block Rendering sections. There are also quite a few tutorials around on ISimpleBlockRenderingHandlers that are better than the one you linked. -TGG
October 1, 201411 yr 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) [/img]
October 1, 201411 yr 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.