Integrate Wild Update quests and Citizens contacts
This commit is contained in:
parent
018d776874
commit
f46b26d956
1 changed files with 919 additions and 81 deletions
|
|
@ -0,0 +1,9 @@
|
|||
package com.dunerealms.gui;
|
||||
|
||||
/** Turns an offset into words a player can follow. North is -Z, east is +X. */
|
||||
final class Bearing {
|
||||
private static final String[] POINTS={"north","north-east","east","south-east","south","south-west","west","north-west"};
|
||||
private Bearing(){}
|
||||
static String direction(double dx,double dz){double degrees=Math.toDegrees(Math.atan2(dx,-dz));if(degrees<0)degrees+=360;return POINTS[(int)Math.round(degrees/45.0)%8];}
|
||||
static String describe(double dx,double dz){int blocks=(int)Math.round(Math.hypot(dx,dz));return blocks<6?"right beside you":blocks+" blocks "+direction(dx,dz);}
|
||||
}
|
||||
Loading…
Reference in a new issue

Staff