mirror of
https://github.com/2006-Scape/Parabot-317-API-Minified.git
synced 2026-07-05 16:49:42 +00:00
Changed package
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
package org.rev317.min.api.wrappers;
|
||||
|
||||
import org.rev317.min.api.interfaces.Locatable;
|
||||
import org.rev317.min.api.methods.Calculations;
|
||||
import org.rev317.min.api.methods.Game;
|
||||
import org.rev317.min.api.methods.Menu;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Everel
|
||||
*
|
||||
*/
|
||||
public class GroundItem implements Locatable {
|
||||
private org.rev317.min.accessors.Item accessor;
|
||||
private int x;
|
||||
private int y;
|
||||
|
||||
public GroundItem(org.rev317.min.accessors.Item accessor, int x, int y) {
|
||||
this.accessor = accessor;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets location of this ground item
|
||||
* @return location
|
||||
*/
|
||||
public Tile getLocation() {
|
||||
return new Tile(Game.getBaseX() + x, Game.getBaseY() + y);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets region X
|
||||
* @return x
|
||||
*/
|
||||
public int getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets region Y
|
||||
* @return y
|
||||
*/
|
||||
public int getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
/**
|
||||
* Interacts with this ground item
|
||||
* @param actionIndex
|
||||
*/
|
||||
public void interact(int actionIndex) {
|
||||
Menu.interact(this, actionIndex);
|
||||
}
|
||||
|
||||
/**
|
||||
* Takes this item from the ground
|
||||
*/
|
||||
public void take() {
|
||||
Menu.take(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets distance between you and this ground item
|
||||
* @return distance
|
||||
*/
|
||||
public int distanceTo() {
|
||||
return (int) Calculations.distanceTo(getLocation());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get's ID of this item
|
||||
* @return ID
|
||||
*/
|
||||
public int getId() {
|
||||
return accessor.getId();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user