A quick question: how does one use the setLocation(float x, float y) method in CampaingFleetAPI?
I'm trying to use it like this:
playerfleet.setLocation(-11500, 11500);
But I've got a feeling that's completely wrong because I get this error:
A method named "setLocation" is not declared in any enclosing class nor any supertype, nor through a static import
...and I have no idea what that means. I have CampaignFleetAPI imported at the top of the file, so that's not an issue. Here's the relevant code:
StarSystemAPI system = getSector().getStarSystem("God");
FactionAPI csix = getSector().getFaction("csix");
FactionAPI player = getSector().getFaction("player");
SectorEntityToken dockyard = system.getEntityByName("Dockyard");
SectorEntityToken wn = system.getEntityByName("Warp Node");
SectorEntityToken playerf = system.getEntityByName("Fleet");
CargoAPI cargoh = wn.getCargo();
CargoAPI cargoplayer = playerf.getCargo();
boolean jumptl = cargoplayer.removeItems(CargoAPI.CargoItemType.RESOURCES, "jumptl", 1);
boolean jumptr = cargoplayer.removeItems(CargoAPI.CargoItemType.RESOURCES, "jumptr", 1);
boolean jumpbr = cargoplayer.removeItems(CargoAPI.CargoItemType.RESOURCES, "jumpbr", 1);
boolean jumpbl = cargoplayer.removeItems(CargoAPI.CargoItemType.RESOURCES, "jumpbl", 1);
if (jumptl) {
playerf.setLocation(-11500, 11500); //line that the error report gives as problematic.
Global.getSectorAPI().addMessage("Mass hyperstream jump successful.", Color.green);
cargoh.addItems(CargoAPI.CargoItemType.RESOURCES, "jumptl", 1);
}
Any help would be greatly appreciated.