diff --git a/README.md b/README.md index 53e24c5ca6..53423df333 100644 --- a/README.md +++ b/README.md @@ -22,21 +22,21 @@ - [runescape-api](runescape-api/src/main/java/net/runelite) - Mappings correspond to these interfaces, runelite-api is a subset of this - [runelite-client](runelite-client/src/main/java/net/runelite/client) - Game client with plugins +## Building +We have migrated the project to Gradle. Information on how to setup and build the project can be found at https://github.com/runelite-extended/runelite/wiki/Building-with-IntelliJ-IDEA + ## Private Servers Currently we support RSMod which can be found at: https://github.com/Tomm0017/rsmod but should work with any server that follows osrs protocol. ``` Jar/IntelliJ -Use -private-server arg. +Use -rs=RSPS arg. Exe -Use --clientargs="--private-server" arg. - -Using modified mixins is possible using -local-injected arg, but it looks in a very specific location. -(./injected-client/target/injected-client-X.X.XX-SNAPSHOT.jar) (X.X.XX must match current API version) +Use --clientargs="--rs=RSPS" arg. ----- -Set codebase in ./codebase or in Private Server plugin and restart. +Codebase is set to 127.0.0.1 by default and can be changed in the Private Server plugin (requires restart) Update modulus in Private Server plugin. Disable Default World plugin if you have it enabled, this causes issues with codebase. diff --git a/build.gradle b/build.gradle index e091d60949..745dfb755c 100644 --- a/build.gradle +++ b/build.gradle @@ -27,6 +27,9 @@ allprojects { apply plugin: 'maven' apply plugin: 'checkstyle' + group = 'net.runelite' + version = '1.5.30-SNAPSHOT' + ext { rsversion = 181 cacheversion = 165 @@ -36,12 +39,9 @@ allprojects { gitDirty = localGitDirty rootPath = rootDir.toString().replace('\\', '/') - injectedClassesPath = rootPath + "/injector-plugin/out/injected-client/" + injectedClassesPath = rootPath + "/injected-client/build/libs/injected-client-" + version + ".jar" } - group = 'net.runelite' - version = '1.5.30-SNAPSHOT' - gradle.projectsEvaluated { tasks.withType(JavaCompile) { options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" diff --git a/http-api/build.gradle b/http-api/build.gradle index 2576fa7122..309aa0de60 100644 --- a/http-api/build.gradle +++ b/http-api/build.gradle @@ -1,6 +1,7 @@ import org.apache.tools.ant.filters.ReplaceTokens description = 'Web API' dependencies { + implementation project(':runelite-api') implementation group: 'com.squareup.okhttp3', name: 'okhttp', version: '4.0.1' implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.5' implementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.26' diff --git a/http-api/src/main/java/net/runelite/http/api/ws/WebsocketGsonFactory.java b/http-api/src/main/java/net/runelite/http/api/ws/WebsocketGsonFactory.java index 589a538de3..9d4e46e6ea 100644 --- a/http-api/src/main/java/net/runelite/http/api/ws/WebsocketGsonFactory.java +++ b/http-api/src/main/java/net/runelite/http/api/ws/WebsocketGsonFactory.java @@ -34,6 +34,7 @@ import net.runelite.http.api.ws.messages.Handshake; import net.runelite.http.api.ws.messages.LoginResponse; import net.runelite.http.api.ws.messages.party.Join; import net.runelite.http.api.ws.messages.party.Part; +import net.runelite.http.api.ws.messages.party.PartyChatMessage; import net.runelite.http.api.ws.messages.party.UserJoin; import net.runelite.http.api.ws.messages.party.UserPart; import net.runelite.http.api.ws.messages.party.UserSync; @@ -52,6 +53,7 @@ public class WebsocketGsonFactory messages.add(UserJoin.class); messages.add(UserPart.class); messages.add(UserSync.class); + messages.add(PartyChatMessage.class); MESSAGES = messages; } diff --git a/http-api/src/main/java/net/runelite/http/api/ws/WebsocketMessage.java b/http-api/src/main/java/net/runelite/http/api/ws/WebsocketMessage.java index d732c110cd..227e61eb56 100644 --- a/http-api/src/main/java/net/runelite/http/api/ws/WebsocketMessage.java +++ b/http-api/src/main/java/net/runelite/http/api/ws/WebsocketMessage.java @@ -24,7 +24,9 @@ */ package net.runelite.http.api.ws; -public class WebsocketMessage +import net.runelite.api.events.Event; + +public class WebsocketMessage implements Event { protected boolean _party; diff --git a/http-api/src/main/java/net/runelite/http/api/ws/messages/LoginResponse.java b/http-api/src/main/java/net/runelite/http/api/ws/messages/LoginResponse.java index b517e773a2..588736887d 100644 --- a/http-api/src/main/java/net/runelite/http/api/ws/messages/LoginResponse.java +++ b/http-api/src/main/java/net/runelite/http/api/ws/messages/LoginResponse.java @@ -24,13 +24,14 @@ */ package net.runelite.http.api.ws.messages; +import net.runelite.api.events.Event; import net.runelite.http.api.ws.WebsocketMessage; /** * Called after a successful login to the server * @author Adam */ -public class LoginResponse extends WebsocketMessage +public class LoginResponse extends WebsocketMessage implements Event { private String username; diff --git a/http-api/src/main/java/net/runelite/http/api/ws/messages/party/Join.java b/http-api/src/main/java/net/runelite/http/api/ws/messages/party/Join.java index 21aed0f653..e68910567b 100644 --- a/http-api/src/main/java/net/runelite/http/api/ws/messages/party/Join.java +++ b/http-api/src/main/java/net/runelite/http/api/ws/messages/party/Join.java @@ -27,11 +27,12 @@ package net.runelite.http.api.ws.messages.party; import java.util.UUID; import lombok.EqualsAndHashCode; import lombok.Value; +import net.runelite.api.events.Event; import net.runelite.http.api.ws.WebsocketMessage; @Value @EqualsAndHashCode(callSuper = true) -public class Join extends WebsocketMessage +public class Join extends WebsocketMessage implements Event { private final UUID partyId; private final String name; diff --git a/http-api/src/main/java/net/runelite/http/api/ws/messages/party/Part.java b/http-api/src/main/java/net/runelite/http/api/ws/messages/party/Part.java index e284ff0cf8..0d487a3be6 100644 --- a/http-api/src/main/java/net/runelite/http/api/ws/messages/party/Part.java +++ b/http-api/src/main/java/net/runelite/http/api/ws/messages/party/Part.java @@ -24,8 +24,9 @@ */ package net.runelite.http.api.ws.messages.party; +import net.runelite.api.events.Event; import net.runelite.http.api.ws.WebsocketMessage; -public class Part extends WebsocketMessage +public class Part extends WebsocketMessage implements Event { } diff --git a/runelite-client/src/test/java/net/runelite/client/RuneLiteModuleTest.java b/http-api/src/main/java/net/runelite/http/api/ws/messages/party/PartyChatMessage.java similarity index 79% rename from runelite-client/src/test/java/net/runelite/client/RuneLiteModuleTest.java rename to http-api/src/main/java/net/runelite/http/api/ws/messages/party/PartyChatMessage.java index b62ea720e9..cc67d2a051 100644 --- a/runelite-client/src/test/java/net/runelite/client/RuneLiteModuleTest.java +++ b/http-api/src/main/java/net/runelite/http/api/ws/messages/party/PartyChatMessage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2017, Adam + * Copyright (c) 2019, Tomas Slusny * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -22,17 +22,12 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.client; +package net.runelite.http.api.ws.messages.party; -import com.google.inject.Guice; -import net.runelite.client.rs.ClientUpdateCheckMode; -import org.junit.Test; - -public class RuneLiteModuleTest +import lombok.Value; +import net.runelite.api.events.Event; +@Value +public class PartyChatMessage extends PartyMemberMessage implements Event { - @Test - public void testConfigure() - { - Guice.createInjector(new RuneLiteModule(ClientUpdateCheckMode.AUTO, true)); - } + private final String value; } diff --git a/http-api/src/main/java/net/runelite/http/api/ws/messages/party/PartyMemberMessage.java b/http-api/src/main/java/net/runelite/http/api/ws/messages/party/PartyMemberMessage.java index 9d5cab8545..3a4f330343 100644 --- a/http-api/src/main/java/net/runelite/http/api/ws/messages/party/PartyMemberMessage.java +++ b/http-api/src/main/java/net/runelite/http/api/ws/messages/party/PartyMemberMessage.java @@ -3,10 +3,11 @@ package net.runelite.http.api.ws.messages.party; import java.util.UUID; import lombok.Getter; import lombok.Setter; +import net.runelite.api.events.Event; @Getter @Setter -public abstract class PartyMemberMessage extends PartyMessage +public abstract class PartyMemberMessage extends PartyMessage implements Event { private UUID memberId; } diff --git a/http-api/src/main/java/net/runelite/http/api/ws/messages/party/PartyMessage.java b/http-api/src/main/java/net/runelite/http/api/ws/messages/party/PartyMessage.java index 709457ed8c..2f9ef90d92 100644 --- a/http-api/src/main/java/net/runelite/http/api/ws/messages/party/PartyMessage.java +++ b/http-api/src/main/java/net/runelite/http/api/ws/messages/party/PartyMessage.java @@ -24,9 +24,10 @@ */ package net.runelite.http.api.ws.messages.party; +import net.runelite.api.events.Event; import net.runelite.http.api.ws.WebsocketMessage; -public abstract class PartyMessage extends WebsocketMessage +public abstract class PartyMessage extends WebsocketMessage implements Event { public PartyMessage() { diff --git a/http-api/src/main/java/net/runelite/http/api/ws/messages/party/UserJoin.java b/http-api/src/main/java/net/runelite/http/api/ws/messages/party/UserJoin.java index 7f940e8060..fd024c6cf3 100644 --- a/http-api/src/main/java/net/runelite/http/api/ws/messages/party/UserJoin.java +++ b/http-api/src/main/java/net/runelite/http/api/ws/messages/party/UserJoin.java @@ -27,11 +27,12 @@ package net.runelite.http.api.ws.messages.party; import java.util.UUID; import lombok.EqualsAndHashCode; import lombok.Value; +import net.runelite.api.events.Event; import net.runelite.http.api.ws.WebsocketMessage; @Value @EqualsAndHashCode(callSuper = true) -public class UserJoin extends WebsocketMessage +public class UserJoin extends WebsocketMessage implements Event { private final UUID memberId; private final UUID partyId; diff --git a/http-api/src/main/java/net/runelite/http/api/ws/messages/party/UserPart.java b/http-api/src/main/java/net/runelite/http/api/ws/messages/party/UserPart.java index e80c6002bd..1dcd277c02 100644 --- a/http-api/src/main/java/net/runelite/http/api/ws/messages/party/UserPart.java +++ b/http-api/src/main/java/net/runelite/http/api/ws/messages/party/UserPart.java @@ -27,11 +27,12 @@ package net.runelite.http.api.ws.messages.party; import java.util.UUID; import lombok.EqualsAndHashCode; import lombok.Value; +import net.runelite.api.events.Event; import net.runelite.http.api.ws.WebsocketMessage; @Value @EqualsAndHashCode(callSuper = true) -public class UserPart extends WebsocketMessage +public class UserPart extends WebsocketMessage implements Event { private final UUID memberId; } diff --git a/http-api/src/main/java/net/runelite/http/api/ws/messages/party/UserSync.java b/http-api/src/main/java/net/runelite/http/api/ws/messages/party/UserSync.java index c95038c9fa..bcb6ca0ee7 100644 --- a/http-api/src/main/java/net/runelite/http/api/ws/messages/party/UserSync.java +++ b/http-api/src/main/java/net/runelite/http/api/ws/messages/party/UserSync.java @@ -26,9 +26,10 @@ package net.runelite.http.api.ws.messages.party; import lombok.EqualsAndHashCode; import lombok.Value; +import net.runelite.api.events.Event; @Value @EqualsAndHashCode(callSuper = true) -public class UserSync extends PartyMemberMessage +public class UserSync extends PartyMemberMessage implements Event { } diff --git a/injected-client/build.gradle b/injected-client/build.gradle index e73d2bd89c..a1ef30df3d 100644 --- a/injected-client/build.gradle +++ b/injected-client/build.gradle @@ -24,28 +24,8 @@ */ description = 'Injected Client' - - -def injectedClassesPath = "${rootPath}/injector-plugin/out/injected-client/" - -compileJava { - dependsOn ':injector-plugin:assemble' -} - -compileJava.outputs.upToDateWhen { false } - -compileJava.doLast() { - copy { - File f = file("build/classes/java/main/injected-client") - f.deleteDir() - f.mkdirs() - from ("${injectedClassesPath}") - into ("build/classes/java/main/injected-client") - } -} - -classes.doLast() { - File f = file("build/classes/java/main/Placeholder.class") - f.delete() +task injector(){ + // I kinda want to make the entire injector work here but seems like more work + dependsOn ':injector-plugin:compileJava' } diff --git a/injector-plugin/build.gradle b/injector-plugin/build.gradle index 745807236e..45ccd6ee2f 100644 --- a/injector-plugin/build.gradle +++ b/injector-plugin/build.gradle @@ -2,7 +2,6 @@ group = 'net.runelite.rs' description = 'Injector' def buildPath = buildDir.toString().replace('\\', '/') // this doesnt work in an ext block for some reason - def deobfuscatedJar = "${rootPath}/runescape-client/build/libs/rs-client-${project.version}.jar" def vanillaJar = "${buildPath}/vanilla-${rsversion}.jar" @@ -39,7 +38,7 @@ compileJava.doLast() { into "$buildDir" } def path = sourceSets.main.runtimeClasspath - def loader = new URLClassLoader(path.collect { f -> f.toURL() } as URL[]) + def loader = new URLClassLoader(path.collect { f -> f.toURI().toURL() } as URL[]) def inject = loader.loadClass('net.runelite.injector.Injector') String[] jarPaths = [ deobfuscatedJar.toString(), @@ -47,6 +46,7 @@ compileJava.doLast() { injectedClassesPath.toString() ] inject.main(jarPaths) + loader.close() } test { diff --git a/injector-plugin/src/main/java/net/runelite/injector/Injector.java b/injector-plugin/src/main/java/net/runelite/injector/Injector.java index 4543ed5b46..9409b02075 100644 --- a/injector-plugin/src/main/java/net/runelite/injector/Injector.java +++ b/injector-plugin/src/main/java/net/runelite/injector/Injector.java @@ -26,9 +26,6 @@ package net.runelite.injector; import java.io.File; import java.io.IOException; - -import com.google.common.io.Files; -import net.runelite.asm.ClassFile; import net.runelite.asm.ClassGroup; import net.runelite.deob.util.JarUtil; @@ -72,13 +69,7 @@ public class Injector private void save(File out) throws IOException { - out.mkdirs(); - for (ClassFile cf : vanilla.getClasses()) - { - File f = new File(out, cf.getClassName() + ".class"); - byte[] data = JarUtil.writeClass(vanilla, cf); - Files.write(data, f); - } + JarUtil.saveJar(vanilla, out); } diff --git a/injector-plugin/vanilla-181.jar b/injector-plugin/vanilla-181.jar deleted file mode 100644 index 9c78f36300..0000000000 Binary files a/injector-plugin/vanilla-181.jar and /dev/null differ diff --git a/runelite-api/src/main/java/net/runelite/api/Quest.java b/runelite-api/src/main/java/net/runelite/api/Quest.java index 2a2d5d13fd..47453e7cad 100644 --- a/runelite-api/src/main/java/net/runelite/api/Quest.java +++ b/runelite-api/src/main/java/net/runelite/api/Quest.java @@ -120,8 +120,8 @@ public enum Quest MONKEY_MADNESS_II(396, "Monkey Madness II", Varbits.QUEST_MONKEY_MADNESS_II), MONKS_FRIEND(397, "Monk's Friend", VarPlayer.QUEST_MONKS_FRIEND), MOUNTAIN_DAUGHTER(398, "Mountain Daughter", Varbits.QUEST_MOUNTAIN_DAUGHTER), - MOURNINGS_ENDS_PART_I(399, "Mourning's Ends Part I", VarPlayer.QUEST_MOURNINGS_ENDS_PART_I), - MOURNINGS_ENDS_PART_II(400, "Mourning's Ends Part II", Varbits.QUEST_MOURNINGS_ENDS_PART_II), + MOURNINGS_END_PART_I(399, "Mourning's End Part I", VarPlayer.QUEST_MOURNINGS_END_PART_I), + MOURNINGS_END_PART_II(400, "Mourning's End Part II", Varbits.QUEST_MOURNINGS_END_PART_II), MURDER_MYSTERY(401, "Murder Mystery", VarPlayer.QUEST_MURDER_MYSTERY), MY_ARMS_BIG_ADVENTURE(402, "My Arm's Big Adventure", Varbits.QUEST_MY_ARMS_BIG_ADVENTURE), NATURE_SPIRIT(403, "Nature Spirit", VarPlayer.QUEST_NATURE_SPIRIT), @@ -173,6 +173,7 @@ public enum Quest ZOGRE_FLESH_EATERS(449, "Zogre Flesh Eaters", Varbits.QUEST_ZOGRE_FLESH_EATERS), THE_ASCENT_OF_ARCEUUS(542, "The Ascent of Arceuus", Varbits.QUEST_THE_ASCENT_OF_ARCEUUS), THE_FORSAKEN_TOWER(543, "The Forsaken Tower", Varbits.QUEST_THE_FORSAKEN_TOWER), + SONG_OF_THE_ELVES(603, "Song of the Elves", Varbits.QUEST_SONG_OF_THE_ELVES), //Miniquests ENTER_THE_ABYSS(319, "Enter the Abyss", VarPlayer.QUEST_ENTER_THE_ABYSS), @@ -186,7 +187,8 @@ public enum Quest THE_MAGE_ARENA(327, "The Mage Arena", VarPlayer.QUEST_THE_MAGE_ARENA), LAIR_OF_TARN_RAZORLOR(328, "Lair of Tarn Razorlor", Varbits.QUEST_LAIR_OF_TARN_RAZORLOR), FAMILY_PEST(329, "Family Pest", Varbits.QUEST_FAMILY_PEST), - THE_MAGE_ARENA_II(330, "The Mage Arena II", Varbits.QUEST_THE_MAGE_ARENA_II); + THE_MAGE_ARENA_II(330, "The Mage Arena II", Varbits.QUEST_THE_MAGE_ARENA_II), + IN_SEARCH_OF_KNOWLEDGE(602, "In Search of Knowledge", Varbits.QUEST_IN_SEARCH_OF_KNOWLEDGE); @Getter private final int id; diff --git a/runelite-api/src/main/java/net/runelite/api/VarPlayer.java b/runelite-api/src/main/java/net/runelite/api/VarPlayer.java index db9f9908d3..ba78672da5 100644 --- a/runelite-api/src/main/java/net/runelite/api/VarPlayer.java +++ b/runelite-api/src/main/java/net/runelite/api/VarPlayer.java @@ -220,7 +220,7 @@ public enum VarPlayer QUEST_MERLINS_CRYSTAL(14), QUEST_MONKEY_MADNESS_I(365), QUEST_MONKS_FRIEND(30), - QUEST_MOURNINGS_ENDS_PART_I(517), + QUEST_MOURNINGS_END_PART_I(517), QUEST_MURDER_MYSTERY(192), QUEST_NATURE_SPIRIT(307), QUEST_OBSERVATORY_QUEST(112), diff --git a/runelite-api/src/main/java/net/runelite/api/Varbits.java b/runelite-api/src/main/java/net/runelite/api/Varbits.java index d12beffb45..0ceac97105 100644 --- a/runelite-api/src/main/java/net/runelite/api/Varbits.java +++ b/runelite-api/src/main/java/net/runelite/api/Varbits.java @@ -595,7 +595,7 @@ public enum Varbits QUEST_LUNAR_DIPLOMACY(2448), QUEST_MAKING_HISTORY(1383), QUEST_MOUNTAIN_DAUGHTER(260), - QUEST_MOURNINGS_ENDS_PART_II(1103), + QUEST_MOURNINGS_END_PART_II(1103), QUEST_MY_ARMS_BIG_ADVENTURE(2790), QUEST_RATCATCHERS(1404), QUEST_RECIPE_FOR_DISASTER(1850), @@ -629,6 +629,8 @@ public enum Varbits QUEST_MAKING_FRIENDS_WITH_MY_ARM(6528), QUEST_THE_ASCENT_OF_ARCEUUS(7856), QUEST_THE_FORSAKEN_TOWER(7796), + //TODO + QUEST_SONG_OF_THE_ELVES(7796), /** * mini-quest varbits, these don't hold the completion value. @@ -642,6 +644,8 @@ public enum Varbits QUEST_LAIR_OF_TARN_RAZORLOR(3290), QUEST_FAMILY_PEST(5347), QUEST_THE_MAGE_ARENA_II(6067), + //TODO + QUEST_IN_SEARCH_OF_KNOWLEDGE(6067), /** * Active spellbook (see enumID) diff --git a/runelite-api/src/main/java/net/runelite/api/events/AnimationChanged.java b/runelite-api/src/main/java/net/runelite/api/events/AnimationChanged.java index 0c4e1d5b68..943337f132 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/AnimationChanged.java +++ b/runelite-api/src/main/java/net/runelite/api/events/AnimationChanged.java @@ -2,7 +2,6 @@ package net.runelite.api.events; import net.runelite.api.Actor; import lombok.Data; -import net.runelite.api.Actor; /** * An event where the {@link Actor} has changed animations. @@ -18,7 +17,7 @@ import net.runelite.api.Actor; * @see net.runelite.api.AnimationID */ @Data -public class AnimationChanged +public class AnimationChanged implements Event { /** * The actor that has entered a new animation. diff --git a/runelite-api/src/main/java/net/runelite/api/events/AreaSoundEffectPlayed.java b/runelite-api/src/main/java/net/runelite/api/events/AreaSoundEffectPlayed.java index 488bff8264..084ba26f73 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/AreaSoundEffectPlayed.java +++ b/runelite-api/src/main/java/net/runelite/api/events/AreaSoundEffectPlayed.java @@ -27,7 +27,7 @@ package net.runelite.api.events; import lombok.Data; @Data -public class AreaSoundEffectPlayed +public class AreaSoundEffectPlayed implements Event { private int soundId; private int sceneX; diff --git a/runelite-api/src/main/java/net/runelite/api/events/BeforeMenuRender.java b/runelite-api/src/main/java/net/runelite/api/events/BeforeMenuRender.java index 5d1e10994b..055fb37a41 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/BeforeMenuRender.java +++ b/runelite-api/src/main/java/net/runelite/api/events/BeforeMenuRender.java @@ -27,7 +27,7 @@ package net.runelite.api.events; import lombok.Data; @Data -public class BeforeMenuRender +public class BeforeMenuRender implements Event { private boolean consumed; diff --git a/runelite-api/src/main/java/net/runelite/api/events/BeforeRender.java b/runelite-api/src/main/java/net/runelite/api/events/BeforeRender.java index 73c004d4b3..ac9db4163a 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/BeforeRender.java +++ b/runelite-api/src/main/java/net/runelite/api/events/BeforeRender.java @@ -27,7 +27,7 @@ package net.runelite.api.events; /** * Posted at the start of every frame */ -public class BeforeRender +public class BeforeRender implements Event { public static final BeforeRender INSTANCE = new BeforeRender(); diff --git a/runelite-api/src/main/java/net/runelite/api/events/BoostedLevelChanged.java b/runelite-api/src/main/java/net/runelite/api/events/BoostedLevelChanged.java index a465e3b407..b40b450ab9 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/BoostedLevelChanged.java +++ b/runelite-api/src/main/java/net/runelite/api/events/BoostedLevelChanged.java @@ -42,7 +42,7 @@ import lombok.Data; * retrieve the newly boosted skill level. */ @Data -public class BoostedLevelChanged +public class BoostedLevelChanged implements Event { /** * The skill that has had its level modified. diff --git a/runelite-api/src/main/java/net/runelite/api/events/CannonballFired.java b/runelite-api/src/main/java/net/runelite/api/events/CannonballFired.java index c44789965a..61feeeeecb 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/CannonballFired.java +++ b/runelite-api/src/main/java/net/runelite/api/events/CannonballFired.java @@ -27,7 +27,7 @@ package net.runelite.api.events; /** * an event posted when a cannonball is fired */ -public class CannonballFired +public class CannonballFired implements Event { public static final CannonballFired INSTANCE = new CannonballFired(); diff --git a/runelite-api/src/main/java/net/runelite/api/events/CanvasSizeChanged.java b/runelite-api/src/main/java/net/runelite/api/events/CanvasSizeChanged.java index 0efef18d0d..66ad5dbcec 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/CanvasSizeChanged.java +++ b/runelite-api/src/main/java/net/runelite/api/events/CanvasSizeChanged.java @@ -27,7 +27,7 @@ package net.runelite.api.events; /** * An event posted when the canvas size might have changed. */ -public class CanvasSizeChanged +public class CanvasSizeChanged implements Event { public static final CanvasSizeChanged INSTANCE = new CanvasSizeChanged(); diff --git a/runelite-api/src/main/java/net/runelite/api/events/ChatMessage.java b/runelite-api/src/main/java/net/runelite/api/events/ChatMessage.java index 791ec350b3..a29a674373 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/ChatMessage.java +++ b/runelite-api/src/main/java/net/runelite/api/events/ChatMessage.java @@ -41,7 +41,7 @@ import lombok.NoArgsConstructor; @Data @AllArgsConstructor @NoArgsConstructor -public class ChatMessage +public class ChatMessage implements Event { /** * The underlying MessageNode for the message. diff --git a/runelite-api/src/main/java/net/runelite/api/events/ClanChanged.java b/runelite-api/src/main/java/net/runelite/api/events/ClanChanged.java index e39dbc400e..e44c1aabb4 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/ClanChanged.java +++ b/runelite-api/src/main/java/net/runelite/api/events/ClanChanged.java @@ -30,7 +30,7 @@ import lombok.Value; * An event where the client has joined or left a clan chat. */ @Value -public class ClanChanged +public class ClanChanged implements Event { /** * Whether or not the client is now in a clan chat. diff --git a/runelite-api/src/main/java/net/runelite/api/events/ClanMemberJoined.java b/runelite-api/src/main/java/net/runelite/api/events/ClanMemberJoined.java index c0a694555b..c2f99c52a0 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/ClanMemberJoined.java +++ b/runelite-api/src/main/java/net/runelite/api/events/ClanMemberJoined.java @@ -28,7 +28,7 @@ import net.runelite.api.ClanMember; import lombok.Value; @Value -public class ClanMemberJoined +public class ClanMemberJoined implements Event { /** * The ClanMember that joined diff --git a/runelite-api/src/main/java/net/runelite/api/events/ClanMemberLeft.java b/runelite-api/src/main/java/net/runelite/api/events/ClanMemberLeft.java index c403261532..68081b1e7d 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/ClanMemberLeft.java +++ b/runelite-api/src/main/java/net/runelite/api/events/ClanMemberLeft.java @@ -28,7 +28,7 @@ import net.runelite.api.ClanMember; import lombok.Value; @Value -public class ClanMemberLeft +public class ClanMemberLeft implements Event { /** * The ClanMember that left diff --git a/runelite-api/src/main/java/net/runelite/api/events/ClientTick.java b/runelite-api/src/main/java/net/runelite/api/events/ClientTick.java index 6874f4145c..9ffef0d573 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/ClientTick.java +++ b/runelite-api/src/main/java/net/runelite/api/events/ClientTick.java @@ -27,7 +27,7 @@ package net.runelite.api.events; /** * Posted every client tick */ -public class ClientTick +public class ClientTick implements Event { public static final ClientTick INSTANCE = new ClientTick(); diff --git a/runelite-api/src/main/java/net/runelite/api/events/CommandExecuted.java b/runelite-api/src/main/java/net/runelite/api/events/CommandExecuted.java index d0dfae5ff2..025b874245 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/CommandExecuted.java +++ b/runelite-api/src/main/java/net/runelite/api/events/CommandExecuted.java @@ -42,7 +42,7 @@ import lombok.Value; * will set command to "" and arguments to ["hello", "world!"]. */ @Value -public class CommandExecuted +public class CommandExecuted implements Event { /** * The name of the command entered. diff --git a/runelite-api/src/main/java/net/runelite/api/events/ConfigChanged.java b/runelite-api/src/main/java/net/runelite/api/events/ConfigChanged.java index f27f4819cb..0198dc900b 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/ConfigChanged.java +++ b/runelite-api/src/main/java/net/runelite/api/events/ConfigChanged.java @@ -30,7 +30,7 @@ import lombok.Data; * An event where a configuration entry has been modified. */ @Data -public class ConfigChanged +public class ConfigChanged implements Event { /** * The parent group for the key. diff --git a/runelite-api/src/main/java/net/runelite/api/events/DecorativeObjectChanged.java b/runelite-api/src/main/java/net/runelite/api/events/DecorativeObjectChanged.java index a18683d7b4..a64a1c5c47 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/DecorativeObjectChanged.java +++ b/runelite-api/src/main/java/net/runelite/api/events/DecorativeObjectChanged.java @@ -33,7 +33,7 @@ import lombok.Data; * has been modified. */ @Data -public class DecorativeObjectChanged +public class DecorativeObjectChanged implements Event { /** * The affected tile. diff --git a/runelite-api/src/main/java/net/runelite/api/events/DecorativeObjectDespawned.java b/runelite-api/src/main/java/net/runelite/api/events/DecorativeObjectDespawned.java index 94c06488c7..6760c0d05d 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/DecorativeObjectDespawned.java +++ b/runelite-api/src/main/java/net/runelite/api/events/DecorativeObjectDespawned.java @@ -33,7 +33,7 @@ import lombok.Data; * is removed. */ @Data -public class DecorativeObjectDespawned +public class DecorativeObjectDespawned implements Event { /** * The affected tile. diff --git a/runelite-api/src/main/java/net/runelite/api/events/DecorativeObjectSpawned.java b/runelite-api/src/main/java/net/runelite/api/events/DecorativeObjectSpawned.java index fe8d17862f..37d0a5fab2 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/DecorativeObjectSpawned.java +++ b/runelite-api/src/main/java/net/runelite/api/events/DecorativeObjectSpawned.java @@ -32,7 +32,7 @@ import lombok.Data; * An event where a {@link DecorativeObject} is attached to a {@link Tile}. */ @Data -public class DecorativeObjectSpawned +public class DecorativeObjectSpawned implements Event { /** * The affected tile. diff --git a/runelite-api/src/main/java/net/runelite/api/events/DraggingWidgetChanged.java b/runelite-api/src/main/java/net/runelite/api/events/DraggingWidgetChanged.java index 8aef02d570..0f9bf09691 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/DraggingWidgetChanged.java +++ b/runelite-api/src/main/java/net/runelite/api/events/DraggingWidgetChanged.java @@ -31,7 +31,7 @@ import lombok.Data; * the cursor. */ @Data -public class DraggingWidgetChanged +public class DraggingWidgetChanged implements Event { /** * Whether a widget is currently being dragged. diff --git a/runelite-api/src/main/java/net/runelite/api/events/DynamicObjectAnimationChanged.java b/runelite-api/src/main/java/net/runelite/api/events/DynamicObjectAnimationChanged.java index 1e4571e4fe..382cb706fb 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/DynamicObjectAnimationChanged.java +++ b/runelite-api/src/main/java/net/runelite/api/events/DynamicObjectAnimationChanged.java @@ -3,7 +3,7 @@ package net.runelite.api.events; import lombok.Data; @Data -public class DynamicObjectAnimationChanged +public class DynamicObjectAnimationChanged implements Event { /** * The object that has entered a new animation. diff --git a/runelite-api/src/main/java/net/runelite/api/events/Event.java b/runelite-api/src/main/java/net/runelite/api/events/Event.java new file mode 100644 index 0000000000..33ea361467 --- /dev/null +++ b/runelite-api/src/main/java/net/runelite/api/events/Event.java @@ -0,0 +1,5 @@ +package net.runelite.api.events; + +public interface Event +{ +} diff --git a/runelite-api/src/main/java/net/runelite/api/events/ExperienceChanged.java b/runelite-api/src/main/java/net/runelite/api/events/ExperienceChanged.java index 587efd4f41..c2b1515027 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/ExperienceChanged.java +++ b/runelite-api/src/main/java/net/runelite/api/events/ExperienceChanged.java @@ -32,7 +32,7 @@ import lombok.Data; * An event where the experience level of a {@link Skill} has been modified. */ @Data -public class ExperienceChanged +public class ExperienceChanged implements Event { /** * The modified skill. diff --git a/runelite-api/src/main/java/net/runelite/api/events/FocusChanged.java b/runelite-api/src/main/java/net/runelite/api/events/FocusChanged.java index fd9fcb6466..3f190fd331 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/FocusChanged.java +++ b/runelite-api/src/main/java/net/runelite/api/events/FocusChanged.java @@ -37,7 +37,7 @@ import lombok.Data; * */ @Data -public class FocusChanged +public class FocusChanged implements Event { /** * The new focus state. diff --git a/runelite-api/src/main/java/net/runelite/api/events/FriendAdded.java b/runelite-api/src/main/java/net/runelite/api/events/FriendAdded.java index 76b60e3681..47d577a132 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/FriendAdded.java +++ b/runelite-api/src/main/java/net/runelite/api/events/FriendAdded.java @@ -6,7 +6,7 @@ import lombok.Value; * An event where a request to add a friend is sent to the server. */ @Value -public class FriendAdded +public class FriendAdded implements Event { /** * The name of the added friend. diff --git a/runelite-api/src/main/java/net/runelite/api/events/FriendRemoved.java b/runelite-api/src/main/java/net/runelite/api/events/FriendRemoved.java index 2b9c641b3c..abf3f021a3 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/FriendRemoved.java +++ b/runelite-api/src/main/java/net/runelite/api/events/FriendRemoved.java @@ -30,7 +30,7 @@ import lombok.Value; * An event where a request to remove a friend is sent to the server. */ @Value -public class FriendRemoved +public class FriendRemoved implements Event { /** * The name of the removed friend. diff --git a/runelite-api/src/main/java/net/runelite/api/events/GameObjectChanged.java b/runelite-api/src/main/java/net/runelite/api/events/GameObjectChanged.java index 117ad81f60..dee1f261ea 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/GameObjectChanged.java +++ b/runelite-api/src/main/java/net/runelite/api/events/GameObjectChanged.java @@ -32,7 +32,7 @@ import net.runelite.api.Tile; * An event where a {@link GameObject} on a {@link Tile} has been replaced. */ @Data -public class GameObjectChanged +public class GameObjectChanged implements Event { /** * The affected tile. diff --git a/runelite-api/src/main/java/net/runelite/api/events/GameObjectDespawned.java b/runelite-api/src/main/java/net/runelite/api/events/GameObjectDespawned.java index 5d2e9fad1a..ed7e11ae2f 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/GameObjectDespawned.java +++ b/runelite-api/src/main/java/net/runelite/api/events/GameObjectDespawned.java @@ -32,7 +32,7 @@ import lombok.Data; * An event where a {@link GameObject} on a {@link Tile} is removed. */ @Data -public class GameObjectDespawned +public class GameObjectDespawned implements Event { /** * The affected tile. diff --git a/runelite-api/src/main/java/net/runelite/api/events/GameObjectSpawned.java b/runelite-api/src/main/java/net/runelite/api/events/GameObjectSpawned.java index 5dfc301066..78ded8655c 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/GameObjectSpawned.java +++ b/runelite-api/src/main/java/net/runelite/api/events/GameObjectSpawned.java @@ -32,7 +32,7 @@ import lombok.Data; * An event where a {@link GameObject} is added to a {@link Tile}. */ @Data -public class GameObjectSpawned +public class GameObjectSpawned implements Event { /** * The affected tile. diff --git a/runelite-api/src/main/java/net/runelite/api/events/GameStateChanged.java b/runelite-api/src/main/java/net/runelite/api/events/GameStateChanged.java index 2a0b61fc40..eb9612211c 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/GameStateChanged.java +++ b/runelite-api/src/main/java/net/runelite/api/events/GameStateChanged.java @@ -31,7 +31,7 @@ import lombok.Data; * An event where the clients game state has changed. */ @Data -public class GameStateChanged +public class GameStateChanged implements Event { /** * The new game state. diff --git a/runelite-api/src/main/java/net/runelite/api/events/GameTick.java b/runelite-api/src/main/java/net/runelite/api/events/GameTick.java index 2bf035633d..5e8046c3e8 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/GameTick.java +++ b/runelite-api/src/main/java/net/runelite/api/events/GameTick.java @@ -41,7 +41,7 @@ package net.runelite.api.events; * Note that occurrences that take place purely on the client, such as right * click menus, are independent of the game tick. */ -public class GameTick +public class GameTick implements Event { public static final GameTick INSTANCE = new GameTick(); diff --git a/runelite-api/src/main/java/net/runelite/api/events/GrandExchangeOfferChanged.java b/runelite-api/src/main/java/net/runelite/api/events/GrandExchangeOfferChanged.java index 88e4aa1fac..52ae0e6d92 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/GrandExchangeOfferChanged.java +++ b/runelite-api/src/main/java/net/runelite/api/events/GrandExchangeOfferChanged.java @@ -41,7 +41,7 @@ import lombok.Data; * can change into. */ @Data -public class GrandExchangeOfferChanged +public class GrandExchangeOfferChanged implements Event { /** * The offer that has been modified. diff --git a/runelite-api/src/main/java/net/runelite/api/events/GraphicsObjectCreated.java b/runelite-api/src/main/java/net/runelite/api/events/GraphicsObjectCreated.java index f2cc4f35a9..333e390592 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/GraphicsObjectCreated.java +++ b/runelite-api/src/main/java/net/runelite/api/events/GraphicsObjectCreated.java @@ -31,7 +31,7 @@ import lombok.Value; * An event where a new {@link GraphicsObject} has been created. */ @Value -public class GraphicsObjectCreated +public class GraphicsObjectCreated implements Event { /** * The newly created graphics object. diff --git a/runelite-api/src/main/java/net/runelite/api/events/GroundObjectChanged.java b/runelite-api/src/main/java/net/runelite/api/events/GroundObjectChanged.java index 8fa97ae503..c58b46575d 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/GroundObjectChanged.java +++ b/runelite-api/src/main/java/net/runelite/api/events/GroundObjectChanged.java @@ -32,7 +32,7 @@ import lombok.Data; * An event where the {@link GroundObject} on a {@link Tile} has been changed. */ @Data -public class GroundObjectChanged +public class GroundObjectChanged implements Event { /** * The affected tile. diff --git a/runelite-api/src/main/java/net/runelite/api/events/GroundObjectDespawned.java b/runelite-api/src/main/java/net/runelite/api/events/GroundObjectDespawned.java index 54bb6dfbe0..6e793f025e 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/GroundObjectDespawned.java +++ b/runelite-api/src/main/java/net/runelite/api/events/GroundObjectDespawned.java @@ -32,7 +32,7 @@ import lombok.Data; * An event where a {@link GroundObject} on a {@link Tile} has been removed. */ @Data -public class GroundObjectDespawned +public class GroundObjectDespawned implements Event { /** * The affected tile. diff --git a/runelite-api/src/main/java/net/runelite/api/events/GroundObjectSpawned.java b/runelite-api/src/main/java/net/runelite/api/events/GroundObjectSpawned.java index af1f15ab6f..2ccce09136 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/GroundObjectSpawned.java +++ b/runelite-api/src/main/java/net/runelite/api/events/GroundObjectSpawned.java @@ -32,7 +32,7 @@ import lombok.Data; * An event where a {@link GroundObject} is added to a {@link Tile}. */ @Data -public class GroundObjectSpawned +public class GroundObjectSpawned implements Event { /** * The affected tile. diff --git a/runelite-api/src/main/java/net/runelite/api/events/HitsplatApplied.java b/runelite-api/src/main/java/net/runelite/api/events/HitsplatApplied.java index f96a0f08d7..d8b22ee2bc 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/HitsplatApplied.java +++ b/runelite-api/src/main/java/net/runelite/api/events/HitsplatApplied.java @@ -36,7 +36,7 @@ import lombok.Data; * visible hitsplats. */ @Data -public class HitsplatApplied +public class HitsplatApplied implements Event { /** * The actor the hitsplat was applied to. diff --git a/runelite-api/src/main/java/net/runelite/api/events/InteractChanged.java b/runelite-api/src/main/java/net/runelite/api/events/InteractChanged.java index fcd2e54a43..1e08180b88 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/InteractChanged.java +++ b/runelite-api/src/main/java/net/runelite/api/events/InteractChanged.java @@ -28,7 +28,7 @@ import net.runelite.api.Actor; import lombok.Data; @Data -public class InteractChanged +public class InteractChanged implements Event { private Actor actor; } diff --git a/runelite-api/src/main/java/net/runelite/api/events/InteractingChanged.java b/runelite-api/src/main/java/net/runelite/api/events/InteractingChanged.java index c76abd349f..722e2251eb 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/InteractingChanged.java +++ b/runelite-api/src/main/java/net/runelite/api/events/InteractingChanged.java @@ -7,7 +7,7 @@ import lombok.Value; * An event called when the actor an actor is interacting with changes */ @Value -public class InteractingChanged +public class InteractingChanged implements Event { private final Actor source; diff --git a/runelite-api/src/main/java/net/runelite/api/events/ItemContainerChanged.java b/runelite-api/src/main/java/net/runelite/api/events/ItemContainerChanged.java index 1b0a80fa4e..c9fed24aa9 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/ItemContainerChanged.java +++ b/runelite-api/src/main/java/net/runelite/api/events/ItemContainerChanged.java @@ -39,7 +39,7 @@ import lombok.Value; * */ @Value -public class ItemContainerChanged +public class ItemContainerChanged implements Event { /** * The modified container's ID. diff --git a/runelite-api/src/main/java/net/runelite/api/events/ItemDespawned.java b/runelite-api/src/main/java/net/runelite/api/events/ItemDespawned.java index 04016fe60a..cad55dd472 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/ItemDespawned.java +++ b/runelite-api/src/main/java/net/runelite/api/events/ItemDespawned.java @@ -34,7 +34,7 @@ import lombok.Value; * all item piles are implicitly despawned, and despawn events will not be sent. */ @Value -public class ItemDespawned +public class ItemDespawned implements Event { private final Tile tile; private final TileItem item; diff --git a/runelite-api/src/main/java/net/runelite/api/events/ItemQuantityChanged.java b/runelite-api/src/main/java/net/runelite/api/events/ItemQuantityChanged.java index ec8bde0c5c..0408bceb64 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/ItemQuantityChanged.java +++ b/runelite-api/src/main/java/net/runelite/api/events/ItemQuantityChanged.java @@ -33,7 +33,7 @@ import lombok.Value; * Called when the quantity of an item pile changes. */ @Value -public class ItemQuantityChanged +public class ItemQuantityChanged implements Event { private final TileItem item; private final Tile tile; diff --git a/runelite-api/src/main/java/net/runelite/api/events/ItemSpawned.java b/runelite-api/src/main/java/net/runelite/api/events/ItemSpawned.java index 39a183e2d2..28314d4afd 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/ItemSpawned.java +++ b/runelite-api/src/main/java/net/runelite/api/events/ItemSpawned.java @@ -34,7 +34,7 @@ import lombok.Value; * all item piles are implicitly reset and a new spawn event will be sent. */ @Value -public class ItemSpawned +public class ItemSpawned implements Event { private final Tile tile; private final TileItem item; diff --git a/runelite-api/src/main/java/net/runelite/api/events/LocalPlayerDeath.java b/runelite-api/src/main/java/net/runelite/api/events/LocalPlayerDeath.java index 0cf8f33c76..6b22cf1784 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/LocalPlayerDeath.java +++ b/runelite-api/src/main/java/net/runelite/api/events/LocalPlayerDeath.java @@ -27,7 +27,7 @@ package net.runelite.api.events; /** * An event when the local player dies. */ -public class LocalPlayerDeath +public class LocalPlayerDeath implements Event { public static final LocalPlayerDeath INSTANCE = new LocalPlayerDeath(); diff --git a/runelite-api/src/main/java/net/runelite/api/events/MenuEntryAdded.java b/runelite-api/src/main/java/net/runelite/api/events/MenuEntryAdded.java index 37f73ec792..733d36e7d1 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/MenuEntryAdded.java +++ b/runelite-api/src/main/java/net/runelite/api/events/MenuEntryAdded.java @@ -33,7 +33,7 @@ import net.runelite.api.MenuEntry; */ @Data @AllArgsConstructor -public class MenuEntryAdded +public class MenuEntryAdded implements Event { /** * The MenuEntry object that was actually added diff --git a/runelite-api/src/main/java/net/runelite/api/events/MenuOpened.java b/runelite-api/src/main/java/net/runelite/api/events/MenuOpened.java index 3a7b04c287..bd05ba5ee8 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/MenuOpened.java +++ b/runelite-api/src/main/java/net/runelite/api/events/MenuOpened.java @@ -31,7 +31,7 @@ import lombok.Data; * An event where a menu has been opened. */ @Data -public class MenuOpened +public class MenuOpened implements Event { /** * The menu entries in the newly opened menu. diff --git a/runelite-api/src/main/java/net/runelite/api/events/MenuOptionClicked.java b/runelite-api/src/main/java/net/runelite/api/events/MenuOptionClicked.java index 848beb4b84..b3746be9e9 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/MenuOptionClicked.java +++ b/runelite-api/src/main/java/net/runelite/api/events/MenuOptionClicked.java @@ -42,7 +42,7 @@ import net.runelite.api.MenuEntry; * it seems that this event still triggers with the "Cancel" action. */ @Data -public class MenuOptionClicked +public class MenuOptionClicked implements Event { public MenuOptionClicked(MenuEntry entry) { diff --git a/runelite-api/src/main/java/net/runelite/api/events/MenuShouldLeftClick.java b/runelite-api/src/main/java/net/runelite/api/events/MenuShouldLeftClick.java index c36372ff2c..9652721791 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/MenuShouldLeftClick.java +++ b/runelite-api/src/main/java/net/runelite/api/events/MenuShouldLeftClick.java @@ -31,7 +31,7 @@ import lombok.Data; * opened on left click. */ @Data -public class MenuShouldLeftClick +public class MenuShouldLeftClick implements Event { /** * If set to true, the menu will open on left click. diff --git a/runelite-api/src/main/java/net/runelite/api/events/NameableNameChanged.java b/runelite-api/src/main/java/net/runelite/api/events/NameableNameChanged.java index afcc43973d..111b050733 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/NameableNameChanged.java +++ b/runelite-api/src/main/java/net/runelite/api/events/NameableNameChanged.java @@ -31,7 +31,7 @@ import lombok.Value; * An event where a {@link Nameable} has had their name changed. */ @Value -public class NameableNameChanged +public class NameableNameChanged implements Event { /** * The nameable that changed names. diff --git a/runelite-api/src/main/java/net/runelite/api/events/NpcActionChanged.java b/runelite-api/src/main/java/net/runelite/api/events/NpcActionChanged.java index 35838e067c..76e1a0d973 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/NpcActionChanged.java +++ b/runelite-api/src/main/java/net/runelite/api/events/NpcActionChanged.java @@ -31,7 +31,7 @@ import net.runelite.api.NPCDefinition; * An event where an action of an {@link NPCDefinition} has changed. */ @Data -public class NpcActionChanged +public class NpcActionChanged implements Event { /** * The NPC composition that has been changed. diff --git a/runelite-api/src/main/java/net/runelite/api/events/NpcDefinitionChanged.java b/runelite-api/src/main/java/net/runelite/api/events/NpcDefinitionChanged.java index 7d9569f5bd..40c68f5621 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/NpcDefinitionChanged.java +++ b/runelite-api/src/main/java/net/runelite/api/events/NpcDefinitionChanged.java @@ -31,7 +31,7 @@ import net.runelite.api.NPC; * Fires after the composition of an {@link NPC} changes. */ @Value -public class NpcDefinitionChanged +public class NpcDefinitionChanged implements Event { /** * The NPC of which the composition changed. diff --git a/runelite-api/src/main/java/net/runelite/api/events/NpcDespawned.java b/runelite-api/src/main/java/net/runelite/api/events/NpcDespawned.java index f1bc72344f..225141fc89 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/NpcDespawned.java +++ b/runelite-api/src/main/java/net/runelite/api/events/NpcDespawned.java @@ -32,7 +32,7 @@ import lombok.Value; * An event where an {@link NPC} has despawned. */ @Value -public class NpcDespawned +public class NpcDespawned implements Event { /** * The despawned NPC. diff --git a/runelite-api/src/main/java/net/runelite/api/events/NpcSpawned.java b/runelite-api/src/main/java/net/runelite/api/events/NpcSpawned.java index 911d3780c1..6120968c4c 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/NpcSpawned.java +++ b/runelite-api/src/main/java/net/runelite/api/events/NpcSpawned.java @@ -32,7 +32,7 @@ import lombok.Value; * An event where an {@link NPC} has spawned. */ @Value -public class NpcSpawned +public class NpcSpawned implements Event { /** * The spawned NPC. diff --git a/runelite-api/src/main/java/net/runelite/api/events/OverheadTextChanged.java b/runelite-api/src/main/java/net/runelite/api/events/OverheadTextChanged.java index a8a22730fd..0ebbc4f21e 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/OverheadTextChanged.java +++ b/runelite-api/src/main/java/net/runelite/api/events/OverheadTextChanged.java @@ -4,7 +4,7 @@ import net.runelite.api.Actor; import lombok.Value; @Value -public class OverheadTextChanged +public class OverheadTextChanged implements Event { private final Actor actor; diff --git a/runelite-api/src/main/java/net/runelite/api/events/PlayerDespawned.java b/runelite-api/src/main/java/net/runelite/api/events/PlayerDespawned.java index 7094f3bd1a..025c362d1a 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/PlayerDespawned.java +++ b/runelite-api/src/main/java/net/runelite/api/events/PlayerDespawned.java @@ -34,7 +34,7 @@ import lombok.Value; * Note: This event does not get called for the local player. */ @Value -public class PlayerDespawned +public class PlayerDespawned implements Event { /** * The despawned player. diff --git a/runelite-api/src/main/java/net/runelite/api/events/PlayerMenuOptionClicked.java b/runelite-api/src/main/java/net/runelite/api/events/PlayerMenuOptionClicked.java index dcfb0421ca..14a85b6025 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/PlayerMenuOptionClicked.java +++ b/runelite-api/src/main/java/net/runelite/api/events/PlayerMenuOptionClicked.java @@ -31,7 +31,7 @@ import lombok.Data; * been clicked (ie. HiScore Lookup). */ @Data -public class PlayerMenuOptionClicked +public class PlayerMenuOptionClicked implements Event { /** * The menu option clicked. diff --git a/runelite-api/src/main/java/net/runelite/api/events/PlayerMenuOptionsChanged.java b/runelite-api/src/main/java/net/runelite/api/events/PlayerMenuOptionsChanged.java index d33aa4d06c..a75af8acf3 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/PlayerMenuOptionsChanged.java +++ b/runelite-api/src/main/java/net/runelite/api/events/PlayerMenuOptionsChanged.java @@ -27,7 +27,7 @@ package net.runelite.api.events; import lombok.Data; @Data -public class PlayerMenuOptionsChanged +public class PlayerMenuOptionsChanged implements Event { /** * Index in playerOptions which changed. diff --git a/runelite-api/src/main/java/net/runelite/api/events/PlayerSpawned.java b/runelite-api/src/main/java/net/runelite/api/events/PlayerSpawned.java index 31cc16a9c0..7b836754f5 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/PlayerSpawned.java +++ b/runelite-api/src/main/java/net/runelite/api/events/PlayerSpawned.java @@ -32,7 +32,7 @@ import lombok.Value; * An event where a {@link Player} has spawned. */ @Value -public class PlayerSpawned +public class PlayerSpawned implements Event { /** * The spawned player. diff --git a/runelite-api/src/main/java/net/runelite/api/events/PostHealthBar.java b/runelite-api/src/main/java/net/runelite/api/events/PostHealthBar.java index c8896ff945..1f327ec13a 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/PostHealthBar.java +++ b/runelite-api/src/main/java/net/runelite/api/events/PostHealthBar.java @@ -28,7 +28,7 @@ import net.runelite.api.HealthBar; import lombok.Data; @Data -public class PostHealthBar +public class PostHealthBar implements Event { private HealthBar healthBar; } diff --git a/runelite-api/src/main/java/net/runelite/api/events/PostItemDefinition.java b/runelite-api/src/main/java/net/runelite/api/events/PostItemDefinition.java index 35718b5ea9..c21c9e1fa6 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/PostItemDefinition.java +++ b/runelite-api/src/main/java/net/runelite/api/events/PostItemDefinition.java @@ -32,7 +32,7 @@ import net.runelite.api.ItemDefinition; * its data is initialized. */ @Data -public class PostItemDefinition +public class PostItemDefinition implements Event { /** * The newly created item. diff --git a/runelite-api/src/main/java/net/runelite/api/events/ProjectileMoved.java b/runelite-api/src/main/java/net/runelite/api/events/ProjectileMoved.java index 70d73d7026..82590778be 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/ProjectileMoved.java +++ b/runelite-api/src/main/java/net/runelite/api/events/ProjectileMoved.java @@ -35,7 +35,7 @@ import lombok.Data; * once (ie. AoE from Lizardman Shaman). */ @Data -public class ProjectileMoved +public class ProjectileMoved implements Event { /** * The projectile being moved. diff --git a/runelite-api/src/main/java/net/runelite/api/events/ProjectileSpawned.java b/runelite-api/src/main/java/net/runelite/api/events/ProjectileSpawned.java index f5ba810a5f..223e1cc579 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/ProjectileSpawned.java +++ b/runelite-api/src/main/java/net/runelite/api/events/ProjectileSpawned.java @@ -32,7 +32,7 @@ import lombok.Data; * An event called whenever a {@link Projectile} has spawned. */ @Data -public class ProjectileSpawned +public class ProjectileSpawned implements Event { /** * The spawned projectile. diff --git a/runelite-api/src/main/java/net/runelite/api/events/ResizeableChanged.java b/runelite-api/src/main/java/net/runelite/api/events/ResizeableChanged.java index 146f92ac38..ecc5c0d380 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/ResizeableChanged.java +++ b/runelite-api/src/main/java/net/runelite/api/events/ResizeableChanged.java @@ -32,7 +32,7 @@ import lombok.Data; * An event where the game has changed from fixed to resizable mode or vice versa. */ @Data -public class ResizeableChanged +public class ResizeableChanged implements Event { /** * Whether the game is in resizable mode. diff --git a/runelite-api/src/main/java/net/runelite/api/events/ScriptCallbackEvent.java b/runelite-api/src/main/java/net/runelite/api/events/ScriptCallbackEvent.java index 0c1bdd5ee9..601ebb97fa 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/ScriptCallbackEvent.java +++ b/runelite-api/src/main/java/net/runelite/api/events/ScriptCallbackEvent.java @@ -31,7 +31,7 @@ import lombok.Data; * A callback from a runelite_callback opcode in a cs2 */ @Data -public class ScriptCallbackEvent +public class ScriptCallbackEvent implements Event { /** * The script being called. diff --git a/runelite-api/src/main/java/net/runelite/api/events/SoundEffectPlayed.java b/runelite-api/src/main/java/net/runelite/api/events/SoundEffectPlayed.java index 127a9a2646..640a5f1282 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/SoundEffectPlayed.java +++ b/runelite-api/src/main/java/net/runelite/api/events/SoundEffectPlayed.java @@ -27,7 +27,7 @@ package net.runelite.api.events; import lombok.Data; @Data -public class SoundEffectPlayed +public class SoundEffectPlayed implements Event { private int soundId; private int delay; diff --git a/runelite-api/src/main/java/net/runelite/api/events/SpotAnimationChanged.java b/runelite-api/src/main/java/net/runelite/api/events/SpotAnimationChanged.java index 79b8643d2c..ce7ea97397 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/SpotAnimationChanged.java +++ b/runelite-api/src/main/java/net/runelite/api/events/SpotAnimationChanged.java @@ -19,7 +19,7 @@ import net.runelite.api.Actor; * @see net.runelite.api.GraphicID */ @Data -public class SpotAnimationChanged +public class SpotAnimationChanged implements Event { /** * The actor that has had their graphic changed. diff --git a/runelite-api/src/main/java/net/runelite/api/events/UsernameChanged.java b/runelite-api/src/main/java/net/runelite/api/events/UsernameChanged.java index 3dea001150..802df61b63 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/UsernameChanged.java +++ b/runelite-api/src/main/java/net/runelite/api/events/UsernameChanged.java @@ -30,7 +30,7 @@ package net.runelite.api.events; * This event triggers for every character change to the username * in the login screen. */ -public class UsernameChanged +public class UsernameChanged implements Event { public static final UsernameChanged INSTANCE = new UsernameChanged(); diff --git a/runelite-api/src/main/java/net/runelite/api/events/VarClientIntChanged.java b/runelite-api/src/main/java/net/runelite/api/events/VarClientIntChanged.java index 82c2c404d4..9aece80003 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/VarClientIntChanged.java +++ b/runelite-api/src/main/java/net/runelite/api/events/VarClientIntChanged.java @@ -31,7 +31,7 @@ import lombok.Value; * An event where a varbit integer has changed. */ @Value -public class VarClientIntChanged +public class VarClientIntChanged implements Event { private int index; } diff --git a/runelite-api/src/main/java/net/runelite/api/events/VarClientStrChanged.java b/runelite-api/src/main/java/net/runelite/api/events/VarClientStrChanged.java index e1d7da6ffa..1e109e66df 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/VarClientStrChanged.java +++ b/runelite-api/src/main/java/net/runelite/api/events/VarClientStrChanged.java @@ -31,7 +31,7 @@ import lombok.Value; * An event where a varbit string has changed. */ @Value -public class VarClientStrChanged +public class VarClientStrChanged implements Event { private int index; } diff --git a/runelite-api/src/main/java/net/runelite/api/events/VarbitChanged.java b/runelite-api/src/main/java/net/runelite/api/events/VarbitChanged.java index 9680e54ac4..ebadd78f59 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/VarbitChanged.java +++ b/runelite-api/src/main/java/net/runelite/api/events/VarbitChanged.java @@ -32,7 +32,7 @@ import lombok.Data; * An event when a varbit or varplayer has changed. */ @Data -public class VarbitChanged +public class VarbitChanged implements Event { /** * Index in the varp array that was changed. diff --git a/runelite-api/src/main/java/net/runelite/api/events/WallObjectChanged.java b/runelite-api/src/main/java/net/runelite/api/events/WallObjectChanged.java index bea7686602..6cf5fd8f25 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/WallObjectChanged.java +++ b/runelite-api/src/main/java/net/runelite/api/events/WallObjectChanged.java @@ -32,7 +32,7 @@ import lombok.Data; * An event where the {@link WallObject} of a {@link Tile} has been changed. */ @Data -public class WallObjectChanged +public class WallObjectChanged implements Event { /** * The affected tile. diff --git a/runelite-api/src/main/java/net/runelite/api/events/WallObjectDespawned.java b/runelite-api/src/main/java/net/runelite/api/events/WallObjectDespawned.java index 6ac609a46f..8a510a7bae 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/WallObjectDespawned.java +++ b/runelite-api/src/main/java/net/runelite/api/events/WallObjectDespawned.java @@ -32,7 +32,7 @@ import lombok.Data; * An event where a {@link WallObject} on a {@link Tile} has been removed. */ @Data -public class WallObjectDespawned +public class WallObjectDespawned implements Event { /** * The affected tile. diff --git a/runelite-api/src/main/java/net/runelite/api/events/WallObjectSpawned.java b/runelite-api/src/main/java/net/runelite/api/events/WallObjectSpawned.java index dc22e07f7d..a1da8542a4 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/WallObjectSpawned.java +++ b/runelite-api/src/main/java/net/runelite/api/events/WallObjectSpawned.java @@ -32,7 +32,7 @@ import lombok.Data; * An event where a {@link WallObject} is added to a {@link Tile}. */ @Data -public class WallObjectSpawned +public class WallObjectSpawned implements Event { /** * The affected tile. diff --git a/runelite-api/src/main/java/net/runelite/api/events/WidgetHiddenChanged.java b/runelite-api/src/main/java/net/runelite/api/events/WidgetHiddenChanged.java index 2cf434faa4..578adbe296 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/WidgetHiddenChanged.java +++ b/runelite-api/src/main/java/net/runelite/api/events/WidgetHiddenChanged.java @@ -31,7 +31,7 @@ import lombok.Data; * An event where the hidden state of a {@link Widget} has been modified. */ @Data -public class WidgetHiddenChanged +public class WidgetHiddenChanged implements Event { /** * The affected widget. diff --git a/runelite-api/src/main/java/net/runelite/api/events/WidgetLoaded.java b/runelite-api/src/main/java/net/runelite/api/events/WidgetLoaded.java index c71bc41634..5f337603d1 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/WidgetLoaded.java +++ b/runelite-api/src/main/java/net/runelite/api/events/WidgetLoaded.java @@ -30,7 +30,7 @@ import lombok.Data; * An event where a {@link net.runelite.api.widgets.Widget} has been loaded. */ @Data -public class WidgetLoaded +public class WidgetLoaded implements Event { /** * The group ID of the loaded widget. diff --git a/runelite-api/src/main/java/net/runelite/api/events/WidgetMenuOptionClicked.java b/runelite-api/src/main/java/net/runelite/api/events/WidgetMenuOptionClicked.java index 6945e88790..0a9270b6a5 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/WidgetMenuOptionClicked.java +++ b/runelite-api/src/main/java/net/runelite/api/events/WidgetMenuOptionClicked.java @@ -31,7 +31,7 @@ import lombok.Data; * An event where an option has been clicked in a {@link net.runelite.api.widgets.Widget}s menu. */ @Data -public class WidgetMenuOptionClicked +public class WidgetMenuOptionClicked implements Event { /** * The clicked menu option. diff --git a/runelite-api/src/main/java/net/runelite/api/events/WidgetPositioned.java b/runelite-api/src/main/java/net/runelite/api/events/WidgetPositioned.java index 6f58e9fe07..4835db0aa4 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/WidgetPositioned.java +++ b/runelite-api/src/main/java/net/runelite/api/events/WidgetPositioned.java @@ -28,7 +28,7 @@ package net.runelite.api.events; * An event where the position of a {@link net.runelite.api.widgets.Widget} * relative to its parent has changed. */ -public class WidgetPositioned +public class WidgetPositioned implements Event { public static final WidgetPositioned INSTANCE = new WidgetPositioned(); diff --git a/runelite-api/src/main/java/net/runelite/api/events/WidgetPressed.java b/runelite-api/src/main/java/net/runelite/api/events/WidgetPressed.java index 12ee089c80..0b90d14563 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/WidgetPressed.java +++ b/runelite-api/src/main/java/net/runelite/api/events/WidgetPressed.java @@ -31,7 +31,7 @@ import lombok.Data; * An event where a draggable widget has been pressed. */ @Data -public class WidgetPressed +public class WidgetPressed implements Event { public static final WidgetPressed INSTANCE = new WidgetPressed(); diff --git a/runelite-api/src/main/java/net/runelite/api/events/WorldListLoad.java b/runelite-api/src/main/java/net/runelite/api/events/WorldListLoad.java index 67fa28797e..9484e5193f 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/WorldListLoad.java +++ b/runelite-api/src/main/java/net/runelite/api/events/WorldListLoad.java @@ -31,7 +31,7 @@ import lombok.Value; * Event when the world list is loaded for the world switcher */ @Value -public class WorldListLoad +public class WorldListLoad implements Event { private final World[] worlds; } diff --git a/runelite-api/src/main/java/net/runelite/api/hooks/Callbacks.java b/runelite-api/src/main/java/net/runelite/api/hooks/Callbacks.java index 861ecf1196..ef121b3ebe 100644 --- a/runelite-api/src/main/java/net/runelite/api/hooks/Callbacks.java +++ b/runelite-api/src/main/java/net/runelite/api/hooks/Callbacks.java @@ -25,6 +25,7 @@ package net.runelite.api.hooks; import net.runelite.api.MainBufferProvider; +import net.runelite.api.events.Event; import net.runelite.api.widgets.WidgetItem; import java.awt.Graphics; import java.awt.event.KeyEvent; @@ -41,14 +42,14 @@ public interface Callbacks * * @param event the event */ - void post(Class eventClass, Object event); + void post(Class eventClass, Event event); /** * Post a deferred event, which gets delayed until the next cycle. * * @param event the event */ - void postDeferred(Class eventClass, Object event); + void postDeferred(Class eventClass, Event event); /** * Called each client cycle. diff --git a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java index b134b2df0f..64a22743c6 100644 --- a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java +++ b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java @@ -1127,5 +1127,7 @@ public class WidgetID static class SeedVault { static final int TITLE_CONTAINER = 2; + static final int ITEM_CONTAINER = 15; + static final int ITEM_TEXT = 16; } } diff --git a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java index 55ad634155..cccb043833 100644 --- a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java +++ b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java @@ -752,7 +752,9 @@ public enum WidgetInfo ITEMS_LOST_VALUE(WidgetID.ITEMS_KEPT_ON_DEATH_GROUP_ID, WidgetID.KeptOnDeath.LOST_ITEMS_VALUE), ITEMS_KEPT_MAX(WidgetID.ITEMS_KEPT_ON_DEATH_GROUP_ID, WidgetID.KeptOnDeath.MAX_ITEMS_KEPT_ON_DEATH), - SEED_VAULT_TITLE_CONTAINER(WidgetID.SEED_VAULT_GROUP_ID, WidgetID.SeedVault.TITLE_CONTAINER); + SEED_VAULT_TITLE_CONTAINER(WidgetID.SEED_VAULT_GROUP_ID, WidgetID.SeedVault.TITLE_CONTAINER), + SEED_VAULT_ITEM_CONTAINER(WidgetID.SEED_VAULT_GROUP_ID, WidgetID.SeedVault.ITEM_CONTAINER), + SEED_VAULT_ITEM_TEXT(WidgetID.SEED_VAULT_GROUP_ID, WidgetID.SeedVault.ITEM_TEXT); private final int groupId; private final int childId; diff --git a/runelite-client/build.gradle b/runelite-client/build.gradle index 02fa592477..9d2d067d91 100644 --- a/runelite-client/build.gradle +++ b/runelite-client/build.gradle @@ -45,7 +45,7 @@ dependencies { runtime group: 'org.jogamp.gluegen', name: 'gluegen-rt', version: '2.3.2', classifier: 'natives-linux-amd64' runtime group: 'org.jogamp.gluegen', name: 'gluegen-rt', version: '2.3.2', classifier: 'natives-linux-i586' runtime project(':runescape-api') - runtime project(':injected-client') + runtimeOnly files("${injectedClassesPath}") testImplementation group: 'junit', name: 'junit', version: '4.12' testImplementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.26' testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '2.1' @@ -72,6 +72,8 @@ jar { } shadowJar { + dependsOn ':injected-client:injector' + archiveClassifier.set("shaded") exclude("net/runelite/injector/**") diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/aoewarnings/AoeProjectile.java b/runelite-client/src/main/java/net/runelite/client/ClassPreloader.java similarity index 63% rename from runelite-client/src/main/java/net/runelite/client/plugins/aoewarnings/AoeProjectile.java rename to runelite-client/src/main/java/net/runelite/client/ClassPreloader.java index f875cae629..227e8f3978 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/aoewarnings/AoeProjectile.java +++ b/runelite-client/src/main/java/net/runelite/client/ClassPreloader.java @@ -1,10 +1,7 @@ /* - * Copyright (c) 2017, Adam + * Copyright (c) 2019 Abex * All rights reserved. * - * - * Modified by farhan1666 - * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * @@ -25,21 +22,27 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.client.plugins.aoewarnings; +package net.runelite.client; -import java.time.Instant; -import lombok.AccessLevel; -import lombok.AllArgsConstructor; -import lombok.Getter; -import net.runelite.api.coords.LocalPoint; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import net.runelite.client.ui.FontManager; -@Getter(AccessLevel.PACKAGE) -@AllArgsConstructor -class AoeProjectile +/** + * Loads some slow to initialize classes (hopefully) before they are needed to streamline client startup + */ +@SuppressWarnings({"ResultOfMethodCallIgnored", "unused"}) +class ClassPreloader { - private final Instant startTime; - private final LocalPoint targetPoint; - private final AoeProjectileInfo aoeProjectileInfo; - private final int projectileLifetime; - private final int finalTick; -} \ No newline at end of file + static void preload() + { + // This needs to enumerate the system fonts for some reason, and that takes a while + FontManager.getRunescapeSmallFont(); + + // This needs to load a timezone database that is mildly large + ZoneId.of("Europe/London"); + + // This just needs to call 20 different DateTimeFormatter constructors, which are slow + Object unused = DateTimeFormatter.BASIC_ISO_DATE; + } +} 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 1ca25a1a4d..b0595c1e19 100644 --- a/runelite-client/src/main/java/net/runelite/client/RuneLite.java +++ b/runelite-client/src/main/java/net/runelite/client/RuneLite.java @@ -58,7 +58,6 @@ import net.runelite.client.game.chatbox.ChatboxPanelManager; import net.runelite.client.graphics.ModelOutlineRenderer; import net.runelite.client.menus.MenuManager; import net.runelite.client.plugins.PluginManager; -import net.runelite.client.rs.ClientLoader; import net.runelite.client.rs.ClientUpdateCheckMode; import net.runelite.client.task.Scheduler; import net.runelite.client.ui.ClientUI; @@ -80,7 +79,7 @@ import org.slf4j.LoggerFactory; @Slf4j public class RuneLite { - public static final String PLUS_VERSION = "2.1.0.0"; + public static final String PLUS_VERSION = "2.1.1.0"; public static final File RUNELITE_DIR = new File(System.getProperty("user.home"), ".runelite"); public static final File PROFILES_DIR = new File(RUNELITE_DIR, "profiles"); public static final File PLUGIN_DIR = new File(RUNELITE_DIR, "plugins"); @@ -179,8 +178,6 @@ public class RuneLite parser.accepts("developer-mode", "Enable developer tools"); parser.accepts("debug", "Show extra debugging output"); parser.accepts("no-splash", "Do not show the splash screen"); - parser.accepts("local-injected", "Use local injected-client"); - parser.accepts("private-server", "Use a custom codebase"); final ArgumentAcceptingOptionSpec proxyInfo = parser .accepts("proxy") @@ -259,16 +256,6 @@ public class RuneLite logger.setLevel(Level.DEBUG); } - if (options.has("local-injected")) - { - ClientLoader.useLocalInjected = true; - } - - if (options.has("private-server")) - { - allowPrivateServer = true; - } - Thread.setDefaultUncaughtExceptionHandler((thread, throwable) -> { log.error("Uncaught exception:", throwable); @@ -378,6 +365,8 @@ public class RuneLite // Start plugins pluginManager.startCorePlugins(); + discordService.init(); + // Register additional schedulers if (this.client != null) { diff --git a/runelite-client/src/main/java/net/runelite/client/callback/Hooks.java b/runelite-client/src/main/java/net/runelite/client/callback/Hooks.java index 93c3927554..9cbc2c60c6 100644 --- a/runelite-client/src/main/java/net/runelite/client/callback/Hooks.java +++ b/runelite-client/src/main/java/net/runelite/client/callback/Hooks.java @@ -50,6 +50,7 @@ import net.runelite.api.Renderable; import net.runelite.api.WorldMapManager; import net.runelite.api.events.BeforeMenuRender; import net.runelite.api.events.BeforeRender; +import net.runelite.api.events.Event; import net.runelite.api.events.GameTick; import net.runelite.api.hooks.Callbacks; import net.runelite.api.hooks.DrawCallbacks; @@ -128,13 +129,13 @@ public class Hooks implements Callbacks private boolean shouldProcessGameTick; @Override - public void post(Class eventClass, Object event) + public void post(Class eventClass, Event event) { eventBus.post(eventClass, event); } @Override - public void postDeferred(Class eventClass, Object event) + public void postDeferred(Class eventClass, Event event) { deferredEventBus.post(eventClass, event); } diff --git a/runelite-client/src/main/java/net/runelite/client/discord/events/DiscordDisconnected.java b/runelite-client/src/main/java/net/runelite/client/discord/events/DiscordDisconnected.java index cc4d110a70..5d1d85df1c 100644 --- a/runelite-client/src/main/java/net/runelite/client/discord/events/DiscordDisconnected.java +++ b/runelite-client/src/main/java/net/runelite/client/discord/events/DiscordDisconnected.java @@ -25,12 +25,13 @@ package net.runelite.client.discord.events; import lombok.Value; +import net.runelite.api.events.Event; /** * Called when the RPC connection has been severed */ @Value -public class DiscordDisconnected +public class DiscordDisconnected implements Event { /** * Discord error code diff --git a/runelite-client/src/main/java/net/runelite/client/discord/events/DiscordErrored.java b/runelite-client/src/main/java/net/runelite/client/discord/events/DiscordErrored.java index 3c50464dbd..82a80dd8e0 100644 --- a/runelite-client/src/main/java/net/runelite/client/discord/events/DiscordErrored.java +++ b/runelite-client/src/main/java/net/runelite/client/discord/events/DiscordErrored.java @@ -25,12 +25,13 @@ package net.runelite.client.discord.events; import lombok.Value; +import net.runelite.api.events.Event; /** * Called when an internal error is caught within the SDK */ @Value -public class DiscordErrored +public class DiscordErrored implements Event { /** * Discord error code. diff --git a/runelite-client/src/main/java/net/runelite/client/discord/events/DiscordJoinGame.java b/runelite-client/src/main/java/net/runelite/client/discord/events/DiscordJoinGame.java index a9d9421f8a..021e1d1b5e 100644 --- a/runelite-client/src/main/java/net/runelite/client/discord/events/DiscordJoinGame.java +++ b/runelite-client/src/main/java/net/runelite/client/discord/events/DiscordJoinGame.java @@ -25,12 +25,13 @@ package net.runelite.client.discord.events; import lombok.Value; +import net.runelite.api.events.Event; /** * Called when the logged in user joined a game */ @Value -public class DiscordJoinGame +public class DiscordJoinGame implements Event { /** * Obfuscated data of your choosing used as join secret diff --git a/runelite-client/src/main/java/net/runelite/client/discord/events/DiscordJoinRequest.java b/runelite-client/src/main/java/net/runelite/client/discord/events/DiscordJoinRequest.java index 1b71368ac7..97b720894f 100644 --- a/runelite-client/src/main/java/net/runelite/client/discord/events/DiscordJoinRequest.java +++ b/runelite-client/src/main/java/net/runelite/client/discord/events/DiscordJoinRequest.java @@ -25,12 +25,13 @@ package net.runelite.client.discord.events; import lombok.Value; +import net.runelite.api.events.Event; /** * Called when another discord user wants to join the game of the logged in user */ @Value -public class DiscordJoinRequest +public class DiscordJoinRequest implements Event { /** * The userId for the user that requests to join diff --git a/runelite-client/src/main/java/net/runelite/client/discord/events/DiscordReady.java b/runelite-client/src/main/java/net/runelite/client/discord/events/DiscordReady.java index 2a6f9d622e..62a40b38fa 100644 --- a/runelite-client/src/main/java/net/runelite/client/discord/events/DiscordReady.java +++ b/runelite-client/src/main/java/net/runelite/client/discord/events/DiscordReady.java @@ -25,12 +25,13 @@ package net.runelite.client.discord.events; import lombok.Value; +import net.runelite.api.events.Event; /** * Called when the RPC connection has been established */ @Value -public class DiscordReady +public class DiscordReady implements Event { /** * The userId for the active user diff --git a/runelite-client/src/main/java/net/runelite/client/discord/events/DiscordSpectateGame.java b/runelite-client/src/main/java/net/runelite/client/discord/events/DiscordSpectateGame.java index bcff4a74bd..9f5204af1c 100644 --- a/runelite-client/src/main/java/net/runelite/client/discord/events/DiscordSpectateGame.java +++ b/runelite-client/src/main/java/net/runelite/client/discord/events/DiscordSpectateGame.java @@ -25,12 +25,13 @@ package net.runelite.client.discord.events; import lombok.Value; +import net.runelite.api.events.Event; /** * Called when the logged in user joined to spectate a game */ @Value -public class DiscordSpectateGame +public class DiscordSpectateGame implements Event { /** * Obfuscated data of your choosing used as spectate secret diff --git a/runelite-client/src/main/java/net/runelite/client/eventbus/EventBus.java b/runelite-client/src/main/java/net/runelite/client/eventbus/EventBus.java index 12bba2da05..b07357ac41 100644 --- a/runelite-client/src/main/java/net/runelite/client/eventbus/EventBus.java +++ b/runelite-client/src/main/java/net/runelite/client/eventbus/EventBus.java @@ -11,12 +11,14 @@ import java.util.Map; import java.util.Objects; import javax.inject.Singleton; import lombok.extern.slf4j.Slf4j; +import net.runelite.api.events.Event; import org.apache.commons.lang3.exception.ExceptionUtils; @Slf4j @Singleton public class EventBus implements EventBusInterface { + private Map subscriptionList = new HashMap<>(); private Map, Relay> subjectList = new HashMap<>(); private Map subscriptionsMap = new HashMap<>(); @@ -43,6 +45,11 @@ public class EventBus implements EventBusInterface // Subscribe on lifecycle (for example from plugin startUp -> shutdown) public void subscribe(Class eventClass, @NonNull Object lifecycle, @NonNull Consumer action) { + if (subscriptionList.containsKey(lifecycle) && eventClass.equals(subscriptionList.get(lifecycle))) + { + return; + } + Disposable disposable = getSubject(eventClass) .filter(Objects::nonNull) // Filter out null objects, better safe than sorry .cast(eventClass) // Cast it for easier usage @@ -53,6 +60,7 @@ public class EventBus implements EventBusInterface }); getCompositeDisposable(lifecycle).add(disposable); + subscriptionList.put(lifecycle, eventClass); } @Override @@ -60,6 +68,7 @@ public class EventBus implements EventBusInterface { //We have to remove the composition from the map, because once you dispose it can't be used anymore CompositeDisposable compositeDisposable = subscriptionsMap.remove(lifecycle); + subscriptionList.remove(lifecycle); if (compositeDisposable != null) { compositeDisposable.dispose(); @@ -67,7 +76,7 @@ public class EventBus implements EventBusInterface } @Override - public void post(Class eventClass, @NonNull Object event) + public void post(Class eventClass, @NonNull Event event) { getSubject(eventClass).accept(event); } diff --git a/runelite-client/src/main/java/net/runelite/client/eventbus/EventBusInterface.java b/runelite-client/src/main/java/net/runelite/client/eventbus/EventBusInterface.java index d0858562ef..ef75ac265a 100644 --- a/runelite-client/src/main/java/net/runelite/client/eventbus/EventBusInterface.java +++ b/runelite-client/src/main/java/net/runelite/client/eventbus/EventBusInterface.java @@ -2,6 +2,7 @@ package net.runelite.client.eventbus; import io.reactivex.annotations.NonNull; import io.reactivex.functions.Consumer; +import net.runelite.api.events.Event; public interface EventBusInterface { @@ -9,5 +10,5 @@ public interface EventBusInterface void unregister(@NonNull Object lifecycle); - void post(Class eventClass, @NonNull Object event); + void post(Class eventClass, @NonNull Event event); } diff --git a/runelite-client/src/main/java/net/runelite/client/events/NavigationButtonAdded.java b/runelite-client/src/main/java/net/runelite/client/events/NavigationButtonAdded.java index 647cbe7016..c1d2b728f5 100644 --- a/runelite-client/src/main/java/net/runelite/client/events/NavigationButtonAdded.java +++ b/runelite-client/src/main/java/net/runelite/client/events/NavigationButtonAdded.java @@ -25,10 +25,11 @@ package net.runelite.client.events; import lombok.Value; +import net.runelite.api.events.Event; import net.runelite.client.ui.NavigationButton; @Value -public class NavigationButtonAdded +public class NavigationButtonAdded implements Event { private NavigationButton button; } diff --git a/runelite-client/src/main/java/net/runelite/client/events/NavigationButtonRemoved.java b/runelite-client/src/main/java/net/runelite/client/events/NavigationButtonRemoved.java index 988d18e72b..422bcf8350 100644 --- a/runelite-client/src/main/java/net/runelite/client/events/NavigationButtonRemoved.java +++ b/runelite-client/src/main/java/net/runelite/client/events/NavigationButtonRemoved.java @@ -25,10 +25,11 @@ package net.runelite.client.events; import lombok.Value; +import net.runelite.api.events.Event; import net.runelite.client.ui.NavigationButton; @Value -public class NavigationButtonRemoved +public class NavigationButtonRemoved implements Event { private NavigationButton button; } diff --git a/runelite-client/src/main/java/net/runelite/client/events/NpcLootReceived.java b/runelite-client/src/main/java/net/runelite/client/events/NpcLootReceived.java index e3ef8a03da..ef0702974d 100644 --- a/runelite-client/src/main/java/net/runelite/client/events/NpcLootReceived.java +++ b/runelite-client/src/main/java/net/runelite/client/events/NpcLootReceived.java @@ -27,10 +27,11 @@ package net.runelite.client.events; import java.util.Collection; import lombok.Value; import net.runelite.api.NPC; +import net.runelite.api.events.Event; import net.runelite.client.game.ItemStack; @Value -public class NpcLootReceived +public class NpcLootReceived implements Event { private final NPC npc; private final Collection items; diff --git a/runelite-client/src/main/java/net/runelite/client/events/OverlayMenuClicked.java b/runelite-client/src/main/java/net/runelite/client/events/OverlayMenuClicked.java index 6394e7c799..b1c0d11494 100644 --- a/runelite-client/src/main/java/net/runelite/client/events/OverlayMenuClicked.java +++ b/runelite-client/src/main/java/net/runelite/client/events/OverlayMenuClicked.java @@ -26,6 +26,7 @@ package net.runelite.client.events; import lombok.AllArgsConstructor; import lombok.Data; +import net.runelite.api.events.Event; import net.runelite.client.ui.overlay.Overlay; import net.runelite.client.ui.overlay.OverlayMenuEntry; @@ -34,7 +35,7 @@ import net.runelite.client.ui.overlay.OverlayMenuEntry; */ @Data @AllArgsConstructor -public class OverlayMenuClicked +public class OverlayMenuClicked implements Event { private OverlayMenuEntry entry; private Overlay overlay; diff --git a/runelite-client/src/main/java/net/runelite/client/events/PartyChanged.java b/runelite-client/src/main/java/net/runelite/client/events/PartyChanged.java index 0cb8a94c3e..72490a7e0c 100644 --- a/runelite-client/src/main/java/net/runelite/client/events/PartyChanged.java +++ b/runelite-client/src/main/java/net/runelite/client/events/PartyChanged.java @@ -26,9 +26,10 @@ package net.runelite.client.events; import java.util.UUID; import lombok.Value; +import net.runelite.api.events.Event; @Value -public class PartyChanged +public class PartyChanged implements Event { private final UUID partyId; } diff --git a/runelite-client/src/main/java/net/runelite/client/events/PlayerLootReceived.java b/runelite-client/src/main/java/net/runelite/client/events/PlayerLootReceived.java index 56eb722a83..c1891d664d 100644 --- a/runelite-client/src/main/java/net/runelite/client/events/PlayerLootReceived.java +++ b/runelite-client/src/main/java/net/runelite/client/events/PlayerLootReceived.java @@ -27,10 +27,11 @@ package net.runelite.client.events; import java.util.Collection; import lombok.Value; import net.runelite.api.Player; +import net.runelite.api.events.Event; import net.runelite.client.game.ItemStack; @Value -public class PlayerLootReceived +public class PlayerLootReceived implements Event { private final Player player; private final Collection items; diff --git a/runelite-client/src/main/java/net/runelite/client/events/PluginChanged.java b/runelite-client/src/main/java/net/runelite/client/events/PluginChanged.java index c237782732..723cd8e0b3 100644 --- a/runelite-client/src/main/java/net/runelite/client/events/PluginChanged.java +++ b/runelite-client/src/main/java/net/runelite/client/events/PluginChanged.java @@ -25,10 +25,11 @@ package net.runelite.client.events; import lombok.Data; +import net.runelite.api.events.Event; import net.runelite.client.plugins.Plugin; @Data -public class PluginChanged +public class PluginChanged implements Event { private final Plugin plugin; private final boolean loaded; diff --git a/runelite-client/src/main/java/net/runelite/client/events/SessionClose.java b/runelite-client/src/main/java/net/runelite/client/events/SessionClose.java index e8a2f227cb..f73d3a31b5 100644 --- a/runelite-client/src/main/java/net/runelite/client/events/SessionClose.java +++ b/runelite-client/src/main/java/net/runelite/client/events/SessionClose.java @@ -25,6 +25,7 @@ package net.runelite.client.events; import lombok.Data; +import net.runelite.api.events.Event; /** * An event where a new RuneLite account session has been closed, @@ -34,7 +35,7 @@ import lombok.Data; * it has nothing to do with whether an account is being logged out. */ @Data -public class SessionClose +public class SessionClose implements Event { } diff --git a/runelite-client/src/main/java/net/runelite/client/events/SessionOpen.java b/runelite-client/src/main/java/net/runelite/client/events/SessionOpen.java index 971ba7cb2e..b1d042af2b 100644 --- a/runelite-client/src/main/java/net/runelite/client/events/SessionOpen.java +++ b/runelite-client/src/main/java/net/runelite/client/events/SessionOpen.java @@ -25,6 +25,7 @@ package net.runelite.client.events; import lombok.Data; +import net.runelite.api.events.Event; /** * An event where a new RuneLite account session has been opened @@ -34,7 +35,7 @@ import lombok.Data; * it has nothing to do with whether an account is being logged in. */ @Data -public class SessionOpen +public class SessionOpen implements Event { } diff --git a/runelite-client/src/main/java/net/runelite/client/game/AgilityShortcut.java b/runelite-client/src/main/java/net/runelite/client/game/AgilityShortcut.java index 96a55f3e86..c3ebc24ee5 100644 --- a/runelite-client/src/main/java/net/runelite/client/game/AgilityShortcut.java +++ b/runelite-client/src/main/java/net/runelite/client/game/AgilityShortcut.java @@ -214,6 +214,10 @@ import static net.runelite.api.ObjectID.STRANGE_FLOOR; import static net.runelite.api.ObjectID.STRANGE_FLOOR_16544; import static net.runelite.api.ObjectID.STRONG_TREE_17074; import static net.runelite.api.ObjectID.TIGHTGAP; +import static net.runelite.api.ObjectID.TIGHT_GAP; +import static net.runelite.api.ObjectID.TIGHT_GAP_36693; +import static net.runelite.api.ObjectID.TIGHT_GAP_36694; +import static net.runelite.api.ObjectID.TIGHT_GAP_36695; import static net.runelite.api.ObjectID.TRELLIS_20056; import static net.runelite.api.ObjectID.TRIPWIRE; import static net.runelite.api.ObjectID.TUNNEL_30174; @@ -347,6 +351,7 @@ public enum AgilityShortcut YANILLE_DUNGEON_MONKEY_BARS(57, "Monkey Bars", null, MONKEYBARS_23567), PHASMATYS_ECTOPOOL_SHORTCUT(58, "Weathered Wall", null, WEATHERED_WALL, WEATHERED_WALL_16526), ELVEN_OVERPASS_CLIFF_SCRAMBLE(59, "Rocks", new WorldPoint(2345, 3300, 0), ROCKS_16514, ROCKS_16515), + ELVEN_OVERPASS_CLIFF_SCRAMBLE_PRIFDDINAS(59, "Rocks", new WorldPoint(3369, 6052, 0), ROCKS_16514, ROCKS_16515), WILDERNESS_GWD_CLIMB_EAST(60, "Rocks", new WorldPoint(2943, 3770, 0), ROCKY_HANDHOLDS_26400, ROCKY_HANDHOLDS_26401, ROCKY_HANDHOLDS_26402, ROCKY_HANDHOLDS_26404, ROCKY_HANDHOLDS_26405, ROCKY_HANDHOLDS_26406), WILDERNESS_GWD_CLIMB_WEST(60, "Rocks", new WorldPoint(2928, 3760, 0), ROCKY_HANDHOLDS_26400, ROCKY_HANDHOLDS_26401, ROCKY_HANDHOLDS_26402, ROCKY_HANDHOLDS_26404, ROCKY_HANDHOLDS_26405, ROCKY_HANDHOLDS_26406), MOS_LEHARMLESS_STEPPING_STONE(60, "Stepping Stone", new WorldPoint(3710, 2970, 0), STEPPING_STONE_19042), @@ -368,6 +373,7 @@ public enum AgilityShortcut HEROES_GUILD_TUNNEL_WEST(67, "Crevice", new WorldPoint(2913, 9895, 0), CREVICE_9739, CREVICE_9740), YANILLE_DUNGEON_RUBBLE_CLIMB(67, "Pile of Rubble", null, PILE_OF_RUBBLE_23563, PILE_OF_RUBBLE_23564), ELVEN_OVERPASS_MEDIUM_CLIFF(68, "Rocks", new WorldPoint(2337, 3288, 0), ROCKS_16514, ROCKS_16515), + ELVEN_OVERPASS_MEDIUM_CLIFF_PRIFDDINAS(68, "Rocks", new WorldPoint(3361, 6040, 0), ROCKS_16514, ROCKS_16515), WEISS_OBSTACLES(68, "Shortcut", null, LITTLE_BOULDER, ROCKSLIDE_33184, ROCKSLIDE_33185, NULL_33327, NULL_33328, LEDGE_33190, ROCKSLIDE_33191, FALLEN_TREE_33192), ARCEUUS_ESSENSE_NORTH(69, "Rock Climb", new WorldPoint(1761, 3873, 0), ROCKS_34741), TAVERLEY_DUNGEON_PIPE_BLUE_DRAGON(70, "Pipe Squeeze", new WorldPoint(2886, 9798, 0), OBSTACLE_PIPE_16509), @@ -388,14 +394,19 @@ public enum AgilityShortcut REVENANT_CAVES_ANKOU_EAST(75, "Jump", new WorldPoint(3201, 10195, 0), PILLAR_31561), REVENANT_CAVES_ANKOU_NORTH(75, "Jump", new WorldPoint(3180, 10209, 0), PILLAR_31561), ZUL_ANDRA_ISLAND_CROSSING(76, "Stepping Stone", new WorldPoint(2156, 3073, 0), STEPPING_STONE_10663), - SHILO_VILLAGE_STEPPING_STONES(77, "Stepping Stones", new WorldPoint(2863, 2974, 0), STEPPING_STONE_16466), + SHILO_VILLAGE_STEPPING_STONES( 77, "Stepping Stones", new WorldPoint(2863, 2974, 0), STEPPING_STONE_16466), + IORWERTHS_DUNGEON_NORTHERN_SHORTCUT_EAST(78, "Tight Gap", new WorldPoint(3221, 12441, 0), TIGHT_GAP), + IORWERTHS_DUNGEON_NORTHERN_SHORTCUT_WEST(78, "Tight Gap", new WorldPoint(3215, 12441, 0), TIGHT_GAP_36693), KHARAZI_JUNGLE_VINE_CLIMB(79, "Vine", new WorldPoint(2897, 2939, 0), NULL_26884, NULL_26886), TAVERLEY_DUNGEON_SPIKED_BLADES(80, "Strange Floor", new WorldPoint(2877, 9813, 0), STRANGE_FLOOR), SLAYER_DUNGEON_CHASM_JUMP(81, "Spiked Blades", new WorldPoint(2770, 10003, 0), STRANGE_FLOOR_16544), LAVA_MAZE_NORTH_JUMP(82, "Stepping Stone", new WorldPoint(3092, 3880, 0), STEPPING_STONE_14917), BRIMHAVEN_DUNGEON_EAST_STEPPING_STONES_NORTH(83, "Stepping Stones", new WorldPoint(2685, 9547, 0), STEPPING_STONE_19040), BRIMHAVEN_DUNGEON_EAST_STEPPING_STONES_SOUTH(83, "Stepping Stones", new WorldPoint(2693, 9529, 0), STEPPING_STONE_19040), + IORWERTHS_DUNGEON_SOUTHERN_SHORTCUT_EAST(84, "Tight Gap", new WorldPoint(3241, 12420, 0), TIGHT_GAP_36694), + IORWERTHS_DUNGEON_SOUTHERN_SHORTCUT_WEST(84, "Tight Gap", new WorldPoint(3231, 12420, 0), TIGHT_GAP_36695), ELVEN_ADVANCED_CLIFF_SCRAMBLE(85, "Rocks", new WorldPoint(2337, 3253, 0), ROCKS_16514, ROCKS_16514), + ELVEN_ADVANCED_CLIFF_SCRAMBLE_PRIFDDINAS(85, "Rocks", new WorldPoint(3361, 6005, 0), ROCKS_16514, ROCKS_16514), KALPHITE_WALL(86, "Crevice", new WorldPoint(3214, 9508, 0), CREVICE_16465), BRIMHAVEN_DUNGEON_VINE_EAST(87, "Vine", new WorldPoint(2672, 9582, 0), VINE_26880, VINE_26882), BRIMHAVEN_DUNGEON_VINE_WEST(87, "Vine", new WorldPoint(2606, 9584, 0), VINE_26880, VINE_26882), diff --git a/runelite-client/src/main/java/net/runelite/client/game/WorldLocation.java b/runelite-client/src/main/java/net/runelite/client/game/WorldLocation.java index 36f254fa9c..701a2e1534 100644 --- a/runelite-client/src/main/java/net/runelite/client/game/WorldLocation.java +++ b/runelite-client/src/main/java/net/runelite/client/game/WorldLocation.java @@ -23,11 +23,11 @@ import net.runelite.client.util.PvPUtil; public enum WorldLocation { // Non-Wilderness Locations - AGILITY_PYRAMID("Agility Pyramid", new Location(3386, 2864, 3334, 2819), 0), + AGILITY_PYRAMID("Agility Pyramid", new Location(3334, 2864, 3386, 2819), 0), AL_KHARID_BANK("Al Kharid Bank", new Location(3265, 3173, 3272, 3161), 0), AL_KHARID_GLIDER("Al Kharid_Glider", new Location(3276, 3214, 3283, 3209), 0), AL_KHARID_PALACE("Al Kharid Palace", new Location(3281, 3177, 3304, 3158), 0), - ANDRA("Zul-Andra", new Location(2214, 3070, 2182, 3042), 0), + ZUL_ANDRA("Zul-Andra", new Location(2182, 3070, 2214, 3042), 0), APE_ATOLL_TEMPLE("Ape Atoll Temple", new Location(2784, 2802, 2810, 2770), 0), ARDY_CASTLE("Ardy Castle", new Location(2567, 3311, 2591, 3283), 0), ARDY_DOCKS("Ardy Docks", new Location(2660, 3284, 2689, 3264), 0), @@ -36,27 +36,27 @@ public enum WorldLocation ARDY_STALLS("Ardy Stalls", new Location(2651, 3318, 2673, 3293), 0), ARDY_ZOO("Ardy Zoo", new Location(2598, 3288, 2640, 3261), 0), BARB_VILLAGE("Barb Village", new Location(3071, 3448, 3092, 3405), 0), - BARROWS("Barrows", new Location(3583, 3268, 3546, 3314), 0), - BEDABIN_CAMP("Bedabin Camp", new Location(3188, 3052, 3157, 3019), 0), - CAMELOT_CASTLE("Camelot Castle", new Location(2775, 3481, 2743, 3468), 0), - CASTLE_WARS("Castle Wars", new Location(2435, 3074, 2474, 3127), 0), - CATHERBY("Catherby", new Location(2833, 3436, 2791, 3457), 0), - CATHERBY_DOCKS("Catherby Docks", new Location(2808, 3432, 2790, 3409), 0), - CATHERBY_EAST("Catherby East", new Location(2862, 3441, 2834, 3425), 0), - CATHERBY_NORTH("Catherby North", new Location(2791, 3458, 2833, 3472), 0), - CLAN_WARS("Clan Wars", new Location(3391, 3142, 3344, 3176), 0), + BARROWS("Barrows", new Location(3546, 3314, 3583, 3268), 0), + BEDABIN_CAMP("Bedabin Camp", new Location(3157, 3052, 3188, 3019), 0), + CAMELOT_CASTLE("Camelot Castle", new Location(2743, 3481, 2775, 3468), 0), + CASTLE_WARS("Castle Wars", new Location(2435, 3127, 2474, 3074), 0), + CATHERBY("Catherby", new Location(2791, 3457, 2833, 3436), 0), + CATHERBY_DOCKS("Catherby Docks", new Location(2790, 3432, 2808, 3409), 0), + CATHERBY_EAST("Catherby East", new Location(2834, 3441, 2862, 3425), 0), + CATHERBY_NORTH("Catherby North", new Location(2791, 3472, 2833, 3458), 0), + CLAN_WARS("Clan Wars", new Location(3344, 3176, 3391, 3142), 0), COOKS_GUILD("Cooks Guild", new Location(3135, 3455, 3155, 3427), 0), COX("CoX", new Location(1226, 3574, 1270, 3559), 0), - CRAB_CLAW_ISLE("Crab Claw Isle", new Location(1795, 3449, 1745, 3399), 0), - DESERT_BANDIT_CAMP("Desert Bandit Camp", new Location(3189, 2993, 3154, 2963), 0), - DIGSITE_NORTHEAST("Digsite NorthWest", new Location(3325, 3445, 3353, 3420), 0), - DIGSITE_NORTHWEST("Digsite NorthEast", new Location(3354, 3420, 3382, 3445), 0), + CRAB_CLAW_ISLE("Crab Claw Isle", new Location(1745, 3449, 1795, 3399), 0), + DESERT_BANDIT_CAMP("Desert Bandit Camp", new Location(3154, 2993, 3189, 2963), 0), + DIGSITE_NORTHWEST("Digsite NorthWest", new Location(3325, 3445, 3353, 3420), 0), + DIGSITE_NORTHEAST("Digsite NorthEast", new Location(3354, 3445, 3382, 3420), 0), DIGSITE_SOUTHEAST("Digsite SouthEast", new Location(3354, 3419, 3382, 3393), 0), - DIGSITE_SOUTHWEST("Digsite SouthWest", new Location(3353, 3419, 3325, 3393), 0), + DIGSITE_SOUTHWEST("Digsite SouthWest", new Location(3325, 3419, 3353, 3393), 0), DRYANOR_VILLAGE("Dryanor Village", new Location(3074, 3283, 3112, 3241), 0), DUEL_ARENA_ENTRANCE("Duel Arena Entrance", new Location(3311, 3247, 3328, 3223), 0), DUEL_ARENA_NORTH("Duel Arena North", new Location(3329, 3266, 3388, 3264), 0), - DUEL_ARENA_NW("Duel Arena North West", new Location(3328, 3266, 3322, 3248), 0), + DUEL_ARENA_NORTH_WEST("Duel Arena North West", new Location(3322, 3266, 3328, 3248), 0), EDGE_BANK("Edge Bank", new Location(3090, 3499, 3099, 3487), 0), FALADOR_PARTYROOM("Falador Partyroom", new Location(3035, 3386, 3056, 3370), 0), FALLY_BANK("Fally Bank", new Location(2943, 3372, 2949, 3358), 0), @@ -66,68 +66,66 @@ public enum WorldLocation FALLY_RESPAWN("Fally Respawn", new Location(2957, 3355, 2998, 3325), 0), GNOME_AGILITY("Gnome Agility", new Location(2469, 3441, 2489, 3412), 0), GNOME_BALL("Gnome Ball", new Location(2384, 3495, 2408, 3479), 0), - GRAND_EXCHANGE_NORTHEAST("Grand Exchange NorthEast", new Location(3165, 3490, 3197, 3516), 0), - GRAND_EXCHANGE_NORTHWEST("Grand Exchange NorthWest", new Location(3164, 3490, 3139, 3516), 0), + GRAND_EXCHANGE_NORTHEAST("Grand Exchange NorthEast", new Location(3165, 3516, 3197, 3490), 0), + GRAND_EXCHANGE_NORTHWEST("Grand Exchange NorthWest", new Location(3139, 3516, 3164, 3490), 0), GRAND_EXCHANGE_SOUTHEAST("Grand Exchange SouthEast", new Location(3165, 3489, 3189, 3468), 0), - GRAND_EXCHANGE_SOUTHWEST("Grand Exchange SouthWest", new Location(3164, 3489, 3139, 3467), 0), + GRAND_EXCHANGE_SOUTHWEST("Grand Exchange SouthWest", new Location(3139, 3489, 3164, 3467), 0), GRAND_TREE("Grand Tree", new Location(2442, 3515, 2490, 3478), 0), ICE_MOUNTAIN("Ice Mountain", new Location(3001, 3508, 3024, 3463), 0), - KING_LANTHAS_TRAINING_GROUND("Training Ground", new Location(2534, 3387, 2501, 3358), 0), + TRAINING_GROUND("Training Ground", new Location(2501, 3387, 2534, 3358), 0), LUMBRIDGE_CASTLE("Lumbridge Castle", new Location(3201, 3235, 3225, 3201), 0), LUMBY_SWAMP("Lumby Swamp", new Location(3135, 3203, 3245, 3140), 0), - LUNAR_ISLE_CENTRAL("Lunar Isle Central", new Location(2112, 3888, 2055, 3933), 0), - LUNAR_ISLE_EAST("Lunar Isle East", new Location(2185, 3921, 2113, 3888), 0), - LUNAR_ISLE_NORTH("Lunar Isle North", new Location(2112, 3934, 2063, 3958), 0), - LUNAR_ISLE_NORTH_EAST("Lunar Isle North East", new Location(2113, 3922, 2185, 3958), 0), - LUNAR_ISLE_SOUTH("Lunar Isle South", new Location(2112, 3887, 2057, 3843), 0), + LUNAR_ISLE_CENTRAL("Lunar Isle Central", new Location(2055, 3933, 2112, 3888), 0), + LUNAR_ISLE_EAST("Lunar Isle East", new Location(2113, 3921, 2185, 3888), 0), + LUNAR_ISLE_NORTH("Lunar Isle North", new Location(2063, 3958, 2112, 3934), 0), + LUNAR_ISLE_NORTH_EAST("Lunar Isle North East", new Location(2113, 3958, 2185, 3922), 0), + LUNAR_ISLE_SOUTH("Lunar Isle South", new Location(2057, 3887, 2112, 3843), 0), LUNAR_ISLE_SOUTHEAST("Lunar Isle SouthEast", new Location(2113, 3887, 2185, 3843), 0), MONASTERY("Monastery", new Location(3044, 3507, 3060, 3471), 0), - NARDAH_NORTH("Nardah North", new Location(3397, 2915, 3453, 2942), 0), - NARDAH_SOUTH("Nardah South", new Location(3453, 2882, 3397, 2914), 0), + NARDAH_NORTH("Nardah North", new Location(3397, 2942, 3453, 2915), 0), + NARDAH_SOUTH("Nardah South", new Location(3397, 2914, 3453, 2882), 0), NIEVE("Nieve", new Location(2430, 3425, 2435, 3419), 0), NIGHTMARE_ZONE("Nightmare Zone", new Location(2599, 3119, 2614, 3111), 0), - NORTH_APE_ATOLL_MARIM("North Marim", new Location(2783, 2786, 2731, 2804), 0), - PEST_CONTROL("Pest Control", new Location(2682, 2627, 2630, 2679), 0), - POLLNIVNEACH_NORTH("Pollnivneach North", new Location(3379, 2974, 3331, 3004), 0), - POLLNIVNEACH_SOUTH("Pollnivneach South", new Location(3379, 2973, 3331, 2941), 0), + NORTH_MARIM("North Marim", new Location(2731, 2804, 2783, 2786), 0), + PEST_CONTROL("Pest Control", new Location(2630, 2679, 2682, 2627), 0), + POLLNIVNEACH_NORTH("Pollnivneach North", new Location(3331, 3004, 3379, 2974), 0), + POLLNIVNEACH_SOUTH("Pollnivneach South", new Location(3331, 2973, 3379, 2941), 0), PORT_KHAZARD("Port Khazard", new Location(2624, 3182, 2680, 3143), 0), PORT_SARIM("Port Sarim", new Location(3009, 3261, 3060, 3194), 0), - RELLEKA_SOUTHWEST("Relleka South West", new Location(2649, 3678, 2609, 3644), 0), - RELLEKKA_NORTHEAST("Rellekka North East", new Location(2690, 3712, 2650, 3679), 0), - RELLEKKA_NORTHWEST("Rellekka North West", new Location(2649, 3679, 2609, 3712), 0), - RELLEKKA_SOUTHEAST("Rellekka South East", new Location(2650, 3678, 2690, 3644), 0), + RELLEKA_SOUTH_WEST("Relleka South West", new Location(2609, 3678, 2649, 3644), 0), + RELLEKKA_NORTH_EAST("Rellekka North East", new Location(2650, 3712, 2690, 3679), 0), + RELLEKKA_NORTH_WEST("Rellekka North West", new Location(2609, 3712, 2649, 3679), 0), + RELLEKKA_SOUTH_EAST("Rellekka South East", new Location(2650, 3678, 2690, 3644), 0), RIMMINGTON_PORTAL("Rimmington Portal", new Location(2946, 3228, 2960, 3218), 0), - ROCK_CRABS_EAST("Rock Crabs East", new Location(2691, 3713, 2730, 3738), 0), - ROCK_CRABS_WEST("Rock Crabs West", new Location(2690, 3738, 2650, 3713), 0), + ROCK_CRABS_EAST("Rock Crabs East", new Location(2691, 3738, 2730, 3713), 0), + ROCK_CRABS_WEST("Rock Crabs West", new Location(2650, 3738, 2690, 3713), 0), SANDCRABS_CENTRAL("SandCrabs Central", new Location(1850, 3529, 1884, 3465), 0), SANDCRABS_NORTH("SandCrabs North", new Location(1848, 3572, 1884, 3532), 0), - SANDCRABS_SOUTH("SandCrabs South", new Location(1849, 3468, 1796, 3436), 0), - SEERS_VILLAGE("Seers Village", new Location(2742, 3468, 2688, 3498), 0), + SANDCRABS_SOUTH("SandCrabs South", new Location(1796, 3468, 1849, 3436), 0), + SEERS_VILLAGE("Seers Village", new Location(2688, 3498, 2742, 3468), 0), SHANTAY_PASS("Shantay Pass", new Location(3293, 3137, 3312, 3116), 0), - SHILO_VILLAGE_NORTH("Shilo Village North", new Location(2878, 3006, 2817, 2973), 0), - SHILO_VILLAGE_SOUTH("Shilo Village South", new Location(2879, 2972, 2816, 2944), 0), - SOUTH_APE_ATOLL_MARIM("South Marim", new Location(2783, 2785, 2731, 2762), 0), + SHILO_VILLAGE_NORTH("Shilo Village North", new Location(2817, 3006, 2878, 2973), 0), + SHILO_VILLAGE_SOUTH("Shilo Village South", new Location(2816, 2972, 2879, 2944), 0), + SOUTH_MARIM("South Marim", new Location(2731, 2785, 2783, 2762), 0), SOUTH_OF_GRAND_EXCHANGE("South of Grand Exchange", new Location(3156, 3466, 3190, 3448), 0), TREEGOME_VILLAGE("TreeGome Village", new Location(2514, 3175, 2547, 3158), 0), VARROCK_CENTRE("Varrock Centre", new Location(3201, 3444, 3229, 3412), 0), - VARROCK_EAST("Varrock East", new Location(3241, 3438, 3228, 3450), 0), + VARROCK_EAST("Varrock East", new Location(3228, 3450, 3241, 3438), 0), VARROCK_WEST("Varrock West", new Location(3172, 3447, 3200, 3427), 0), - WATERBIRTH_ISLAND("Waterbirth Island", new Location(2562, 3774, 2494, 3710), 0), + WATERBIRTH_ISLAND("Waterbirth Island", new Location(2494, 3774, 2562, 3710), 0), WEST_ARDY("West Ardy", new Location(2452, 3336, 2557, 3265), 0), WINDERTODT_SOUTH_EAST("Windertodt South East", new Location(1630, 4007, 1651, 3987), 0), - WINTERTODT_CAMP("Wintertodt Camp", new Location(1645, 3932, 1616, 3963), 0), - WINTERTODT_ENTRANCE("Wintertodt Entrance", new Location(1641, 3964, 1617, 3986), 0), - WINTERTODT_NORTHEAST("Wintertodt NorthEast", new Location(1630, 4008, 1651, 4027), 0), - WINTERTODT_NORTHWEST("Wintertodt NorthWest", new Location(1629, 4008, 1608, 4028), 0), - WINTERTODT_SOUTHWEST("Wintertodt SouthWest", new Location(1629, 4007, 1608, 3987), 0), + WINTERTODT_CAMP("Wintertodt Camp", new Location(1616, 3963, 1645, 3932), 0), + WINTERTODT_ENTRANCE("Wintertodt Entrance", new Location(1617, 3986, 1641, 3964), 0), + WINTERTODT_NORTHEAST("Wintertodt NorthEast", new Location(1630, 4027, 1651, 4008), 0), + WINTERTODT_NORTHWEST("Wintertodt NorthWest", new Location(1608, 4028, 1629, 4008), 0), + WINTERTODT_SOUTHWEST("Wintertodt SouthWest", new Location(1608, 4007, 1629, 3987), 0), WIZARDS_GUILD("Wizards Guild", new Location(2585, 3092, 2596, 3082), 0), WIZARDS_TOWER("Wizards Tower", new Location(3093, 3171, 3121, 3146), 0), YANILE_BANK("Yanile Bank", new Location(2608, 3097, 2616, 3087), 0), YANILLE_EAST("Yanille East", new Location(2576, 3110, 2621, 3071), 0), YANILLE_PORTAL("Yanille Portal", new Location(2537, 3108, 2551, 3091), 0), - YANILLE_WEST("Yanille West", new Location(2575, 3110, 2532, 3071), 0), - - //Wilderness Locations + YANILLE_WEST("Yanille West", new Location(2532, 3110, 2575, 3071), 0), AXE_HUT("Axe Hut", new Location(3187, 3962, 3194, 3957), 0), BANDIT_CAMP("Bandit Camp", new Location(3017, 3712, 3059, 3681), 0), CALLISTO("Callisto", new Location(3266, 3863, 3315, 3827), 0), @@ -137,9 +135,9 @@ public enum WorldLocation CHINS("Chins", new Location(3128, 3792, 3160, 3754), 0), CORP_CAVE("Corp Cave", new Location(3201, 3684, 3219, 3672), 0), CRAZY_ARCHAEOLOGIST("Crazy Archaeologist", new Location(2952, 3709, 2985, 3678), 0), - DARK_WARRIOR_FORTRESS("Dark Warriors", new Location(3014, 3648, 3046, 3616), 0), + DARK_WARRIORS("Dark Warriors", new Location(3014, 3648, 3046, 3616), 0), DWARVES("Dwarves", new Location(3230, 3805, 3264, 3779), 0), - EAST_DRAGONS("East Drags", new Location(3326, 3704, 3365, 3671), 0), + EAST_DRAGS("East Drags", new Location(3326, 3704, 3365, 3671), 0), ENTS("Ents", new Location(3300, 3627, 3320, 3584), 0), FIFTY_PORTS("50 ports", new Location(3301, 3923, 3315, 3909), 0), FIRE_GIANT_ENTRANCE("Fire Giant Entrance", new Location(3042, 3929, 3051, 3920), 0), @@ -150,7 +148,7 @@ public enum WorldLocation GLORY_HOLE("Glory Hole", new Location(3352, 3897, 3386, 3869), 0), GRAVES("Graves", new Location(3128, 3686, 3181, 3658), 0), GRAVEYARD_DRAGS("Graveyard Drags", new Location(3129, 3717, 3172, 3691), 0), - GWD("God Wars Dungeon", new Location(3010, 3745, 3027, 3727), 0), + GOD_WARS_DUNGEON("God Wars Dungeon", new Location(3010, 3745, 3027, 3727), 0), HIGH_ALTAR("High Altar", new Location(2945, 3826, 2970, 3813), 0), HILL_GIANTS("Hill Giants", new Location(3282, 3687, 3300, 3674), 0), HOB_OBELISK("35 Obelisk", new Location(3097, 3804, 3115, 3785), 0), @@ -164,34 +162,37 @@ public enum WorldLocation MAGE_ARENA("Mage Arena", new Location(3088, 3949, 3123, 3919), 0), MAGE_BANK("Mage Bank", new Location(3082, 3960, 3103, 3952), 0), NEW_GATE("New Gate", new Location(3345, 3957, 3390, 3916), 0), - NINETEEN_OBELISK("19s", new Location(3220, 3672, 3234, 3660), 0), + PORTS_19("19s", new Location(3220, 3672, 3234, 3660), 0), OLD_GATE("Old Gate", new Location(3211, 3906, 3238, 3882), 0), PIRATE_HUT("Pirate Hut", new Location(3037, 3959, 3045, 3948), 0), RESOURCE_ARENA("Resource Arena", new Location(3174, 3946, 3195, 3923), 0), REV_BLACK_DRAGS("Rev Black Drags", new Location(3223, 10216, 3254, 10190), 0), - REV_CAVE_OTHER("Rev Cave", new Location(3128, 10232, 3225, 10059), 0), + REV_CAVE("Rev Cave", new Location(3128, 10232, 3225, 10059), 0), REV_DARK_BEAST("Rev Dark Beast", new Location(3243, 10154, 3264, 10136), 0), REV_ENTRANCE("Rev Entrance", new Location(3118, 3837, 3142, 3818), 0), - REV_ENTRANCE_INSIDE("Inside Rev Ent.", new Location(3238, 10236, 3243, 10231), 0), - REV_MAIN_CHAMBER("Main Rev Chamber", new Location(3227, 10187, 3261, 10157), 0), + INSIDE_REV_ENT("Inside Rev Ent.", new Location(3238, 10236, 3243, 10231), 0), + MAIN_REV_CHAMBER("Main Rev Chamber", new Location(3227, 10187, 3261, 10157), 0), ROGUE_CASTLE("Rogue Castle", new Location(3275, 3947, 3299, 3920), 0), RUNE_ROCKS("Rune Rocks", new Location(3055, 3890, 3072, 3876), 0), SCORPIA("Scorpia", new Location(3216, 3949, 3248, 3935), 0), SINGLE_STRIP("Single Strip", new Location(3333, 3842, 3348, 3774), 0), - SOUTH_REV_ENTRANCE("Lvl 18 Rev Ent", new Location(3071, 3660, 3092, 3645), 0), + LVL_18_REV_ENT("Lvl 18 Rev Ent", new Location(3071, 3660, 3092, 3645), 0), SPIDER_HILL("Spider Hill", new Location(3156, 3896, 3182, 3871), 0), - THIRTEEN_OBELISK("13s", new Location(3145, 3628, 3168, 3609), 0), + PORTAL_13S("13s", new Location(3145, 3628, 3168, 3609), 0), VENENATIS("Venenatis", new Location(3298, 3759, 3353, 3722), 0), VETTION("Vet'tion", new Location(3183, 3796, 3227, 3765), 0), VOLCANO("Volcano", new Location(3345, 3957, 3390, 3916), 0), WEB("Web", new Location(3153, 3961, 3163, 3948), 0), - WEST_DRAGONS("West Drags", new Location(2960, 3627, 2992, 3598), 0), + WEST_DRAGS("West Drags", new Location(2960, 3627, 2992, 3598), 0), WILDY_AGILITY_COURSE("Wildy Agility Course", new Location(2988, 3967, 3008, 3906), 0); + @Getter private final String name; @Getter private final WorldArea worldArea; + @Getter + private final Location location; /** * Creates a location used to get the name of a location by a WorldPoint @@ -203,6 +204,7 @@ public enum WorldLocation WorldLocation(String name, Location location, int plane) { this.name = name; + this.location = location; this.worldArea = new WorldArea(location.x, location.y, location.width, location.height, plane); } @@ -289,8 +291,14 @@ public enum WorldLocation public static class Location { - final int x; - final int y; + @Getter + private final int x; + @Getter + private final int y; + @Getter + private final int x1; + @Getter + private final int y1; final int width; final int height; @@ -298,8 +306,10 @@ public enum WorldLocation { this.x = x; this.y = y; + this.x1 = x1; + this.y1 = y1; this.width = x1 - x; - this.height = y1 - y; + this.height = y - y1; } @Override diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/achievementdiary/diaries/ArdougneDiaryRequirement.java b/runelite-client/src/main/java/net/runelite/client/plugins/achievementdiary/diaries/ArdougneDiaryRequirement.java index fbb7bbfa78..e519510885 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/achievementdiary/diaries/ArdougneDiaryRequirement.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/achievementdiary/diaries/ArdougneDiaryRequirement.java @@ -109,7 +109,7 @@ public class ArdougneDiaryRequirement extends GenericDiaryRequirement new QuestRequirement(Quest.LEGENDS_QUEST)); add("Craft some Death runes.", new SkillRequirement(Skill.RUNECRAFT, 65), - new QuestRequirement(Quest.MOURNINGS_ENDS_PART_II)); + new QuestRequirement(Quest.MOURNINGS_END_PART_II)); // ELITE add("Catch a Manta ray in the Fishing Trawler and cook it in Port Khazard.", diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/achievementdiary/diaries/WesternDiaryRequirement.java b/runelite-client/src/main/java/net/runelite/client/plugins/achievementdiary/diaries/WesternDiaryRequirement.java index b136f889fe..ed253026ba 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/achievementdiary/diaries/WesternDiaryRequirement.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/achievementdiary/diaries/WesternDiaryRequirement.java @@ -110,7 +110,7 @@ public class WesternDiaryRequirement extends GenericDiaryRequirement new QuestRequirement(Quest.REGICIDE)); add("Check the health of your Palm tree in Lletya.", new SkillRequirement(Skill.FARMING, 68), - new QuestRequirement(Quest.MOURNINGS_ENDS_PART_I, true)); + new QuestRequirement(Quest.MOURNINGS_END_PART_I, true)); add("Claim a Chompy bird hat from Rantz after registering at least 300 kills.", new QuestRequirement(Quest.BIG_CHOMPY_BIRD_HUNTING)); add("Build an Isafdar painting in your POH Quest hall.", @@ -128,7 +128,7 @@ public class WesternDiaryRequirement extends GenericDiaryRequirement // ELITE add("Fletch a Magic Longbow in the Elven lands.", new SkillRequirement(Skill.FLETCHING, 85), - new QuestRequirement(Quest.MOURNINGS_ENDS_PART_I)); + new QuestRequirement(Quest.MOURNINGS_END_PART_I)); add("Kill the Thermonuclear Smoke devil (Does not require task).", new SkillRequirement(Skill.SLAYER, 93)); add("Have Prissy Scilla protect your Magic tree.", @@ -140,6 +140,6 @@ public class WesternDiaryRequirement extends GenericDiaryRequirement new QuestRequirement(Quest.BIG_CHOMPY_BIRD_HUNTING)); add("Pickpocket an Elf.", new SkillRequirement(Skill.THIEVING, 85), - new QuestRequirement(Quest.MOURNINGS_ENDS_PART_I, true)); + new QuestRequirement(Quest.MOURNINGS_END_PART_I, true)); } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/agility/Courses.java b/runelite-client/src/main/java/net/runelite/client/plugins/agility/Courses.java index 91812e30f8..85f921a8e1 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/agility/Courses.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/agility/Courses.java @@ -47,6 +47,7 @@ enum Courses SEERS(570.0, 435, 10806), POLLNIVNEACH(890.0, 540, 13358), RELLEKA(780.0, 475, 10553), + PRIFDDINAS(1199.0, 968, 12895), ARDOUGNE(793.0, 529, 10547); private final static Map coursesByRegion; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/agility/Obstacles.java b/runelite-client/src/main/java/net/runelite/client/plugins/agility/Obstacles.java index 004eddf9fb..ad07643db7 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/agility/Obstacles.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/agility/Obstacles.java @@ -91,7 +91,12 @@ class Obstacles NULL_18116, FLOORBOARDS_18117, FLOORBOARDS_18118, STAIRS_DOWN, WALL_17980, // Werewolf STEPPING_STONE_11643, HURDLE, HURDLE_11639, HURDLE_11640, PIPE_11657, SKULL_SLOPE, ZIP_LINE, - ZIP_LINE_11645, ZIP_LINE_11646 + ZIP_LINE_11645, ZIP_LINE_11646, + // Prifddinas + LADDER_36221, TIGHTROPE_36225, CHIMNEY_36227, ROOF_EDGE, DARK_HOLE_36229, LADDER_36231, ROPE_BRIDGE_36233, + TIGHTROPE_36234, ROPE_BRIDGE_36235, TIGHTROPE_36236, TIGHTROPE_36237, DARK_HOLE_36238, + // Prifddinas portals + NULL_36241, NULL_36242, NULL_36243, NULL_36244, NULL_36245, NULL_36246 ); static final Multimap SHORTCUT_OBSTACLE_IDS; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/aoewarnings/AoeWarningConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/aoewarnings/AoeWarningConfig.java index 3714ce651e..bf64d697ea 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/aoewarnings/AoeWarningConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/aoewarnings/AoeWarningConfig.java @@ -41,7 +41,7 @@ public interface AoeWarningConfig extends Config { @Getter @AllArgsConstructor - public enum FontStyle + enum FontStyle { BOLD("Bold", Font.BOLD), ITALIC("Italic", Font.ITALIC), @@ -948,41 +948,4 @@ public interface AoeWarningConfig extends Config { return false; } - - @ConfigItem( - keyName = "marbleGargoyleStub", - name = "Marble Gargoyle", - description = "", - position = 72, - parent = "npcStub" - ) - default Stub marbleGarboyleStub() - { - return new Stub(); - } - - @ConfigItem( - keyName = "marbleGargoyle", - name = "MarbleGargoyle", - description = "Configures if Marble Gargoyle ranged attack tile markers are displayed", - parent = "marbleGargoyleStub", - position = 73 - ) - default boolean isMarbleGargoyleEnabled() - { - return true; - } - - @ConfigItem( - keyName = "marbleGargoyleNotify", - name = "Marble Gargoyle Notify", - description = "Configures whether or not AoE Projectile Warnings for Marble Gargoyle range attack should trigger a notification", - parent = "marbleGargoyleStub", - position = 73, - hide = "aoeNotifyAll" - ) - default boolean isMarbleGargoyleNotifyEnabled() - { - return false; - } } \ No newline at end of file diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/aoewarnings/AoeWarningOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/aoewarnings/AoeWarningOverlay.java index 1dfeb1c1a0..549edff56a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/aoewarnings/AoeWarningOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/aoewarnings/AoeWarningOverlay.java @@ -34,14 +34,12 @@ import java.awt.Polygon; import java.awt.Rectangle; import java.time.Duration; import java.time.Instant; -import java.util.Iterator; -import java.util.Map; +import java.util.Set; import javax.inject.Inject; import javax.inject.Singleton; import net.runelite.api.Client; import net.runelite.api.Perspective; import net.runelite.api.Point; -import net.runelite.api.Projectile; import net.runelite.api.coords.WorldPoint; import net.runelite.client.ui.overlay.Overlay; import net.runelite.client.ui.overlay.OverlayLayer; @@ -71,53 +69,50 @@ public class AoeWarningOverlay extends Overlay public Dimension render(Graphics2D graphics) { WorldPoint lp = client.getLocalPlayer().getWorldLocation(); - for (WorldPoint point : plugin.getLightningTrail()) - { - OverlayUtil.drawTiles(graphics, client, point, lp, new Color(0, 150, 200), 2, 150, 50); - } - for (WorldPoint point : plugin.getAcidTrail()) - { - OverlayUtil.drawTiles(graphics, client, point, lp, new Color(69, 241, 44), 2, 150, 50); - } + plugin.getLightningTrail().forEach(o -> + OverlayUtil.drawTiles(graphics, client, o, lp, new Color(0, 150, 200), 2, 150, 50)); - for (WorldPoint point : plugin.getCrystalSpike()) - { - OverlayUtil.drawTiles(graphics, client, point, lp, new Color(255, 0, 84), 2, 150, 50); - } + plugin.getAcidTrail().forEach(o -> + OverlayUtil.drawTiles(graphics, client, o.getWorldLocation(), lp, new Color(69, 241, 44), 2, 150, 50)); - for (WorldPoint point : plugin.getWintertodtSnowFall()) - { - OverlayUtil.drawTiles(graphics, client, point, lp, new Color(255, 0, 84), 2, 150, 50); - } + plugin.getCrystalSpike().forEach(o -> + OverlayUtil.drawTiles(graphics, client, o.getWorldLocation(), lp, new Color(255, 0, 84), 2, 150, 50)); + + plugin.getWintertodtSnowFall().forEach(o -> + OverlayUtil.drawTiles(graphics, client, o.getWorldLocation(), lp, new Color(255, 0, 84), 2, 150, 50)); Instant now = Instant.now(); - Map projectiles = plugin.getProjectiles(); - for (Iterator it = projectiles.values().iterator(); it.hasNext(); ) + Set projectiles = plugin.getProjectiles(); + projectiles.forEach(proj -> { - AoeProjectile aoeProjectile = it.next(); - Color color; - if (now.isAfter(aoeProjectile.getStartTime().plus(Duration.ofMillis(aoeProjectile.getProjectileLifetime())))) + if (proj.getTargetPoint() == null) { - it.remove(); - continue; + return; } - Polygon tilePoly = Perspective.getCanvasTileAreaPoly(client, aoeProjectile.getTargetPoint(), aoeProjectile.getAoeProjectileInfo().getAoeSize()); + Color color; + + if (now.isAfter(proj.getStartTime().plus(Duration.ofMillis(proj.getLifetime())))) + { + return; + } + + final Polygon tilePoly = Perspective.getCanvasTileAreaPoly(client, proj.getTargetPoint(), proj.getAoeProjectileInfo().getAoeSize()); + if (tilePoly == null) { - continue; + return; } - // how far through the projectiles lifetime between 0-1. - double progress = (System.currentTimeMillis() - aoeProjectile.getStartTime().toEpochMilli()) / (double) aoeProjectile.getProjectileLifetime(); + final double progress = (System.currentTimeMillis() - proj.getStartTime().toEpochMilli()) / (double) proj.getLifetime(); - int tickProgress = aoeProjectile.getFinalTick() - client.getTickCount(); + final int tickProgress = proj.getFinalTick() - client.getTickCount(); int fillAlpha, outlineAlpha; if (plugin.isConfigFadeEnabled()) { - fillAlpha = (int) ((1 - progress) * FILL_START_ALPHA);//alpha drop off over lifetime + fillAlpha = (int) ((1 - progress) * FILL_START_ALPHA); outlineAlpha = (int) ((1 - progress) * OUTLINE_START_ALPHA); } else @@ -165,7 +160,8 @@ public class AoeWarningOverlay extends Overlay graphics.setColor(new Color(setAlphaComponent(plugin.getOverlayColor().getRGB(), fillAlpha), true)); graphics.fillPolygon(tilePoly); - } + }); + projectiles.removeIf(proj -> now.isAfter(proj.getStartTime().plus(Duration.ofMillis(proj.getLifetime())))); return null; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/aoewarnings/AoeWarningPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/aoewarnings/AoeWarningPlugin.java index 332dcd48f3..c2ef089e95 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/aoewarnings/AoeWarningPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/aoewarnings/AoeWarningPlugin.java @@ -31,10 +31,9 @@ import com.google.inject.Provides; import java.awt.Color; import java.time.Instant; import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; +import java.util.HashSet; import java.util.List; -import java.util.Map; +import java.util.Set; import javax.inject.Inject; import javax.inject.Singleton; import lombok.AccessLevel; @@ -44,12 +43,9 @@ import net.runelite.api.Client; import net.runelite.api.GameObject; import net.runelite.api.GameState; import net.runelite.api.GraphicID; -import net.runelite.api.GraphicsObject; import net.runelite.api.NullObjectID; import net.runelite.api.ObjectID; import net.runelite.api.Projectile; -import net.runelite.api.Tile; -import net.runelite.api.coords.LocalPoint; import net.runelite.api.coords.WorldPoint; import net.runelite.api.events.ConfigChanged; import net.runelite.api.events.GameObjectDespawned; @@ -57,6 +53,7 @@ import net.runelite.api.events.GameObjectSpawned; import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.GameTick; import net.runelite.api.events.ProjectileMoved; +import net.runelite.api.events.ProjectileSpawned; import net.runelite.client.Notifier; import net.runelite.client.config.ConfigManager; import net.runelite.client.eventbus.EventBus; @@ -76,10 +73,6 @@ import net.runelite.client.ui.overlay.OverlayManager; @Slf4j public class AoeWarningPlugin extends Plugin { - @Getter(AccessLevel.PACKAGE) - private final Map bombs = new HashMap<>(); - @Getter(AccessLevel.PACKAGE) - private final Map projectiles = new HashMap<>(); @Inject public AoeWarningConfig config; @Inject @@ -95,20 +88,17 @@ public class AoeWarningPlugin extends Plugin @Inject private EventBus eventbus; @Getter(AccessLevel.PACKAGE) - private List LightningTrail = new ArrayList<>(); + private List lightningTrail = new ArrayList<>(); @Getter(AccessLevel.PACKAGE) - private List AcidTrail = new ArrayList<>(); + private List acidTrail = new ArrayList<>(); @Getter(AccessLevel.PACKAGE) - private List CrystalSpike = new ArrayList<>(); + private List crystalSpike = new ArrayList<>(); @Getter(AccessLevel.PACKAGE) - private List WintertodtSnowFall = new ArrayList<>(); - - @Provides - AoeWarningConfig getConfig(ConfigManager configManager) - { - return configManager.getConfig(AoeWarningConfig.class); - } - + private List wintertodtSnowFall = new ArrayList<>(); + @Getter(AccessLevel.PACKAGE) + private final Set bombs = new HashSet<>(); + @Getter(AccessLevel.PACKAGE) + private final Set projectiles = new HashSet<>(); // Config values private boolean aoeNotifyAll; @Getter(AccessLevel.PACKAGE) @@ -167,28 +157,30 @@ public class AoeWarningPlugin extends Plugin private boolean configCerbFireNotifyEnabled; private boolean configDemonicGorillaEnabled; private boolean configDemonicGorillaNotifyEnabled; - private boolean configMarbleGargoyleEnabled; - private boolean configMarbleGargoyleNotifyEnabled; + + @Provides + AoeWarningConfig getConfig(ConfigManager configManager) + { + return configManager.getConfig(AoeWarningConfig.class); + } @Override - protected void startUp() throws Exception + protected void startUp() { updateConfig(); addSubscriptions(); - overlayManager.add(coreOverlay); overlayManager.add(bombOverlay); reset(); } @Override - protected void shutDown() throws Exception + protected void shutDown() { - eventbus.unregister(this); - overlayManager.remove(coreOverlay); overlayManager.remove(bombOverlay); reset(); + eventbus.unregister(this); } private void addSubscriptions() @@ -199,6 +191,7 @@ public class AoeWarningPlugin extends Plugin eventbus.subscribe(GameObjectDespawned.class, this, this::onGameObjectDespawned); eventbus.subscribe(GameStateChanged.class, this, this::onGameStateChanged); eventbus.subscribe(GameTick.class, this, this::onGameTick); + eventbus.subscribe(ProjectileSpawned.class, this, this::onProjectileSpawned); } private void onConfigChanged(ConfigChanged event) @@ -211,42 +204,60 @@ public class AoeWarningPlugin extends Plugin updateConfig(); } - private void onProjectileMoved(ProjectileMoved event) + private void onProjectileSpawned(ProjectileSpawned event) { - Projectile projectile = event.getProjectile(); + final Projectile projectile = event.getProjectile(); - int projectileId = projectile.getId(); - int projectileLifetime = this.delay + (projectile.getRemainingCycles() * 20); + if (AoeProjectileInfo.getById(projectile.getId()) == null) + { + return; + } + + final int id = projectile.getId(); + final int lifetime = this.delay + (projectile.getRemainingCycles() * 20); int ticksRemaining = projectile.getRemainingCycles() / 30; - if (!isTickTimersEnabledForProjectileID(projectileId)) + if (!isTickTimersEnabledForProjectileID(id)) { ticksRemaining = 0; } - int tickCycle = client.getTickCount() + ticksRemaining; - AoeProjectileInfo aoeProjectileInfo = AoeProjectileInfo.getById(projectileId); - if (aoeProjectileInfo != null - && isConfigEnabledForProjectileId(projectileId, false)) + final int tickCycle = client.getTickCount() + ticksRemaining; + if (isConfigEnabledForProjectileId(id, false)) { - LocalPoint targetPoint = event.getPosition(); - AoeProjectile aoeProjectile = new AoeProjectile(Instant.now(), targetPoint, aoeProjectileInfo, projectileLifetime, tickCycle); - projectiles.put(projectile, aoeProjectile); + projectiles.add(new ProjectileContainer(projectile, Instant.now(), lifetime, tickCycle)); - if (this.aoeNotifyAll || isConfigEnabledForProjectileId(projectileId, true)) + if (this.aoeNotifyAll || isConfigEnabledForProjectileId(id, true)) { notifier.notify("AoE attack detected!"); } } } + private void onProjectileMoved(ProjectileMoved event) + { + if (projectiles.isEmpty()) + { + return; + } + + final Projectile projectile = event.getProjectile(); + + projectiles.forEach(proj -> + { + if (proj.getProjectile() == projectile) + { + proj.setTargetPoint(event.getPosition()); + } + }); + } + private void onGameObjectSpawned(GameObjectSpawned event) { final GameObject gameObject = event.getGameObject(); - final WorldPoint wp = gameObject.getWorldLocation(); switch (gameObject.getId()) { case ObjectID.CRYSTAL_BOMB: - bombs.put(wp, new CrystalBomb(gameObject, client.getTickCount())); + bombs.add(new CrystalBomb(gameObject, client.getTickCount())); if (this.aoeNotifyAll || this.configbombDisplayNotifyEnabled) { @@ -254,16 +265,15 @@ public class AoeWarningPlugin extends Plugin } break; case ObjectID.ACID_POOL: - AcidTrail.add(wp); + acidTrail.add(gameObject); break; case ObjectID.SMALL_CRYSTALS: - CrystalSpike.add(wp); + crystalSpike.add(gameObject); break; case NullObjectID.NULL_26690: - //Wintertodt Snowfall if (this.configWintertodtEnabled) { - WintertodtSnowFall.add(wp); + wintertodtSnowFall.add(gameObject); if (this.aoeNotifyAll || this.configWintertodtNotifyEnabled) { @@ -276,98 +286,55 @@ public class AoeWarningPlugin extends Plugin private void onGameObjectDespawned(GameObjectDespawned event) { - GameObject gameObject = event.getGameObject(); - WorldPoint wp = gameObject.getWorldLocation(); + final GameObject gameObject = event.getGameObject(); + switch (gameObject.getId()) { case ObjectID.CRYSTAL_BOMB: - purgeBombs(bombs); + bombs.removeIf(o -> o.getGameObject() == gameObject); break; case ObjectID.ACID_POOL: - AcidTrail.remove(wp); + acidTrail.remove(gameObject); break; case ObjectID.SMALL_CRYSTALS: - CrystalSpike.remove(wp); + crystalSpike.remove(gameObject); break; case NullObjectID.NULL_26690: - //Wintertodt Snowfall - if (this.configWintertodtEnabled) - { - WintertodtSnowFall.remove(wp); - } + wintertodtSnowFall.remove(gameObject); break; } } - private void onGameStateChanged(GameStateChanged delta) + private void onGameStateChanged(GameStateChanged event) { - if (client.getGameState() == GameState.LOGGED_IN) + if (event.getGameState() == GameState.LOGGED_IN) { - purgeBombs(bombs); + return; } + reset(); } private void onGameTick(GameTick event) { + lightningTrail.clear(); + if (this.configLightningTrail) { - LightningTrail.clear(); - for (GraphicsObject o : client.getGraphicsObjects()) + client.getGraphicsObjects().forEach(o -> { if (o.getId() == GraphicID.OLM_LIGHTNING) { - LightningTrail.add(WorldPoint.fromLocal(client, o.getLocation())); + lightningTrail.add(WorldPoint.fromLocal(client, o.getLocation())); if (this.aoeNotifyAll || this.configLightningTrailNotifyEnabled) { notifier.notify("Lightning!"); } } - } + }); } - for (Map.Entry entry : bombs.entrySet()) - { - CrystalBomb bomb = entry.getValue(); - bomb.bombClockUpdate(); - //bombClockUpdate smooths the shown timer; not using this results in 1.2 --> .6 vs. 1.2 --> 1.1, etc. - } - } - - private void purgeBombs(Map bombs) - { - Iterator> it = bombs.entrySet().iterator(); - Tile[][][] tiles = client.getScene().getTiles(); - - while (it.hasNext()) - { - Map.Entry entry = it.next(); - WorldPoint world = entry.getKey(); - LocalPoint local = LocalPoint.fromWorld(client, world); - - if (local == null) - { - return; - } - - Tile tile = tiles[world.getPlane()][local.getSceneX()][local.getSceneY()]; - GameObject[] objects = tile.getGameObjects(); - boolean containsObjects = false; - - for (GameObject object : objects) - { - if (object != null) - { - containsObjects = true; - } - } - - if (!containsObjects) - { - it.remove(); - } - - } + bombs.forEach(CrystalBomb::bombClockUpdate); } private boolean isTickTimersEnabledForProjectileID(int projectileId) @@ -456,8 +423,6 @@ public class AoeWarningPlugin extends Plugin return notify ? this.configCerbFireNotifyEnabled : this.configCerbFireEnabled; case DEMONIC_GORILLA_BOULDER: return notify ? this.configDemonicGorillaNotifyEnabled : this.configDemonicGorillaEnabled; - case MARBLE_GARGOYLE_AOE: - return notify ? this.configMarbleGargoyleNotifyEnabled : this.configMarbleGargoyleEnabled; } return false; @@ -514,16 +479,14 @@ public class AoeWarningPlugin extends Plugin this.configCerbFireNotifyEnabled = config.isCerbFireNotifyEnabled(); this.configDemonicGorillaEnabled = config.isDemonicGorillaEnabled(); this.configDemonicGorillaNotifyEnabled = config.isDemonicGorillaNotifyEnabled(); - this.configMarbleGargoyleEnabled = config.isMarbleGargoyleEnabled(); - this.configMarbleGargoyleNotifyEnabled = config.isMarbleGargoyleNotifyEnabled(); } private void reset() { - LightningTrail.clear(); - AcidTrail.clear(); - CrystalSpike.clear(); - WintertodtSnowFall.clear(); + lightningTrail.clear(); + acidTrail.clear(); + crystalSpike.clear(); + wintertodtSnowFall.clear(); bombs.clear(); projectiles.clear(); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/aoewarnings/BombOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/aoewarnings/BombOverlay.java index d51b52aee3..707ed7c5c4 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/aoewarnings/BombOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/aoewarnings/BombOverlay.java @@ -33,13 +33,11 @@ import java.text.DecimalFormat; import java.text.NumberFormat; import java.time.Instant; import java.util.Locale; -import java.util.Map; import javax.inject.Inject; import javax.inject.Singleton; import lombok.extern.slf4j.Slf4j; import net.runelite.api.Client; import net.runelite.api.Perspective; -import net.runelite.api.Player; import net.runelite.api.Point; import net.runelite.api.coords.LocalPoint; import net.runelite.api.coords.WorldPoint; @@ -55,24 +53,13 @@ public class BombOverlay extends Overlay { private static final String SAFE = "#00cc00"; - //safe private static final String CAUTION = "#ffff00"; - //1 tile in range (minor damage) private static final String WARNING = "#ff9933"; - //2 tiles in range (moderate damage) private static final String DANGER = "#ff6600"; - //3 tiles in range/adjacent to bomb (major damage) private static final String LETHAL = "#cc0000"; - //On the bomb, using it as a makeshift space launch vehicle. (massive damage) - private static final int BOMB_AOE = 7; private static final int BOMB_DETONATE_TIME = 8; - //This is in ticks. It should be 10, but it varies from 8 to 11. private static final double ESTIMATED_TICK_LENGTH = .6; - //Thank you Woox & co. for this assumption. .6 seconds/tick. - - - //Utilized from the npc highlight code for formatting text being displayed on the client canvas. private static final NumberFormat TIME_LEFT_FORMATTER = DecimalFormat.getInstance(Locale.US); @@ -99,84 +86,73 @@ public class BombOverlay extends Overlay { if (plugin.isConfigbombDisplay()) { - drawBombs(graphics); + drawDangerZone(graphics); } return null; } - private void drawBombs(Graphics2D graphics) - //I can condense drawDangerZone into this. Ambivalent though. + private void drawDangerZone(Graphics2D graphics) { - for (Map.Entry entry : plugin.getBombs().entrySet()) + final WorldPoint loc = client.getLocalPlayer().getWorldLocation(); + plugin.getBombs().forEach(bomb -> { - CrystalBomb bomb = entry.getValue(); - drawDangerZone(graphics, bomb); - } - } + final LocalPoint localLoc = LocalPoint.fromWorld(client, bomb.getWorldLocation()); + final WorldPoint worldLoc = bomb.getWorldLocation(); - private void drawDangerZone(Graphics2D graphics, CrystalBomb bomb) - { - final Player localPlayer = client.getLocalPlayer(); - LocalPoint localLoc = LocalPoint.fromWorld(client, bomb.getWorldLocation()); - if (localLoc == null) - { - return; - } - double distance_x = Math.abs(bomb.getWorldLocation().getX() - localPlayer.getWorldLocation().getX()); - double distance_y = Math.abs(bomb.getWorldLocation().getY() - localPlayer.getWorldLocation().getY()); - Color color_code = Color.decode(SAFE); - //defaults to this unless conditionals met below. + if (localLoc == null) + { + return; + } - if (distance_x < 1 && distance_y < 1) - { - color_code = Color.decode(LETHAL); - } - else if (distance_x < 2 && distance_y < 2) - { - color_code = Color.decode(DANGER); - } - else if (distance_x < 3 && distance_y < 3) - { - color_code = Color.decode(WARNING); - } - else if (distance_x < 4 && distance_y < 4) - { - color_code = Color.decode(CAUTION); - } - LocalPoint CenterPoint = new LocalPoint(localLoc.getX(), localLoc.getY()); - Polygon poly = Perspective.getCanvasTileAreaPoly(client, CenterPoint, BOMB_AOE); + final double distance_x = Math.abs(worldLoc.getX() - loc.getX()); + final double distance_y = Math.abs(worldLoc.getY() - loc.getY()); - if (poly != null) - { - //manually generating the polygon so as to assign a custom alpha value. Request adtl' arg for alpha maybe? - graphics.setColor(color_code); - graphics.setStroke(new BasicStroke(1)); - graphics.drawPolygon(poly); - graphics.setColor(new Color(0, 0, 0, 10)); - graphics.fillPolygon(poly); - } + Color color_code = Color.decode(SAFE); - Instant now = Instant.now(); - double timeLeft = ((BOMB_DETONATE_TIME - (client.getTickCount() - - bomb.getTickStarted())) * ESTIMATED_TICK_LENGTH) - - (now.toEpochMilli() - bomb.getLastClockUpdate().toEpochMilli()) / 1000.0; - //divided by 1000.00 because of milliseconds :) + if (distance_x < 1 && distance_y < 1) + { + color_code = Color.decode(LETHAL); + } + else if (distance_x < 2 && distance_y < 2) + { + color_code = Color.decode(DANGER); + } + else if (distance_x < 3 && distance_y < 3) + { + color_code = Color.decode(WARNING); + } + else if (distance_x < 4 && distance_y < 4) + { + color_code = Color.decode(CAUTION); + } + final LocalPoint CenterPoint = new LocalPoint(localLoc.getX(), localLoc.getY()); + final Polygon poly = Perspective.getCanvasTileAreaPoly(client, CenterPoint, BOMB_AOE); - timeLeft = Math.max(0.0, timeLeft); - String bombTimerString = TIME_LEFT_FORMATTER.format(timeLeft); - int textWidth = graphics.getFontMetrics().stringWidth(bombTimerString); - int textHeight = graphics.getFontMetrics().getAscent(); - Point canvasPoint = Perspective.localToCanvas(client, localLoc.getX(), - localLoc.getY(), bomb.getWorldLocation().getPlane()); + if (poly != null) + { + graphics.setColor(color_code); + graphics.setStroke(new BasicStroke(1)); + graphics.drawPolygon(poly); + graphics.setColor(new Color(0, 0, 0, 10)); + graphics.fillPolygon(poly); + } - if (canvasPoint != null) - { - Point canvasCenterPoint = new Point( - canvasPoint.getX() - textWidth / 2, - canvasPoint.getY() + textHeight / 2); - OverlayUtil.renderTextLocation(graphics, canvasCenterPoint, bombTimerString, color_code); - } + final Instant now = Instant.now(); + double timeLeft = ((BOMB_DETONATE_TIME - (client.getTickCount() - bomb.getTickStarted())) * ESTIMATED_TICK_LENGTH) - + (now.toEpochMilli() - bomb.getLastClockUpdate().toEpochMilli()) / 1000.0; + timeLeft = Math.max(0.0, timeLeft); + final String bombTimerString = TIME_LEFT_FORMATTER.format(timeLeft); + final int textWidth = graphics.getFontMetrics().stringWidth(bombTimerString); + final int textHeight = graphics.getFontMetrics().getAscent(); + final Point canvasPoint = Perspective.localToCanvas(client, localLoc.getX(), localLoc.getY(), worldLoc.getPlane()); + + if (canvasPoint != null) + { + Point canvasCenterPoint = new Point(canvasPoint.getX() - textWidth / 2, canvasPoint.getY() + textHeight / 2); + OverlayUtil.renderTextLocation(graphics, canvasCenterPoint, bombTimerString, color_code); + } + }); } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/aoewarnings/CrystalBomb.java b/runelite-client/src/main/java/net/runelite/client/plugins/aoewarnings/CrystalBomb.java index 0a63fa4b97..ade1288e48 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/aoewarnings/CrystalBomb.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/aoewarnings/CrystalBomb.java @@ -32,28 +32,21 @@ import net.runelite.api.GameObject; import net.runelite.api.coords.WorldPoint; @Slf4j +@Getter(AccessLevel.PACKAGE) class CrystalBomb { - @Getter(AccessLevel.PACKAGE) + private GameObject gameObject; private Instant plantedOn; - - @Getter(AccessLevel.PACKAGE) private Instant lastClockUpdate; - - @Getter(AccessLevel.PACKAGE) private int objectId; - - @Getter(AccessLevel.PACKAGE) private int tickStarted; - // - - @Getter(AccessLevel.PACKAGE) private WorldPoint worldLocation; CrystalBomb(GameObject gameObject, int startTick) { - this.plantedOn = Instant.now(); + this.gameObject = gameObject; this.objectId = gameObject.getId(); + this.plantedOn = Instant.now(); this.worldLocation = gameObject.getWorldLocation(); this.tickStarted = startTick; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/aoewarnings/ProjectileContainer.java b/runelite-client/src/main/java/net/runelite/client/plugins/aoewarnings/ProjectileContainer.java new file mode 100644 index 0000000000..cb226d6262 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/aoewarnings/ProjectileContainer.java @@ -0,0 +1,30 @@ +package net.runelite.client.plugins.aoewarnings; + +import java.time.Instant; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.Setter; +import net.runelite.api.Projectile; +import net.runelite.api.coords.LocalPoint; + +@Getter(AccessLevel.PACKAGE) +class ProjectileContainer +{ + private Projectile projectile; + private Instant startTime; + private AoeProjectileInfo aoeProjectileInfo; + private int lifetime; + private int finalTick; + @Setter(AccessLevel.PACKAGE) + private LocalPoint targetPoint; + + ProjectileContainer(Projectile projectile, Instant startTime, int lifetime, int finalTick) + { + this.projectile = projectile; + this.startTime = startTime; + this.targetPoint = null; + this.aoeProjectileInfo = AoeProjectileInfo.getById(projectile.getId()); + this.lifetime = lifetime; + this.finalTick = finalTick; + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/bosstimer/Boss.java b/runelite-client/src/main/java/net/runelite/client/plugins/bosstimer/Boss.java index 46e52bdf9e..5cbe672527 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/bosstimer/Boss.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/bosstimer/Boss.java @@ -58,7 +58,8 @@ enum Boss KALPHITE_QUEEN(NpcID.KALPHITE_QUEEN_965, 30, ChronoUnit.SECONDS, ItemID.KALPHITE_PRINCESS), DUSK(NpcID.DUSK_7889, 2, ChronoUnit.MINUTES, ItemID.NOON), ALCHEMICAL_HYDRA(NpcID.ALCHEMICAL_HYDRA_8622, 25200, ChronoUnit.MILLIS, ItemID.IKKLE_HYDRA), - SARACHNIS(NpcID.SARACHNIS, 30, ChronoUnit.SECONDS, ItemID.SRARACHA); + SARACHNIS(NpcID.SARACHNIS, 30, ChronoUnit.SECONDS, ItemID.SRARACHA), + ZALCANO(NpcID.ZALCANO_9050, 21600, ChronoUnit.MILLIS, ItemID.SMOLCANO); private static final Map bosses; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java index 4d363e21ac..8304dbd5b2 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java @@ -87,12 +87,12 @@ import org.apache.commons.text.WordUtils; @Slf4j public class ChatCommandsPlugin extends Plugin { - private static final Pattern KILLCOUNT_PATTERN = Pattern.compile("Your (.+) (?:kill|harvest) count is: (\\d+)"); + private static final Pattern KILLCOUNT_PATTERN = Pattern.compile("Your (.+) (?:kill|harvest|lap) count is: (\\d+)"); private static final Pattern RAIDS_PATTERN = Pattern.compile("Your completed (.+) count is: (\\d+)"); private static final Pattern WINTERTODT_PATTERN = Pattern.compile("Your subdued Wintertodt count is: (\\d+)"); private static final Pattern BARROWS_PATTERN = Pattern.compile("Your Barrows chest count is: (\\d+)"); - private static final Pattern KILL_DURATION_PATTERN = Pattern.compile("Fight duration: [0-9:]+. Personal best: ([0-9:]+)"); - private static final Pattern NEW_PB_PATTERN = Pattern.compile("Fight duration: ([0-9:]+) \\(new personal best\\)"); + private static final Pattern KILL_DURATION_PATTERN = Pattern.compile("(?:Fight|Lap) duration: [0-9:]+. Personal best: ([0-9:]+)"); + private static final Pattern NEW_PB_PATTERN = Pattern.compile("(?:Fight|Lap) duration: ([0-9:]+) \\(new personal best\\)"); private static final Pattern DUEL_ARENA_WINS_PATTERN = Pattern.compile("You (were defeated|won)! You have(?: now)? won (\\d+) duels?"); private static final Pattern DUEL_ARENA_LOSSES_PATTERN = Pattern.compile("You have(?: now)? lost (\\d+) duels?"); private static final String TOTAL_LEVEL_COMMAND_STRING = "!total"; @@ -1377,6 +1377,11 @@ public class ChatCommandsPlugin extends Plugin case "raids 2": return "Theatre of Blood"; + // agility course + case "prif": + case "prifddinas": + return "Prifddinas Agility Course"; + default: return WordUtils.capitalize(boss); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/chatfilter/ChatFilterPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/chatfilter/ChatFilterPlugin.java index 9dfd7d428c..22881a5aad 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/chatfilter/ChatFilterPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/chatfilter/ChatFilterPlugin.java @@ -25,6 +25,7 @@ */ package net.runelite.client.plugins.chatfilter; +import com.google.common.base.CharMatcher; import com.google.common.base.Splitter; import com.google.inject.Provides; import java.util.ArrayList; @@ -66,7 +67,7 @@ public class ChatFilterPlugin extends Plugin private static final String CENSOR_MESSAGE = "Hey, everyone, I just tried to say something very silly!"; - private final JagexPrintableCharMatcher jagexPrintableCharMatcher = new JagexPrintableCharMatcher(); + private final CharMatcher jagexPrintableCharMatcher = Text.JAGEX_PRINTABLE_CHAR_MATCHER; private final List filteredPatterns = new ArrayList<>(); @Inject diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/AnagramClue.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/AnagramClue.java index a25e4c7e10..3023754e35 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/AnagramClue.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/AnagramClue.java @@ -162,7 +162,8 @@ public class AnagramClue extends ClueScroll implements TextClueScroll, NpcClueSc new AnagramClue("RAIN COVE", "Veronica", new WorldPoint(3110, 3330, 0), "Outside Draynor Manor"), new AnagramClue("RUG DETER", "Gertrude", new WorldPoint(3151, 3412, 0), "West of Varrock, south of the Cooks' Guild"), new AnagramClue("SIR SHARE RED", "Hairdresser", new WorldPoint(2944, 3381, 0), "Western Falador"), - new AnagramClue("TAUNT ROOF", "Fortunato", new WorldPoint(3080, 3250, 0), "Draynor Village Market") + new AnagramClue("TAUNT ROOF", "Fortunato", new WorldPoint(3080, 3250, 0), "Draynor Village Market"), + new AnagramClue("HICK JET", "Jethick", new WorldPoint(2541, 3305, 0), "West Ardougne", "38") ); private final String text; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CrypticClue.java b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CrypticClue.java index d94275dcdc..9d1c4fc897 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CrypticClue.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/cluescrolls/clues/CrypticClue.java @@ -266,7 +266,7 @@ public class CrypticClue extends ClueScroll implements TextClueScroll, NpcClueSc new CrypticClue("Thanks, Grandma!", "Tynan", new WorldPoint(1836, 3786, 0), "Tynan can be found in the north-east corner of Port Piscarilius."), new CrypticClue("In a town where everyone has perfect vision, seek some locked drawers in a house that sits opposite a workshop.", "Chicken", DRAWERS_25766, new WorldPoint(2709, 3478, 0), "The Seers' Village house south of the Elemental Workshop entrance. Kill any Chicken to obtain a key."), new CrypticClue("The treasure is buried in a small building full of bones. Here is a hint: it's not near a graveyard.", new WorldPoint(3356, 3507, 0), "In the western building near the Limestone quarry east of Varrock. Dig south of the box of bones in the smaller building."), - new CrypticClue("Search the crates in East Ardougne's general store.", CRATE_357, new WorldPoint(2615, 3291, 0), "Located south of the Ardounge church."), + new CrypticClue("Search the crates in East Ardougne's general store.", CRATE_357, new WorldPoint(2615, 3291, 0), "Located south of the Ardougne church."), new CrypticClue("Come brave adventurer, your sense is on fire. If you talk to me, it's an old god you desire.", "Viggora", null, "Speak to Viggora"), new CrypticClue("2 musical birds. Dig in front of the spinning light.", new WorldPoint(2671, 10396, 0), "Dig in front of the spinning light in Ping and Pong's room inside the Iceberg"), new CrypticClue("Search the wheelbarrow in Rimmington mine.", WHEELBARROW_9625, new WorldPoint(2978, 3239, 0), "The Rimmington mining site is located north of Rimmington."), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/examine/ExaminePlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/examine/ExaminePlugin.java index 8fb6cecad4..d715d36e50 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/examine/ExaminePlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/examine/ExaminePlugin.java @@ -42,7 +42,9 @@ import net.runelite.api.events.ChatMessage; import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.MenuOptionClicked; import net.runelite.api.widgets.Widget; +import net.runelite.api.widgets.WidgetID; import net.runelite.api.widgets.WidgetInfo; +import static net.runelite.api.widgets.WidgetInfo.SEED_VAULT_ITEM_CONTAINER; import static net.runelite.api.widgets.WidgetInfo.TO_CHILD; import static net.runelite.api.widgets.WidgetInfo.TO_GROUP; import net.runelite.api.widgets.WidgetItem; @@ -335,6 +337,24 @@ public class ExaminePlugin extends Plugin return new int[]{widgetItem.getItemQuantity(), widgetItem.getItemId()}; } } + else if (WidgetID.SEED_VAULT_GROUP_ID == widgetGroup) + { + Widget[] children = client.getWidget(SEED_VAULT_ITEM_CONTAINER).getDynamicChildren(); + if (actionParam < children.length) + { + Widget widgetItem = children[actionParam]; + return new int[]{widgetItem.getItemQuantity(), widgetItem.getItemId()}; + } + } + else if (WidgetID.SEED_VAULT_INVENTORY_GROUP_ID == widgetGroup) + { + Widget[] children = widget.getDynamicChildren(); + if (actionParam < children.length) + { + Widget widgetItem = children[actionParam]; + return new int[]{widgetItem.getItemQuantity(), widgetItem.getItemId()}; + } + } return null; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItem.java b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItem.java index 69f4894e93..9a28266918 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItem.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItem.java @@ -25,6 +25,8 @@ package net.runelite.client.plugins.grounditems; import java.time.Instant; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; import lombok.Builder; import lombok.Data; import lombok.Value; @@ -51,6 +53,16 @@ class GroundItem private boolean isAlwaysPrivate; private boolean isOwnedByPlayer; private Instant droppedInstant; + + @Nonnull + private LootType lootType; + /** + * Is dropped by me + */ + private boolean isDropped; + + @Nullable + private Instant spawnTime; int getHaPrice() { @@ -62,6 +74,11 @@ class GroundItem return gePrice * quantity; } + boolean isMine() + { + return lootType != LootType.UNKNOWN; + } + @Value static class GroundItemKey { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsPlugin.java index 71f0ccc212..b387ff9279 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsPlugin.java @@ -27,6 +27,7 @@ package net.runelite.client.plugins.grounditems; import com.google.common.cache.CacheBuilder; import com.google.common.cache.LoadingCache; +import com.google.common.collect.EvictingQueue; import com.google.inject.Provides; import java.awt.Color; import java.awt.Rectangle; @@ -40,6 +41,7 @@ import java.util.HashSet; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Queue; import java.util.Set; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.TimeUnit; @@ -72,6 +74,7 @@ import net.runelite.api.events.ItemDespawned; import net.runelite.api.events.ItemQuantityChanged; import net.runelite.api.events.ItemSpawned; import net.runelite.api.events.MenuEntryAdded; +import net.runelite.api.events.MenuOptionClicked; import net.runelite.client.Notifier; import net.runelite.client.config.ConfigManager; import net.runelite.client.eventbus.EventBus; @@ -170,6 +173,7 @@ public class GroundItemsPlugin extends Plugin private EventBus eventBus; private LoadingCache highlightedItems; private LoadingCache hiddenItems; + private final Queue droppedItemQueue = EvictingQueue.create(16); // recently dropped items private Color defaultColor; private Color highlightedColor; @@ -270,6 +274,7 @@ public class GroundItemsPlugin extends Plugin eventBus.subscribe(ClientTick.class, this, this::onClientTick); eventBus.subscribe(MenuEntryAdded.class, this, this::onMenuEntryAdded); eventBus.subscribe(FocusChanged.class, this, this::onFocusChanged); + eventBus.subscribe(MenuOptionClicked.class, this, this::onMenuOptionClicked); } private void onGameTick(GameTick event) @@ -313,6 +318,7 @@ public class GroundItemsPlugin extends Plugin if (existing != null) { existing.setQuantity(existing.getQuantity() + groundItem.getQuantity()); + // The spawn time remains set at the oldest spawn } boolean shouldNotify = !this.onlyShowLoot && this.highlightedColor.equals(getHighlighted( @@ -345,6 +351,10 @@ public class GroundItemsPlugin extends Plugin else { groundItem.setQuantity(groundItem.getQuantity() - item.getQuantity()); + // When picking up an item when multiple stacks appear on the ground, + // it is not known which item is picked up, so we invalidate the spawn + // time + groundItem.setSpawnTime(null); } } @@ -377,14 +387,14 @@ public class GroundItemsPlugin extends Plugin ); Collection items = npcLootReceived.getItems(); - lootReceived(items); + lootReceived(items, LootType.PVM); lootNotifier(items); } private void onPlayerLootReceived(PlayerLootReceived playerLootReceived) { Collection items = playerLootReceived.getItems(); - lootReceived(items); + lootReceived(items, LootType.PVP); lootNotifier(items); } @@ -534,7 +544,7 @@ public class GroundItemsPlugin extends Plugin }).toArray(MenuEntry[]::new)); } - private void lootReceived(Collection items) + private void lootReceived(Collection items, LootType lootType) { for (ItemStack itemStack : items) { @@ -545,6 +555,7 @@ public class GroundItemsPlugin extends Plugin { groundItem.setMine(true); groundItem.setTicks(200); + groundItem.setLootType(lootType); boolean shouldNotify = this.onlyShowLoot && this.highlightedColor.equals(getHighlighted( groundItem.getName(), @@ -586,6 +597,7 @@ public class GroundItemsPlugin extends Plugin durationMillis = NORMAL_DURATION_MILLIS; durationTicks = tile.getWorldLocation().equals(playerLocation) ? NORMAL_DURATION_TICKS * 2 : NORMAL_DURATION_TICKS; } + final boolean dropped = tile.getWorldLocation().equals(client.getLocalPlayer().getWorldLocation()) && droppedItemQueue.remove(itemId); final GroundItem groundItem = GroundItem.builder() .id(itemId) @@ -601,6 +613,9 @@ public class GroundItemsPlugin extends Plugin .isAlwaysPrivate(client.isInInstancedRegion() || (!itemComposition.isTradeable() && realItemId != COINS)) .isOwnedByPlayer(tile.getWorldLocation().equals(playerLocation)) .ticks(durationTicks) + .lootType(LootType.UNKNOWN) + .isDropped(dropped) + .spawnTime(Instant.now()) .build(); @@ -925,6 +940,17 @@ public class GroundItemsPlugin extends Plugin } } + private void onMenuOptionClicked(MenuOptionClicked menuOptionClicked) + { + if (menuOptionClicked.getMenuAction() == MenuAction.ITEM_DROP) + { + int itemId = menuOptionClicked.getIdentifier(); + // Keep a queue of recently dropped items to better detect + // item spawns that are drops + droppedItemQueue.add(itemId); + } + } + private void notifyHighlightedItem(GroundItem item) { final Player local = client.getLocalPlayer(); diff --git a/injected-client/src/main/java/Placeholder.java b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/LootType.java similarity index 86% rename from injected-client/src/main/java/Placeholder.java rename to runelite-client/src/main/java/net/runelite/client/plugins/grounditems/LootType.java index 0e04b3710c..abd6c815e0 100644 --- a/injected-client/src/main/java/Placeholder.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/LootType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 ThatGamerBlue + * Copyright (c) 2019, Adam * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -22,13 +22,11 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +package net.runelite.client.plugins.grounditems; -/** - * @author ThatGamerBlue - * - * This file exists to force gradle to execute the compileJava task - * so we can hijack it and run the injector-plugin - */ -public class Placeholder +enum LootType { + UNKNOWN, + PVP, + PVM; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/groundmarkers/GroundMarkerPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/groundmarkers/GroundMarkerPlugin.java index b4772002ae..77e02e7b3b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/groundmarkers/GroundMarkerPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/groundmarkers/GroundMarkerPlugin.java @@ -300,38 +300,38 @@ public class GroundMarkerPlugin extends Plugin if (hotKeyPressed && event.getOption().equals(WALK_HERE)) { MenuEntry[] menuEntries = client.getMenuEntries(); - int lastIndex = menuEntries.length; - menuEntries = Arrays.copyOf(menuEntries, lastIndex + 4); + int lastIndex = menuEntries.length; + menuEntries = Arrays.copyOf(menuEntries, lastIndex + 4); - final Tile tile = client.getSelectedSceneTile(); - if (tile == null) - { - return; - } - final WorldPoint loc = WorldPoint.fromLocalInstance(client, tile.getLocalLocation()); - final int regionId = loc.getRegionID(); + final Tile tile = client.getSelectedSceneTile(); + if (tile == null) + { + return; + } + final WorldPoint loc = WorldPoint.fromLocalInstance(client, tile.getLocalLocation()); + final int regionId = loc.getRegionID(); - for (int i = 4; i > 0; i--) - { - MenuEntry menuEntry = menuEntries[lastIndex] = new MenuEntry(); + for (int i = 4; i > 0; i--) + { + MenuEntry menuEntry = menuEntries[lastIndex] = new MenuEntry(); - final GroundMarkerPoint point = new GroundMarkerPoint(regionId, loc.getRegionX(), loc.getRegionY(), client.getPlane(), i); - final Optional stream = getPoints(regionId).stream().filter(x -> x.equals(point)).findAny(); - final String option = (stream.isPresent() && stream.get().getGroup() == i) ? UNMARK : MARK; - menuEntry.setOption(ColorUtil.prependColorTag(Text.removeTags(option + (i == 1 ? "" : " (Group " + i + ")")), getColor(i))); - menuEntry.setTarget(event.getTarget()); - menuEntry.setType(MenuAction.RUNELITE.getId()); + final GroundMarkerPoint point = new GroundMarkerPoint(regionId, loc.getRegionX(), loc.getRegionY(), client.getPlane(), i); + final Optional stream = getPoints(regionId).stream().filter(x -> x.equals(point)).findAny(); + final String option = (stream.isPresent() && stream.get().getGroup() == i) ? UNMARK : MARK; + menuEntry.setOption(ColorUtil.prependColorTag(Text.removeTags(option + (i == 1 ? "" : " (Group " + i + ")")), getColor(i))); + menuEntry.setTarget(event.getTarget()); + menuEntry.setType(MenuAction.RUNELITE.getId()); + + lastIndex++; + } - lastIndex++; - } client.setMenuEntries(menuEntries); } } private void onMenuOptionClicked(MenuOptionClicked event) { - if (event.getMenuAction().getId() != MenuAction.RUNELITE.getId() || - !(event.getOption().equals(MARK) || event.getOption().equals(UNMARK))) + if (!event.getOption().contains(MARK) && !event.getOption().contains(UNMARK)) { return; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/implings/Impling.java b/runelite-client/src/main/java/net/runelite/client/plugins/implings/Impling.java index 473fad2c23..968a50c869 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/implings/Impling.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/implings/Impling.java @@ -60,12 +60,33 @@ enum Impling NINJA(ImplingType.NINJA, NpcID.NINJA_IMPLING), NINJA_2(ImplingType.NINJA, NpcID.NINJA_IMPLING_1653), + + CRYSTAL(ImplingType.CRYSTAL, NpcID.CRYSTAL_IMPLING), + CRYSTAL_2(ImplingType.CRYSTAL, NpcID.CRYSTAL_IMPLING_8742), + CRYSTAL_3(ImplingType.CRYSTAL, NpcID.CRYSTAL_IMPLING_8743), + CRYSTAL_4(ImplingType.CRYSTAL, NpcID.CRYSTAL_IMPLING_8744), + CRYSTAL_5(ImplingType.CRYSTAL, NpcID.CRYSTAL_IMPLING_8745), + CRYSTAL_6(ImplingType.CRYSTAL, NpcID.CRYSTAL_IMPLING_8746), + CRYSTAL_7(ImplingType.CRYSTAL, NpcID.CRYSTAL_IMPLING_8747), + CRYSTAL_8(ImplingType.CRYSTAL, NpcID.CRYSTAL_IMPLING_8748), + CRYSTAL_9(ImplingType.CRYSTAL, NpcID.CRYSTAL_IMPLING_8749), + CRYSTAL_10(ImplingType.CRYSTAL, NpcID.CRYSTAL_IMPLING_8750), + CRYSTAL_11(ImplingType.CRYSTAL, NpcID.CRYSTAL_IMPLING_8751), + CRYSTAL_12(ImplingType.CRYSTAL, NpcID.CRYSTAL_IMPLING_8752), + CRYSTAL_13(ImplingType.CRYSTAL, NpcID.CRYSTAL_IMPLING_8753), + CRYSTAL_14(ImplingType.CRYSTAL, NpcID.CRYSTAL_IMPLING_8754), + CRYSTAL_15(ImplingType.CRYSTAL, NpcID.CRYSTAL_IMPLING_8755), + CRYSTAL_16(ImplingType.CRYSTAL, NpcID.CRYSTAL_IMPLING_8756), + CRYSTAL_17(ImplingType.CRYSTAL, NpcID.CRYSTAL_IMPLING_8757), + DRAGON(ImplingType.DRAGON, NpcID.DRAGON_IMPLING), DRAGON_2(ImplingType.DRAGON, NpcID.DRAGON_IMPLING_1654), LUCKY(ImplingType.LUCKY, NpcID.LUCKY_IMPLING), LUCKY_2(ImplingType.LUCKY, NpcID.LUCKY_IMPLING_7302); + + private ImplingType implingType; private final int npcId; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/implings/ImplingType.java b/runelite-client/src/main/java/net/runelite/client/plugins/implings/ImplingType.java index 787adcc46a..8a98bd7186 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/implings/ImplingType.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/implings/ImplingType.java @@ -41,6 +41,7 @@ enum ImplingType NATURE("Nature"), MAGPIE("Magpie"), NINJA("Ninja"), + CRYSTAL("Crystal"), DRAGON("Dragon"), LUCKY("Lucky"); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/implings/ImplingsConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/implings/ImplingsConfig.java index 386284a874..d538509825 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/implings/ImplingsConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/implings/ImplingsConfig.java @@ -232,9 +232,31 @@ public interface ImplingsConfig extends Config { return new Color(71, 70, 75); } - + @ConfigItem( position = 19, + keyName = "showcrystal", + name = "Show Crystal implings", + description = "Configures whether or not Crystal impling tags are displayed" + ) + default boolean showCrystal() + { + return false; + } + + @ConfigItem( + position = 20, + keyName = "crystalColor", + name = "Crystal impling color", + description = "Text color for Crystal implings" + ) + default Color getCrystalColor() + { + return new Color(2, 255, 251); + } + + @ConfigItem( + position = 21, keyName = "showdragon", name = "Show Dragon implings", description = "Configures whether or not Dragon impling tags are displayed" @@ -245,7 +267,7 @@ public interface ImplingsConfig extends Config } @ConfigItem( - position = 20, + position = 22, keyName = "dragonColor", name = "Dragon impling color", description = "Text color for Dragon implings" @@ -256,7 +278,7 @@ public interface ImplingsConfig extends Config } @ConfigItem( - position = 21, + position = 23, keyName = "showlucky", name = "Show Lucky implings", description = "Configures whether or not Lucky impling tags are displayed" @@ -267,7 +289,7 @@ public interface ImplingsConfig extends Config } @ConfigItem( - position = 22, + position = 24, keyName = "luckyColor", name = "Lucky impling color", description = "Text color for Lucky implings" @@ -278,7 +300,7 @@ public interface ImplingsConfig extends Config } @ConfigItem( - position = 23, + position = 25, keyName = "showspawn", name = "Show Spawn locations", description = "Configures whether or not spawn locations are displayed in Puro Puro" @@ -289,7 +311,7 @@ public interface ImplingsConfig extends Config } @ConfigItem( - position = 24, + position = 26, keyName = "spawnColor", name = "Impling spawn color", description = "Text color for impling spawns in Puro Puro" @@ -300,7 +322,7 @@ public interface ImplingsConfig extends Config } @ConfigItem( - position = 25, + position = 27, keyName = "showname", name = "Show name on minimap", description = "Configures whether or not impling names are displayed on minimap" @@ -311,7 +333,7 @@ public interface ImplingsConfig extends Config } @ConfigItem( - position = 26, + position = 28, keyName = "spawnColorDynamic", name = "Impling dynamic spawn color", description = "Text color for dynamic impling spawns in Puro Puro" diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/implings/ImplingsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/implings/ImplingsPlugin.java index d005a30af3..7c1f3077de 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/implings/ImplingsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/implings/ImplingsPlugin.java @@ -105,6 +105,8 @@ public class ImplingsPlugin extends Plugin private Color getMagpieColor; private boolean showNinja; private Color getNinjaColor; + private boolean showCrystal; + private Color getCrystalColor; private boolean showDragon; private Color getDragonColor; private boolean showLucky; @@ -260,6 +262,8 @@ public class ImplingsPlugin extends Plugin return this.showMagpie; case NINJA: return this.showNinja; + case CRYSTAL: + return this.showCrystal; case DRAGON: return this.showDragon; case LUCKY: @@ -303,6 +307,8 @@ public class ImplingsPlugin extends Plugin return this.getMagpieColor; case NINJA: return this.getNinjaColor; + case CRYSTAL: + return this.getCrystalColor; case DRAGON: return this.getDragonColor; case LUCKY: @@ -342,6 +348,8 @@ public class ImplingsPlugin extends Plugin this.getMagpieColor = config.getMagpieColor(); this.showNinja = config.showNinja(); this.getNinjaColor = config.getNinjaColor(); + this.showCrystal = config.showCrystal(); + this.getCrystalColor = config.getCrystalColor(); this.showDragon = config.showDragon(); this.getDragonColor = config.getDragonColor(); this.showLucky = config.showLucky(); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemprices/ItemPricesOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemprices/ItemPricesOverlay.java index 1b06ce6714..01be8dc8c0 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemprices/ItemPricesOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemprices/ItemPricesOverlay.java @@ -97,9 +97,9 @@ class ItemPricesOverlay extends Overlay switch (action) { case ITEM_USE_ON_WIDGET: - if (!client.getSelectedSpellName().equalsIgnoreCase("high level alchemy") || !plugin.isShowAlchProfit()) + if (!menuEntry.getTarget().contains("High Level Alchemy") || !plugin.isShowAlchProfit()) { - return null; + break; } case WIDGET_DEFAULT: case ITEM_USE: diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatChanges.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatChanges.java index c03da92e0f..dc20acc1d8 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatChanges.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/ItemStatChanges.java @@ -319,6 +319,8 @@ import static net.runelite.api.ItemID.SLICE_OF_CAKE; import static net.runelite.api.ItemID.SPICY_CRUNCHIES; import static net.runelite.api.ItemID.SPICY_SAUCE; import static net.runelite.api.ItemID.SPICY_STEW; +import static net.runelite.api.ItemID.SPIDER_ON_SHAFT_6299; +import static net.runelite.api.ItemID.SPIDER_ON_STICK_6297; import static net.runelite.api.ItemID.SPINACH_ROLL; import static net.runelite.api.ItemID.SPRING_SQIRKJUICE; import static net.runelite.api.ItemID.SQUARE_SANDWICH; @@ -501,6 +503,7 @@ public class ItemStatChanges add(combo(2, food(8), heal(RUN_ENERGY, 5)), PAPAYA_FRUIT); add(range(food(5), food(7)), THIN_SNAIL_MEAT); add(range(food(7), food(9)), FAT_SNAIL_MEAT); + add(range(food(7), food(10)), SPIDER_ON_STICK_6297, SPIDER_ON_SHAFT_6299); // Dorgeshuun Cuisine add(food(2), BAT_SHISH, COATED_FROGS_LEGS, FILLETS, FINGERS, FROGBURGER, FROGSPAWN_GUMBO, GREEN_GLOOP_SOUP, diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java index 88f37516b9..e959bb7fbc 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerPlugin.java @@ -115,6 +115,7 @@ import net.runelite.http.api.loottracker.GameItem; import net.runelite.http.api.loottracker.LootRecord; import net.runelite.http.api.loottracker.LootRecordType; import net.runelite.http.api.loottracker.LootTrackerClient; +import org.apache.commons.lang3.ArrayUtils; @PluginDescriptor( name = "Loot Tracker", @@ -135,7 +136,17 @@ public class LootTrackerPlugin extends Plugin // Herbiboar loot handling private static final String HERBIBOAR_LOOTED_MESSAGE = "You harvest herbs from the herbiboar, whereupon it escapes."; - private static final String HERBIBOR_EVENT = "Herbiboar"; + private static final String HERBIBOAR_EVENT = "Herbiboar"; + + // Hespori loot handling + private static final String HESPORI_LOOTED_MESSAGE = "You have successfully cleared this patch for new crops."; + private static final String HESPORI_EVENT = "Hespori"; + private static final int HESPORI_REGION = 5021; + + // Gauntlet loot handling + private static final String GAUNTLET_LOOTED_MESSAGE = "You open the chest."; + private static final String GAUNTLET_EVENT = "The Gauntlet"; + private static final int GAUNTLET_LOBBY_REGION = 12127; // Chest loot handling private static final String CHEST_LOOTED_MESSAGE = "You find some treasure in the chest!"; @@ -144,7 +155,8 @@ public class LootTrackerPlugin extends Plugin 5179, "Brimstone Chest", 11573, "Crystal Chest", 12093, "Larran's big chest", - 13113, "Larran's small chest" + 13113, "Larran's small chest", + 13151, "Elven Crystal Chest" ); private static final File LOOT_RECORDS_FILE = new File(RuneLite.RUNELITE_DIR, "lootRecords.json"); private static final Set RESPAWN_REGIONS = ImmutableSet.of( @@ -163,6 +175,10 @@ public class LootTrackerPlugin extends Plugin @VisibleForTesting private Collection lootRecords = new ArrayList<>(); private boolean pvpDeath = false; + + // Last man standing map regions + private static final Set LAST_MAN_STANDING_REGIONS = ImmutableSet.of(13658, 13659, 13914, 13915, 13916); + @Inject private ClientToolbar clientToolbar; @Inject @@ -511,6 +527,11 @@ public class LootTrackerPlugin extends Plugin private void onPlayerLootReceived(final PlayerLootReceived playerLootReceived) { + // Ignore Last Man Standing player loots + if (isAtLMS()) + { + return; + } if (this.sendLootValueMessages) { if (WorldType.isDeadmanWorld(client.getWorldType()) || WorldType.isHighRiskWorld(client.getWorldType()) || @@ -564,16 +585,18 @@ public class LootTrackerPlugin extends Plugin container = client.getItemContainer(InventoryID.CHAMBERS_OF_XERIC_CHEST); chestLooted = true; break; - case (WidgetID.THEATRE_OF_BLOOD_GROUP_ID): + case (WidgetID.THEATRE_OF_BLOOD_REWARD_GROUP_ID): if (chestLooted) { return; } - int region = WorldPoint.fromLocalInstance(client, client.getLocalPlayer().getLocalLocation()).getRegionID(); - if (region != THEATRE_OF_BLOOD_REGION) + + if (WorldPoint.fromLocalInstance(client, client.getLocalPlayer() + .getLocalLocation()).getRegionID() != THEATRE_OF_BLOOD_REGION) { return; } + eventType = "Theatre of Blood"; container = client.getItemContainer(InventoryID.THEATRE_OF_BLOOD_CHEST); chestLooted = true; @@ -678,7 +701,7 @@ public class LootTrackerPlugin extends Plugin if (message.equals(HERBIBOAR_LOOTED_MESSAGE)) { - eventType = HERBIBOR_EVENT; + eventType = HERBIBOAR_EVENT; takeInventorySnapshot(); return; @@ -686,6 +709,21 @@ public class LootTrackerPlugin extends Plugin // Remove all tags final String chatMessage = Text.removeTags(message); + + final int regionID = client.getLocalPlayer().getWorldLocation().getRegionID(); + if (HESPORI_REGION == regionID && message.equals(HESPORI_LOOTED_MESSAGE)) + { + eventType = HESPORI_EVENT; + takeInventorySnapshot(); + return; + } + + if (GAUNTLET_LOBBY_REGION == regionID && message.equals(GAUNTLET_LOOTED_MESSAGE)) + { + eventType = GAUNTLET_EVENT; + takeInventorySnapshot(); + return; + } // Check if message is for a clue scroll reward final Matcher m = CLUE_SCROLL_PATTERN.matcher(chatMessage); @@ -808,7 +846,10 @@ public class LootTrackerPlugin extends Plugin } } - if (eventType != null && (CHEST_EVENT_TYPES.containsValue(eventType) || HERBIBOR_EVENT.equals(eventType))) + if (CHEST_EVENT_TYPES.containsValue(eventType) + || HERBIBOAR_EVENT.equals(eventType) + || HESPORI_EVENT.equals(eventType) + || GAUNTLET_EVENT.equals(eventType)) { if (event.getItemContainer() != client.getItemContainer(InventoryID.INVENTORY)) { @@ -1046,6 +1087,24 @@ public class LootTrackerPlugin extends Plugin }).collect(Collectors.toList()); } + /** + * Is player at the Last Man Standing minigame + */ + private boolean isAtLMS() + { + final int[] mapRegions = client.getMapRegions(); + + for (int region : LAST_MAN_STANDING_REGIONS) + { + if (ArrayUtils.contains(mapRegions, region)) + { + return true; + } + } + + return false; + } + private void updateConfig() { this.getIgnoredItems = config.getIgnoredItems(); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/localstorage/events/LTNameChange.java b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/localstorage/events/LTNameChange.java index c5b166aacd..130c3ef440 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/localstorage/events/LTNameChange.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/localstorage/events/LTNameChange.java @@ -24,6 +24,8 @@ */ package net.runelite.client.plugins.loottracker.localstorage.events; -public class LTNameChange +import net.runelite.api.events.Event; + +public class LTNameChange implements Event { } \ No newline at end of file diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/localstorage/events/LTRecordStored.java b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/localstorage/events/LTRecordStored.java index 31c4da4426..098b497ad6 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/localstorage/events/LTRecordStored.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/localstorage/events/LTRecordStored.java @@ -25,10 +25,11 @@ package net.runelite.client.plugins.loottracker.localstorage.events; import lombok.Data; +import net.runelite.api.events.Event; import net.runelite.client.plugins.loottracker.localstorage.LTRecord; @Data -public class LTRecordStored +public class LTRecordStored implements Event { private final LTRecord record; } \ No newline at end of file diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/party/messages/LocationUpdate.java b/runelite-client/src/main/java/net/runelite/client/plugins/party/messages/LocationUpdate.java index f5bf7131ce..1def4ffd2a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/party/messages/LocationUpdate.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/party/messages/LocationUpdate.java @@ -27,11 +27,12 @@ package net.runelite.client.plugins.party.messages; import lombok.EqualsAndHashCode; import lombok.Value; import net.runelite.api.coords.WorldPoint; +import net.runelite.api.events.Event; import net.runelite.http.api.ws.messages.party.PartyMemberMessage; @Value @EqualsAndHashCode(callSuper = true) -public class LocationUpdate extends PartyMemberMessage +public class LocationUpdate extends PartyMemberMessage implements Event { private final WorldPoint worldPoint; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/party/messages/SkillUpdate.java b/runelite-client/src/main/java/net/runelite/client/plugins/party/messages/SkillUpdate.java index 10f5810b0f..fd7f8f12ed 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/party/messages/SkillUpdate.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/party/messages/SkillUpdate.java @@ -27,11 +27,12 @@ package net.runelite.client.plugins.party.messages; import lombok.AllArgsConstructor; import lombok.Getter; import net.runelite.api.Skill; +import net.runelite.api.events.Event; import net.runelite.http.api.ws.messages.party.PartyMemberMessage; @AllArgsConstructor @Getter -public class SkillUpdate extends PartyMemberMessage +public class SkillUpdate extends PartyMemberMessage implements Event { private final Skill skill; private final int value; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/party/messages/TilePing.java b/runelite-client/src/main/java/net/runelite/client/plugins/party/messages/TilePing.java index fb4f812a81..40b3f7db78 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/party/messages/TilePing.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/party/messages/TilePing.java @@ -27,11 +27,12 @@ package net.runelite.client.plugins.party.messages; import lombok.EqualsAndHashCode; import lombok.Value; import net.runelite.api.coords.WorldPoint; +import net.runelite.api.events.Event; import net.runelite.http.api.ws.messages.party.PartyMemberMessage; @Value @EqualsAndHashCode(callSuper = true) -public class TilePing extends PartyMemberMessage +public class TilePing extends PartyMemberMessage implements Event { private final WorldPoint point; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/privateserver/PrivateServerConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/privateserver/PrivateServerConfig.java index 94e5fc1c9e..af05480ffc 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/privateserver/PrivateServerConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/privateserver/PrivateServerConfig.java @@ -17,7 +17,7 @@ public interface PrivateServerConfig extends Config ) default String codebase() { - return "http://oldschool17.runescape.com/"; + return "http://127.0.0.1"; } @ConfigItem( diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/privateserver/PrivateServerPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/privateserver/PrivateServerPlugin.java index 7bde24c158..0d33714bf9 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/privateserver/PrivateServerPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/privateserver/PrivateServerPlugin.java @@ -35,6 +35,7 @@ import javax.swing.JOptionPane; import lombok.extern.slf4j.Slf4j; import net.runelite.api.Client; import net.runelite.api.events.ConfigChanged; +import net.runelite.client.RuneLite; import net.runelite.client.config.ConfigManager; import net.runelite.client.eventbus.EventBus; import net.runelite.client.plugins.Plugin; @@ -69,14 +70,20 @@ public class PrivateServerPlugin extends Plugin @Override protected void startUp() throws Exception { - updateConfig(); - addSubscriptions(); + if (RuneLite.allowPrivateServer) + { + updateConfig(); + addSubscriptions(); + } } @Override protected void shutDown() throws Exception { - eventBus.unregister(this); + if (RuneLite.allowPrivateServer) + { + eventBus.unregister(this); + } } private void addSubscriptions() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/questlist/QuestListPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/questlist/QuestListPlugin.java index 775d28179b..eda32cbea8 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/questlist/QuestListPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/questlist/QuestListPlugin.java @@ -364,7 +364,14 @@ public class QuestListPlugin extends Plugin else { // Otherwise hide if it doesn't match the filter state - hidden = currentFilterState != QuestState.ALL && questState != null && !questState.equals(currentFilterState); + if (currentFilterState == QuestState.NOT_COMPLETED) + { + hidden = questState == QuestState.COMPLETE; + } + else + { + hidden = currentFilterState != QuestState.ALL && questState != currentFilterState; + } } quest.setHidden(hidden); @@ -398,7 +405,8 @@ public class QuestListPlugin extends Plugin NOT_STARTED(0xff0000, "Not started", SpriteID.MINIMAP_ORB_HITPOINTS), IN_PROGRESS(0xffff00, "In progress", SpriteID.MINIMAP_ORB_HITPOINTS_DISEASE), COMPLETE(0xdc10d, "Completed", SpriteID.MINIMAP_ORB_HITPOINTS_POISON), - ALL(0, "All", SpriteID.MINIMAP_ORB_PRAYER); + ALL(0, "All", SpriteID.MINIMAP_ORB_PRAYER), + NOT_COMPLETED(0, "Not Completed", SpriteID.MINIMAP_ORB_RUN); private final int color; private final String name; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsConfig.java index 47805b8f39..c42e7e80f0 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsConfig.java @@ -196,11 +196,11 @@ public interface RaidsConfig extends Config @ConfigItem( position = 12, parent = "scouterConfig", - keyName = "layoutMessage", + keyName = "displayLayoutMessage", name = "Send raid layout message when entering raid", description = "Sends game message with raid layout on entering new raid" ) - default boolean layoutMessage() + default boolean displayLayoutMessage() { return true; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsPlugin.java index 16494579e6..e73188e953 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/raids/RaidsPlugin.java @@ -34,7 +34,6 @@ import java.awt.image.BufferedImage; import java.text.DecimalFormat; import java.time.Instant; import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -97,6 +96,10 @@ import net.runelite.client.util.ImageUtil; import net.runelite.client.util.Text; import org.apache.commons.lang3.StringUtils; import static org.apache.commons.lang3.StringUtils.containsIgnoreCase; +import net.runelite.client.ws.PartyMember; +import net.runelite.client.ws.PartyService; +import net.runelite.client.ws.WSClient; +import net.runelite.http.api.ws.messages.party.PartyChatMessage; @PluginDescriptor( name = "CoX Scouter", @@ -199,6 +202,28 @@ public class RaidsPlugin extends Plugin @Inject private EventBus eventBus; private boolean raidStarted; + + @Inject + private PartyService party; + + @Inject + private WSClient ws; + + @Getter + private final List roomWhitelist = new ArrayList<>(); + + @Getter + private final List roomBlacklist = new ArrayList<>(); + + @Getter + private final List rotationWhitelist = new ArrayList<>(); + + @Getter + private final List layoutWhitelist = new ArrayList<>(); + + @Getter + private Raid raid; + private boolean inRaidChambers; private boolean enhanceScouterTitle; private boolean hideBackground; @@ -211,7 +236,6 @@ public class RaidsPlugin extends Plugin private boolean displayFloorBreak; private boolean showRecommendedItems; private boolean alwaysShowWorldAndCC; - private boolean layoutMessage; private boolean colorTightrope; private boolean crabHandler; private boolean enableRotationWhitelist; @@ -232,7 +256,8 @@ public class RaidsPlugin extends Plugin private Color rareCrabColor; private Color scavPrepColor; private Color tightropeColor; - private Raid raid; + private boolean displayLayoutMessage; + private String layoutMessage; private RaidsTimer timer; private WidgetOverlay widgetOverlay; private NavigationButton navButton; @@ -244,10 +269,6 @@ public class RaidsPlugin extends Plugin private String tooltip; private String goodCrabs; private String layoutFullCode; - private List roomWhitelist = new ArrayList<>(); - private List roomBlacklist = new ArrayList<>(); - private List rotationWhitelist = new ArrayList<>(); - private List layoutWhitelist = new ArrayList<>(); private List partyMembers = new ArrayList<>(); private List startingPartyMembers = new ArrayList<>(); private Map> recommendedItemsList = new HashMap<>(); @@ -688,7 +709,7 @@ public class RaidsPlugin extends Plugin private void sendRaidLayoutMessage() { - if (!this.layoutMessage) + if (!this.displayLayoutMessage) { return; } @@ -725,6 +746,22 @@ public class RaidsPlugin extends Plugin .build()) .build()); } + + final PartyMember localMember = party.getLocalMember(); + + if (party.getMembers().isEmpty() || localMember == null) + { + chatMessageManager.queue(QueuedMessage.builder() + .type(ChatMessageType.FRIENDSCHATNOTIFICATION) + .runeLiteFormattedMessage(layoutMessage) + .build()); + } + else + { + final PartyChatMessage message = new PartyChatMessage(layoutMessage); + message.setMemberId(localMember.getMemberId()); + ws.send(message); + } } private void updateInfoBoxState() @@ -828,28 +865,28 @@ public class RaidsPlugin extends Plugin } else { - list.addAll(Arrays.asList(input.toLowerCase().split(SPLIT_REGEX))); + list.addAll(Text.fromCSV(input.toLowerCase())); } } int getRotationMatches() { String rotation = raid.getRotationString().toLowerCase(); - String[] bosses = rotation.split(SPLIT_REGEX); + List bosses = Text.fromCSV(rotation); if (rotationWhitelist.contains(rotation)) { - return bosses.length; + return bosses.size(); } for (String whitelisted : rotationWhitelist) { int matches = 0; - String[] whitelistedBosses = whitelisted.split(SPLIT_REGEX); + List whitelistedBosses = Text.fromCSV(whitelisted); - for (int i = 0; i < whitelistedBosses.length; i++) + for (int i = 0; i < whitelistedBosses.size(); i++) { - if (i < bosses.length && whitelistedBosses[i].equals(bosses[i])) + if (i < bosses.size() && whitelistedBosses.get(i).equals(bosses.get(i))) { matches++; } @@ -1240,7 +1277,7 @@ public class RaidsPlugin extends Plugin this.showRecommendedItems = config.showRecommendedItems(); this.recommendedItems = config.recommendedItems(); this.alwaysShowWorldAndCC = config.alwaysShowWorldAndCC(); - this.layoutMessage = config.layoutMessage(); + this.displayLayoutMessage = config.displayLayoutMessage(); this.colorTightrope = config.colorTightrope(); this.tightropeColor = config.tightropeColor(); this.crabHandler = config.crabHandler(); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/runeliteplus/RuneLitePlusPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/runeliteplus/RuneLitePlusPlugin.java index 6cedf124c5..f694be8ef4 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/runeliteplus/RuneLitePlusPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/runeliteplus/RuneLitePlusPlugin.java @@ -38,7 +38,6 @@ import net.runelite.api.widgets.WidgetID; import static net.runelite.api.widgets.WidgetInfo.*; import net.runelite.client.callback.ClientThread; import net.runelite.client.config.RuneLitePlusConfig; -import net.runelite.client.discord.DiscordService; import net.runelite.client.eventbus.EventBus; import net.runelite.client.input.KeyListener; import net.runelite.client.input.KeyManager; @@ -59,9 +58,6 @@ public class RuneLitePlusPlugin extends Plugin @Inject private RuneLitePlusConfig config; - @Inject - private DiscordService discordService; - @Inject private KeyManager keyManager; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/slayer/SlayerPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/slayer/SlayerPlugin.java index 7c1e482eea..022f1b55c1 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/slayer/SlayerPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/slayer/SlayerPlugin.java @@ -738,7 +738,14 @@ public class SlayerPlugin extends Plugin if (cachedXp != 0) { - final int taskKillExp = Task.getTask(taskName).getExpectedKillExp(); + final Task task = Task.getTask(taskName); + + if (task == null) + { + return; + } + + final int taskKillExp = task.getExpectedKillExp(); // Only count exp gain as a kill if the task either has no expected exp for a kill, or if the exp gain is equal // to the expected exp gain for the task. diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/slayer/Task.java b/runelite-client/src/main/java/net/runelite/client/plugins/slayer/Task.java index d074b4fd6d..351ad38b6f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/slayer/Task.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/slayer/Task.java @@ -33,6 +33,7 @@ import java.util.Collections; import java.util.List; import java.util.Map; import lombok.AccessLevel; +import javax.annotation.Nullable; import lombok.Getter; import net.runelite.api.ItemID; import net.runelite.api.NpcID; @@ -355,6 +356,7 @@ enum Task this.expectedKillExp = 0; } + @Nullable static Task getTask(String taskName) { return tasks.get(taskName.toLowerCase()); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/smelting/SmeltingOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/smelting/SmeltingOverlay.java index 017aef6ddd..ff4b468725 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/smelting/SmeltingOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/smelting/SmeltingOverlay.java @@ -49,7 +49,7 @@ import net.runelite.client.ui.overlay.components.table.TableComponent; @Singleton class SmeltingOverlay extends Overlay { - private static final int SMELT_TIMEOUT = 5; + private static final int SMELT_TIMEOUT = 7; private final Client client; private final SmeltingPlugin plugin; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/specialcounter/SpecialCounterUpdate.java b/runelite-client/src/main/java/net/runelite/client/plugins/specialcounter/SpecialCounterUpdate.java index efb8b308a8..46cb32e134 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/specialcounter/SpecialCounterUpdate.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/specialcounter/SpecialCounterUpdate.java @@ -26,11 +26,12 @@ package net.runelite.client.plugins.specialcounter; import lombok.EqualsAndHashCode; import lombok.Value; +import net.runelite.api.events.Event; import net.runelite.http.api.ws.messages.party.PartyMemberMessage; @Value @EqualsAndHashCode(callSuper = true) -class SpecialCounterUpdate extends PartyMemberMessage +class SpecialCounterUpdate extends PartyMemberMessage implements Event { private final int npcId; private final SpecialWeapon weapon; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/ticktimers/NPCContainer.java b/runelite-client/src/main/java/net/runelite/client/plugins/ticktimers/NPCContainer.java index d0a1328c88..29e8c87623 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/ticktimers/NPCContainer.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/ticktimers/NPCContainer.java @@ -102,11 +102,11 @@ class NPCContainer COMMANDER_ZILYANA(NpcID.COMMANDER_ZILYANA, AttackStyle.UNKNOWN, ImmutableSet.of(AnimationID.ZILYANA_AUTO, AnimationID.ZILYANA_MELEE_AUTO, AnimationID.ZILYANA_SPEC)), FLIGHT_KILISA(NpcID.FLIGHT_KILISA, AttackStyle.MELEE, ImmutableSet.of(AnimationID.KILISA_AUTO)), - FLOCKLEADER_GEERIN(NpcID.FLOCKLEADER_GEERIN, AttackStyle.MAGE, ImmutableSet.of(AnimationID.GEERIN_AUTO, AnimationID.GEERIN_FLINCH)), - WINGMAN_SKREE(NpcID.WINGMAN_SKREE, AttackStyle.RANGE, ImmutableSet.of(AnimationID.SKREE_AUTO)), + FLOCKLEADER_GEERIN(NpcID.FLOCKLEADER_GEERIN, AttackStyle.RANGE, ImmutableSet.of(AnimationID.GEERIN_AUTO, AnimationID.GEERIN_FLINCH)), + WINGMAN_SKREE(NpcID.WINGMAN_SKREE, AttackStyle.MAGE, ImmutableSet.of(AnimationID.SKREE_AUTO)), KREEARRA(NpcID.KREEARRA, AttackStyle.RANGE, ImmutableSet.of(AnimationID.KREE_RANGED)), - DAGANNOTH_REX(NpcID.DAGANNOTH_REX, AttackStyle.MAGE, ImmutableSet.of(AnimationID.DAG_REX)), + DAGANNOTH_REX(NpcID.DAGANNOTH_REX, AttackStyle.MELEE, ImmutableSet.of(AnimationID.DAG_REX)), DAGANNOTH_SUPREME(NpcID.DAGANNOTH_SUPREME, AttackStyle.RANGE, ImmutableSet.of(AnimationID.DAG_SUPREME)), DAGANNOTH_PRIME(NpcID.DAGANNOTH_PRIME, AttackStyle.MAGE, ImmutableSet.of(AnimationID.DAG_PRIME)); @@ -147,4 +147,4 @@ class NPCContainer private Color color; private Prayer prayer; } -} \ No newline at end of file +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/farming/FarmingWorld.java b/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/farming/FarmingWorld.java index d74d9027f3..4683f2feb9 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/farming/FarmingWorld.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/farming/FarmingWorld.java @@ -244,6 +244,13 @@ class FarmingWorld new FarmingPatch("", Varbits.FARMING_7907, PatchImplementation.REDWOOD) )); + add(new FarmingRegion("Prifddinas", 13151, + new FarmingPatch("North", Varbits.FARMING_4771, PatchImplementation.ALLOTMENT), + new FarmingPatch("South", Varbits.FARMING_4772, PatchImplementation.ALLOTMENT), + new FarmingPatch("", Varbits.FARMING_4773, PatchImplementation.FLOWER), + new FarmingPatch("", Varbits.FARMING_4775, PatchImplementation.CRYSTAL_TREE) + )); + // Finalize this.regions = Collections.unmodifiableMap(regions); Map> umtabs = new TreeMap<>(); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/farming/PatchImplementation.java b/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/farming/PatchImplementation.java index 1aab9a7320..401269d34d 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/farming/PatchImplementation.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/farming/PatchImplementation.java @@ -224,7 +224,7 @@ public enum PatchImplementation } if (value >= 63 && value <= 69) { - // snape grass seedling,Snape grass plant[Inspect,Guide] 33674,33675,33676,33677,33678,33679,33680 + // Snape grass seedling,Snape grass plant[Inspect,Guide] 33674,33675,33676,33677,33678,33679,33680 return new PatchState(Produce.SNAPE_GRASS, CropState.GROWING, value - 63); } if (value >= 70 && value <= 73) @@ -2391,7 +2391,7 @@ public enum PatchImplementation } if (value >= 46 && value <= 51) { - // Diseased Poato cactus[Cure,Inspect,Guide] 33749,33750,33751,33752,33753,33754 + // Diseased Potato cactus[Cure,Inspect,Guide] 33749,33750,33751,33752,33753,33754 return new PatchState(Produce.POTATO_CACTUS, CropState.DISEASED, value - 45); } if (value >= 52 && value <= 57) @@ -2575,6 +2575,34 @@ public enum PatchImplementation } return null; } + }, + CRYSTAL_TREE(Tab.FRUIT_TREE, "Crystal Tree") + { + @Override + PatchState forVarbitValue(int value) + { + if (value >= 0 && value <= 3) + { + // Crystal tree patch[Rake,Inspect,Guide] 34910,34909,34908,34907 + return new PatchState(Produce.WEEDS, CropState.GROWING, 3 - value); + } + if (value >= 8 && value <= 13) + { + // Crystal tree[Inspect,Guide] 34911,34912,34913,34914,34915,34916 + return new PatchState(Produce.CRYSTAL_TREE, CropState.GROWING, value - 8); + } + if (value == 14) + { + // Crystal tree[Check-health,Inspect,Guide] 34917 + return new PatchState(Produce.CRYSTAL_TREE, CropState.GROWING, Produce.CRYSTAL_TREE.getStages() - 1); + } + if (value == 15) + { + // Crystal tree[Chop-down,Inspect,Guide] 34918 + return new PatchState(Produce.CRYSTAL_TREE, CropState.HARVESTABLE, 0); + } + return null; + } }; @Nullable diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/farming/Produce.java b/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/farming/Produce.java index 66883eedba..bcb4e5ab0b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/farming/Produce.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/farming/Produce.java @@ -129,7 +129,8 @@ public enum Produce SPIRIT_TREE("Spirit tree", ItemID.SPIRIT_TREE, 320, 13), CELASTRUS("Celastrus", ItemID.BATTLESTAFF, 160, 6, 0, 4), REDWOOD("Redwood", ItemID.REDWOOD_LOGS, 640, 11), - HESPORI("Hespori", NullItemID.NULL_23044, 640, 4, 0, 2); + HESPORI("Hespori", NullItemID.NULL_23044, 640, 4, 0, 2), + CRYSTAL_TREE("Crystal tree", ItemID.CRYSTAL_SHARDS, 80, 7); /** * User-visible name diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/wildernesslocations/WildernessLocationsMapOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/wildernesslocations/WildernessLocationsMapOverlay.java index 222efa2562..cbf56934e0 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/wildernesslocations/WildernessLocationsMapOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/wildernesslocations/WildernessLocationsMapOverlay.java @@ -79,8 +79,8 @@ public class WildernessLocationsMapOverlay extends Overlay final int y1 = worldLocation.getWorldArea().getY(); final int y2 = worldLocation.getWorldArea().getY() + worldLocation.getWorldArea().getHeight(); final int plane = worldLocation.getWorldArea().getPlane(); - final Point point = mapWorldPointToGraphicsPoint(new WorldPoint(x1, y2, plane)); - final Point point1 = mapWorldPointToGraphicsPoint(new WorldPoint(x2, y1, plane)); + final Point point = mapWorldPointToGraphicsPoint(new WorldPoint(x1, y1, plane)); + final Point point1 = mapWorldPointToGraphicsPoint(new WorldPoint(x2, y2, plane)); if (point == null || point1 == null) { continue; @@ -89,7 +89,7 @@ public class WildernessLocationsMapOverlay extends Overlay int height = point.getY() - point1.getY(); - Rectangle rectangle = new Rectangle(point.getX(), point1.getY(), width, height); + Rectangle rectangle = new Rectangle(point.getX(), point.getY(), width, height); // These would be unreadable unless font color is black if (worldLocation.equals(WorldLocation.ICE_GATE) || worldLocation.equals(WorldLocation.ICE_ROCK)) @@ -97,7 +97,7 @@ public class WildernessLocationsMapOverlay extends Overlay graphics.setColor(Color.BLACK); if (plugin.isWorldMapNames()) { - graphics.drawString(worldLocation.getName(), point.getX(), point.getY()); + graphics.drawString(worldLocation.getName(), point.getX(), point1.getY()); } if (plugin.isOutlineLocations()) { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/FarmingPatchLocation.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/FarmingPatchLocation.java index 73b903ab26..bfb3e446ae 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/FarmingPatchLocation.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/FarmingPatchLocation.java @@ -40,7 +40,8 @@ enum FarmingPatchLocation new WorldPoint(3598, 3524, 0), new WorldPoint(3052, 3309, 0), new WorldPoint(2810, 3462, 0), - new WorldPoint(2663, 3375, 0) + new WorldPoint(2663, 3375, 0), + new WorldPoint(3289, 6100, 0) ), ANIMA_HERB("Anima/Herb", new WorldPoint(1235, 3724, 0)), BELLADONNA("Belladonna", new WorldPoint(3084, 3356, 0)), @@ -59,6 +60,9 @@ enum FarmingPatchLocation CELASTRUS_FRUIT_TREE("Celastrus/Fruit Tree", new WorldPoint(1242, 3755, 0) ), + CRYSTAL_TREE("Crystal Tree", + new WorldPoint(3292, 6120, 0) + ), FRUIT_TREE("Fruit Tree", new WorldPoint(2487, 3181, 0), new WorldPoint(2343, 3160, 0), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/MinigameLocation.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/MinigameLocation.java index 1b87a8f067..4158308d1e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/MinigameLocation.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/MinigameLocation.java @@ -70,7 +70,8 @@ enum MinigameLocation ANIMATION_ROOM("Animation Room", new WorldPoint(2853, 3537, 0)), DUMMY_ROOM("Dummy Room", new WorldPoint(2857, 3551, 0)), CATAPULT_ROOM("Catapult Room", new WorldPoint(2842, 3545, 0)), - SHOT_PUT_ROOM("Shot Put Room", new WorldPoint(2863, 3550, 0)); + SHOT_PUT_ROOM("Shot Put Room", new WorldPoint(2863, 3550, 0)), + THE_GAUNTLET("The Gauntlet", new WorldPoint(3223, 12505, 1)); private final String tooltip; private final WorldPoint location; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/QuestStartLocation.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/QuestStartLocation.java index cfa3d9fb12..d15ddf86b1 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/QuestStartLocation.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/QuestStartLocation.java @@ -122,15 +122,15 @@ enum QuestStartLocation MAKING_HISTORY(Quest.MAKING_HISTORY, new WorldPoint(2435, 3346, 0)), MONKS_FRIEND(Quest.MONKS_FRIEND, new WorldPoint(2605, 3209, 0)), MOUNTAIN_DAUGHTER(Quest.MOUNTAIN_DAUGHTER, new WorldPoint(2810, 3672, 0)), - MOURNINGS_ENDS_PART_I(Quest.MOURNINGS_ENDS_PART_I, new WorldPoint(2289, 3149, 0)), - MOURNINGS_ENDS_PART_II(Quest.MOURNINGS_ENDS_PART_II, new WorldPoint(2352, 3172, 0)), + MOURNINGS_END_PART_I(Quest.MOURNINGS_END_PART_I, new WorldPoint(2289, 3149, 0)), + MOURNINGS_END_PART_II(Quest.MOURNINGS_END_PART_II, new WorldPoint(2352, 3172, 0)), MURDER_MYSTERY(Quest.MURDER_MYSTERY, new WorldPoint(2740, 3562, 0)), MY_ARMS_BIG_ADVENTURE(Quest.MY_ARMS_BIG_ADVENTURE, new WorldPoint(2908, 10088, 0)), NATURE_SPIRIT(Quest.NATURE_SPIRIT, new WorldPoint(3440, 9894, 0)), OBSERVATORY_QUEST(Quest.OBSERVATORY_QUEST, new WorldPoint(2438, 3185, 0)), OLAFS_QUEST(Quest.OLAFS_QUEST, new WorldPoint(2723, 3729, 0)), ONE_SMALL_FAVOUR(Quest.ONE_SMALL_FAVOUR, new WorldPoint(2834, 2985, 0)), - PLAGUE_CITY(Quest.PLAGUE_CITY, new WorldPoint(2567, 3334, 0)), + PLAGUE_CITY_SONG_OF_THE_ELVES(new Quest[]{Quest.PLAGUE_CITY, Quest.SONG_OF_THE_ELVES}, new WorldPoint(2567, 3334, 0)), PRIEST_IN_PERIL(Quest.PRIEST_IN_PERIL, new WorldPoint(3219, 3473, 0)), THE_QUEEN_OF_THIEVES(Quest.THE_QUEEN_OF_THIEVES, new WorldPoint(1795, 3782, 0)), RAG_AND_BONE_MAN(new Quest[]{Quest.RAG_AND_BONE_MAN, Quest.RAG_AND_BONE_MAN_II}, new WorldPoint(3359, 3504, 0)), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/RareTreeLocation.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/RareTreeLocation.java index 843d6eb645..452eef5bc7 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/RareTreeLocation.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/RareTreeLocation.java @@ -50,7 +50,10 @@ enum RareTreeLocation new WorldPoint(2899, 2897, 0), // Feldip Hills - new WorldPoint(2333, 3049, 0)), + new WorldPoint(2333, 3049, 0), + + // Prifddinas + new WorldPoint(3309, 6123, 0)), SWAYING("Swaying tree", 40, // The Fremennik Trials @@ -78,7 +81,11 @@ enum RareTreeLocation new WorldPoint(2726, 3501, 0), new WorldPoint(2728, 3481, 0), new WorldPoint(2748, 3466, 0), - new WorldPoint(2710, 3570, 0)), + new WorldPoint(2710, 3570, 0), + + // Prifddinas + new WorldPoint(2209, 3427, 0), + new WorldPoint(3233, 6179, 0)), MAHOGANY("Mahogany tree", 50, // Zeah @@ -92,7 +99,10 @@ enum RareTreeLocation new WorldPoint(3824, 3053, 0), // Karamja - new WorldPoint(2946, 2908, 0)), + new WorldPoint(2946, 2908, 0), + + // Prifddinas + new WorldPoint(3301, 6129, 0)), TEAK_MAHOGANY("Teak/Mahogany trees", 50, // Miscellania @@ -126,6 +136,10 @@ enum RareTreeLocation // Tirannwn new WorldPoint(2217, 3141, 0), + // Prifddinas + new WorldPoint(3288, 6066, 0), + new WorldPoint(3305, 6032, 0), + // Kandarin new WorldPoint(2315, 3610, 0), new WorldPoint(2331, 3514, 0), @@ -202,6 +216,9 @@ enum RareTreeLocation // Tirannwn new WorldPoint(2284, 3141, 0), + // Prifddinas + new WorldPoint(3229, 6101, 0), + // Kandarin new WorldPoint(2371, 3427, 0), new WorldPoint(2432, 3411, 0), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TeleportLocationData.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TeleportLocationData.java index 5444d43c82..959eed144a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TeleportLocationData.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TeleportLocationData.java @@ -139,6 +139,8 @@ enum TeleportLocationData PHARAOHS_SCEPTRE_JALEUSTROPHOS(TeleportType.OTHER, "Pharaoh's Sceptre", "Jaleustrophos (Agility Pyramid)", new WorldPoint(3341, 2827, 0), "pharaohs_sceptre_teleport_icon.png"), PHARAOHS_SCEPTRE_JALDRAOCHT(TeleportType.OTHER, "Pharaoh's Sceptre", "Jaldraocht (Desert Treasure Pyramid)", new WorldPoint(3232, 2897, 0), "pharaohs_sceptre_teleport_icon.png"), CAMULET_TEMPLE(TeleportType.OTHER, "Camulet", "Enakhra's Temple", new WorldPoint(3190, 2923, 0), "camulet_teleport_icon.png"), + TELEPORT_CRYSTAL_LLETYA(TeleportType.OTHER, "Teleport crystal", "Lletya", new WorldPoint(2330, 3172, 0), "teleport_crystal_icon.png"), + TELEPORT_CRYSTAL_PRIFDDINAS(TeleportType.OTHER, "Teleport crystal", "Prifddinas", new WorldPoint(3264, 6065, 0), "teleport_crystal_icon.png"), // Wilderness OBELISK_13(TeleportType.OTHER, "Obelisk", "13", new WorldPoint(3156, 3620, 0), "obelisk_icon.png"), @@ -167,7 +169,7 @@ enum TeleportLocationData // Scrolls DIGSITE_SCROLL(TeleportType.SCROLL, "Digsite Teleport", new WorldPoint(3324, 3412, 0), "scroll_teleport_icon.png"), - ELF_CAMP_SCROLL(TeleportType.SCROLL, "Elf Camp Teleport", new WorldPoint(2193, 3257, 0), "scroll_teleport_icon.png"), + IORWERTH_CAMP_SCROLL(TeleportType.SCROLL, "Iorwerth Camp Teleport", new WorldPoint(2193, 3257, 0), "scroll_teleport_icon.png"), FELDIP_HILLS_SCROLL(TeleportType.SCROLL, "Feldip Hills Teleport", new WorldPoint(2542, 2925, 0), "scroll_teleport_icon.png"), LUMBERYARD_SCROLL(TeleportType.SCROLL, "Lumberyard Teleport", new WorldPoint(3303, 3487, 0), "scroll_teleport_icon.png"), LUNAR_ISLE_SCROLL(TeleportType.SCROLL, "Lunar Isle Teleport", new WorldPoint(2093, 3912, 0), "scroll_teleport_icon.png"), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TransportationPointLocation.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TransportationPointLocation.java index a82e77fa72..9ef2cab0ed 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TransportationPointLocation.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/TransportationPointLocation.java @@ -114,6 +114,8 @@ enum TransportationPointLocation CHARTER_PORT_PHASMATYS("Charter Ship", new WorldPoint(3702, 3503, 0)), CHARTER_PORTSARIM("Charter Ship", new WorldPoint(3037, 3191, 0)), CHARTER_TYRAS("Charter Ship", new WorldPoint(2141, 3123, 0)), + CHARTER_PRIFDDINAS("Charter Ship", new WorldPoint(2156, 3331, 0)), + CHARTER_PRIFDDINAS_INSTANCE("Charter Ship", new WorldPoint(3180, 6083, 0)), //Minecarts/Carts MINE_CART_ARCEUUS("Minecart", new WorldPoint(1673, 3832, 0)), @@ -155,6 +157,7 @@ enum TransportationPointLocation SPIRITTREE_GNOMESTRONGHOLD("Spirit Tree", new WorldPoint(2459, 3446, 0)), SPIRITTREE_GNOMEVILLAGE("Spirit Tree", new WorldPoint(2538, 3166, 0)), SPIRITTREE_GRANDEXCHANGE("Spirit Tree", new WorldPoint(3184, 3510, 0)), + SPIRITTREE_PRIFDDINAS("Spirit Tree", new WorldPoint(3274, 6124, 0)), //Carpets CARPET_KHARID("Carpet to Bedabin/Pollnivneach/Uzer", new WorldPoint(3311, 3107, 0)), @@ -172,6 +175,7 @@ enum TransportationPointLocation TELEPORT_RUNE_ARDOUGNE("Teleport to Rune Essence", new WorldPoint(2681, 3325, 0)), TELEPORT_RUNE_YANILLE("Teleport to Rune Essence", new WorldPoint(2592, 3089, 0)), TELEPORT_SORCERESS_GARDEN("Teleport to Sorceress's Garden", new WorldPoint(3320, 3141, 0)), + TELEPORT_PRIFDDINAS_LIBRARY("Teleport to Priffdinas Library", new WorldPoint(3254, 6082, 2)), //Other ALTER_KOUREND_UNDERGROUND("Altar to Skotizo", new WorldPoint(1662, 10047, 0)), diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpTrackerConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpTrackerConfig.java index 616844739b..9f4cedef32 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpTrackerConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpTrackerConfig.java @@ -94,6 +94,17 @@ public interface XpTrackerConfig extends Config @ConfigItem( position = 4, + keyName = "skillTabOverlayMenuOptions", + name = "Add skill tab canvas menu option", + description = "Configures whether a menu option to show/hide canvas XP trackers will be added to skills on the skill tab" + ) + default boolean skillTabOverlayMenuOptions() + { + return true; + } + + @ConfigItem( + position = 5, keyName = "onScreenDisplayMode", name = "On-screen tracker display mode (top)", description = "Configures the information displayed in the first line of on-screen XP overlays" @@ -104,7 +115,7 @@ public interface XpTrackerConfig extends Config } @ConfigItem( - position = 4, + position = 6, keyName = "onScreenDisplayModeBottom", name = "On-screen tracker display mode (bottom)", description = "Configures the information displayed in the second line of on-screen XP overlays" diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpTrackerPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpTrackerPlugin.java index f926248040..e504738eab 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpTrackerPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpTrackerPlugin.java @@ -31,6 +31,7 @@ import com.google.inject.Binder; import com.google.inject.Provides; import java.awt.image.BufferedImage; import java.time.temporal.ChronoUnit; +import java.util.Arrays; import java.util.EnumSet; import java.util.List; import java.util.Objects; @@ -42,6 +43,8 @@ import net.runelite.api.Actor; import net.runelite.api.Client; import net.runelite.api.Experience; import net.runelite.api.GameState; +import net.runelite.api.MenuAction; +import net.runelite.api.MenuEntry; import net.runelite.api.NPC; import net.runelite.api.Player; import net.runelite.api.Skill; @@ -51,7 +54,11 @@ import net.runelite.api.events.ConfigChanged; import net.runelite.api.events.ExperienceChanged; import net.runelite.api.events.GameStateChanged; import net.runelite.api.events.GameTick; +import net.runelite.api.events.MenuEntryAdded; +import net.runelite.api.events.MenuOptionClicked; import net.runelite.api.events.NpcDespawned; +import net.runelite.api.widgets.WidgetID; +import static net.runelite.api.widgets.WidgetInfo.TO_GROUP; import net.runelite.client.config.ConfigManager; import net.runelite.client.eventbus.EventBus; import net.runelite.client.game.NPCManager; @@ -64,6 +71,7 @@ import net.runelite.client.ui.ClientToolbar; import net.runelite.client.ui.NavigationButton; import net.runelite.client.ui.overlay.OverlayManager; import net.runelite.client.util.ImageUtil; +import net.runelite.client.util.Text; import net.runelite.http.api.xp.XpClient; @PluginDescriptor( @@ -79,6 +87,9 @@ public class XpTrackerPlugin extends Plugin */ private static final int XP_THRESHOLD = 10_000; + private static final String MENUOP_ADD_CANVAS_TRACKER = "Add to canvas"; + private static final String MENUOP_REMOVE_CANVAS_TRACKER = "Remove from canvas"; + static final List COMBAT = ImmutableList.of( Skill.ATTACK, Skill.STRENGTH, @@ -178,6 +189,8 @@ public class XpTrackerPlugin extends Plugin eventBus.subscribe(ExperienceChanged.class, this, this::onExperienceChanged); eventBus.subscribe(NpcDespawned.class, this, this::onNpcDespawned); eventBus.subscribe(GameTick.class, this, this::onGameTick); + eventBus.subscribe(MenuEntryAdded.class, this, this::onMenuEntryAdded); + eventBus.subscribe(MenuOptionClicked.class, this, this::onMenuOptionClicked); } private void onGameStateChanged(GameStateChanged event) @@ -402,6 +415,64 @@ public class XpTrackerPlugin extends Plugin } } + private void onMenuEntryAdded(final MenuEntryAdded event) + { + int widgetID = event.getActionParam1(); + + if (TO_GROUP(widgetID) != WidgetID.SKILLS_GROUP_ID + || !event.getOption().startsWith("View") + || !xpTrackerConfig.skillTabOverlayMenuOptions()) + { + return; + } + + // Get skill from menu option, eg. "View Attack guide" + final String skillText = event.getOption().split(" ")[1]; + final Skill skill = Skill.valueOf(Text.removeTags(skillText).toUpperCase()); + + MenuEntry[] menuEntries = client.getMenuEntries(); + menuEntries = Arrays.copyOf(menuEntries, menuEntries.length + 1); + + MenuEntry menuEntry = menuEntries[menuEntries.length - 1] = new MenuEntry(); + menuEntry.setTarget(skillText); + menuEntry.setOption(hasOverlay(skill) ? MENUOP_REMOVE_CANVAS_TRACKER : MENUOP_ADD_CANVAS_TRACKER); + menuEntry.setParam0(event.getActionParam0()); + menuEntry.setParam1(widgetID); + menuEntry.setType(MenuAction.RUNELITE.getId()); + + client.setMenuEntries(menuEntries); + } + + private void onMenuOptionClicked(MenuOptionClicked event) + { + if (event.getMenuAction().getId() != MenuAction.RUNELITE.getId() + || TO_GROUP(event.getIdentifier()) != WidgetID.SKILLS_GROUP_ID) + { + return; + } + + final Skill skill; + try + { + skill = Skill.valueOf(Text.removeTags(event.getTarget()).toUpperCase()); + } + catch (IllegalArgumentException ex) + { + log.debug(null, ex); + return; + } + + switch (event.getOption()) + { + case MENUOP_ADD_CANVAS_TRACKER: + addOverlay(skill); + break; + case MENUOP_REMOVE_CANVAS_TRACKER: + removeOverlay(skill); + break; + } + } + XpSnapshotSingle getSkillSnapshot(Skill skill) { return xpState.getSkillSnapshot(skill); @@ -589,6 +660,11 @@ public class XpTrackerPlugin extends Plugin } } + private boolean hasOverlay(final Skill skill) + { + return overlayManager.anyMatch(o -> o instanceof XpInfoBoxOverlay && ((XpInfoBoxOverlay) o).getSkill() == skill); + } + private void onConfigChanged(ConfigChanged event) { if (!event.getGroup().equals("xpTracker")) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/zoom/ZoomConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/zoom/ZoomConfig.java index 91821ba91b..36ca67e64f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/zoom/ZoomConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/zoom/ZoomConfig.java @@ -34,6 +34,12 @@ public interface ZoomConfig extends Config { int OUTER_LIMIT_MIN = -400; int OUTER_LIMIT_MAX = 400; + /** + * The largest (most zoomed in) value that can be used without the client crashing. + * + * Larger values trigger an overflow in the engine's fov to scale code. + */ + int INNER_ZOOM_LIMIT = 1004; @ConfigItem( keyName = "inner", @@ -91,7 +97,7 @@ public interface ZoomConfig extends Config ) @Range( min = OUTER_LIMIT_MIN, - max = OUTER_LIMIT_MAX + max = INNER_ZOOM_LIMIT ) default int ctrlZoomValue() { diff --git a/runelite-client/src/main/java/net/runelite/client/rs/ClientConfigLoader.java b/runelite-client/src/main/java/net/runelite/client/rs/ClientConfigLoader.java index 9d3804ebab..735c8a459d 100644 --- a/runelite-client/src/main/java/net/runelite/client/rs/ClientConfigLoader.java +++ b/runelite-client/src/main/java/net/runelite/client/rs/ClientConfigLoader.java @@ -25,30 +25,22 @@ */ package net.runelite.client.rs; -import com.google.common.annotations.VisibleForTesting; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; -import javax.inject.Inject; -import javax.inject.Singleton; -import okhttp3.OkHttpClient; +import net.runelite.http.api.RuneLiteAPI; import okhttp3.Request; import okhttp3.Response; -@Singleton class ClientConfigLoader { - private static final String CONFIG_URL = "http://oldschool.runescape.com/jav_config.ws"; - private final OkHttpClient httpClient; - - @Inject - @VisibleForTesting - ClientConfigLoader(final OkHttpClient httpClient) + public ClientConfigLoader() { - this.httpClient = httpClient; } - RSConfig fetch() throws IOException + private static final String CONFIG_URL = "http://oldschool.runescape.com/jav_config.ws"; + + static RSConfig fetch() throws IOException { final Request request = new Request.Builder() .url(CONFIG_URL) @@ -56,8 +48,8 @@ class ClientConfigLoader final RSConfig config = new RSConfig(); - try (final Response response = httpClient.newCall(request).execute(); final BufferedReader in = new BufferedReader( - new InputStreamReader(response.body().byteStream()))) + try (final Response response = RuneLiteAPI.CLIENT.newCall(request).execute(); + final BufferedReader in = new BufferedReader(new InputStreamReader(response.body().byteStream()))) { String str; diff --git a/runelite-client/src/main/java/net/runelite/client/rs/ClientLoader.java b/runelite-client/src/main/java/net/runelite/client/rs/ClientLoader.java index 8dc0942bd4..ac1499ab3c 100644 --- a/runelite-client/src/main/java/net/runelite/client/rs/ClientLoader.java +++ b/runelite-client/src/main/java/net/runelite/client/rs/ClientLoader.java @@ -26,23 +26,20 @@ */ package net.runelite.client.rs; -import com.google.common.io.ByteStreams; -import lombok.extern.slf4j.Slf4j; - +import java.net.URLClassLoader; +import java.applet.Applet; +import java.io.IOException; +import java.net.URL; import javax.inject.Inject; import javax.inject.Named; import javax.inject.Singleton; -import java.applet.Applet; -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.net.URLClassLoader; +import lombok.extern.slf4j.Slf4j; +import net.runelite.client.RuneLite; @Slf4j @Singleton public class ClientLoader { - public static boolean useLocalInjected = false; private final ClientConfigLoader clientConfigLoader; private final ClientUpdateCheckMode updateCheckMode; @@ -55,34 +52,46 @@ public class ClientLoader this.clientConfigLoader = clientConfigLoader; } + public Applet load() + { + try + { + final RSConfig config = clientConfigLoader.fetch(); + + switch (updateCheckMode) + { + case AUTO: + default: + return loadRLPlus(config); + case VANILLA: + return loadVanilla(config); + case NONE: + return null; + case RSPS: + RuneLite.allowPrivateServer = true; + return loadRLPlus(config); + } + } + catch (IOException | InstantiationException | IllegalAccessException e) + { + log.error("Error loading RS!", e); + return null; + } + catch (ClassNotFoundException e) + { + log.error("Unable to load client - class not found. This means you" + + " are not running RuneLite with Maven as the injected client" + + " is not in your classpath."); + + log.error("Error loading RS!", e); + return null; + } + } + private static Applet loadRLPlus(final RSConfig config) throws ClassNotFoundException, InstantiationException, IllegalAccessException { - ClassLoader rsClassLoader = new ClassLoader(ClientLoader.class.getClassLoader()) - { - @Override - protected Class findClass(String name) throws ClassNotFoundException - { - String path = "/injected-client/".concat(name.replace('.', '/')).concat(".class"); - InputStream inputStream = ClientLoader.class.getResourceAsStream(path); - if (inputStream == null) - { - throw new ClassNotFoundException(name + " " + path); - } - byte[] data; - try - { - data = ByteStreams.toByteArray(inputStream); - } - catch (IOException e) - { - e.printStackTrace(); - throw new RuntimeException("Failed to load class: " + name + " " + path); - } - return defineClass(name, data, 0, data.length); - } - }; - Class clientClass = rsClassLoader.loadClass("client"); + final Class clientClass = ClientLoader.class.getClassLoader().loadClass(config.getInitialClass()); return loadFromClass(config, clientClass); } @@ -108,37 +117,4 @@ public class ClientLoader rs.setStub(new RSAppletStub(config)); return rs; } - - public Applet load() - { - try - { - final RSConfig config = clientConfigLoader.fetch(); - - switch (updateCheckMode) - { - case AUTO: - default: - return loadRLPlus(config); - case VANILLA: - return loadVanilla(config); - case NONE: - return null; - } - } - catch (IOException | InstantiationException | IllegalAccessException e) - { - log.error("Error loading RS!", e); - return null; - } - catch (ClassNotFoundException e) - { - log.error("Unable to load client - class not found. This means you" - + " are not running RuneLite with Maven as the injected client" - + " is not in your classpath."); - - log.error("Error loading RS!", e); - return null; - } - } } diff --git a/runelite-client/src/main/java/net/runelite/client/rs/ClientUpdateCheckMode.java b/runelite-client/src/main/java/net/runelite/client/rs/ClientUpdateCheckMode.java index 4d1dd55796..bec27bb7c5 100644 --- a/runelite-client/src/main/java/net/runelite/client/rs/ClientUpdateCheckMode.java +++ b/runelite-client/src/main/java/net/runelite/client/rs/ClientUpdateCheckMode.java @@ -29,6 +29,5 @@ public enum ClientUpdateCheckMode AUTO, NONE, VANILLA, - CUSTOM, - PATCH + RSPS } diff --git a/runelite-client/src/main/java/net/runelite/client/rs/RSAppletStub.java b/runelite-client/src/main/java/net/runelite/client/rs/RSAppletStub.java index 8d5944cdf0..6b73a5f284 100644 --- a/runelite-client/src/main/java/net/runelite/client/rs/RSAppletStub.java +++ b/runelite-client/src/main/java/net/runelite/client/rs/RSAppletStub.java @@ -27,6 +27,7 @@ package net.runelite.client.rs; import java.applet.AppletContext; import java.applet.AppletStub; +import java.io.File; import java.net.MalformedURLException; import java.net.URL; import lombok.RequiredArgsConstructor; @@ -56,7 +57,14 @@ class RSAppletStub implements AppletStub try { if (RuneLite.allowPrivateServer) - return new URL(StringFileUtils.readStringFromFile("./codebase")); + { + File f = new File(RuneLite.RUNELITE_DIR + "/codebase"); + if (!f.exists()) + { + StringFileUtils.writeStringToFile(f.getAbsolutePath(), "http://127.0.0.1"); + } + return new URL(StringFileUtils.readStringFromFile(f.getAbsolutePath())); + } return new URL(config.getCodeBase()); } diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayManager.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayManager.java index aafbf0a5d4..7e70a53b88 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayManager.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayManager.java @@ -215,6 +215,17 @@ public class OverlayManager return removeIf; } + /** + * Returns whether an overlay exists which matches the given predicate. + * + * @param filter Filter predicate function + * @return {@code true} if any overlays match the given filter, {@code false} otherwise + */ + public synchronized boolean anyMatch(Predicate filter) + { + return overlays.stream().anyMatch(filter); + } + /** * Clear all overlays */ diff --git a/runelite-client/src/main/java/net/runelite/client/util/DeferredEventBus.java b/runelite-client/src/main/java/net/runelite/client/util/DeferredEventBus.java index 9fd82a51c2..94eb2d4693 100644 --- a/runelite-client/src/main/java/net/runelite/client/util/DeferredEventBus.java +++ b/runelite-client/src/main/java/net/runelite/client/util/DeferredEventBus.java @@ -29,6 +29,7 @@ import java.util.Queue; import java.util.concurrent.ConcurrentLinkedQueue; import javax.inject.Inject; import javax.inject.Singleton; +import net.runelite.api.events.Event; import net.runelite.client.eventbus.EventBus; import org.apache.commons.lang3.tuple.ImmutablePair; import org.apache.commons.lang3.tuple.Pair; @@ -37,7 +38,7 @@ import org.apache.commons.lang3.tuple.Pair; public class DeferredEventBus extends EventBus { private final EventBus eventBus; - private final Queue> pendingEvents = new ConcurrentLinkedQueue<>(); + private final Queue> pendingEvents = new ConcurrentLinkedQueue<>(); @Inject private DeferredEventBus(EventBus eventBus) @@ -46,7 +47,7 @@ public class DeferredEventBus extends EventBus } @Override - public void post(Class eventClass, @NonNull Object event) + public void post(Class eventClass, @NonNull Event event) { pendingEvents.add(new ImmutablePair<>(eventClass, event)); } @@ -57,7 +58,7 @@ public class DeferredEventBus extends EventBus int size = pendingEvents.size(); while (size-- > 0) { - Pair eventPair = pendingEvents.poll(); + Pair eventPair = pendingEvents.poll(); if (eventPair != null) { eventBus.post(eventPair.getKey(), eventPair.getValue()); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/chatfilter/JagexPrintableCharMatcher.java b/runelite-client/src/main/java/net/runelite/client/util/JagexPrintableCharMatcher.java similarity index 97% rename from runelite-client/src/main/java/net/runelite/client/plugins/chatfilter/JagexPrintableCharMatcher.java rename to runelite-client/src/main/java/net/runelite/client/util/JagexPrintableCharMatcher.java index 72591d71f0..41bc771e9d 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/chatfilter/JagexPrintableCharMatcher.java +++ b/runelite-client/src/main/java/net/runelite/client/util/JagexPrintableCharMatcher.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.client.plugins.chatfilter; +package net.runelite.client.util; import com.google.common.base.CharMatcher; diff --git a/runelite-client/src/main/java/net/runelite/client/util/Text.java b/runelite-client/src/main/java/net/runelite/client/util/Text.java index 67892bdbc3..48a5b8b576 100644 --- a/runelite-client/src/main/java/net/runelite/client/util/Text.java +++ b/runelite-client/src/main/java/net/runelite/client/util/Text.java @@ -46,6 +46,8 @@ public class Text private static final Joiner COMMA_JOINER = Joiner.on(",").skipNulls(); + public static final CharMatcher JAGEX_PRINTABLE_CHAR_MATCHER = new JagexPrintableCharMatcher(); + /** * Splits comma separated values to list of strings * diff --git a/runelite-client/src/main/java/net/runelite/client/util/bootstrap/Bootstrap.java b/runelite-client/src/main/java/net/runelite/client/util/bootstrap/Bootstrap.java index ccbc6dc57e..62fb948cfb 100644 --- a/runelite-client/src/main/java/net/runelite/client/util/bootstrap/Bootstrap.java +++ b/runelite-client/src/main/java/net/runelite/client/util/bootstrap/Bootstrap.java @@ -10,11 +10,11 @@ import java.security.DigestInputStream; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import javax.xml.bind.DatatypeConverter; -import net.runelite.http.api.RuneLiteAPI; import org.codehaus.plexus.util.FileUtils; public class Bootstrap { + private String projectVersion = "1.5.30-SNAPSHOT"; String buildCommit = "6fe334c02648d3f8b38625e3175e3f547d54aa37"; Client client = new Client(); String[] clientJvm9Arguments = new String[]{ @@ -45,6 +45,7 @@ public class Bootstrap "-XX:+UseParNewGC", "-Djna.nosys=true"}; private Artifact[] artifacts = getArtifacts(); + Bootstrap() { } @@ -106,7 +107,7 @@ public class Bootstrap { try { - artifacts = new Artifact[45]; + artifacts = new Artifact[48]; //Static artifacts artifacts[0] = new Artifact(); @@ -115,19 +116,19 @@ public class Bootstrap artifacts[0].path = "https://mvn.runelite.net/org/ow2/asm/asm-all/6.0_BETA/asm-all-6.0_BETA.jar"; artifacts[0].size = "265176"; artifacts[1] = new Artifact(); - artifacts[1].hash = "37abf0103ce5318bfda004fabc004c75ed0dc6d392a8459175692ab7eac97083"; - artifacts[1].name = "naturalmouse-2.0.0.jar"; - artifacts[1].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/artifacts/naturalmouse-2.0.0.jar"; + artifacts[1].hash = "7f0f013961c81d7069d0c0afc569de9ef4791b700be37fab417b0f5352294b73"; + artifacts[1].name = "naturalmouse-2.0.1.jar"; + artifacts[1].path = "https://repo1.maven.org/maven2/com/github/joonasvali/naturalmouse/naturalmouse/2.0.1/naturalmouse-2.0.1.jar"; artifacts[1].size = "3168921"; artifacts[2] = new Artifact(); - artifacts[2].hash = "50d1e07f11827672249dee9ce8a23691fc59f663deed084bb7b52a4f778d5fbc"; - artifacts[2].name = "jcl-core-2.9-SNAPSHOT.jar"; - artifacts[2].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/artifacts/jcl-core-2.9-SNAPSHOT.jar"; + artifacts[2].hash = "72c88d597188ab386ec4de598203675d6286de569812454d732e379c9ecb0ed7"; + artifacts[2].name = "jcl-core-2.8jar"; + artifacts[2].path = "https://repo1.maven.org/maven2/org/xeustechnologies/jcl-core/2.8/jcl-core-2.8.jar"; artifacts[2].size = "3168921"; artifacts[4] = new Artifact(); - artifacts[4].hash = "18c4a0095d5c1da6b817592e767bb23d29dd2f560ad74df75ff3961dbde25b79"; - artifacts[4].name = "slf4j-api-1.7.25.jar"; - artifacts[4].path = "https://mvn.runelite.net/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar"; + artifacts[4].hash = "6d9e5b86cfd1dd44c676899285b5bb4fa0d371cf583e8164f9c8a0366553242b"; + artifacts[4].name = "slf4j-api-1.7.26.jar"; + artifacts[4].path = "https://repo1.maven.org/maven2/org/slf4j/slf4j-api/1.7.26/slf4j-api-1.7.26.jar"; artifacts[4].size = "41203"; artifacts[5] = new Artifact(); artifacts[5].hash = "fb53f8539e7fcb8f093a56e138112056ec1dc809ebb020b59d8a36a5ebac37e0"; @@ -140,19 +141,19 @@ public class Bootstrap artifacts[6].path = "https://mvn.runelite.net/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar"; artifacts[6].size = "471901"; artifacts[7] = new Artifact(); - artifacts[7].hash = "9f0c8d50fa4b79b6ff1502dbec8502179d6b9497cacbe17a13074001aed537ec"; - artifacts[7].name = "jopt-simple-5.0.1.jar"; - artifacts[7].path = "https://mvn.runelite.net/net/sf/jopt-simple/jopt-simple/5.0.1/jopt-simple-5.0.1.jar"; + artifacts[7].hash = "df26cc58f235f477db07f753ba5a3ab243ebe5789d9f89ecf68dd62ea9a66c28"; + artifacts[7].name = "jopt-simple-5.0.4.jar"; + artifacts[7].path = "https://repo1.maven.org/maven2/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar"; artifacts[7].size = "78826"; artifacts[8] = new Artifact(); - artifacts[8].hash = "5be9a7d05ba0ccd74708bc8018ae412255f85843c0b92302e9b9befa6ed52564"; - artifacts[8].name = "guava-23.2-jre.jar"; - artifacts[8].path = "https://mvn.runelite.net/com/google/guava/guava/23.2-jre/guava-23.2-jre.jar"; + artifacts[8].hash = "73e4d6ae5f0e8f9d292a4db83a2479b5468f83d972ac1ff36d6d0b43943b4f91"; + artifacts[8].name = "guava-28.0-jre.jar"; + artifacts[8].path = "https://repo1.maven.org/maven2/com/google/guava/guava/28.0-jre/guava-28.0-jre.jar"; artifacts[8].size = "2649860"; artifacts[9] = new Artifact(); - artifacts[9].hash = "905721a0eea90a81534abb7ee6ef4ea2e5e645fa1def0a5cd88402df1b46c9ed"; - artifacts[9].name = "jsr305-1.3.9.jar"; - artifacts[9].path = "https://mvn.runelite.net/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar"; + artifacts[9].hash = "766ad2a0783f2687962c8ad74ceecc38a28b9f72a2d085ee438b7813e928d0c7"; + artifacts[9].name = "jsr305-3.0.2.jar"; + artifacts[9].path = "https://repo1.maven.org/maven2/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar"; artifacts[9].size = "33015"; artifacts[10] = new Artifact(); artifacts[10].hash = "cb4cfad870bf563a07199f3ebea5763f0dec440fcda0b318640b1feaa788656b"; @@ -170,9 +171,9 @@ public class Bootstrap artifacts[12].path = "https://mvn.runelite.net/org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14.jar"; artifacts[12].size = "3482"; artifacts[13] = new Artifact(); - artifacts[13].hash = "9264c6931c431e928dc64adc842584d5f57d17b2f3aff29221f2b3fdea673dad"; - artifacts[13].name = "guice-4.1.0-no_aop.jar"; - artifacts[13].path = "https://mvn.runelite.net/com/google/inject/guice/4.1.0/guice-4.1.0-no_aop.jar"; + artifacts[13].hash = "d258ff1bd9b8b527872f8402648226658ad3149f1f40e74b0566d69e7e042fbc"; + artifacts[13].name = "guice-4.2.2-no_aop.jar"; + artifacts[13].path = "https://repo1.maven.org/maven2/com/google/inject/guice/4.2.2/guice-4.2.2.jar"; artifacts[13].size = "428603"; artifacts[14] = new Artifact(); artifacts[14].hash = "91c77044a50c481636c32d916fd89c9118a72195390452c81065080f957de7ff"; @@ -275,19 +276,19 @@ public class Bootstrap artifacts[33].path = "https://mvn.runelite.net/net/java/dev/jna/jna/4.5.1/jna-4.5.1.jar"; artifacts[33].size = "1440662"; artifacts[34] = new Artifact(); - artifacts[34].hash = "84c8667555ee8dd91fef44b451419f6f16f71f727d5fc475a10c2663eba83abb"; - artifacts[34].name = "jna-platform-4.5.1.jar"; - artifacts[34].path = "https://mvn.runelite.net/net/java/dev/jna/jna-platform/4.5.1/jna-platform-4.5.1.jar"; + artifacts[34].hash = "890391047a225a7a599f33e665f9bedaee2037d9fe6f1b23d9d2369d69f0f28f"; + artifacts[34].name = "jna-platform-5.4.0.jar"; + artifacts[34].path = "https://repo1.maven.org/maven2/net/java/dev/jna/jna-platform/5.4.0/jna-platform-5.4.0.jar"; artifacts[34].size = "2327547"; artifacts[38] = new Artifact(); - artifacts[38].hash = "f55abda036da75e1af45bd43b9dfa79b2a3d90905be9cb38687c6621597a8165"; - artifacts[38].name = "okhttp-3.7.0.jar"; - artifacts[38].path = "https://mvn.runelite.net/com/squareup/okhttp3/okhttp/3.7.0/okhttp-3.7.0.jar"; + artifacts[38].hash = "0e0392ea5c0d303bca20e13b2340086d7a347b22ad625f967989ee8723b6ac3c"; + artifacts[38].name = "okhttp-4.0.1.jar"; + artifacts[38].path = "https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp/4.0.1/okhttp-4.0.1.jar"; artifacts[38].size = "394987"; artifacts[39] = new Artifact(); - artifacts[39].hash = "bfe7dfe483c37137966a1690f0c7d0b448ba217902c1fed202aaffdbba3291ae"; - artifacts[39].name = "okio-1.12.0.jar"; - artifacts[39].path = "https://mvn.runelite.net/com/squareup/okio/okio/1.12.0/okio-1.12.0.jar"; + artifacts[39].hash = "e58c97406a6bb1138893750299ac63c6aa04b38b6b49eae1bfcad1a63ef9ba1b"; + artifacts[39].name = "okio-2.2.2.jar"; + artifacts[39].path = "https://repo1.maven.org/maven2/com/squareup/okio/okio/2.2.2/okio-2.2.2.jar"; artifacts[39].size = "81088"; artifacts[40] = new Artifact(); artifacts[40].hash = "9d4924588d6280c7516db3a4b7298306db5b6f0d1cdf568ce738309b5660f008"; @@ -314,33 +315,48 @@ public class Bootstrap artifacts[44].name = "reactive-streams-1.0.2.jar"; artifacts[44].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/artifacts/" + artifacts[44].name; artifacts[44].size = "27750"; + artifacts[45] = new Artifact(); + artifacts[45].hash = "f76f9812a703ba5085af8f51769e60e8ecd5e99b55b2ced097cf2343e972ad7b"; + artifacts[45].name = "kotlin-stdlib-1.3.40.jar"; + artifacts[45].path = "https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.3.40/kotlin-stdlib-1.3.40.jar"; + artifacts[45].size = "27750"; + artifacts[46] = new Artifact(); + artifacts[46].hash = "a171ee4c734dd2da837e4b16be9df4661afab72a41adaf31eb84dfdaf936ca26"; + artifacts[46].name = "failureaccess-1.0.1.jar"; + artifacts[46].path = "https://repo1.maven.org/maven2/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar"; + artifacts[46].size = "27750"; //Dynamic artifacts artifacts[3] = new Artifact(); - artifacts[3].name = "client-" + RuneLiteAPI.getVersion() + ".jar"; + artifacts[3].name = "client-" + projectVersion + ".jar"; artifacts[3].hash = getChecksumFile("./runelite-client/build/libs/" + artifacts[3].name); - artifacts[3].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master" + Bootstrapper.remoteLocation + artifacts[3].name; + artifacts[3].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/" + Bootstrapper.remoteLocation + artifacts[3].name; artifacts[3].size = Long.toString(getFileSize("./runelite-client/target/" + artifacts[3].name)); copyTodir("./runelite-client/build/libs/" + artifacts[3].name, Bootstrapper.localLocation); artifacts[35] = new Artifact(); - artifacts[35].name = "runelite-api-" + RuneLiteAPI.getVersion() + ".jar"; + artifacts[35].name = "runelite-api-" + projectVersion + ".jar"; artifacts[35].hash = getChecksumFile("./runelite-api/build/libs/" + artifacts[35].name); artifacts[35].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/" + Bootstrapper.remoteLocation + artifacts[35].name; artifacts[35].size = Long.toString(getFileSize("./runelite-api/target/" + artifacts[35].name)); copyTodir("./runelite-api/build/libs/" + artifacts[35].name, Bootstrapper.localLocation); artifacts[36] = new Artifact(); - artifacts[36].name = "runescape-api-" + RuneLiteAPI.getVersion() + ".jar"; + artifacts[36].name = "runescape-api-" + projectVersion + ".jar"; artifacts[36].hash = getChecksumFile("./runescape-api/build/libs/" + artifacts[36].name); artifacts[36].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/" + Bootstrapper.remoteLocation + artifacts[36].name; artifacts[36].size = Long.toString(getFileSize("./runescape-api/target/" + artifacts[36].name)); copyTodir("./runescape-api/build/libs/" + artifacts[36].name, Bootstrapper.localLocation); artifacts[37] = new Artifact(); - artifacts[37].name = "http-api-" + RuneLiteAPI.getVersion() + ".jar"; + artifacts[37].name = "http-api-" + projectVersion + ".jar"; artifacts[37].hash = getChecksumFile("./http-api/build/libs/" + artifacts[37].name); artifacts[37].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/" + Bootstrapper.remoteLocation + artifacts[37].name; artifacts[37].size = Long.toString(getFileSize("./http-api/target/" + artifacts[37].name)); copyTodir("./http-api/build/libs/" + artifacts[37].name, Bootstrapper.localLocation); - copyTodir("./injected-client/build/libs/injected-client-" + RuneLiteAPI.getVersion() + ".jar", Bootstrapper.localLocation); + artifacts[47] = new Artifact(); + artifacts[47].name = "injected-client-" + projectVersion + ".jar"; + artifacts[47].hash = getChecksumFile("./injected-client/build/libs/" + artifacts[47].name); + artifacts[47].path = "https://raw.githubusercontent.com/runelite-extended/maven-repo/master/" + Bootstrapper.remoteLocation + artifacts[47].name; + artifacts[47].size = Long.toString(getFileSize("./http-api/target/" + artifacts[47].name)); + copyTodir("./injected-client/build/libs/" + artifacts[47].name, Bootstrapper.localLocation); } catch (IOException | NoSuchAlgorithmException e) { diff --git a/runelite-client/src/main/java/net/runelite/client/util/bootstrap/Bootstrapper.java b/runelite-client/src/main/java/net/runelite/client/util/bootstrap/Bootstrapper.java index 0911f44260..edce589251 100644 --- a/runelite-client/src/main/java/net/runelite/client/util/bootstrap/Bootstrapper.java +++ b/runelite-client/src/main/java/net/runelite/client/util/bootstrap/Bootstrapper.java @@ -16,7 +16,7 @@ public class Bootstrapper if (args.length > 0) { - remoteLocation = "/staging/"; + remoteLocation = "staging/"; localLocation = "./staging/"; Gson gson = new GsonBuilder().disableHtmlEscaping().setPrettyPrinting().create(); File dir = new File("./staging/"); diff --git a/runelite-client/src/main/java/net/runelite/client/ws/PartyService.java b/runelite-client/src/main/java/net/runelite/client/ws/PartyService.java index 20663f1d38..a770303204 100644 --- a/runelite-client/src/main/java/net/runelite/client/ws/PartyService.java +++ b/runelite-client/src/main/java/net/runelite/client/ws/PartyService.java @@ -33,12 +33,17 @@ import javax.inject.Singleton; import lombok.Getter; import lombok.Setter; import lombok.extern.slf4j.Slf4j; +import net.runelite.api.ChatMessageType; import net.runelite.client.account.AccountSession; import net.runelite.client.account.SessionManager; +import net.runelite.client.chat.ChatMessageManager; +import net.runelite.client.chat.QueuedMessage; import net.runelite.client.eventbus.EventBus; import net.runelite.client.events.PartyChanged; +import static net.runelite.client.util.Text.JAGEX_PRINTABLE_CHAR_MATCHER; import net.runelite.http.api.ws.messages.party.Join; import net.runelite.http.api.ws.messages.party.Part; +import net.runelite.http.api.ws.messages.party.PartyChatMessage; import net.runelite.http.api.ws.messages.party.UserJoin; import net.runelite.http.api.ws.messages.party.UserPart; import net.runelite.http.api.ws.messages.party.UserSync; @@ -48,10 +53,12 @@ import net.runelite.http.api.ws.messages.party.UserSync; public class PartyService { public static final int PARTY_MAX = 15; + private static final int MAX_MESSAGE_LEN = 150; private final WSClient wsClient; private final SessionManager sessionManager; private final EventBus eventBus; + private final ChatMessageManager chat; private final List members = new ArrayList<>(); @Getter @@ -64,14 +71,16 @@ public class PartyService private String username; @Inject - private PartyService(final WSClient wsClient, final SessionManager sessionManager, final EventBus eventBus) + private PartyService(final WSClient wsClient, final SessionManager sessionManager, final EventBus eventBus, final ChatMessageManager chat) { this.wsClient = wsClient; this.sessionManager = sessionManager; this.eventBus = eventBus; + this.chat = chat; eventBus.subscribe(UserJoin.class, this, this::onUserJoin); eventBus.subscribe(UserPart.class, this, this::onUserPart); + eventBus.subscribe(PartyChatMessage.class, this, this::onPartyChatMessage); } public void changeParty(UUID newParty) @@ -141,6 +150,26 @@ public class PartyService members.removeIf(member -> member.getMemberId().equals(message.getMemberId())); } + private void onPartyChatMessage(final PartyChatMessage message) + { + // Remove non-printable characters, and tags from message + String sentMesage = JAGEX_PRINTABLE_CHAR_MATCHER.retainFrom(message.getValue()) + .replaceAll("", ""); + + // Cap the mesage length + if (sentMesage.length() > MAX_MESSAGE_LEN) + { + sentMesage = sentMesage.substring(0, MAX_MESSAGE_LEN); + } + + chat.queue(QueuedMessage.builder() + .type(ChatMessageType.FRIENDSCHAT) + .sender("Party") + .name(getMemberById(message.getMemberId()).getName()) + .runeLiteFormattedMessage(sentMesage) + .build()); + } + public PartyMember getLocalMember() { return getMemberByName(username); diff --git a/runelite-client/src/main/resources/item_stats.json b/runelite-client/src/main/resources/item_stats.json index dc2ee9e0e0..1d00ea3a24 100644 --- a/runelite-client/src/main/resources/item_stats.json +++ b/runelite-client/src/main/resources/item_stats.json @@ -843,11 +843,11 @@ "quest": true }, "297": { - "name": "Glarial's urn", + "name": "Glarial's urn (empty)", "quest": true }, "298": { - "name": "A key", + "name": "Key", "quest": true, "weight": 0.01 }, @@ -1022,9 +1022,6 @@ "name": "Lobster", "weight": 0.35 }, - "381": { - "name": "Burnt lobster" - }, "383": { "name": "Raw shark", "weight": 0.7 @@ -1155,7 +1152,7 @@ } }, "430": { - "name": "Doctors' gown", + "name": "Medical gown", "quest": true, "equipable": true, "weight": 1.814, @@ -1503,9 +1500,6 @@ "561": { "name": "Nature rune" }, - "562": { - "name": "Chaos rune" - }, "563": { "name": "Law rune" }, @@ -1614,7 +1608,7 @@ "weight": 0.5 }, "598": { - "name": "Bronze fire arrows", + "name": "Bronze fire arrow", "equipable": true, "equipment": { "slot": 13, @@ -2155,9 +2149,6 @@ "quest": true, "weight": 0.51 }, - "713": { - "name": "Clue scroll" - }, "714": { "name": "Radimus notes", "quest": true, @@ -3307,7 +3298,7 @@ } }, "942": { - "name": "Bronze fire arrows", + "name": "Bronze fire arrow (lit)", "equipable": true, "equipment": { "slot": 13, @@ -3578,14 +3569,6 @@ "slot": 0 } }, - "1038": { - "name": "Red partyhat", - "equipable": true, - "weight": 0.056, - "equipment": { - "slot": 0 - } - }, "1040": { "name": "Yellow partyhat", "equipable": true, @@ -6553,7 +6536,7 @@ "weight": 5.0 }, "1485": { - "name": "Damp cloth", + "name": "Oily cloth", "quest": true, "weight": 0.012 }, @@ -6664,7 +6647,7 @@ "weight": 2.2 }, "1505": { - "name": "A magic scroll", + "name": "Ardougne teleport scroll", "quest": true, "weight": 0.02 }, @@ -6849,10 +6832,6 @@ "quest": true, "weight": 0.085 }, - "1550": { - "name": "Garlic", - "weight": 0.028 - }, "1552": { "name": "Seasoned sardine", "quest": true, @@ -7841,10 +7820,6 @@ "name": "Chopped tomato", "weight": 0.2 }, - "1871": { - "name": "Chopped onion", - "weight": 0.2 - }, "1873": { "name": "Chopped ugthanki", "weight": 0.2 @@ -8063,6 +8038,7 @@ }, "1978": { "name": "Cup of tea", + "quest": true, "weight": 0.1 }, "1980": { @@ -8620,11 +8596,6 @@ "quest": true, "weight": 0.1 }, - "2340": { - "name": "Palm leaf", - "quest": true, - "weight": 0.1 - }, "2341": { "name": "Wrapped oomlie", "quest": true, @@ -9418,7 +9389,7 @@ "weight": 5.0 }, "2532": { - "name": "Iron fire arrows", + "name": "Iron fire arrow", "equipable": true, "equipment": { "slot": 13, @@ -9426,7 +9397,7 @@ } }, "2533": { - "name": "Iron fire arrows", + "name": "Iron fire arrow (lit)", "equipable": true, "equipment": { "slot": 13, @@ -9434,7 +9405,7 @@ } }, "2534": { - "name": "Steel fire arrows", + "name": "Steel fire arrow", "equipable": true, "equipment": { "slot": 13, @@ -9442,7 +9413,7 @@ } }, "2535": { - "name": "Steel fire arrows", + "name": "Steel fire arrow (lit)", "equipable": true, "equipment": { "slot": 13, @@ -9450,7 +9421,7 @@ } }, "2536": { - "name": "Mithril fire arrows", + "name": "Mithril fire arrow", "equipable": true, "equipment": { "slot": 13, @@ -9458,7 +9429,7 @@ } }, "2537": { - "name": "Mithril fire arrows", + "name": "Mithril fire arrow (lit)", "equipable": true, "equipment": { "slot": 13, @@ -9466,7 +9437,7 @@ } }, "2538": { - "name": "Adamant fire arrows", + "name": "Adamant fire arrow", "equipable": true, "equipment": { "slot": 13, @@ -9474,7 +9445,7 @@ } }, "2539": { - "name": "Adamant fire arrows", + "name": "Adamant fire arrow (lit)", "equipable": true, "equipment": { "slot": 13, @@ -9482,7 +9453,7 @@ } }, "2540": { - "name": "Rune fire arrows", + "name": "Rune fire arrow", "equipable": true, "equipment": { "slot": 13, @@ -9490,7 +9461,7 @@ } }, "2541": { - "name": "Rune fire arrows", + "name": "Rune fire arrow (lit)", "equipable": true, "equipment": { "slot": 13, @@ -10378,9 +10349,6 @@ "2709": { "name": "Clue scroll (easy)" }, - "2710": { - "name": "Clue scroll (easy)" - }, "2711": { "name": "Clue scroll (easy)" }, @@ -12154,7 +12122,7 @@ "weight": 0.056 }, "3207": { - "name": "Iorwerths message", + "name": "Iorwerth's message", "quest": true, "weight": 0.056 }, @@ -12207,7 +12175,7 @@ "weight": 32.0 }, "3220": { - "name": "Barrel of coal-tar", + "name": "Barrel of coal tar", "quest": true, "weight": 32.0 }, @@ -15636,7 +15604,7 @@ } }, "4313": { - "name": "Crystal of seren", + "name": "Crystal singing for beginners", "weight": 0.51 }, "4315": { @@ -16905,11 +16873,6 @@ "quest": true, "weight": 0.03 }, - "4595": { - "name": "Karidian disguise", - "quest": true, - "weight": 0.1 - }, "4597": { "name": "Note", "quest": true, @@ -17531,21 +17494,6 @@ "rstr": 55 } }, - "4745": { - "name": "Torag's helm", - "equipable": true, - "weight": 2.721, - "equipment": { - "slot": 0, - "amagic": -6, - "arange": -2, - "dstab": 55, - "dslash": 58, - "dcrush": 54, - "dmagic": -1, - "drange": 62 - } - }, "4747": { "name": "Torag's hammers", "equipable": true, @@ -17697,14 +17645,6 @@ "rstr": 45 } }, - "4803": { - "name": "Rune brutal", - "equipable": true, - "equipment": { - "slot": 13, - "rstr": 60 - } - }, "4808": { "name": "Black prism", "quest": true, @@ -18481,21 +18421,6 @@ "drange": 62 } }, - "4905": { - "name": "Guthan's helm 75", - "equipable": true, - "weight": 2.721, - "equipment": { - "slot": 0, - "amagic": -6, - "arange": -2, - "dstab": 55, - "dslash": 58, - "dcrush": 54, - "dmagic": -1, - "drange": 62 - } - }, "4906": { "name": "Guthan's helm 50", "equipable": true, @@ -22733,7 +22658,7 @@ } }, "6066": { - "name": "Mourner trousers", + "name": "Ripped mourner trousers", "quest": true, "weight": 2.267 }, @@ -22904,7 +22829,7 @@ "name": "Teleport crystal (1)" }, "6103": { - "name": "Tiny elf crystal", + "name": "Crystal teleport seed", "weight": 0.001 }, "6104": { @@ -24834,23 +24759,6 @@ "prayer": 5 } }, - "6587": { - "name": "White claws", - "equipable": true, - "weight": 0.907, - "equipment": { - "slot": 3, - "astab": 10, - "aslash": 14, - "acrush": -4, - "dstab": 4, - "dslash": 7, - "dcrush": 2, - "str": 14, - "prayer": 1, - "aspeed": 4 - } - }, "6589": { "name": "White battleaxe", "equipable": true, @@ -25937,10 +25845,6 @@ "quest": true, "weight": 0.005 }, - "6794": { - "name": "Choc-ice", - "weight": 0.001 - }, "6796": { "name": "Lamp", "quest": true, @@ -34438,10 +34342,6 @@ "name": "A green square", "quest": true }, - "9612": { - "name": "A green pentagon", - "quest": true - }, "9613": { "name": "A blue circle", "quest": true @@ -34496,7 +34396,7 @@ "weight": 1.0 }, "9626": { - "name": "Small crystal seed", + "name": "Crystal saw seed", "quest": true, "weight": 0.01 }, @@ -40257,11 +40157,6 @@ "quest": true, "weight": 0.004 }, - "11156": { - "name": "Astral rune shards", - "quest": true, - "weight": 0.453 - }, "11157": { "name": "Dreamy lamp", "quest": true, @@ -40470,7 +40365,7 @@ } }, "11217": { - "name": "Dragon fire arrows", + "name": "Dragon fire arrow", "equipable": true, "equipment": { "slot": 13, @@ -40478,7 +40373,7 @@ } }, "11222": { - "name": "Dragon fire arrows", + "name": "Dragon fire arrow (lit)", "equipable": true, "equipment": { "slot": 13, @@ -40519,16 +40414,6 @@ "aspeed": 3 } }, - "11231": { - "name": "Dragon dart(p)", - "equipable": true, - "equipment": { - "slot": 3, - "arange": 18, - "rstr": 20, - "aspeed": 3 - } - }, "11232": { "name": "Dragon dart tip" }, @@ -43653,9 +43538,6 @@ "12087": { "name": "Clue scroll (elite)" }, - "12088": { - "name": "Clue scroll (elite)" - }, "12089": { "name": "Clue scroll (elite)" }, @@ -45176,7 +45058,7 @@ "name": "Tai bwo wannai teleport" }, "12410": { - "name": "Elf camp teleport" + "name": "Iorwerth camp teleport" }, "12411": { "name": "Mos le'harmless teleport" @@ -47142,7 +47024,7 @@ "weight": 1.0, "equipment": { "slot": 3, - "amagic": 15, + "amagic": 25, "dstab": 2, "dslash": 3, "dcrush": 1, @@ -47530,10 +47412,6 @@ "name": "Ancient rune armour set (lg)", "weight": 6.0 }, - "13062": { - "name": "Ancient rune armour set (sk)", - "weight": 6.0 - }, "13064": { "name": "Combat potion set" }, @@ -48960,9 +48838,6 @@ "13252": { "name": "Sack pack" }, - "13254": { - "name": "Basket pack" - }, "13256": { "name": "Saradomin's light" }, @@ -51732,7 +51607,7 @@ }, "19732": { "name": "Lucky impling jar", - "weight": 2.2 + "weight": 2.267 }, "19734": { "name": "Clue scroll (medium)" @@ -52016,10 +51891,6 @@ "19835": { "name": "Clue scroll (master)" }, - "19836": { - "name": "Reward casket (master)", - "weight": 5.0 - }, "19837": { "name": "Torn clue scroll (part 1)", "equipable": true @@ -52767,13 +52638,6 @@ "slot": 7 } }, - "20107": { - "name": "Ankou socks", - "equipable": true, - "equipment": { - "slot": 10 - } - }, "20110": { "name": "Bowl wig", "equipable": true, @@ -55762,9 +55626,6 @@ "20884": { "name": "Keystone crystal" }, - "20885": { - "name": "Cavern grubs" - }, "20886": { "name": "Creature keeper's journal" }, @@ -55783,9 +55644,6 @@ "20895": { "name": "Vanguard judgement" }, - "20897": { - "name": "Houndmaster's diary" - }, "20899": { "name": "Dark journal" }, @@ -55852,9 +55710,6 @@ "20921": { "name": "Elder (+)(1)" }, - "20922": { - "name": "Elder (+)(2)" - }, "20923": { "name": "Elder (+)(3)" }, @@ -57187,7 +57042,7 @@ } }, "21328": { - "name": "Amethyst fire arrows", + "name": "Amethyst fire arrow", "equipable": true, "equipment": { "slot": 13, @@ -57195,7 +57050,7 @@ } }, "21330": { - "name": "Amethyst fire arrows", + "name": "Amethyst fire arrow (lit)", "equipable": true, "equipment": { "slot": 13, @@ -60961,21 +60816,6 @@ "drange": 62 } }, - "22644": { - "name": "Morrigan's leather chaps", - "equipable": true, - "weight": 5.4, - "equipment": { - "slot": 7, - "amagic": -10, - "arange": 23, - "dstab": 35, - "dslash": 29, - "dcrush": 37, - "dmagic": 46, - "drange": 35 - } - }, "22647": { "name": "Zuriel's staff", "equipable": true, @@ -63433,5 +63273,730 @@ "str": 70, "aspeed": 4 } + }, + "23655": { + "name": "Crystal seedling", + "weight": 0.907 + }, + "23657": { + "name": "Crystal seedling (w)", + "weight": 0.907 + }, + "23659": { + "name": "Crystal sapling", + "weight": 0.9 + }, + "23661": { + "name": "Crystal acorn" + }, + "23667": { + "name": "Dragonstone armour set" + }, + "23673": { + "name": "Crystal axe", + "equipable": true, + "equipment": { + "slot": 3, + "astab": -2, + "aslash": 38, + "acrush": 32, + "dslash": 1, + "str": 42, + "aspeed": 5 + } + }, + "23677": { + "name": "Dragon pickaxe(or)", + "equipable": true, + "weight": 2.2, + "equipment": { + "slot": 3, + "astab": 38, + "aslash": -2, + "acrush": 32, + "dslash": 1, + "str": 42, + "aspeed": 5 + } + }, + "23680": { + "name": "Crystal pickaxe", + "equipable": true, + "weight": 1.0, + "equipment": { + "slot": 3, + "astab": 38, + "aslash": -2, + "acrush": 32, + "dslash": 1, + "str": 42, + "aspeed": 5 + } + }, + "23682": { + "name": "Crystal pickaxe (inactive)", + "equipable": true, + "weight": 1.0, + "equipment": { + "slot": 3, + "astab": 38, + "aslash": -2, + "acrush": 32, + "dslash": 1, + "str": 42, + "aspeed": 5 + } + }, + "23688": { + "name": "Divine super combat potion(3)" + }, + "23691": { + "name": "Divine super combat potion(2)" + }, + "23694": { + "name": "Divine super combat potion(1)" + }, + "23697": { + "name": "Divine super attack potion(4)" + }, + "23700": { + "name": "Divine super attack potion(3)" + }, + "23703": { + "name": "Divine super attack potion(2)" + }, + "23706": { + "name": "Divine super attack potion(1)" + }, + "23709": { + "name": "Divine super strength potion(4)" + }, + "23712": { + "name": "Divine super strength potion(3)" + }, + "23715": { + "name": "Divine super strength potion(2)" + }, + "23718": { + "name": "Divine super strength potion(1)" + }, + "23721": { + "name": "Divine super defence potion(4)" + }, + "23724": { + "name": "Divine super defence potion(3)" + }, + "23727": { + "name": "Divine super defence potion(2)" + }, + "23730": { + "name": "Divine super defence potion(1)" + }, + "23733": { + "name": "Divine ranging potion(4)" + }, + "23736": { + "name": "Divine ranging potion(3)" + }, + "23739": { + "name": "Divine ranging potion(2)" + }, + "23742": { + "name": "Divine ranging potion(1)" + }, + "23745": { + "name": "Divine magic potion(4)" + }, + "23748": { + "name": "Divine magic potion(3)" + }, + "23751": { + "name": "Divine magic potion(2)" + }, + "23754": { + "name": "Divine magic potion(1)" + }, + "23762": { + "name": "Crystal harpoon", + "equipable": true, + "equipment": { + "slot": 3, + "astab": 38, + "aslash": 32, + "dslash": 1, + "str": 42, + "aspeed": 5 + } + }, + "23764": { + "name": "Crystal harpoon (inactive)", + "equipable": true, + "equipment": { + "slot": 3, + "astab": 38, + "aslash": 32, + "dslash": 1, + "str": 42, + "aspeed": 5 + } + }, + "23768": { + "name": "Crystal impling jar", + "weight": 2.267 + }, + "23771": { + "name": "Prifddinas teleport" + }, + "23773": { + "name": "Scrawled notes" + }, + "23775": { + "name": "Hand mirror", + "quest": true, + "weight": 0.01 + }, + "23776": { + "name": "Red crystal", + "quest": true, + "weight": 0.015 + }, + "23777": { + "name": "Yellow crystal", + "quest": true, + "weight": 0.015 + }, + "23778": { + "name": "Green crystal", + "quest": true, + "weight": 0.015 + }, + "23779": { + "name": "Cyan crystal", + "quest": true, + "weight": 0.015 + }, + "23780": { + "name": "Blue crystal", + "quest": true, + "weight": 0.015 + }, + "23781": { + "name": "Magenta crystal", + "quest": true, + "weight": 0.015 + }, + "23782": { + "name": "Black crystal" + }, + "23784": { + "name": "Fractured crystal", + "quest": true, + "weight": 0.015 + }, + "23785": { + "name": "Ardougne knight helm", + "quest": true, + "equipable": true, + "weight": 2.721, + "equipment": { + "slot": 0, + "amagic": -6, + "arange": -2, + "dstab": 6, + "dslash": 7, + "dcrush": 5, + "dmagic": -1, + "drange": 6 + } + }, + "23787": { + "name": "Ardougne knight platebody", + "quest": true, + "equipable": true, + "weight": 9.979, + "equipment": { + "slot": 4, + "amagic": -30, + "arange": -10, + "dstab": 21, + "dslash": 20, + "dcrush": 12, + "dmagic": -6, + "drange": 20 + } + }, + "23789": { + "name": "Ardougne knight platelegs", + "quest": true, + "equipable": true, + "weight": 9.071, + "equipment": { + "slot": 7, + "amagic": -21, + "arange": -7, + "dstab": 11, + "dslash": 10, + "dcrush": 10, + "dmagic": -4, + "drange": 10 + } + }, + "23791": { + "name": "Ardougne knight tabard", + "quest": true, + "weight": 1.0 + }, + "23792": { + "name": "Blue liquid", + "quest": true, + "weight": 0.02 + }, + "23793": { + "name": "Green powder", + "quest": true, + "weight": 0.2 + }, + "23794": { + "name": "clear liquid", + "quest": true, + "weight": 0.02 + }, + "23795": { + "name": "Red powder", + "quest": true, + "weight": 0.02 + }, + "23796": { + "name": "Ode to eternity" + }, + "23798": { + "name": "Elder cadantine", + "quest": true, + "weight": 0.007 + }, + "23800": { + "name": "Elder cadantine potion (unf)", + "quest": true, + "weight": 0.057 + }, + "23802": { + "name": "Crystal", + "quest": true, + "weight": 0.015 + }, + "23806": { + "name": "Inversion potion", + "quest": true, + "weight": 0.056 + }, + "23808": { + "name": "Crystal seed", + "quest": true, + "weight": 0.015 + }, + "23810": { + "name": "Crystal seed", + "quest": true, + "weight": 0.015 + }, + "23812": { + "name": "Orb of light", + "quest": true, + "weight": 0.01 + }, + "23814": { + "name": "Clue scroll", + "quest": true + }, + "23815": { + "name": "Clue scroll", + "quest": true + }, + "23816": { + "name": "Clue scroll", + "quest": true + }, + "23817": { + "name": "Clue scroll", + "quest": true + }, + "23820": { + "name": "Corrupted sceptre" + }, + "23821": { + "name": "Corrupted axe" + }, + "23822": { + "name": "Corrupted pickaxe" + }, + "23823": { + "name": "Corrupted harpoon" + }, + "23824": { + "name": "Corrupted shards" + }, + "23830": { + "name": "Corrupted dust" + }, + "23831": { + "name": "Corrupted spike" + }, + "23832": { + "name": "Corrupted bowstring" + }, + "23833": { + "name": "Corrupted orb" + }, + "23834": { + "name": "Weapon frame" + }, + "23835": { + "name": "Grym leaf" + }, + "23836": { + "name": "Linum tirinum" + }, + "23837": { + "name": "Corrupted ore" + }, + "23838": { + "name": "Phren bark" + }, + "23859": { + "name": "Gauntlet cape", + "equipable": true, + "equipment": { + "slot": 1 + } + }, + "23862": { + "name": "Crystal axe", + "equipable": true, + "equipment": { + "slot": 3, + "astab": -2, + "aslash": 38, + "acrush": 32, + "dslash": 1, + "str": 42, + "aspeed": 5 + } + }, + "23868": { + "name": "Crystal spike" + }, + "23869": { + "name": "Crystalline bowstring" + }, + "23870": { + "name": "Crystal orb" + }, + "23872": { + "name": "Raw paddlefish" + }, + "23874": { + "name": "Paddlefish" + }, + "23878": { + "name": "Phren bark" + }, + "23905": { + "name": "Tephra" + }, + "23906": { + "name": "Refined tephra" + }, + "23907": { + "name": "Imbued tephra", + "equipable": true + }, + "23908": { + "name": "Zalcano shard", + "weight": 0.5 + }, + "23927": { + "name": "Crystal of ithell" + }, + "23929": { + "name": "Crystal of iorwerth" + }, + "23931": { + "name": "Crystal of trahaearn", + "quest": true + }, + "23933": { + "name": "Crystal of cadarn" + }, + "23935": { + "name": "Crystal of crwys" + }, + "23937": { + "name": "Crystal of meilyr" + }, + "23939": { + "name": "Crystal of hefin" + }, + "23941": { + "name": "Crystal of amlodd" + }, + "23943": { + "name": "Elven signet" + }, + "23946": { + "name": "Eternal teleport crystal", + "quest": true + }, + "23948": { + "name": "Elven dawn", + "weight": 0.55 + }, + "23951": { + "name": "Enhanced crystal key" + }, + "23953": { + "name": "Crystal tool seed" + }, + "23956": { + "name": "Crystal armour seed" + }, + "23959": { + "name": "Enhanced crystal teleport seed" + }, + "23962": { + "name": "Crystal shard" + }, + "23971": { + "name": "Crystal helm", + "equipable": true, + "equipment": { + "slot": 0, + "amagic": -10, + "arange": 8, + "dstab": 12, + "dslash": 8, + "dcrush": 14, + "dmagic": 26, + "drange": 18, + "prayer": 2 + } + }, + "23973": { + "name": "Crystal helm (inactive)", + "equipable": true, + "equipment": { + "slot": 0, + "amagic": -10, + "arange": 8, + "dstab": 12, + "dslash": 8, + "dcrush": 14, + "dmagic": 26, + "drange": 18, + "prayer": 2 + } + }, + "23975": { + "name": "Crystal body", + "equipable": true, + "equipment": { + "slot": 4, + "amagic": -18, + "arange": 30, + "dstab": 34, + "dslash": 24, + "dcrush": 32, + "dmagic": 44, + "drange": 53, + "prayer": 3 + } + }, + "23979": { + "name": "Crystal legs", + "equipable": true, + "equipment": { + "slot": 7, + "amagic": -12, + "arange": 17, + "dstab": 20, + "dslash": 16, + "dcrush": 24, + "dmagic": 34, + "drange": 29, + "prayer": 2 + } + }, + "23981": { + "name": "Crystal legs (inactive)", + "equipable": true, + "equipment": { + "slot": 7, + "amagic": -12, + "arange": 17, + "dstab": 20, + "dslash": 16, + "dcrush": 24, + "dmagic": 34, + "drange": 29, + "prayer": 2 + } + }, + "23995": { + "name": "Blade of Saeldor", + "equipable": true, + "weight": 1.0, + "equipment": { + "slot": 3, + "astab": 55, + "aslash": 94, + "str": 89, + "aspeed": 4 + } + }, + "23997": { + "name": "Blade of Saeldor (inactive)", + "equipable": true, + "weight": 1.0, + "equipment": { + "slot": 3, + "astab": 55, + "aslash": 94, + "str": 89, + "aspeed": 4 + } + }, + "24000": { + "name": "Crystal grail", + "equipable": true, + "equipment": { + "slot": 3, + "aspeed": 4 + } + }, + "24030": { + "name": "Memoriam crystal (1)" + }, + "24031": { + "name": "Memoriam crystal (2)" + }, + "24032": { + "name": "Memoriam crystal (3)" + }, + "24033": { + "name": "Memoriam crystal (4)" + }, + "24034": { + "name": "Dragonstone full helm", + "equipable": true, + "equipment": { + "slot": 0, + "amagic": -6, + "arange": -2, + "dstab": 30, + "dslash": 32, + "dcrush": 27, + "dmagic": -1, + "drange": 30 + } + }, + "24037": { + "name": "Dragonstone platebody", + "equipable": true, + "equipment": { + "slot": 4, + "amagic": -30, + "arange": -10, + "dstab": 82, + "dslash": 80, + "dcrush": 72, + "dmagic": -6, + "drange": 80 + } + }, + "24040": { + "name": "Dragonstone platelegs", + "equipable": true, + "equipment": { + "slot": 7, + "amagic": -21, + "arange": -7, + "dstab": 51, + "dslash": 49, + "dcrush": 47, + "dmagic": -4, + "drange": 49 + } + }, + "24043": { + "name": "Dragonstone boots", + "equipable": true, + "equipment": { + "slot": 10, + "amagic": -3, + "arange": -1, + "dstab": 12, + "dslash": 13, + "dcrush": 14, + "str": 2 + } + }, + "24046": { + "name": "Dragonstone gauntlets", + "equipable": true, + "equipment": { + "slot": 9, + "astab": 8, + "aslash": 8, + "acrush": 8, + "amagic": 4, + "arange": 8, + "dstab": 8, + "dslash": 8, + "dcrush": 8, + "dmagic": 4, + "drange": 8, + "str": 8 + } + }, + "24049": { + "name": "Crazed scribbles" + }, + "24051": { + "name": "A dear friend" + }, + "24053": { + "name": "On leprechauns" + }, + "24055": { + "name": "Bloody diary" + }, + "24057": { + "name": "The eight clans" + }, + "24059": { + "name": "Gollwyn's final statement" + }, + "24061": { + "name": "Niff & harry" + }, + "24063": { + "name": "Soggy journal" + }, + "24065": { + "name": "Ebrill's journal" + }, + "24067": { + "name": "Stained journal" + }, + "24069": { + "name": "The truth behind the myth (excerpt)" + }, + "24071": { + "name": "The living statues" + }, + "24073": { + "name": "The spurned demon" + }, + "24075": { + "name": "Legends of the mountain" } } \ No newline at end of file diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/skybox/skybox.txt b/runelite-client/src/main/resources/net/runelite/client/plugins/skybox/skybox.txt index 872c5a95e3..4d37a271ef 100644 --- a/runelite-client/src/main/resources/net/runelite/client/plugins/skybox/skybox.txt +++ b/runelite-client/src/main/resources/net/runelite/client/plugins/skybox/skybox.txt @@ -56,7 +56,7 @@ // C // Sets the chunks relative to the last region/region1 to the current color and blending -bounds 18 19 60 162 +bounds 18 19 60 196 b 8 @@ -392,6 +392,9 @@ r 47 70 r 53 78 r 55 90 r 57 154 +R 42 94 45 96 +R 49 93 52 96 +r 52 92 #b2b595 r 40 67 @@ -948,4 +951,13 @@ R 19 19 21 20 // Cosmic entity's plane #040404 -r 32 75 \ No newline at end of file +r 32 75 + +b 0 +#000000 +// Song of the elves boss area +R 49 92 51 92 + +// Iorwerth dungeon +#030A0A +R 49 193 51 194 diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/teleport_crystal_icon.png b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/teleport_crystal_icon.png new file mode 100644 index 0000000000..0ae82e1a5a Binary files /dev/null and b/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/teleport_crystal_icon.png differ diff --git a/runelite-client/src/main/resources/npc_stats.json b/runelite-client/src/main/resources/npc_stats.json index e114fadb6f..97fe4193bd 100644 --- a/runelite-client/src/main/resources/npc_stats.json +++ b/runelite-client/src/main/resources/npc_stats.json @@ -1237,17 +1237,6 @@ "rangeDef": 5, "undead": true }, - "98": { - "name": "Soulless", - "hitpoints": 24, - "combatLevel": 18, - "attackSpeed": 4, - "attackLevel": 13, - "strengthLevel": 13, - "defenceLevel": 18, - "rangeLevel": 1, - "magicLevel": 1 - }, "99": { "name": "Death wing", "hitpoints": 80, @@ -6142,7 +6131,7 @@ "undead": true }, "891": { - "name": "Moss giant", + "name": "Moss Guardian", "hitpoints": 120, "combatLevel": 84, "attackSpeed": 6, @@ -6171,14 +6160,6 @@ "magicLevel": 100, "demon": true }, - "924": { - "name": "Skeleton", - "hitpoints": 18, - "combatLevel": 13, - "slayerLevel": 1, - "attackSpeed": 4, - "undead": true - }, "925": { "name": "Rock", "hitpoints": 140, @@ -6711,18 +6692,22 @@ }, "976": { "name": "Dagannoth", + "hitpoints": 160, "combatLevel": 100 }, "977": { "name": "Dagannoth", + "hitpoints": 160, "combatLevel": 100 }, "978": { "name": "Dagannoth", + "hitpoints": 160, "combatLevel": 100 }, "979": { "name": "Dagannoth", + "hitpoints": 160, "combatLevel": 100 }, "980": { @@ -6975,18 +6960,6 @@ "rangeLevel": 1, "magicLevel": 1 }, - "1039": { - "name": "Albino bat", - "hitpoints": 33, - "combatLevel": 52, - "slayerLevel": 1, - "attackSpeed": 4, - "attackLevel": 57, - "strengthLevel": 57, - "defenceLevel": 30, - "rangeLevel": 1, - "magicLevel": 1 - }, "1041": { "name": "Giant mosquito", "hitpoints": 3, @@ -7321,36 +7294,6 @@ "rangeLevel": 130, "magicLevel": 1 }, - "1114": { - "name": "Mourner", - "hitpoints": 19, - "combatLevel": 11, - "attackSpeed": 4, - "attackLevel": 8, - "strengthLevel": 8, - "defenceLevel": 8, - "rangeLevel": 1, - "magicLevel": 1, - "stabDef": 6, - "slashDef": 6, - "crushDef": 9, - "bonusAttack": 6, - "bonusStrength": 2 - }, - "1115": { - "name": "Mourner", - "hitpoints": 25, - "combatLevel": 24, - "attackSpeed": 4, - "attackLevel": 20, - "strengthLevel": 20, - "defenceLevel": 20, - "rangeLevel": 1, - "magicLevel": 1, - "stabDef": 3, - "slashDef": 2, - "crushDef": 4 - }, "1118": { "name": "Man", "hitpoints": 7, @@ -7495,22 +7438,6 @@ "magicDef": 80, "bonusStrength": 100 }, - "1136": { - "name": "Mourner", - "hitpoints": 13, - "combatLevel": 18, - "attackSpeed": 4, - "attackLevel": 17, - "strengthLevel": 17, - "defenceLevel": 17, - "rangeLevel": 1, - "magicLevel": 1, - "stabDef": 5, - "slashDef": 5, - "crushDef": 7, - "bonusAttack": 5, - "bonusStrength": 5 - }, "1139": { "name": "Woman", "hitpoints": 13, @@ -7575,48 +7502,6 @@ "bonusAttack": 20, "bonusStrength": 22 }, - "1148": { - "name": "Mourner", - "hitpoints": 25, - "combatLevel": 24, - "attackSpeed": 4, - "attackLevel": 20, - "strengthLevel": 20, - "defenceLevel": 20, - "rangeLevel": 1, - "magicLevel": 1, - "stabDef": 2, - "slashDef": 1, - "crushDef": 3 - }, - "1149": { - "name": "Mourner", - "hitpoints": 19, - "combatLevel": 13, - "attackSpeed": 4, - "attackLevel": 10, - "strengthLevel": 10, - "defenceLevel": 10, - "rangeLevel": 1, - "magicLevel": 1, - "stabDef": 3, - "slashDef": 2, - "crushDef": 4 - }, - "1150": { - "name": "Mourner", - "hitpoints": 13, - "combatLevel": 12, - "attackSpeed": 4, - "attackLevel": 10, - "strengthLevel": 10, - "defenceLevel": 10, - "rangeLevel": 1, - "magicLevel": 1, - "stabDef": 3, - "slashDef": 2, - "crushDef": 4 - }, "1153": { "name": "Ogre", "hitpoints": 60, @@ -8044,7 +7929,8 @@ "attackSpeed": 4, "attackLevel": 64, "strengthLevel": 47, - "defenceLevel": 42 + "defenceLevel": 42, + "poisonImmune": true }, "1282": { "name": "Riyl Shade", @@ -14274,7 +14160,7 @@ "magicLevel": 25 }, "2887": { - "name": "Fancy dress shop owner", + "name": "Asyff", "hitpoints": 40, "combatLevel": 45, "attackSpeed": 4, @@ -17217,7 +17103,7 @@ "magicLevel": 1 }, "3428": { - "name": "Elf warrior", + "name": "Iorwerth Archer", "hitpoints": 105, "combatLevel": 90, "slayerLevel": 1, @@ -17234,7 +17120,7 @@ "magicDef": 60 }, "3429": { - "name": "Elf warrior", + "name": "Iorwerth Warrior", "hitpoints": 105, "combatLevel": 108, "slayerLevel": 1, @@ -19421,22 +19307,6 @@ "rangeDef": 100, "magicDef": 90 }, - "4006": { - "name": "Mourner", - "hitpoints": 105, - "combatLevel": 108, - "slayerLevel": 1, - "attackSpeed": 4, - "attackLevel": 95, - "strengthLevel": 95, - "defenceLevel": 80, - "magicLevel": 1, - "stabDef": 50, - "slashDef": 70, - "crushDef": 70, - "rangeDef": 50, - "magicDef": 60 - }, "4043": { "name": "Pirate", "hitpoints": 20 @@ -21507,117 +21377,6 @@ "rangeLevel": 1, "magicLevel": 1 }, - "4545": { - "name": "Sir Jerro", - "hitpoints": 57, - "combatLevel": 62, - "attackSpeed": 5, - "attackLevel": 54, - "strengthLevel": 54, - "defenceLevel": 54, - "rangeLevel": 1, - "magicLevel": 1, - "stabDef": 87, - "slashDef": 84, - "crushDef": 76, - "rangeDef": 79, - "bonusAttack": 20, - "bonusStrength": 22 - }, - "4546": { - "name": "Sir Carl", - "hitpoints": 57, - "combatLevel": 62, - "attackSpeed": 5, - "attackLevel": 54, - "strengthLevel": 54, - "defenceLevel": 54, - "rangeLevel": 1, - "magicLevel": 1, - "stabDef": 87, - "slashDef": 84, - "crushDef": 76, - "rangeDef": 79, - "bonusAttack": 20, - "bonusStrength": 22 - }, - "4547": { - "name": "Sir Harry", - "hitpoints": 57, - "combatLevel": 62, - "attackSpeed": 5, - "attackLevel": 54, - "strengthLevel": 54, - "defenceLevel": 54, - "rangeLevel": 1, - "magicLevel": 1, - "stabDef": 87, - "slashDef": 84, - "crushDef": 76, - "rangeDef": 79, - "bonusAttack": 20, - "bonusStrength": 22 - }, - "4554": { - "name": "Kalrag", - "hitpoints": 78, - "combatLevel": 89, - "attackSpeed": 4, - "attackLevel": 78, - "strengthLevel": 78, - "defenceLevel": 78, - "rangeLevel": 1, - "magicLevel": 1, - "stabDef": 20, - "slashDef": 17, - "crushDef": 12, - "rangeDef": 13, - "magicDef": 13 - }, - "4555": { - "name": "Othainian", - "hitpoints": 87, - "combatLevel": 91, - "attackSpeed": 4, - "attackLevel": 76, - "strengthLevel": 78, - "defenceLevel": 77, - "rangeLevel": 1, - "magicLevel": 1 - }, - "4556": { - "name": "Doomion", - "hitpoints": 87, - "combatLevel": 91, - "attackSpeed": 4, - "attackLevel": 76, - "strengthLevel": 78, - "defenceLevel": 77, - "rangeLevel": 1, - "magicLevel": 1 - }, - "4557": { - "name": "Holthion", - "hitpoints": 87, - "combatLevel": 91, - "attackSpeed": 4, - "attackLevel": 76, - "strengthLevel": 78, - "defenceLevel": 77, - "rangeLevel": 1, - "magicLevel": 1 - }, - "4559": { - "name": "Disciple of Iban", - "hitpoints": 20, - "combatLevel": 13, - "attackSpeed": 4, - "attackLevel": 8, - "strengthLevel": 8, - "defenceLevel": 12, - "rangeLevel": 1, - "magicLevel": 1 - }, "4561": { "name": "Spider", "hitpoints": 2, @@ -23699,56 +23458,8 @@ "bonusAttack": 15, "undead": true }, - "5285": { - "name": "Mourner", - "hitpoints": 19, - "combatLevel": 11, - "attackSpeed": 4, - "attackLevel": 8, - "strengthLevel": 8, - "defenceLevel": 8, - "rangeLevel": 1, - "magicLevel": 1, - "stabDef": 6, - "slashDef": 6, - "crushDef": 9, - "bonusAttack": 6, - "bonusStrength": 2 - }, - "5286": { - "name": "Mourner", - "hitpoints": 19, - "combatLevel": 11, - "attackSpeed": 4, - "attackLevel": 8, - "strengthLevel": 8, - "defenceLevel": 8, - "rangeLevel": 1, - "magicLevel": 1, - "stabDef": 6, - "slashDef": 6, - "crushDef": 9, - "bonusAttack": 6, - "bonusStrength": 2 - }, - "5287": { - "name": "Mourner", - "hitpoints": 19, - "combatLevel": 11, - "attackSpeed": 4, - "attackLevel": 8, - "strengthLevel": 8, - "defenceLevel": 8, - "rangeLevel": 1, - "magicLevel": 1, - "stabDef": 6, - "slashDef": 6, - "crushDef": 9, - "bonusAttack": 6, - "bonusStrength": 2 - }, "5293": { - "name": "Elf warrior", + "name": "Elf Warrior", "hitpoints": 105, "combatLevel": 108, "slayerLevel": 1, @@ -23764,7 +23475,7 @@ "magicDef": 60 }, "5294": { - "name": "Elf warrior", + "name": "Elf Warrior", "hitpoints": 105, "combatLevel": 108, "slayerLevel": 1, @@ -23780,7 +23491,7 @@ "magicDef": 60 }, "5295": { - "name": "Elf warrior", + "name": "Elf Archer", "hitpoints": 105, "combatLevel": 90, "slayerLevel": 1, @@ -23797,7 +23508,7 @@ "magicDef": 60 }, "5296": { - "name": "Elf warrior", + "name": "Elf Archer", "hitpoints": 105, "combatLevel": 90, "slayerLevel": 1, @@ -23813,38 +23524,6 @@ "rangeDef": 50, "magicDef": 60 }, - "5311": { - "name": "Mourner", - "hitpoints": 105, - "combatLevel": 108, - "slayerLevel": 1, - "attackSpeed": 4, - "attackLevel": 95, - "strengthLevel": 95, - "defenceLevel": 80, - "magicLevel": 1, - "stabDef": 50, - "slashDef": 70, - "crushDef": 70, - "rangeDef": 50, - "magicDef": 60 - }, - "5312": { - "name": "Mourner", - "hitpoints": 105, - "combatLevel": 108, - "slayerLevel": 1, - "attackSpeed": 4, - "attackLevel": 95, - "strengthLevel": 95, - "defenceLevel": 80, - "magicLevel": 1, - "stabDef": 50, - "slashDef": 70, - "crushDef": 70, - "rangeDef": 50, - "magicDef": 60 - }, "5329": { "name": "Sigmund", "hitpoints": 70, @@ -27416,7 +27095,7 @@ "bonusAttack": 10 }, "6325": { - "name": "Moss giant (hard)", + "name": "Moss Guardian (hard)", "hitpoints": 240, "combatLevel": 182, "attackSpeed": 6, @@ -28268,7 +27947,7 @@ "bonusAttack": 10 }, "6386": { - "name": "Moss giant", + "name": "Moss Guardian", "hitpoints": 120, "combatLevel": 84, "attackSpeed": 6, @@ -37795,23 +37474,6 @@ "magicDef": 150, "bonusMagicDamage": 10 }, - "8710": { - "name": "Shaeded Beast", - "hitpoints": 210, - "combatLevel": 186, - "attackSpeed": 4, - "attackLevel": 50, - "strengthLevel": 80, - "defenceLevel": 50, - "rangeLevel": 1, - "magicLevel": 250, - "stabDef": 50, - "slashDef": 30, - "crushDef": 100, - "rangeDef": 50, - "magicDef": 150, - "bonusMagicDamage": 10 - }, "8713": { "name": "Sarachnis", "hitpoints": 400, @@ -37861,5 +37523,109 @@ "slashDef": 50, "crushDef": 50, "magicDef": 150 + }, + "8917": { + "name": "Fragment of Seren", + "hitpoints": 1000, + "combatLevel": 494, + "attackSpeed": 7, + "attackLevel": 242, + "strengthLevel": 288, + "defenceLevel": 102, + "rangeLevel": 235, + "magicLevel": 102, + "stab": 236, + "slash": 236, + "crush": 236, + "range": 224, + "stabDef": 320, + "slashDef": 220, + "crushDef": 320, + "rangeDef": 480, + "magicDef": 10 + }, + "8918": { + "name": "Fragment of Seren", + "hitpoints": 1000, + "combatLevel": 494, + "attackSpeed": 7, + "attackLevel": 242, + "strengthLevel": 288, + "defenceLevel": 102, + "rangeLevel": 235, + "magicLevel": 102, + "stab": 236, + "slash": 236, + "crush": 236, + "range": 224, + "stabDef": 320, + "slashDef": 220, + "crushDef": 320, + "rangeDef": 480, + "magicDef": 10 + }, + "8919": { + "name": "Fragment of Seren", + "hitpoints": 1000, + "combatLevel": 494, + "attackSpeed": 7, + "attackLevel": 242, + "strengthLevel": 288, + "defenceLevel": 102, + "rangeLevel": 235, + "magicLevel": 102, + "stab": 236, + "slash": 236, + "crush": 236, + "range": 224, + "stabDef": 320, + "slashDef": 220, + "crushDef": 320, + "rangeDef": 480, + "magicDef": 10 + }, + "8920": { + "name": "Fragment of Seren", + "hitpoints": 1000, + "combatLevel": 494, + "attackSpeed": 7, + "attackLevel": 242, + "strengthLevel": 288, + "defenceLevel": 102, + "rangeLevel": 235, + "magicLevel": 102, + "stab": 236, + "slash": 236, + "crush": 236, + "range": 224, + "stabDef": 320, + "slashDef": 220, + "crushDef": 320, + "rangeDef": 480, + "magicDef": 10 + }, + "9021": { + "name": "Crystalline Hunllef", + "hitpoints": 600, + "combatLevel": 674, + "attackSpeed": 5 + }, + "9022": { + "name": "Crystalline Hunllef", + "hitpoints": 600, + "combatLevel": 674, + "attackSpeed": 5 + }, + "9023": { + "name": "Crystalline Hunllef", + "hitpoints": 600, + "combatLevel": 674, + "attackSpeed": 5 + }, + "9024": { + "name": "Crystalline Hunllef", + "hitpoints": 600, + "combatLevel": 674, + "attackSpeed": 5 } } \ No newline at end of file diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/PluginManagerTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/PluginManagerTest.java index 69f48ca4bf..0069618dd6 100644 --- a/runelite-client/src/test/java/net/runelite/client/plugins/PluginManagerTest.java +++ b/runelite-client/src/test/java/net/runelite/client/plugins/PluginManagerTest.java @@ -50,7 +50,6 @@ import net.runelite.client.RuneLite; import net.runelite.client.RuneLiteModule; import net.runelite.client.config.Config; import net.runelite.client.config.ConfigItem; -import net.runelite.client.rs.ClientUpdateCheckMode; import static org.junit.Assert.assertEquals; import org.junit.Before; import org.junit.Rule; @@ -83,7 +82,7 @@ public class PluginManagerTest public void before() throws IOException { Injector injector = Guice.createInjector(Modules - .override(new RuneLiteModule(ClientUpdateCheckMode.AUTO, true)) + .override(new RuneLiteModule(() -> null, true)) .with(BoundFieldModule.of(this))); RuneLite.setInjector(injector); @@ -107,7 +106,6 @@ public class PluginManagerTest configClasses.add(clazz); } } - } @SuppressWarnings("unchecked") @@ -142,7 +140,7 @@ public class PluginManagerTest { List modules = new ArrayList<>(); modules.add(new GraphvizModule()); - modules.add(new RuneLiteModule(ClientUpdateCheckMode.AUTO, true)); + modules.add(new RuneLiteModule(() -> null, true)); PluginManager pluginManager = new PluginManager(true, null, null, null, null, null); pluginManager.loadCorePlugins(); diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/chatcommands/ChatCommandsPluginTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/chatcommands/ChatCommandsPluginTest.java index 111827fd12..58860a03fb 100644 --- a/runelite-client/src/test/java/net/runelite/client/plugins/chatcommands/ChatCommandsPluginTest.java +++ b/runelite-client/src/test/java/net/runelite/client/plugins/chatcommands/ChatCommandsPluginTest.java @@ -226,4 +226,22 @@ public class ChatCommandsPluginTest verify(configManager).setConfiguration("killcount.adam", "duel arena losses", 999); } + + @Test + public void testAgilityLap() + { + final String NEW_PB = "Lap duration: 1:01 (new personal best)."; + + when(client.getUsername()).thenReturn("Adam"); + + // This sets lastBoss + ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Your Prifddinas Agility Course lap count is: 2.", null, 0); + chatCommandsPlugin.onChatMessage(chatMessage); + + chatMessage = new ChatMessage(null, GAMEMESSAGE, "", NEW_PB, null, 0); + chatCommandsPlugin.onChatMessage(chatMessage); + + verify(configManager).setConfiguration(eq("personalbest.adam"), eq("prifddinas agility course"), eq(61)); + verify(configManager).setConfiguration(eq("killcount.adam"), eq("prifddinas agility course"), eq(2)); + } } diff --git a/runelite-client/src/test/java/net/runelite/client/rs/ClientConfigLoaderTest.java b/runelite-client/src/test/java/net/runelite/client/rs/ClientConfigLoaderTest.java index 719998d407..beb3400927 100644 --- a/runelite-client/src/test/java/net/runelite/client/rs/ClientConfigLoaderTest.java +++ b/runelite-client/src/test/java/net/runelite/client/rs/ClientConfigLoaderTest.java @@ -26,7 +26,6 @@ package net.runelite.client.rs; import java.io.IOException; -import okhttp3.OkHttpClient; import org.junit.Test; /** @@ -38,8 +37,7 @@ public class ClientConfigLoaderTest @Test public void test() throws IOException { - final ClientConfigLoader loader = new ClientConfigLoader(new OkHttpClient()); - final RSConfig config = loader.fetch(); + final RSConfig config = ClientConfigLoader.fetch(); for (String key : config.getClassLoaderProperties().keySet()) { diff --git a/runelite-script-assembler-plugin/build.gradle b/runelite-script-assembler-plugin/build.gradle index 165c0a3d4d..4720641d75 100644 --- a/runelite-script-assembler-plugin/build.gradle +++ b/runelite-script-assembler-plugin/build.gradle @@ -13,7 +13,7 @@ compileJava.outputs.upToDateWhen {false} compileJava.doLast { def path = sourceSets.main.runtimeClasspath - def loader = new URLClassLoader(path.collect { f -> f.toURL() } as URL[]) + def loader = new URLClassLoader(path.collect { f -> f.toURI().toURL() } as URL[]) def assemble = loader.loadClass('net.runelite.script.AssembleMojo') String[] assembleArgs = [ "${project.rootDir}/runelite-client/src/main/scripts", @@ -27,4 +27,6 @@ compileJava.doLast { "${project.rootDir}/runelite-client/src/main/resources/runelite/index" ] index.main(indexArgs) + + loader.close() }