Posted July 17, 201312 yr I am trying to make my ship move in all directions Which i can do but it will go through blocks i am trying to add a if statement to check if a block is in that location and then if it is it will skip all the movement code. i got this so far but it doenst work public boolean isSolid(Block block) { if (block != Block.blockID) { return false; }else{ return true; } } The other thing is there a method (where is it located, i will find the method just tell me where it is) where i can change which key is use to exit the ship and LShift is default Thanks
July 17, 201312 yr You need a World object as well as the coordinates: if(!world.getBlockMaterial(i, j, k).isSolid()) { //movement code here }
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.