Posted November 30, 201410 yr Hello, I was wondering how do I get the front texture of a multi-textured block to face the player when the block is placed, similar to when a furnace is placed. Any help would be awesome.
November 30, 201410 yr The chest uses ForgeDirection some how, but I have no idea how (I've never done anything like this). Try to look at the vanilla code.
November 30, 201410 yr Author @RYxINATORx314 I'll try that, but where do I find the furnace or oak tree classes? Sorry for asking, I haven't made a mod since 1.4.6 or 1.4.7.. Nvm, I got it.. @Awesome_Spider Thanks, I'll play around with ForgeDirection and see if I can get something working(or broken)
November 30, 201410 yr Hi For clues look at BlockFurnace.onBlockPlacedBy. It uses metadata to specify the four directions the furnace can face. For more background information, see the Block topics on this link: http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html public void onBlockPlacedBy(World world, int wx, int wy, int wz, EntityLivingBase entityLivingBase, ItemStack itemStack) { int l = MathHelper.floor_double((double) (entityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; // which compass point is the player facing? if (l == 0) { world.setBlockMetadataWithNotify(wx, wy, wz, 2, 2); } if (l == 1) { world.setBlockMetadataWithNotify(wx, wy, wz, 5, 2); } if (l == 2) { world.setBlockMetadataWithNotify(wx, wy, wz, 3, 2); } if (l == 3) { world.setBlockMetadataWithNotify(wx, wy, wz, 4, 2); } if (itemStack.hasDisplayName()) { ((TileEntityFurnace)world.getTileEntity(wx, wy, wz)).func_145951_a(itemStack.getDisplayName()); } } -TGG
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.