Cannon
Cannon class for placing and managing Dwarf multicannon.
ClassRLPlugins API
public class CannonThese helpers wait. Call them only from VitaPlugin.loop(); on the game thread, for example in a @Subscribe method, they freeze the game.
Members
Static methods
- intballsLeft()
Get cannonballs left.
- booleancachedIsPlaced()
Cached is placed.
- booleanensure()
Ensure cannon is placed, or you have cannon in inventory as well as cannonballs.
- booleanensureBalls()
Ensure cannonballs are in inventory.
- booleanensureCannon()
Ensure cannon is placed or in inventory.
- WorldPointgetLocation()
Get cannon location.
- booleanisPlaced()
Check if cannon is placed.
- booleanpickup()
Pickup cannon.
- booleanplace()
Place cannon at current location.
- booleanplace(WorldPoint)
Place cannon at location.
- voidreclaimCannon()
Reclaim cannon.
- booleanreload()
Reload cannon.
- booleanrepair()
Repair.
- voidrun(Supplier<Boolean>)
Place and manage cannon.
- voidrun(WorldPoint, Supplier<Boolean>)
Place and manage cannon.
- voidsetPlaced(boolean)
Sets the placed.
- booleanspotOpen(WorldPoint, int)
Spot open.
ballsLeft()static
public static int ballsLeft()Get cannonballs left.
Returns
Int.
cachedIsPlaced()static
public static boolean cachedIsPlaced()Cached is placed.
ensure()static
public static boolean ensure()Ensure cannon is placed, or you have cannon in inventory as well as cannonballs.
Returns
Boolean.
ensureBalls()static
public static boolean ensureBalls()Ensure cannonballs are in inventory.
Returns
Boolean.
ensureCannon()static
public static boolean ensureCannon()Ensure cannon is placed or in inventory.
Returns
Boolean.
getLocation()static
public static WorldPoint getLocation()Get cannon location.
Returns
WorldPoint.
isPlaced()static
public static boolean isPlaced()Check if cannon is placed.
Returns
Boolean.
pickup()static
public static boolean pickup()Pickup cannon.
place()static
public static boolean place()Place cannon at current location.
Returns
Return true if cannon is placed.
place(WorldPoint)static
public static boolean place(WorldPoint location)Place cannon at location.
Parameters
location- WorldPoint.
Returns
Return true if cannon is placed.
reclaimCannon()static
public static void reclaimCannon()Reclaim cannon.
reload()static
public static boolean reload()Reload cannon.
Returns
Boolean.
repair()static
public static boolean repair()Repair.
run(Supplier<Boolean>)static
public static void run(Supplier<Boolean> opperation)Place and manage cannon.
Cannon will be placed at the players current location, and opperation will be run until cannon is out of cannonballs or opperation returns true. NOTE: This method is blocking and needs to be run on its own thread.
Parameters
opperation- Supplier.
run(WorldPoint, Supplier<Boolean>)static
public static void run(WorldPoint location, Supplier<Boolean> opperation)Place and manage cannon.
Cannon will be placed at location, and opperation will be run until cannon is out of cannonballs or opperation returns true. NOTE: This method is blocking and needs to be run on its own thread.
Parameters
location- WorldPoint.
opperation- Supplier.
setPlaced(boolean)static
public static void setPlaced(boolean arg0)Sets the placed.
Parameters
arg0- Argument 0.
spotOpen(WorldPoint, int)static
public static boolean spotOpen(WorldPoint spot, int radius)Spot open.
Parameters
spot- Spot.
radius- Radius.
Also allowed
Every class has these, as in plain Java.
equals, toString