From 795a8effc0e953672a49b953669f53638fe16bec Mon Sep 17 00:00:00 2001 From: Owain van Brakel Date: Wed, 22 Jun 2022 22:51:14 +0200 Subject: [PATCH] project(mixins): Server varps --- .../net/runelite/client/runelite.properties | 2 ++ .../net/runelite/mixins/RSClientMixin.java | 23 +++++++++++++++++++ .../java/net/runelite/rs/api/RSClient.java | 4 ++++ 3 files changed, 29 insertions(+) diff --git a/runelite-client/src/main/resources/net/runelite/client/runelite.properties b/runelite-client/src/main/resources/net/runelite/client/runelite.properties index 9ed1f066d5..04dc01c677 100644 --- a/runelite-client/src/main/resources/net/runelite/client/runelite.properties +++ b/runelite-client/src/main/resources/net/runelite/client/runelite.properties @@ -1,6 +1,8 @@ runelite.title=OpenOSRS runelite.version=@project.version@ runescape.version=@rs.version@ +runelite.commit=nogit +runelite.dirty=false runelite.discord.appid=627741263881568257 runelite.discord.invite=https://discord.gg/OpenOSRS runelite.github.link=https://github.com/open-osrs diff --git a/runelite-mixins/src/main/java/net/runelite/mixins/RSClientMixin.java b/runelite-mixins/src/main/java/net/runelite/mixins/RSClientMixin.java index e88b2bab9c..a5c1dd2d34 100644 --- a/runelite-mixins/src/main/java/net/runelite/mixins/RSClientMixin.java +++ b/runelite-mixins/src/main/java/net/runelite/mixins/RSClientMixin.java @@ -750,6 +750,29 @@ public Widget getWidget(int groupId, int childId) return childWidgets[childId]; } + @Inject + @Override + public int getServerVarpValue(int varpId) + { + int[] varps = this.getServerVarps(); + return varps[varpId]; + } + + @Inject + @Override + public int getServerVar(VarPlayer varPlayer) + { + int[] varps = getServerVarps(); + return varps[varPlayer.getId()]; + } + + @Inject + @Override + public int getServerVarbitValue(int varbit) + { + return this.getVarbitValue(this.getServerVarps(), varbit); + } + @Inject @Override public int getVar(VarPlayer varPlayer) diff --git a/runescape-api/src/main/java/net/runelite/rs/api/RSClient.java b/runescape-api/src/main/java/net/runelite/rs/api/RSClient.java index 2c567dab2a..84950b8a9f 100644 --- a/runescape-api/src/main/java/net/runelite/rs/api/RSClient.java +++ b/runescape-api/src/main/java/net/runelite/rs/api/RSClient.java @@ -102,6 +102,10 @@ public interface RSClient extends RSGameEngine, Client @Override byte[][][] getTileSettings(); + @Import("Varps_temp") + @Override + int[] getServerVarps(); + @Import("Varps_main") @Override int[] getVarps();