Guest User

ModCompass implements IItemPropertyGetter

a guest
Aug 15th, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.69 KB | None | 0 0
  1. private double getSpawnToAngle(World worldIn, Entity ent)
  2.     {
  3.         //can I use this to look for nearby Coils?
  4.         //idea is find neraby coil, get it's object and use it's messUpCompass value in the if below
  5.         //worldIn.getEntitiesWithinAABB(EntityPlayer.class, <AABB>)
  6.        
  7.         //first sets blockpos to world spawnpoint
  8.         BlockPos blockpos = worldIn.getSpawnPoint();;
  9.        
  10.         //if true changes the blockpos var used to calculate compass angle to the blockpos of the BlockCoil
  11.         if(nearby_coil_object.messUpCompass){
  12.             blockpos = coil_object.getCoilPosition();
  13.         }
  14.         return Math.atan2((double)blockpos.getZ() - ent.posZ, (double)blockpos.getX() - ent.posX);
  15.     }
Add Comment
Please, Sign In to add comment