Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public void clickedRight(EntityPlayer player, int face, float localVecX, float localVecY, float localVecZ) {
- if (worldObj.isRemote) return;
- //0 bottom, 1 top, 2 -z, 3 +z, 4 -x, 5 +x
- //x z -x -z
- //vec values range from 0-1 relative to the world coord alignment
- if (face == 0) {
- //no point
- } else if (face == 1) {
- Vec3 vec = Vec3.createVectorHelper(localVecX-0.5F, 0, localVecZ-0.5F);
- vec.rotateAroundY((float) Math.toRadians((((int)(player.rotationYaw/90)) * 90)-180)); //quantified to 90
- clickedFace(player, face, (float)vec.xCoord+0.5F, (float)vec.zCoord+0.5F);
- } else if (face == 2) { //needs invert
- clickedFace(player, face, 1F-localVecX, localVecY);
- } else if (face == 3) {
- clickedFace(player, face, localVecX, localVecY);
- } else if (face == 4) {
- clickedFace(player, face, localVecZ, localVecY);
- } else if (face == 5) { //needs invert
- clickedFace(player, face, 1F-localVecZ, localVecY);
- }
- }
- //expects absolute float values with no rotation adjustments required
- public void clickedFace(EntityPlayer player, int face, float localVecX, float localVecY) {
- /*System.out.println(face + " - " + localVecX + " - " + localVecY + " - " + localVecZ);
- if (localVecX < 0.5F) {
- System.out.println("left");
- } else {
- System.out.println("right");
- }*/
- if (face == 1) {
- setBuildModeChooseCoord(player);
- } else if (face == 2 || face == 3 || face == 4 || face == 5) {
- if (localVecX < 0.5F) {
- cycleLeft();
- } else {
- cycleRight();
- }
- sync();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement