Flenix Posted July 25, 2013 Share Posted July 25, 2013 Hey guys, I have a metadata-based block, whcih has 4 blocks with 4 different rotations. So, meta 0-3 is block 1 rotation 1-4, meta 4-7 is block 2 rotation 1-4 etc. Now, I want to set it up so I can use the pick block key (middle click) and get block 1 rotation 1 for meta 0-3, block 2 rotation 1 for 4-7 and so on - I don't want to get the extra rotated blocks. Can anyone guide me on how I'd go about doing this? It's one of the last things until I can release the beta of my mod so really want to get it sorted! Quote http://s13.postimg.org/z9mlly2av/siglogo.png[/img] My mods (Links coming soon) Cities | Roads | Remula | SilvaniaMod | MoreStats Link to comment Share on other sites More sharing options...
adamAndMath Posted July 25, 2013 Share Posted July 25, 2013 Put this into your block: @Override public int damageDropped(int meta) { return meta / 4; } Quote Link to comment Share on other sites More sharing options...
Flenix Posted July 26, 2013 Author Share Posted July 26, 2013 That didn't work, but pointed me in the right direction. Because my base metas are 0, 4, 8 and 12 your thing didn't work - it was giving me 0-3. Using this worked (for anyone interested) public int damageDropped(int meta) { if (meta == 0 || meta == 1 || meta == 2 || meta == 3) { return 0; } if (meta == 4 || meta == 5 || meta == 6 || meta == 7) { return 4; } if (meta == 8 || meta == 9 || meta == 10 || meta == 11) { return 8; } else return 12; } Quote http://s13.postimg.org/z9mlly2av/siglogo.png[/img] My mods (Links coming soon) Cities | Roads | Remula | SilvaniaMod | MoreStats Link to comment Share on other sites More sharing options...
adamAndMath Posted July 26, 2013 Share Posted July 26, 2013 Then use this: @Override public int damageDropped(int meta) { return meta % 4; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.