Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Gets the xOrigin for this screen, based on the screen type
- * @return
- * xOrigin (-1 if error)
- */
- public double getXOrigin(){
- switch(this.type){
- case XY:
- return this.loc1.getX();
- case ZY:
- return this.loc1.getZ();
- case XZ:
- return this.loc1.getX();
- }
- return -1;
- }
- /**
- * Gets the yOrigin for this screen, based on the screen type
- * @return
- * yOrigin (-1 if error)
- */
- public double getYOrigin(){
- switch(this.type){
- case XY:
- return this.loc1.getY();
- case ZY:
- return this.loc1.getY();
- case XZ:
- return this.loc1.getZ();
- }
- return -1;
- }
- /**
- * Calculates and returns a Bukkit Location of the given screen coordinates,
- * keeping in mind the possible screen orientations
- * @param x
- * x-coordinate (of the screen)
- * @param y
- * y-coordinate (of the screen)
- * @return
- * Location for use in CraftApplet
- */
- public Location getScreenCoordinate(double x, double y){
- switch(type){
- case XY:
- return new Location(world, xOrigin+x, yOrigin+y, constantCoor);
- case ZY:
- return new Location(world, constantCoor, yOrigin+y, xOrigin+x);
- case XZ:
- return new Location(world, xOrigin+x, constantCoor, yOrigin+y);
- }
- return null;
- }
Add Comment
Please, Sign In to add comment