rl-api, groundmarkers: handle instance plane conversion correctly
This commit is contained in:
@@ -237,7 +237,7 @@ public class GroundMarkerPlugin extends Plugin
|
||||
|
||||
final WorldPoint worldPoint = WorldPoint.fromLocalInstance(client, selectedSceneTile.getLocalLocation());
|
||||
final int regionId = worldPoint.getRegionID();
|
||||
final GroundMarkerPoint point = new GroundMarkerPoint(regionId, worldPoint.getRegionX(), worldPoint.getRegionY(), client.getPlane(), null, null);
|
||||
final GroundMarkerPoint point = new GroundMarkerPoint(regionId, worldPoint.getRegionX(), worldPoint.getRegionY(), worldPoint.getPlane(), null, null);
|
||||
final boolean exists = getPoints(regionId).contains(point);
|
||||
|
||||
client.createMenuEntry(-1)
|
||||
@@ -302,7 +302,7 @@ public class GroundMarkerPlugin extends Plugin
|
||||
WorldPoint worldPoint = WorldPoint.fromLocalInstance(client, localPoint);
|
||||
|
||||
int regionId = worldPoint.getRegionID();
|
||||
GroundMarkerPoint point = new GroundMarkerPoint(regionId, worldPoint.getRegionX(), worldPoint.getRegionY(), client.getPlane(), config.markerColor(), null);
|
||||
GroundMarkerPoint point = new GroundMarkerPoint(regionId, worldPoint.getRegionX(), worldPoint.getRegionY(), worldPoint.getPlane(), config.markerColor(), null);
|
||||
log.debug("Updating point: {} - {}", point, worldPoint);
|
||||
|
||||
List<GroundMarkerPoint> groundMarkerPoints = new ArrayList<>(getPoints(regionId));
|
||||
@@ -326,7 +326,7 @@ public class GroundMarkerPlugin extends Plugin
|
||||
WorldPoint worldPoint = WorldPoint.fromLocalInstance(client, localPoint);
|
||||
final int regionId = worldPoint.getRegionID();
|
||||
|
||||
GroundMarkerPoint searchPoint = new GroundMarkerPoint(regionId, worldPoint.getRegionX(), worldPoint.getRegionY(), client.getPlane(), null, null);
|
||||
GroundMarkerPoint searchPoint = new GroundMarkerPoint(regionId, worldPoint.getRegionX(), worldPoint.getRegionY(), worldPoint.getPlane(), null, null);
|
||||
Collection<GroundMarkerPoint> points = getPoints(regionId);
|
||||
GroundMarkerPoint existing = points.stream()
|
||||
.filter(p -> p.equals(searchPoint))
|
||||
@@ -342,7 +342,7 @@ public class GroundMarkerPlugin extends Plugin
|
||||
{
|
||||
input = Strings.emptyToNull(input);
|
||||
|
||||
GroundMarkerPoint newPoint = new GroundMarkerPoint(regionId, worldPoint.getRegionX(), worldPoint.getRegionY(), client.getPlane(), existing.getColor(), input);
|
||||
GroundMarkerPoint newPoint = new GroundMarkerPoint(regionId, worldPoint.getRegionX(), worldPoint.getRegionY(), worldPoint.getPlane(), existing.getColor(), input);
|
||||
points.remove(searchPoint);
|
||||
points.add(newPoint);
|
||||
savePoints(regionId, points);
|
||||
|
||||
Reference in New Issue
Block a user