diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodePlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodePlugin.java index a739a2ceac..b88cb8944f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodePlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodePlugin.java @@ -53,8 +53,10 @@ import static net.runelite.api.ObjectID.ORE_VEIN_26663; import static net.runelite.api.ObjectID.ORE_VEIN_26664; import static net.runelite.api.ObjectID.ROCKFALL; import static net.runelite.api.ObjectID.ROCKFALL_26680; +import net.runelite.api.Perspective; import net.runelite.api.Varbits; import net.runelite.api.WallObject; +import net.runelite.api.coords.LocalPoint; import net.runelite.api.events.ChatMessage; import net.runelite.api.events.GameObjectChanged; import net.runelite.api.events.GameObjectDespawned; @@ -86,6 +88,8 @@ public class MotherlodePlugin extends Plugin private static final int SACK_LARGE_SIZE = 162; private static final int SACK_SIZE = 81; + private static final int UPPER_FLOOR_HEIGHT = -500; + @Inject private MotherlodeOverlay overlay; @@ -399,4 +403,15 @@ public class MotherlodePlugin extends Plugin return true; } + + /** + * Checks if the given point is "upstairs" in the mlm. + * The upper floor is actually on z=0. + * @param localPoint + * @return + */ + boolean isUpstairs(LocalPoint localPoint) + { + return Perspective.getTileHeight(client, localPoint.getX(), localPoint.getY(), 0) < UPPER_FLOOR_HEIGHT; + } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodeRocksOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodeRocksOverlay.java index 44a9c43397..b6b7c89674 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodeRocksOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodeRocksOverlay.java @@ -91,7 +91,11 @@ class MotherlodeRocksOverlay extends Overlay LocalPoint location = vein.getLocalLocation(); if (localLocation.distanceTo(location) <= MAX_DISTANCE) { - renderVein(graphics, vein); + // Only draw veins on the same level + if (plugin.isUpstairs(localLocation) == plugin.isUpstairs(vein.getLocalLocation())) + { + renderVein(graphics, vein); + } } }