From 52c2061ccd2e58af3d4c06419c5cb5052d5d7617 Mon Sep 17 00:00:00 2001 From: Max Weber Date: Mon, 7 Mar 2022 12:35:18 -0700 Subject: [PATCH 01/11] rl-api: use TileObjects' z for hulls/clickboxes/outlines --- .../java/net/runelite/api/GraphicsObject.java | 6 +-- .../java/net/runelite/api/Perspective.java | 11 +++-- .../java/net/runelite/api/TileObject.java | 5 +++ .../overlay/outline/ModelOutlineRenderer.java | 40 ++++++------------- 4 files changed, 24 insertions(+), 38 deletions(-) diff --git a/runelite-api/src/main/java/net/runelite/api/GraphicsObject.java b/runelite-api/src/main/java/net/runelite/api/GraphicsObject.java index 73ee342777..0c17af8a1d 100644 --- a/runelite-api/src/main/java/net/runelite/api/GraphicsObject.java +++ b/runelite-api/src/main/java/net/runelite/api/GraphicsObject.java @@ -60,11 +60,9 @@ public interface GraphicsObject extends Renderable int getLevel(); /** - * Gets the height of the graphic. - * - * @return the height + * Gets the z coordinate */ - int getHeight(); + int getZ(); /** * Checks if this spotanim is done animating diff --git a/runelite-api/src/main/java/net/runelite/api/Perspective.java b/runelite-api/src/main/java/net/runelite/api/Perspective.java index e5f2262965..256355d5fc 100644 --- a/runelite-api/src/main/java/net/runelite/api/Perspective.java +++ b/runelite-api/src/main/java/net/runelite/api/Perspective.java @@ -42,6 +42,7 @@ import net.runelite.api.geometry.SimplePolygon; import net.runelite.api.model.Jarvis; import net.runelite.api.widgets.Widget; import net.runelite.api.widgets.WidgetInfo; +import org.jetbrains.annotations.ApiStatus; /** * A utility class containing methods to help with conversion between @@ -677,21 +678,19 @@ public class Perspective * @param client the game client * @param model the model to calculate a clickbox for * @param orientation the orientation of the model (0-2048, where 0 is north) - * @param point the coordinate of the tile + * @param x x coord in local space + * @param z y coord in local space * @return the clickable area of the model */ @Nullable - public static Shape getClickbox(@Nonnull Client client, Model model, int orientation, LocalPoint point) + @ApiStatus.Internal + public static Shape getClickbox(@Nonnull Client client, Model model, int orientation, int x, int y, int z) { if (model == null) { return null; } - int x = point.getX(); - int y = point.getY(); - int z = getTileHeight(client, point, client.getPlane()); - SimplePolygon bounds = calculateAABB(client, model, orientation, x, y, z); if (bounds == null) diff --git a/runelite-api/src/main/java/net/runelite/api/TileObject.java b/runelite-api/src/main/java/net/runelite/api/TileObject.java index 0153d01be9..b9d83901a4 100644 --- a/runelite-api/src/main/java/net/runelite/api/TileObject.java +++ b/runelite-api/src/main/java/net/runelite/api/TileObject.java @@ -53,6 +53,11 @@ public interface TileObject */ int getY(); + /** + * Gets the vertical coordinate of this object + */ + int getZ(); + /** * Gets the plane of the tile that the object is on. */ diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/outline/ModelOutlineRenderer.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/outline/ModelOutlineRenderer.java index 6f56546547..c6c174edab 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/outline/ModelOutlineRenderer.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/outline/ModelOutlineRenderer.java @@ -1016,15 +1016,13 @@ public class ModelOutlineRenderer private void drawOutline(GameObject gameObject, int outlineWidth, Color color, int feather) { - LocalPoint lp = gameObject.getLocalLocation(); Renderable renderable = gameObject.getRenderable(); if (renderable != null) { Model model = renderable instanceof Model ? (Model) renderable : renderable.getModel(); if (model != null) { - drawModelOutline(model, lp.getX(), lp.getY(), - Perspective.getTileHeight(client, lp, gameObject.getPlane()), + drawModelOutline(model, gameObject.getX(), gameObject.getY(), gameObject.getZ(), gameObject.getModelOrientation(), outlineWidth, color, feather); } } @@ -1032,15 +1030,13 @@ public class ModelOutlineRenderer private void drawOutline(GroundObject groundObject, int outlineWidth, Color color, int feather) { - LocalPoint lp = groundObject.getLocalLocation(); Renderable renderable = groundObject.getRenderable(); if (renderable != null) { Model model = renderable instanceof Model ? (Model) renderable : renderable.getModel(); if (model != null) { - drawModelOutline(model, lp.getX(), lp.getY(), - Perspective.getTileHeight(client, lp, client.getPlane()), + drawModelOutline(model, groundObject.getX(), groundObject.getY(), groundObject.getZ(), 0, outlineWidth, color, feather); } } @@ -1048,16 +1044,13 @@ public class ModelOutlineRenderer private void drawOutline(ItemLayer itemLayer, int outlineWidth, Color color, int feather) { - LocalPoint lp = itemLayer.getLocalLocation(); - Renderable bottomRenderable = itemLayer.getBottom(); if (bottomRenderable != null) { Model model = bottomRenderable instanceof Model ? (Model) bottomRenderable : bottomRenderable.getModel(); if (model != null) { - drawModelOutline(model, lp.getX(), lp.getY(), - Perspective.getTileHeight(client, lp, itemLayer.getPlane()) - itemLayer.getHeight(), + drawModelOutline(model, itemLayer.getX(), itemLayer.getY(), itemLayer.getZ() - itemLayer.getHeight(), 0, outlineWidth, color, feather); } } @@ -1068,8 +1061,7 @@ public class ModelOutlineRenderer Model model = middleRenderable instanceof Model ? (Model) middleRenderable : middleRenderable.getModel(); if (model != null) { - drawModelOutline(model, lp.getX(), lp.getY(), - Perspective.getTileHeight(client, lp, itemLayer.getPlane()) - itemLayer.getHeight(), + drawModelOutline(model, itemLayer.getX(), itemLayer.getY(), itemLayer.getZ() - itemLayer.getHeight(), 0, outlineWidth, color, feather); } } @@ -1080,8 +1072,7 @@ public class ModelOutlineRenderer Model model = topRenderable instanceof Model ? (Model) topRenderable : topRenderable.getModel(); if (model != null) { - drawModelOutline(model, lp.getX(), lp.getY(), - Perspective.getTileHeight(client, lp, itemLayer.getPlane()) - itemLayer.getHeight(), + drawModelOutline(model, itemLayer.getX(), itemLayer.getY(), itemLayer.getZ() - itemLayer.getHeight(), 0, outlineWidth, color, feather); } } @@ -1089,8 +1080,6 @@ public class ModelOutlineRenderer private void drawOutline(DecorativeObject decorativeObject, int outlineWidth, Color color, int feather) { - LocalPoint lp = decorativeObject.getLocalLocation(); - Renderable renderable1 = decorativeObject.getRenderable(); if (renderable1 != null) { @@ -1098,9 +1087,9 @@ public class ModelOutlineRenderer if (model != null) { drawModelOutline(model, - lp.getX() + decorativeObject.getXOffset(), - lp.getY() + decorativeObject.getYOffset(), - Perspective.getTileHeight(client, lp, decorativeObject.getPlane()), + decorativeObject.getX() + decorativeObject.getXOffset(), + decorativeObject.getY() + decorativeObject.getYOffset(), + decorativeObject.getZ(), 0, outlineWidth, color, feather); } } @@ -1112,8 +1101,7 @@ public class ModelOutlineRenderer if (model != null) { // Offset is not used for the second model - drawModelOutline(model, lp.getX(), lp.getY(), - Perspective.getTileHeight(client, lp, decorativeObject.getPlane()), + drawModelOutline(model, decorativeObject.getX(), decorativeObject.getY(), decorativeObject.getZ(), 0, outlineWidth, color, feather); } } @@ -1121,16 +1109,13 @@ public class ModelOutlineRenderer private void drawOutline(WallObject wallObject, int outlineWidth, Color color, int feather) { - LocalPoint lp = wallObject.getLocalLocation(); - Renderable renderable1 = wallObject.getRenderable1(); if (renderable1 != null) { Model model = renderable1 instanceof Model ? (Model) renderable1 : renderable1.getModel(); if (model != null) { - drawModelOutline(model, lp.getX(), lp.getY(), - Perspective.getTileHeight(client, lp, wallObject.getPlane()), + drawModelOutline(model, wallObject.getX(), wallObject.getY(), wallObject.getZ(), 0, outlineWidth, color, feather); } } @@ -1141,8 +1126,7 @@ public class ModelOutlineRenderer Model model = renderable2 instanceof Model ? (Model) renderable2 : renderable2.getModel(); if (model != null) { - drawModelOutline(model, lp.getX(), lp.getY(), - Perspective.getTileHeight(client, lp, wallObject.getPlane()), + drawModelOutline(model, wallObject.getX(), wallObject.getY(), wallObject.getZ(), 0, outlineWidth, color, feather); } } @@ -1180,7 +1164,7 @@ public class ModelOutlineRenderer Model model = graphicsObject.getModel(); if (model != null) { - drawModelOutline(model, lp.getX(), lp.getY(), graphicsObject.getHeight(), + drawModelOutline(model, lp.getX(), lp.getY(), graphicsObject.getZ(), 0, outlineWidth, color, feather); } } From 53ee3eb74759e21ddea91fae1cf9a363e42337b2 Mon Sep 17 00:00:00 2001 From: Jordan Atwood Date: Thu, 17 Mar 2022 11:05:19 -0700 Subject: [PATCH 02/11] roof removal: Add Grim Tales tower override --- .../client/plugins/roofremoval/overrides.jsonc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/roofremoval/overrides.jsonc b/runelite-client/src/main/resources/net/runelite/client/plugins/roofremoval/overrides.jsonc index 777e425099..b3fd2f2ae3 100644 --- a/runelite-client/src/main/resources/net/runelite/client/plugins/roofremoval/overrides.jsonc +++ b/runelite-client/src/main/resources/net/runelite/client/plugins/roofremoval/overrides.jsonc @@ -3410,5 +3410,15 @@ "z1": 1, "z2": 1 } + ], + "11830": [ // Goblin Village & mind altar + { // Grim Tales tower + "rx1": 21, + "ry1": 10, + "rx2": 27, + "ry2": 15, + "z1": 2, + "z2": 2 + } ] } From b9d905621d71e36ec8f85f924f1973b9a1c8049e Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 18 Mar 2022 15:59:04 -0400 Subject: [PATCH 03/11] gpu: remove newt dependency --- .../java/net/runelite/client/plugins/gpu/GpuPlugin.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java index 77efae681b..12034c7875 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java @@ -26,6 +26,8 @@ package net.runelite.client.plugins.gpu; import com.google.common.primitives.Ints; import com.google.inject.Provides; +import com.jogamp.nativewindow.AbstractGraphicsConfiguration; +import com.jogamp.nativewindow.NativeWindowFactory; import com.jogamp.nativewindow.awt.AWTGraphicsConfiguration; import com.jogamp.nativewindow.awt.JAWTWindow; import com.jogamp.opengl.GL; @@ -64,7 +66,6 @@ import javax.swing.SwingUtilities; import jogamp.nativewindow.SurfaceScaleUtils; import jogamp.nativewindow.jawt.x11.X11JAWTWindow; import jogamp.nativewindow.macosx.OSXUtil; -import jogamp.newt.awt.NewtFactoryAWT; import lombok.extern.slf4j.Slf4j; import net.runelite.api.BufferProvider; import net.runelite.api.Client; @@ -380,7 +381,7 @@ public class GpuPlugin extends Plugin implements DrawCallbacks GLCapabilities glCaps = new GLCapabilities(glProfile); AWTGraphicsConfiguration config = AWTGraphicsConfiguration.create(canvas.getGraphicsConfiguration(), glCaps, glCaps); - jawtWindow = NewtFactoryAWT.getNativeWindow(canvas, config); + jawtWindow = (JAWTWindow) NativeWindowFactory.getNativeWindow(canvas, config); canvas.setFocusable(true); GLDrawableFactory glDrawableFactory = GLDrawableFactory.getFactory(glProfile); @@ -547,7 +548,9 @@ public class GpuPlugin extends Plugin implements DrawCallbacks // we'll just leak the window... if (OSType.getOSType() != OSType.MacOS) { - NewtFactoryAWT.destroyNativeWindow(jawtWindow); + final AbstractGraphicsConfiguration config = jawtWindow.getGraphicsConfiguration(); + jawtWindow.destroy(); + config.getScreen().getDevice().close(); } } }); From 3464551d83c4b3f197281a780fa10af1c19edcfd Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 18 Mar 2022 15:59:12 -0400 Subject: [PATCH 04/11] gpu: remove egl dependency --- .../net/runelite/client/plugins/gpu/OpenCLManager.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/gpu/OpenCLManager.java b/runelite-client/src/main/java/net/runelite/client/plugins/gpu/OpenCLManager.java index 21e9224fe5..634b4cb473 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/gpu/OpenCLManager.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/gpu/OpenCLManager.java @@ -35,7 +35,6 @@ import java.util.Objects; import javax.inject.Singleton; import jogamp.opengl.GLContextImpl; import jogamp.opengl.GLDrawableImpl; -import jogamp.opengl.egl.EGLContext; import jogamp.opengl.macosx.cgl.CGL; import jogamp.opengl.windows.wgl.WindowsWGLContext; import jogamp.opengl.x11.glx.X11GLXContext; @@ -306,12 +305,6 @@ class OpenCLManager contextProps.addProperty(CL_GL_CONTEXT_KHR, glContextHandle); contextProps.addProperty(CL_WGL_HDC_KHR, surfaceHandle); } - else if (glContext instanceof EGLContext) - { - long displayHandle = nativeSurface.getDisplayHandle(); - contextProps.addProperty(CL_GL_CONTEXT_KHR, glContextHandle); - contextProps.addProperty(CL_EGL_DISPLAY_KHR, displayHandle); - } log.debug("Creating context with props: {}", contextProps); context = clCreateContext(contextProps, 1, new cl_device_id[]{device}, null, null, null); From dbfcc456f97cb89eaa6068d371e8f9793db4e6ee Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 18 Mar 2022 15:59:25 -0400 Subject: [PATCH 05/11] gpu: update to jogl 2.4.0-rc-20220318 --- runelite-client/pom.xml | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/runelite-client/pom.xml b/runelite-client/pom.xml index 3467eb7ac8..4383ed6b26 100644 --- a/runelite-client/pom.xml +++ b/runelite-client/pom.xml @@ -140,66 +140,70 @@ net.runelite.jogl - jogl-all - 2.4.0-rc-20200429 + jogl-rl + 2.4.0-rc-20220318 net.runelite.jogl - jogl-all - 2.4.0-rc-20200429 + jogl-rl + 2.4.0-rc-20220318 natives-windows-amd64 runtime net.runelite.jogl - jogl-all - 2.4.0-rc-20200429 + jogl-rl + 2.4.0-rc-20220318 natives-windows-i586 runtime net.runelite.jogl - jogl-all - 2.4.0-rc-20200429 + jogl-rl + 2.4.0-rc-20220318 natives-linux-amd64 runtime net.runelite.jogl - jogl-all-natives-macosx - 2.4.0-rc-20210117 + jogl-rl + 2.4.0-rc-20220318 + natives-macosx-universal runtime + + net.runelite.gluegen gluegen-rt - 2.4.0-rc-20200429 + 2.4.0-rc-20220318 net.runelite.gluegen gluegen-rt - 2.4.0-rc-20200429 + 2.4.0-rc-20220318 natives-windows-amd64 runtime net.runelite.gluegen gluegen-rt - 2.4.0-rc-20200429 + 2.4.0-rc-20220318 natives-windows-i586 runtime net.runelite.gluegen gluegen-rt - 2.4.0-rc-20200429 + 2.4.0-rc-20220318 natives-linux-amd64 runtime net.runelite.gluegen - gluegen-rt-natives-macosx - 2.4.0-rc-20210117 + gluegen-rt + 2.4.0-rc-20220318 + natives-macosx-universal runtime From 2192ac7d458a64b9e82c588630dbb8d94027d6b1 Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 15 Mar 2022 17:03:14 -0400 Subject: [PATCH 06/11] client: allow setting system properties via runtime config --- .../java/net/runelite/client/RuneLite.java | 22 +++++++++++++++++++ .../net/runelite/client/RuntimeConfig.java | 1 + 2 files changed, 23 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/RuneLite.java b/runelite-client/src/main/java/net/runelite/client/RuneLite.java index 5c3cd50611..5c4497385f 100644 --- a/runelite-client/src/main/java/net/runelite/client/RuneLite.java +++ b/runelite-client/src/main/java/net/runelite/client/RuneLite.java @@ -44,6 +44,7 @@ import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; import java.security.cert.X509Certificate; import java.util.Locale; +import java.util.Map; import java.util.concurrent.TimeUnit; import java.util.stream.Stream; import javax.annotation.Nullable; @@ -145,6 +146,10 @@ public class RuneLite @Nullable private Client client; + @Inject + @Nullable + private RuntimeConfig runtimeConfig; + public static void main(String[] args) throws Exception { Locale.setDefault(Locale.ENGLISH); @@ -287,6 +292,8 @@ public class RuneLite injector.injectMembers(client); } + setupSystemProps(); + // Start the applet if (applet != null) { @@ -514,4 +521,19 @@ public class RuneLite log.warn("unable to copy jagexcache", e); } } + + private void setupSystemProps() + { + if (runtimeConfig == null || runtimeConfig.getSysProps() == null) + { + return; + } + + for (Map.Entry entry : runtimeConfig.getSysProps().entrySet()) + { + String key = entry.getKey(), value = entry.getValue(); + log.debug("Setting property {}={}", key, value); + System.setProperty(key, value); + } + } } diff --git a/runelite-client/src/main/java/net/runelite/client/RuntimeConfig.java b/runelite-client/src/main/java/net/runelite/client/RuntimeConfig.java index 5d3fb80d94..0d41a3573c 100644 --- a/runelite-client/src/main/java/net/runelite/client/RuntimeConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/RuntimeConfig.java @@ -32,4 +32,5 @@ import lombok.Data; public class RuntimeConfig { private Map props = Collections.emptyMap(); + private Map sysProps = Collections.emptyMap(); } \ No newline at end of file From 51e2ff00c49b64921643b2c4811e36ce6c9c7474 Mon Sep 17 00:00:00 2001 From: Hydrox6 Date: Fri, 18 Mar 2022 00:52:01 +0000 Subject: [PATCH 07/11] ItemMapping: add shattered relics ornament kits --- .../net/runelite/client/game/ItemMapping.java | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/game/ItemMapping.java b/runelite-client/src/main/java/net/runelite/client/game/ItemMapping.java index af2423a862..63dd7ad33b 100644 --- a/runelite-client/src/main/java/net/runelite/client/game/ItemMapping.java +++ b/runelite-client/src/main/java/net/runelite/client/game/ItemMapping.java @@ -105,6 +105,7 @@ public enum ItemMapping ITEM_RUNE_SCIMITAR_ORNAMENT_KIT_ZAMORAK(RUNE_SCIMITAR_ORNAMENT_KIT_ZAMORAK, RUNE_SCIMITAR_23334), ITEM_RUNE_DEFENDER(RUNE_DEFENDER, RUNE_DEFENDER_T), ITEM_RUNE_DEFENDER_ORNAMENT_KIT(RUNE_DEFENDER_ORNAMENT_KIT, RUNE_DEFENDER_T), + ITEM_RUNE_CROSSBOW(RUNE_CROSSBOW, RUNE_CROSSBOW_OR), // Godsword ornament kits ITEM_ARMADYL_GODSWORD(ARMADYL_GODSWORD, ARMADYL_GODSWORD_OR), @@ -130,6 +131,21 @@ public enum ItemMapping ITEM_BERSERKER_NECKLACE(BERSERKER_NECKLACE, BERSERKER_NECKLACE_OR), ITEM_BERSERKER_NECKLACE_ORNAMENT_KIT(BERSERKER_NECKLACE_ORNAMENT_KIT, BERSERKER_NECKLACE_OR), + // Other ornament kits + ITEM_SHATTERED_RELICS_VARIETY_ORNAMENT_KIT(SHATTERED_RELICS_VARIETY_ORNAMENT_KIT, RUNE_CROSSBOW_OR, ABYSSAL_TENTACLE_OR, ABYSSAL_WHIP_OR, BOOK_OF_BALANCE_OR, BOOK_OF_DARKNESS_OR, BOOK_OF_LAW_OR, BOOK_OF_WAR_OR, HOLY_BOOK_OR, UNHOLY_BOOK_OR), + ITEM_SHATTERED_RELICS_VOID_ORNAMENT_KIT(SHATTERED_RELICS_VOID_ORNAMENT_KIT, ELITE_VOID_TOP_OR, ELITE_VOID_ROBE_OR, VOID_KNIGHT_TOP_OR, VOID_KNIGHT_ROBE_OR, VOID_KNIGHT_GLOVES_OR, VOID_MAGE_HELM_OR, VOID_MELEE_HELM_OR, VOID_RANGER_HELM_OR), + ITEM_MYSTIC_BOOTS(MYSTIC_BOOTS, MYSTIC_BOOTS_OR), + ITEM_MYSTIC_GLOVES(MYSTIC_GLOVES, MYSTIC_GLOVES_OR), + ITEM_MYSTIC_HAT(MYSTIC_HAT, MYSTIC_HAT_OR), + ITEM_MYSTIC_ROBE_BOTTOM(MYSTIC_ROBE_BOTTOM, MYSTIC_ROBE_BOTTOM_OR), + ITEM_MYSTIC_ROBE_TOP(MYSTIC_ROBE_TOP, MYSTIC_ROBE_TOP_OR), + ITEM_SHATTERED_RELICS_MYSTIC_ORNAMENT_KIT(SHATTERED_RELICS_MYSTIC_ORNAMENT_KIT, MYSTIC_BOOTS_OR, MYSTIC_GLOVES_OR, MYSTIC_HAT_OR, MYSTIC_ROBE_BOTTOM_OR, MYSTIC_ROBE_TOP_OR), + ITEM_CANNON_BARRELS(CANNON_BARRELS, CANNON_BARRELS_OR), + ITEM_CANNON_BASE(CANNON_BASE, CANNON_BASE_OR), + ITEM_CANNON_FURNACE(CANNON_FURNACE, CANNON_FURNACE_OR), + ITEM_CANNON_STAND(CANNON_STAND, CANNON_STAND_OR), + ITEM_SHATTERED_CANNON_ORNAMENT_KIT(SHATTERED_CANNON_ORNAMENT_KIT, CANNON_BARRELS_OR, CANNON_BASE_OR, CANNON_FURNACE_OR, CANNON_STAND_OR), + // Ensouled heads ITEM_ENSOULED_GOBLIN_HEAD(ENSOULED_GOBLIN_HEAD_13448, ENSOULED_GOBLIN_HEAD), ITEM_ENSOULED_MONKEY_HEAD(ENSOULED_MONKEY_HEAD_13451, ENSOULED_MONKEY_HEAD), @@ -181,8 +197,8 @@ public enum ItemMapping ITEM_GAMES_NECKLACE(GAMES_NECKLACE8, GAMES_NECKLACE1, GAMES_NECKLACE2, GAMES_NECKLACE3, GAMES_NECKLACE4, GAMES_NECKLACE5, GAMES_NECKLACE6, GAMES_NECKLACE7), // Degradable/charged weaponry/armour - ITEM_ABYSSAL_WHIP(ABYSSAL_WHIP, VOLCANIC_ABYSSAL_WHIP, FROZEN_ABYSSAL_WHIP), - ITEM_KRAKEN_TENTACLE(KRAKEN_TENTACLE, ABYSSAL_TENTACLE), + ITEM_ABYSSAL_WHIP(ABYSSAL_WHIP, VOLCANIC_ABYSSAL_WHIP, FROZEN_ABYSSAL_WHIP, ABYSSAL_WHIP_OR), + ITEM_KRAKEN_TENTACLE(KRAKEN_TENTACLE, ABYSSAL_TENTACLE, ABYSSAL_TENTACLE_OR), ITEM_TRIDENT_OF_THE_SEAS(UNCHARGED_TRIDENT, TRIDENT_OF_THE_SEAS), ITEM_TRIDENT_OF_THE_SEAS_E(UNCHARGED_TRIDENT_E, TRIDENT_OF_THE_SEAS_E), ITEM_TRIDENT_OF_THE_SWAMP(UNCHARGED_TOXIC_TRIDENT, TRIDENT_OF_THE_SWAMP), From 7051bedc61c1be0ac98cec8f6960e5e443b860a0 Mon Sep 17 00:00:00 2001 From: Hydrox6 Date: Fri, 18 Mar 2022 00:53:56 +0000 Subject: [PATCH 08/11] cannon: add support for shattered relics league ornamental cannon Annoyingly, the cannonball projectiles are not fired out of the centre of the cannon object like the original cannon does, so how the cannon's position is stored had to be changed to a WorldArea --- .../main/java/net/runelite/api/GraphicID.java | 2 ++ .../client/plugins/cannon/CannonOverlay.java | 5 ++- .../client/plugins/cannon/CannonPlugin.java | 35 +++++++++++++------ 3 files changed, 31 insertions(+), 11 deletions(-) diff --git a/runelite-api/src/main/java/net/runelite/api/GraphicID.java b/runelite-api/src/main/java/net/runelite/api/GraphicID.java index d172a7af77..5d12d655e6 100644 --- a/runelite-api/src/main/java/net/runelite/api/GraphicID.java +++ b/runelite-api/src/main/java/net/runelite/api/GraphicID.java @@ -53,4 +53,6 @@ public final class GraphicID public static final int GRANITE_CANNONBALL = 1443; public static final int GRAPHICS_OBJECT_ROCKFALL = 1727; public static final int ZALCANO_PROJECTILE_FIREBALL = 1728; + public static final int CANNONBALL_OR = 2018; + public static final int GRANITE_CANNONBALL_OR = 2019; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cannon/CannonOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/cannon/CannonOverlay.java index b2a4c7df36..51e3165dd9 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cannon/CannonOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cannon/CannonOverlay.java @@ -34,6 +34,7 @@ import net.runelite.api.Perspective; import static net.runelite.api.Perspective.LOCAL_TILE_SIZE; import net.runelite.api.Point; import net.runelite.api.coords.LocalPoint; +import net.runelite.api.coords.WorldPoint; import net.runelite.client.ui.overlay.Overlay; import net.runelite.client.ui.overlay.OverlayPosition; import net.runelite.client.ui.overlay.OverlayPriority; @@ -66,7 +67,9 @@ class CannonOverlay extends Overlay return null; } - LocalPoint cannonPoint = LocalPoint.fromWorld(client, plugin.getCannonPosition()); + // WorldAreas return the SW point, whereas we want the centre point + WorldPoint cannonLocation = plugin.getCannonPosition().toWorldPoint().dx(1).dy(1); + LocalPoint cannonPoint = LocalPoint.fromWorld(client, cannonLocation); if (cannonPoint == null) { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cannon/CannonPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/cannon/CannonPlugin.java index cc5d47324d..1e9282211e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cannon/CannonPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cannon/CannonPlugin.java @@ -24,10 +24,12 @@ */ package net.runelite.client.plugins.cannon; +import com.google.common.collect.ImmutableSet; import com.google.inject.Provides; import java.awt.Color; import java.util.ArrayList; import java.util.List; +import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; import javax.inject.Inject; @@ -37,18 +39,17 @@ import net.runelite.api.ChatMessageType; import net.runelite.api.Client; import net.runelite.api.GameObject; import net.runelite.api.GameState; -import static net.runelite.api.GraphicID.CANNONBALL; -import static net.runelite.api.GraphicID.GRANITE_CANNONBALL; +import net.runelite.api.GraphicID; import net.runelite.api.InventoryID; import net.runelite.api.Item; import net.runelite.api.ItemContainer; import net.runelite.api.ItemID; import net.runelite.api.MenuAction; import net.runelite.api.ObjectID; -import static net.runelite.api.ObjectID.CANNON_BASE; import net.runelite.api.Player; import net.runelite.api.Projectile; import net.runelite.api.coords.LocalPoint; +import net.runelite.api.coords.WorldArea; import net.runelite.api.coords.WorldPoint; import net.runelite.api.events.ChatMessage; import net.runelite.api.events.GameObjectSpawned; @@ -79,6 +80,11 @@ public class CannonPlugin extends Plugin static final int MAX_OVERLAY_DISTANCE = 4100; static final int MAX_CBALLS = 30; + private static final Set CANNONBALL_PROJECTILE_IDS = ImmutableSet.of( + GraphicID.CANNONBALL, GraphicID.GRANITE_CANNONBALL, + GraphicID.CANNONBALL_OR, GraphicID.GRANITE_CANNONBALL_OR + ); + private CannonCounter counter; private boolean skipProjectileCheckThisTick; private boolean cannonBallNotificationSent; @@ -92,7 +98,7 @@ public class CannonPlugin extends Plugin private boolean cannonPlaced; @Getter - private WorldPoint cannonPosition; + private WorldArea cannonPosition; @Getter private int cannonWorld = -1; @@ -185,15 +191,19 @@ public class CannonPlugin extends Plugin switch (item.getId()) { case ItemID.CANNON_BASE: + case ItemID.CANNON_BASE_OR: hasBase = true; break; case ItemID.CANNON_STAND: + case ItemID.CANNON_STAND_OR: hasStand = true; break; case ItemID.CANNON_BARRELS: + case ItemID.CANNON_BARRELS_OR: hasBarrels = true; break; case ItemID.CANNON_FURNACE: + case ItemID.CANNON_FURNACE_OR: hasFurnace = true; break; } @@ -253,12 +263,12 @@ public class CannonPlugin extends Plugin GameObject gameObject = event.getGameObject(); Player localPlayer = client.getLocalPlayer(); - if (gameObject.getId() == CANNON_BASE && !cannonPlaced) + if ((gameObject.getId() == ObjectID.CANNON_BASE || gameObject.getId() == ObjectID.CANNON_BASE_43029) && !cannonPlaced) { if (localPlayer.getWorldLocation().distanceTo(gameObject.getWorldLocation()) <= 2 && localPlayer.getAnimation() == AnimationID.BURYING_BONES) { - cannonPosition = gameObject.getWorldLocation(); + cannonPosition = buildCannonWorldArea(gameObject.getWorldLocation()); cannonWorld = client.getWorld(); cannon = gameObject; } @@ -268,7 +278,7 @@ public class CannonPlugin extends Plugin @Subscribe public void onMenuOptionClicked(MenuOptionClicked event) { - if (cannonPosition != null || event.getId() != ObjectID.DWARF_MULTICANNON) + if (cannonPosition != null || (event.getId() != ObjectID.DWARF_MULTICANNON && event.getId() != ObjectID.DWARF_MULTICANNON_43027)) { return; } @@ -303,12 +313,12 @@ public class CannonPlugin extends Plugin { Projectile projectile = event.getProjectile(); - if ((projectile.getId() == CANNONBALL || projectile.getId() == GRANITE_CANNONBALL) && cannonPosition != null && cannonWorld == client.getWorld()) + if (CANNONBALL_PROJECTILE_IDS.contains(projectile.getId()) && cannonPosition != null && cannonWorld == client.getWorld()) { WorldPoint projectileLoc = WorldPoint.fromLocal(client, projectile.getX1(), projectile.getY1(), client.getPlane()); //Check to see if projectile x,y is 0 else it will continuously decrease while ball is flying. - if (projectileLoc.equals(cannonPosition) && projectile.getX() == 0 && projectile.getY() == 0) + if (cannonPosition.contains(projectileLoc) && projectile.getX() == 0 && projectile.getY() == 0) { // When there's a chat message about cannon reloaded/unloaded/out of ammo, // the message event runs before the projectile event. However they run @@ -393,7 +403,7 @@ public class CannonPlugin extends Plugin cannonPlaced = true; cannonWorld = client.getWorld(); cannon = objects[0]; - cannonPosition = cannon.getWorldLocation(); + cannonPosition = buildCannonWorldArea(cannon.getWorldLocation()); } } } @@ -514,4 +524,9 @@ public class CannonPlugin extends Plugin infoBoxManager.removeInfoBox(counter); counter = null; } + + private static WorldArea buildCannonWorldArea(WorldPoint worldPoint) + { + return new WorldArea(worldPoint.getX() - 1, worldPoint.getY() - 1, 3, 3, worldPoint.getPlane()); + } } From 508c5928fe2eedd7e87310a4a6f8b501116134d0 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 19 Mar 2022 18:05:53 -0400 Subject: [PATCH 09/11] gpu: use DebugGL4 in debug mode --- runelite-client/pom.xml | 6 ++++++ .../net/runelite/client/plugins/gpu/GpuPlugin.java | 14 ++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/runelite-client/pom.xml b/runelite-client/pom.xml index 4383ed6b26..247802e226 100644 --- a/runelite-client/pom.xml +++ b/runelite-client/pom.xml @@ -143,6 +143,12 @@ jogl-rl 2.4.0-rc-20220318 + + net.runelite.jogl + jogl-gldesktop-dbg + 2.4.0-rc-20220318 + true + net.runelite.jogl jogl-rl diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java index 12034c7875..9f80cf6023 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java @@ -30,6 +30,7 @@ import com.jogamp.nativewindow.AbstractGraphicsConfiguration; import com.jogamp.nativewindow.NativeWindowFactory; import com.jogamp.nativewindow.awt.AWTGraphicsConfiguration; import com.jogamp.nativewindow.awt.JAWTWindow; +import com.jogamp.opengl.DebugGL4; import com.jogamp.opengl.GL; import static com.jogamp.opengl.GL.GL_ARRAY_BUFFER; import static com.jogamp.opengl.GL.GL_DYNAMIC_DRAW; @@ -418,10 +419,17 @@ public class GpuPlugin extends Plugin implements DrawCallbacks this.gl = glContext.getGL().getGL4(); - setupSyncMode(); - if (log.isDebugEnabled()) { + try + { + gl = new DebugGL4(gl); + } + catch (NoClassDefFoundError ex) + { + log.debug("Disabling DebugGL due to jogl-gldesktop-dbg not being present on the classpath"); + } + gl.glEnable(gl.GL_DEBUG_OUTPUT); // GLDebugEvent[ id 0x20071 @@ -441,6 +449,8 @@ public class GpuPlugin extends Plugin implements DrawCallbacks gl.GL_DONT_CARE, 1, new int[]{0x20052}, 0, false); } + setupSyncMode(); + initVao(); try { From cb018fc1fe70207c5e7d8dc2221f4d294305e45e Mon Sep 17 00:00:00 2001 From: Runelite auto updater Date: Sat, 19 Mar 2022 22:36:21 +0000 Subject: [PATCH 10/11] Release 1.8.14 --- cache-client/pom.xml | 2 +- cache-updater/pom.xml | 2 +- cache/pom.xml | 2 +- pom.xml | 4 ++-- runelite-api/pom.xml | 2 +- runelite-client/pom.xml | 2 +- runelite-jshell/pom.xml | 2 +- runelite-script-assembler-plugin/pom.xml | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cache-client/pom.xml b/cache-client/pom.xml index 6e03e322f4..2a56bef544 100644 --- a/cache-client/pom.xml +++ b/cache-client/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.8.14-SNAPSHOT + 1.8.14 cache-client diff --git a/cache-updater/pom.xml b/cache-updater/pom.xml index d516abdee4..d011d202d9 100644 --- a/cache-updater/pom.xml +++ b/cache-updater/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.8.14-SNAPSHOT + 1.8.14 Cache Updater diff --git a/cache/pom.xml b/cache/pom.xml index ec85e354bb..a054458fa3 100644 --- a/cache/pom.xml +++ b/cache/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.8.14-SNAPSHOT + 1.8.14 cache diff --git a/pom.xml b/pom.xml index 7d2aecbe20..3d8dac45c3 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.8.14-SNAPSHOT + 1.8.14 pom RuneLite @@ -63,7 +63,7 @@ https://github.com/runelite/runelite scm:git:git://github.com/runelite/runelite scm:git:git@github.com:runelite/runelite - HEAD + runelite-parent-1.8.14 diff --git a/runelite-api/pom.xml b/runelite-api/pom.xml index 82dd597f29..8bb945c61a 100644 --- a/runelite-api/pom.xml +++ b/runelite-api/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.8.14-SNAPSHOT + 1.8.14 runelite-api diff --git a/runelite-client/pom.xml b/runelite-client/pom.xml index 247802e226..61e732af08 100644 --- a/runelite-client/pom.xml +++ b/runelite-client/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.8.14-SNAPSHOT + 1.8.14 client diff --git a/runelite-jshell/pom.xml b/runelite-jshell/pom.xml index c480798e4d..9676c774f5 100644 --- a/runelite-jshell/pom.xml +++ b/runelite-jshell/pom.xml @@ -30,7 +30,7 @@ net.runelite runelite-parent - 1.8.14-SNAPSHOT + 1.8.14 jshell diff --git a/runelite-script-assembler-plugin/pom.xml b/runelite-script-assembler-plugin/pom.xml index 7965daed5e..0a78a2c214 100644 --- a/runelite-script-assembler-plugin/pom.xml +++ b/runelite-script-assembler-plugin/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.8.14-SNAPSHOT + 1.8.14 script-assembler-plugin From 3097531564a0e79a174bdf5d819b68fa74507b4a Mon Sep 17 00:00:00 2001 From: Runelite auto updater Date: Sat, 19 Mar 2022 22:36:29 +0000 Subject: [PATCH 11/11] Bump for 1.8.15-SNAPSHOT --- cache-client/pom.xml | 2 +- cache-updater/pom.xml | 2 +- cache/pom.xml | 2 +- pom.xml | 4 ++-- runelite-api/pom.xml | 2 +- runelite-client/pom.xml | 2 +- runelite-jshell/pom.xml | 2 +- runelite-script-assembler-plugin/pom.xml | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cache-client/pom.xml b/cache-client/pom.xml index 2a56bef544..369b9d54a4 100644 --- a/cache-client/pom.xml +++ b/cache-client/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.8.14 + 1.8.15-SNAPSHOT cache-client diff --git a/cache-updater/pom.xml b/cache-updater/pom.xml index d011d202d9..c5153619d7 100644 --- a/cache-updater/pom.xml +++ b/cache-updater/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.8.14 + 1.8.15-SNAPSHOT Cache Updater diff --git a/cache/pom.xml b/cache/pom.xml index a054458fa3..5eeb770aae 100644 --- a/cache/pom.xml +++ b/cache/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.8.14 + 1.8.15-SNAPSHOT cache diff --git a/pom.xml b/pom.xml index 3d8dac45c3..58bb0d9a5a 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.8.14 + 1.8.15-SNAPSHOT pom RuneLite @@ -63,7 +63,7 @@ https://github.com/runelite/runelite scm:git:git://github.com/runelite/runelite scm:git:git@github.com:runelite/runelite - runelite-parent-1.8.14 + HEAD diff --git a/runelite-api/pom.xml b/runelite-api/pom.xml index 8bb945c61a..4f6f4a2717 100644 --- a/runelite-api/pom.xml +++ b/runelite-api/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.8.14 + 1.8.15-SNAPSHOT runelite-api diff --git a/runelite-client/pom.xml b/runelite-client/pom.xml index 61e732af08..190c3fa6b7 100644 --- a/runelite-client/pom.xml +++ b/runelite-client/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.8.14 + 1.8.15-SNAPSHOT client diff --git a/runelite-jshell/pom.xml b/runelite-jshell/pom.xml index 9676c774f5..fa12569ab7 100644 --- a/runelite-jshell/pom.xml +++ b/runelite-jshell/pom.xml @@ -30,7 +30,7 @@ net.runelite runelite-parent - 1.8.14 + 1.8.15-SNAPSHOT jshell diff --git a/runelite-script-assembler-plugin/pom.xml b/runelite-script-assembler-plugin/pom.xml index 0a78a2c214..34923f3848 100644 --- a/runelite-script-assembler-plugin/pom.xml +++ b/runelite-script-assembler-plugin/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.8.14 + 1.8.15-SNAPSHOT script-assembler-plugin