Merge branch 'master' into gradlestuff
This commit is contained in:
@@ -4,7 +4,7 @@ about: Create a report to help us improve
|
||||
|
||||
---
|
||||
|
||||
Please check if your issue is not a duplicate by [searching existing issues](https://github.com/runelite/runelite/search?type=Issues)
|
||||
Please check if your issue is not a duplicate by [searching existing issues](https://github.com/open-osrs/runelite/search?type=Issues)
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
@@ -10,6 +10,12 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.gradle/caches
|
||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gradle-
|
||||
- name: Make gradlew executable
|
||||
run: chmod +x ./gradlew
|
||||
- name: Update Gradle Wrapper
|
||||
@@ -22,23 +28,4 @@ jobs:
|
||||
PULL_REQUEST_TITLE: 'project: Update gradle wrapper'
|
||||
PULL_REQUEST_BODY: This is an auto-generated PR with an updated gradle version
|
||||
COMMIT_MESSAGE: 'project: Update gradle wrapper'
|
||||
PULL_REQUEST_LABELS: automated-pull-request, gradle
|
||||
|
||||
update-dependencies:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Make gradlew executable
|
||||
run: chmod +x ./gradlew
|
||||
- name: Update Gradle dependencies
|
||||
run: ./gradlew useLatestVersions --console=plain
|
||||
- name: Create Gradle dependencies update Pull Request
|
||||
uses: Owain94/create-pull-request@master
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.OpenOSRS }}
|
||||
PULL_REQUEST_BRANCH: GRADLE-DEPENDENCY-UPDATE
|
||||
PULL_REQUEST_TITLE: 'project: Update gradle dependencies'
|
||||
PULL_REQUEST_BODY: This is an auto-generated PR with an updated gradle dependencies versions
|
||||
COMMIT_MESSAGE: 'project: Update gradle dependencies'
|
||||
PULL_REQUEST_LABELS: automated-pull-request, gradle
|
||||
@@ -20,6 +20,12 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.gradle/caches
|
||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gradle-
|
||||
- name: Make gradlew executable
|
||||
run: chmod +x ./gradlew
|
||||
- name: Set up JDK 11
|
||||
@@ -37,6 +43,12 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.gradle/caches
|
||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gradle-
|
||||
- name: Make gradlew executable
|
||||
run: chmod +x ./gradlew
|
||||
- name: Set up JDK 11
|
||||
@@ -48,12 +60,18 @@ jobs:
|
||||
- name: Testing
|
||||
run: ./gradlew test --stacktrace --console=plain
|
||||
|
||||
checkstyle:
|
||||
name: Checkstyle
|
||||
checkstyleMain:
|
||||
name: Checkstyle main
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.gradle/caches
|
||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gradle-
|
||||
- name: Make gradlew executable
|
||||
run: chmod +x ./gradlew
|
||||
- name: Set up JDK 11
|
||||
@@ -65,9 +83,32 @@ jobs:
|
||||
- name: Checking code conventions
|
||||
run: ./gradlew checkstyleMain --console=plain
|
||||
|
||||
checkstyleTest:
|
||||
name: Checkstyle test
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.gradle/caches
|
||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gradle-
|
||||
- name: Make gradlew executable
|
||||
run: chmod +x ./gradlew
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 11
|
||||
- name: Assembling
|
||||
run: ./gradlew assemble --console=plain
|
||||
- name: Checking code conventions
|
||||
run: ./gradlew checkstyleTest --console=plain
|
||||
|
||||
approve:
|
||||
name: Approve
|
||||
needs: [build, test, checkstyle]
|
||||
needs: [build, test, checkstyleMain, checkstyleTest]
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
|
||||
@@ -12,6 +12,12 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.gradle/caches
|
||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gradle-
|
||||
- name: Make gradlew executable
|
||||
run: chmod +x ./gradlew
|
||||
- name: Set up JDK 11
|
||||
@@ -29,6 +35,12 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.gradle/caches
|
||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gradle-
|
||||
- name: Make gradlew executable
|
||||
run: chmod +x ./gradlew
|
||||
- name: Set up JDK 11
|
||||
@@ -40,12 +52,18 @@ jobs:
|
||||
- name: Testing
|
||||
run: ./gradlew test --stacktrace --console=plain
|
||||
|
||||
checkstyle:
|
||||
name: Checkstyle
|
||||
checkstyleMain:
|
||||
name: Checkstyle main
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.gradle/caches
|
||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gradle-
|
||||
- name: Make gradlew executable
|
||||
run: chmod +x ./gradlew
|
||||
- name: Set up JDK 11
|
||||
@@ -57,6 +75,29 @@ jobs:
|
||||
- name: Checking code conventions
|
||||
run: ./gradlew checkstyleMain --console=plain
|
||||
|
||||
checkstyleTest:
|
||||
name: Checkstyle test
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.gradle/caches
|
||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gradle-
|
||||
- name: Make gradlew executable
|
||||
run: chmod +x ./gradlew
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 11
|
||||
- name: Assembling
|
||||
run: ./gradlew assemble --console=plain
|
||||
- name: Checking code conventions
|
||||
run: ./gradlew checkstyleTest --console=plain
|
||||
|
||||
update_draft_release:
|
||||
name: Draft release
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@@ -10,6 +10,12 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.gradle/caches
|
||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gradle-
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
|
||||
+30
-29
@@ -28,9 +28,8 @@ import org.ajoberstar.grgit.Grgit
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
maven(url = "https://plugins.gradle.org/m2/")
|
||||
gradlePluginPortal()
|
||||
maven(url = "https://raw.githubusercontent.com/open-osrs/hosting/master")
|
||||
mavenLocal()
|
||||
}
|
||||
dependencies {
|
||||
classpath(Plugins.grgitPlugin)
|
||||
@@ -42,10 +41,10 @@ buildscript {
|
||||
plugins {
|
||||
id(Plugins.testLogger.first) version Plugins.testLogger.second apply false
|
||||
id(Plugins.versions.first) version Plugins.versions.second
|
||||
id(Plugins.buildScan.first) version Plugins.buildScan.second
|
||||
id(Plugins.latestVersion.first) version Plugins.latestVersion.second
|
||||
id(Plugins.grgit.first) version Plugins.grgit.second
|
||||
|
||||
checkstyle
|
||||
application
|
||||
}
|
||||
|
||||
@@ -60,48 +59,40 @@ fun isNonStable(version: String): Boolean {
|
||||
}
|
||||
|
||||
allprojects {
|
||||
apply<JavaLibraryPlugin>()
|
||||
apply<MavenPlugin>()
|
||||
apply<MavenPublishPlugin>()
|
||||
|
||||
group = "com.openosrs"
|
||||
version = ProjectVersions.rlVersion
|
||||
}
|
||||
|
||||
subprojects {
|
||||
repositories {
|
||||
//mavenLocal()
|
||||
jcenter()
|
||||
maven(url = "https://mvnrepository.com/artifact")
|
||||
maven(url = "https://repo.runelite.net")
|
||||
maven(url = "https://raw.githubusercontent.com/open-osrs/hosting/master")
|
||||
maven(url = "https://jitpack.io")
|
||||
}
|
||||
|
||||
apply<JavaLibraryPlugin>()
|
||||
apply<MavenPublishPlugin>()
|
||||
apply(plugin = Plugins.testLogger.first)
|
||||
|
||||
project.extra["gitCommit"] = localGitCommit
|
||||
project.extra["gitCommitShort"] = localGitCommitShort
|
||||
|
||||
project.extra["rootPath"] = rootDir.toString().replace("\\", "/")
|
||||
}
|
||||
|
||||
subprojects {
|
||||
apply(plugin = Plugins.testLogger.first)
|
||||
|
||||
if (this.name != "runescape-client") {
|
||||
apply(plugin = "checkstyle")
|
||||
configure<CheckstyleExtension> {
|
||||
sourceSets = setOf(project.sourceSets.main.get())
|
||||
configFile = file("${rootDir}/checkstyle/checkstyle.xml")
|
||||
configProperties = mapOf("suppressionFile" to file("${rootDir}/checkstyle/suppressions.xml"))
|
||||
|
||||
checkstyle {
|
||||
maxWarnings = 0
|
||||
toolVersion = "6.4.1"
|
||||
toolVersion = "8.25"
|
||||
isShowViolations = true
|
||||
isIgnoreFailures = false
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
|
||||
maven(url = "http://repo1.maven.org/maven2")
|
||||
maven(url = "http://repo.runelite.net")
|
||||
maven(url = "http://repo.maven.apache.org/maven2")
|
||||
maven(url = "https://raw.githubusercontent.com/open-osrs/hosting/master")
|
||||
|
||||
if (System.getenv("NEXUS-URL") != null) {
|
||||
maven(url = System.getenv("NEXUS-URL"))
|
||||
}
|
||||
}
|
||||
|
||||
configure<PublishingExtension> {
|
||||
repositories {
|
||||
maven {
|
||||
@@ -120,6 +111,7 @@ subprojects {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
tasks {
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
@@ -136,6 +128,13 @@ subprojects {
|
||||
dirMode = 493
|
||||
fileMode = 420
|
||||
}
|
||||
|
||||
withType<Checkstyle> {
|
||||
group = "verification"
|
||||
|
||||
exclude("**/ScriptVarType.java")
|
||||
exclude("**/LayoutSolver.java")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,6 +144,8 @@ application {
|
||||
|
||||
tasks {
|
||||
named<JavaExec>("run") {
|
||||
group = "openosrs"
|
||||
|
||||
classpath = project(":runelite-client").sourceSets.main.get().runtimeClasspath
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ plugins {
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
jcenter()
|
||||
maven(url = "https://raw.githubusercontent.com/open-osrs/hosting/master")
|
||||
}
|
||||
|
||||
|
||||
@@ -27,9 +27,9 @@ const val kotlinVersion = "1.3.50"
|
||||
|
||||
object ProjectVersions {
|
||||
const val launcherVersion = "2.0.4"
|
||||
const val rlVersion = "1.5.39-SNAPSHOT"
|
||||
const val rlVersion = "1.5.40-SNAPSHOT"
|
||||
|
||||
const val openosrsVersion = "2.1.9.1"
|
||||
const val openosrsVersion = "2.1.12.0-SNAPSHOT"
|
||||
|
||||
const val rsversion = 185
|
||||
const val cacheversion = 165
|
||||
@@ -41,16 +41,15 @@ object Plugins {
|
||||
val injectorPlugin = "com.openosrs:injector-plugin:1.0.2"
|
||||
val testLogger = Pair("com.adarshr.test-logger", "2.0.0")
|
||||
val versions = Pair("com.github.ben-manes.versions", "0.27.0")
|
||||
val buildScan = Pair("com.gradle.build-scan", "3.0")
|
||||
val latestVersion = Pair("se.patrikerdes.use-latest-versions", "0.2.12")
|
||||
val latestVersion = Pair("se.patrikerdes.use-latest-versions", "0.2.13")
|
||||
val grgit = Pair("org.ajoberstar.grgit", "4.0.0-rc.1")
|
||||
val jarTest = Pair("com.github.hauner.jarTest", "1.0.1")
|
||||
val shadow = Pair("com.github.johnrengelman.shadow", "5.1.0")
|
||||
val shadow = Pair("com.github.johnrengelman.shadow", "5.2.0")
|
||||
}
|
||||
|
||||
object Libraries {
|
||||
private object Versions {
|
||||
const val annotations = "17.0.0"
|
||||
const val annotations = "18.0.0"
|
||||
const val antlr = "4.7.2"
|
||||
const val apacheCommonsCompress = "1.19"
|
||||
const val apacheCommonsCsv = "1.7"
|
||||
@@ -73,10 +72,10 @@ object Libraries {
|
||||
const val jbsdiff = "1.0"
|
||||
const val jclCore = "2.8"
|
||||
const val jedis = "3.1.0"
|
||||
const val jna = "5.4.0"
|
||||
const val jna = "5.5.0"
|
||||
const val jogamp = "2.3.2"
|
||||
const val jopt = "5.0.4"
|
||||
const val jooq = "3.12.2"
|
||||
const val jooq = "3.12.3"
|
||||
const val junit = "4.12"
|
||||
const val jupiter = "5.6.0-M1"
|
||||
const val logback = "1.2.3"
|
||||
@@ -87,21 +86,22 @@ object Libraries {
|
||||
const val mavenPluginApi = "3.6.2"
|
||||
const val minio = "6.0.11"
|
||||
const val mockito = "3.1.0"
|
||||
const val mongodbDriverSync = "3.11.1"
|
||||
const val mongodbDriverSync = "3.11.2"
|
||||
const val mysqlConnectorJava = "8.0.18"
|
||||
const val naturalMouse = "2.0.2"
|
||||
const val netty = "4.1.42.Final"
|
||||
const val netty = "4.1.43.Final"
|
||||
const val okhttp3 = "4.2.2"
|
||||
const val orangeExtensions = "1.0"
|
||||
const val petitparser = "2.2.0"
|
||||
const val plexus = "3.3.0"
|
||||
const val rxjava = "2.2.13"
|
||||
const val rxjava = "2.2.14"
|
||||
const val rxrelay = "2.1.1"
|
||||
const val scribejava = "6.9.0"
|
||||
const val sisu = "0.3.3"
|
||||
const val slf4j = "1.7.28"
|
||||
const val springJdbc = "5.2.0.RELEASE"
|
||||
const val springboot = "2.2.0.RELEASE"
|
||||
const val sisu = "0.3.4"
|
||||
const val sentry = "1.7.28"
|
||||
const val slf4j = "1.7.29"
|
||||
const val springJdbc = "5.2.1.RELEASE"
|
||||
const val springboot = "2.2.1.RELEASE"
|
||||
const val sql2o = "1.6.0"
|
||||
const val substance = "8.0.02"
|
||||
const val trident = "1.5.00"
|
||||
@@ -179,6 +179,7 @@ object Libraries {
|
||||
const val slf4jApi = "org.slf4j:slf4j-api:${Versions.slf4j}"
|
||||
const val slf4jNop = "org.slf4j:slf4j-nop:${Versions.slf4j}"
|
||||
const val slf4jSimple = "org.slf4j:slf4j-simple:${Versions.slf4j}"
|
||||
const val sentry = "io.sentry:sentry:${Versions.sentry}"
|
||||
const val springbootDevtools = "org.springframework.boot:spring-boot-devtools:${Versions.springboot}"
|
||||
const val springbootStarter = "org.springframework.boot:spring-boot-starter:${Versions.springboot}"
|
||||
const val springbootStarterWeb = "org.springframework.boot:spring-boot-starter-web:${Versions.springboot}"
|
||||
|
||||
Vendored
+9
-3
@@ -52,7 +52,11 @@ dependencies {
|
||||
}
|
||||
|
||||
tasks {
|
||||
"processTestResources"(ProcessResources::class) {
|
||||
processTestResources {
|
||||
finalizedBy("filterTestResources")
|
||||
}
|
||||
|
||||
register<Copy>("filterTestResources") {
|
||||
val tokens = mapOf(
|
||||
"rs.version" to ProjectVersions.rsversion.toString(),
|
||||
"cache.version" to ProjectVersions.cacheversion.toString()
|
||||
@@ -62,8 +66,10 @@ tasks {
|
||||
|
||||
from("src/test/resources") {
|
||||
include("cache.properties")
|
||||
|
||||
filter<ReplaceTokens>("tokens" to tokens)
|
||||
}
|
||||
into("${buildDir}/resources/test")
|
||||
|
||||
filter(ReplaceTokens::class, "tokens" to tokens)
|
||||
filteringCharset = "UTF-8"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,18 +24,19 @@
|
||||
*/
|
||||
package net.runelite.cache;
|
||||
|
||||
import com.google.common.io.FileWriteMode;
|
||||
import com.google.common.io.Files;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.Charset;
|
||||
import javax.sound.sampled.AudioFileFormat;
|
||||
import javax.sound.sampled.AudioFormat;
|
||||
import javax.sound.sampled.AudioInputStream;
|
||||
import javax.sound.sampled.AudioSystem;
|
||||
import net.runelite.cache.definitions.loaders.sound.SoundEffectTrackLoader;
|
||||
import net.runelite.cache.definitions.sound.SoundEffectTrackDefinition;
|
||||
import net.runelite.cache.fs.Archive;
|
||||
@@ -48,11 +49,6 @@ import org.junit.rules.TemporaryFolder;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.sound.sampled.AudioFileFormat;
|
||||
import javax.sound.sampled.AudioFormat;
|
||||
import javax.sound.sampled.AudioInputStream;
|
||||
import javax.sound.sampled.AudioSystem;
|
||||
|
||||
public class SoundEffectsDumperTest
|
||||
{
|
||||
private static final Logger logger = LoggerFactory.getLogger(SoundEffectsDumperTest.class);
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
|
||||
"https://checkstyle.org/dtds/configuration_1_3.dtd">
|
||||
<module name="Checker">
|
||||
<module name="SuppressionCommentFilter"/>
|
||||
<module name="TreeWalker">
|
||||
<module name="SuppressionCommentFilter"/>
|
||||
<module name="LeftCurly">
|
||||
<property name="option" value="nl"/>
|
||||
</module>
|
||||
@@ -58,6 +58,6 @@
|
||||
<property name="message" value="Newline should not be between else and if"/>
|
||||
</module>
|
||||
<module name="SuppressionFilter">
|
||||
<property name="file" value="${suppressionFile}"/>
|
||||
<property name="file" value="${config_loc}/suppressions.xml"/>
|
||||
</module>
|
||||
</module>
|
||||
@@ -24,11 +24,11 @@
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
<!DOCTYPE suppressions PUBLIC
|
||||
"-//Checkstyle//DTD SuppressionFilter Configuration 1.1//EN"
|
||||
"https://checkstyle.org/dtds/suppressions_1_1.dtd">
|
||||
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
|
||||
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
|
||||
<suppressions>
|
||||
<suppress files="RuntimeTypeAdapterFactory\.java" checks="[a-zA-Z0-9]*"/>
|
||||
<suppress files="[\\/]runescape-client[\\/]" checks="[a-zA-Z0-9]*"/>
|
||||
<suppress files="[\\/]ScriptVarType[\./]" checks="[a-zA-Z0-9]*"/>
|
||||
<suppress files="[\\/]RoomType[\./]" checks="[a-zA-Z0-9]*"/>
|
||||
<suppress files="[\\/]LayoutSolver[\./]" checks="[a-zA-Z0-9]*"/>
|
||||
</suppressions>
|
||||
@@ -45,7 +45,7 @@ dependencies {
|
||||
implementation(project(":runelite-api"))
|
||||
implementation(project(":runescape-api"))
|
||||
|
||||
runtime(Libraries.slf4jSimple)
|
||||
runtimeOnly(Libraries.slf4jSimple)
|
||||
|
||||
testImplementation(deobjars)
|
||||
testImplementation(Libraries.junit)
|
||||
@@ -59,23 +59,35 @@ tasks {
|
||||
"rs.client" to deobjars.find { it.name.startsWith("runescape-client") }.toString().replace("\\", "/")
|
||||
)
|
||||
|
||||
"processResources"(ProcessResources::class) {
|
||||
processResources {
|
||||
finalizedBy("filterResources")
|
||||
}
|
||||
|
||||
register<Copy>("filterResources") {
|
||||
inputs.properties(tokens)
|
||||
|
||||
from("src/main/resources") {
|
||||
include("deob.properties")
|
||||
|
||||
filter<ReplaceTokens>("tokens" to tokens)
|
||||
}
|
||||
into("${buildDir}/resources/main")
|
||||
|
||||
filter(ReplaceTokens::class, "tokens" to tokens)
|
||||
filteringCharset = "UTF-8"
|
||||
}
|
||||
|
||||
"processTestResources"(ProcessResources::class) {
|
||||
processTestResources {
|
||||
finalizedBy("filterTestResources")
|
||||
}
|
||||
|
||||
register<Copy>("filterTestResources") {
|
||||
inputs.properties(tokens)
|
||||
|
||||
from("src/test/resources") {
|
||||
include("deob-test.properties")
|
||||
|
||||
filter<ReplaceTokens>("tokens" to tokens)
|
||||
}
|
||||
into("${buildDir}/resources/test")
|
||||
|
||||
filter(ReplaceTokens::class, "tokens" to tokens)
|
||||
filteringCharset = "UTF-8"
|
||||
}
|
||||
}
|
||||
|
||||
+22
-12
@@ -43,8 +43,21 @@ public class NonloadingClassWriter extends ClassWriter
|
||||
@Override
|
||||
protected String getCommonSuperClass(String type1, String type2)
|
||||
{
|
||||
ClassFile cf1 = group.findClass(type1),
|
||||
cf2 = group.findClass(type2);
|
||||
// Checking more than this wouldn't make any sense
|
||||
// Object has no super class, and RS api is guaranteed to be interfaces, which always extend from Object
|
||||
// some rl api classes however ARE actual classes, so we can't just assume interface, for the slim chance
|
||||
// we've got rl api on classpath. We could check all implemented interfaces in group, but that means you end up
|
||||
// with Object as super class anyway, just like if you just let the Class.forName call throw.
|
||||
// (maybe we could if we had a better package structure...)
|
||||
if (type1.equals("java/lang/Object")
|
||||
|| type2.equals("java/lang/Object")
|
||||
|| type1.startsWith("net/runelite/rs/api/RS")
|
||||
|| type2.startsWith("net/runelite/rs/api/RS")
|
||||
)
|
||||
return "java/lang/Object";
|
||||
|
||||
ClassFile cf1 = group.findClass(type1);
|
||||
ClassFile cf2 = group.findClass(type2);
|
||||
|
||||
if (cf1 == null && cf2 == null)
|
||||
{
|
||||
@@ -62,10 +75,11 @@ public class NonloadingClassWriter extends ClassWriter
|
||||
|
||||
if (cf1 != null && cf2 != null)
|
||||
{
|
||||
for (ClassFile c = cf1; c != null; c = c.getParent())
|
||||
for (ClassFile c2 = cf2; c2 != null; c2 = c2.getParent())
|
||||
if (c == c2)
|
||||
return c.getName();
|
||||
if (!(cf1.isInterface() || cf2.isInterface()))
|
||||
for (ClassFile c = cf1; c != null; c = c.getParent())
|
||||
for (ClassFile c2 = cf2; c2 != null; c2 = c2.getParent())
|
||||
if (c == c2)
|
||||
return c.getName();
|
||||
|
||||
return "java/lang/Object";
|
||||
}
|
||||
@@ -80,7 +94,6 @@ public class NonloadingClassWriter extends ClassWriter
|
||||
}
|
||||
else
|
||||
{
|
||||
assert cf2 == null;
|
||||
found = cf1;
|
||||
other = type2;
|
||||
}
|
||||
@@ -88,13 +101,10 @@ public class NonloadingClassWriter extends ClassWriter
|
||||
ClassFile prev = null;
|
||||
|
||||
for (ClassFile c = found; c != null; c = c.getParent())
|
||||
{
|
||||
prev = c;
|
||||
|
||||
if (c.getName().equals(other))
|
||||
if ((prev = c).getSuperName().equals(other))
|
||||
return other;
|
||||
}
|
||||
|
||||
// This should pretty much never be hit, right?
|
||||
return super.getCommonSuperClass(prev.getSuperName(), other);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,165 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2016-2017, Adam <Adam@sigterm.info>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (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.runeloader;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.net.URLClassLoader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import net.runelite.mapping.Export;
|
||||
import net.runelite.mapping.ObfuscatedGetter;
|
||||
import net.runelite.mapping.ObfuscatedName;
|
||||
import net.runelite.runeloader.inject.GetterInjectInstruction;
|
||||
import net.runelite.runeloader.inject.Injection;
|
||||
import net.runelite.runeloader.inject.InjectionModscript;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
public class CheckMappings
|
||||
{
|
||||
private static final File CLIENT = new File("d:/rs/07/adamout.jar");
|
||||
|
||||
private final List<Class> classes = new ArrayList<>();
|
||||
|
||||
@Before
|
||||
public void before() throws MalformedURLException, ClassNotFoundException
|
||||
{
|
||||
ClassLoader loader = new URLClassLoader(new URL[]{CLIENT.toURI().toURL()});
|
||||
|
||||
Class c = loader.loadClass("client");
|
||||
classes.add(c);
|
||||
|
||||
for (int i = 0; i < 230; ++i)
|
||||
{
|
||||
try
|
||||
{
|
||||
c = loader.loadClass("class" + i);
|
||||
classes.add(c);
|
||||
}
|
||||
catch (ClassNotFoundException ex)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private Class<?> findClassWithObfuscatedName(String name)
|
||||
{
|
||||
for (Class c : classes)
|
||||
{
|
||||
if (c.getName().equals("net.runelite.rs.client.client") && name.equals("client"))
|
||||
{
|
||||
return c;
|
||||
}
|
||||
|
||||
ObfuscatedName oc = (ObfuscatedName) c.getDeclaredAnnotation(ObfuscatedName.class);
|
||||
if (oc == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (oc.value().equals(name))
|
||||
{
|
||||
return c;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private Field findFieldWithObfuscatedName(Class c, String name)
|
||||
{
|
||||
for (Field f : c.getDeclaredFields())
|
||||
{
|
||||
ObfuscatedName oc = f.getDeclaredAnnotation(ObfuscatedName.class);
|
||||
if (oc == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (oc.value().equals(name))
|
||||
{
|
||||
return f;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private Integer getIntegerMultiplier(Field f)
|
||||
{
|
||||
ObfuscatedGetter getter = f.getDeclaredAnnotation(ObfuscatedGetter.class);
|
||||
if (getter == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return getter.intValue() == 0 ? null : getter.intValue();
|
||||
}
|
||||
|
||||
private String getExportedName(Field f)
|
||||
{
|
||||
Export e = f.getDeclaredAnnotation(Export.class);
|
||||
if (e == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return e.value();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void checkMappings() throws IOException
|
||||
{
|
||||
InjectionModscript mod = Injection.load(MappingImporter.class.getResourceAsStream(MappingImporter.RL_INJECTION));
|
||||
|
||||
for (int i = 0; i < mod.getGetterInjects().size(); ++i)
|
||||
{
|
||||
GetterInjectInstruction gii = mod.getGetterInjects().get(i);
|
||||
|
||||
Class c = this.findClassWithObfuscatedName(gii.getGetterClassName());
|
||||
Assert.assertNotNull(c);
|
||||
|
||||
Field f = this.findFieldWithObfuscatedName(c, gii.getGetterFieldName());
|
||||
Assert.assertNotNull(f);
|
||||
|
||||
String exportedName = this.getExportedName(f);
|
||||
String attrName = gii.getGetterName();
|
||||
attrName = Utils.toExportedName(attrName);
|
||||
|
||||
Integer mul = gii.getMultiplier(),
|
||||
myMul = this.getIntegerMultiplier(f);
|
||||
|
||||
// XXX Check @Export etc names
|
||||
|
||||
//Assert.assertEquals(exportedName, attrName);
|
||||
Assert.assertEquals(myMul, mul);
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0-all.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
@@ -47,7 +47,11 @@ dependencies {
|
||||
}
|
||||
|
||||
tasks {
|
||||
"processResources"(ProcessResources::class) {
|
||||
processResources {
|
||||
finalizedBy("filterResources")
|
||||
}
|
||||
|
||||
register<Copy>("filterResources") {
|
||||
val tokens = mapOf(
|
||||
"projectver" to ProjectVersions.rlVersion,
|
||||
"rsver" to ProjectVersions.rsversion.toString(),
|
||||
@@ -58,8 +62,10 @@ tasks {
|
||||
|
||||
from("src/main/resources") {
|
||||
include("runelite.properties")
|
||||
|
||||
filter<ReplaceTokens>("tokens" to tokens)
|
||||
}
|
||||
into("${buildDir}/resources/main")
|
||||
|
||||
filter(ReplaceTokens::class, "tokens" to tokens)
|
||||
filteringCharset = "UTF-8"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -316,36 +316,6 @@ public class ChatClient
|
||||
}
|
||||
}
|
||||
|
||||
public String getLayout(String username) throws IOException
|
||||
{
|
||||
HttpUrl url = RuneLiteAPI.getOpenOSRSApiBase().newBuilder()
|
||||
.addPathSegment("chat")
|
||||
.addPathSegment("layout")
|
||||
.addQueryParameter("name", username)
|
||||
.build();
|
||||
|
||||
Request request = new Request.Builder()
|
||||
.url(url)
|
||||
.build();
|
||||
|
||||
try (Response response = RuneLiteAPI.CLIENT.newCall(request).execute())
|
||||
{
|
||||
if (!response.isSuccessful())
|
||||
{
|
||||
throw new IOException("Unable to look up layout!");
|
||||
}
|
||||
|
||||
final String layout = response.body().string();
|
||||
|
||||
if (!testLayout(layout))
|
||||
{
|
||||
throw new IOException("Layout " + layout + " is not valid!");
|
||||
}
|
||||
|
||||
return layout;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean testLayout(String layout)
|
||||
{
|
||||
return LAYOUT_VALIDATOR.test(layout);
|
||||
@@ -465,4 +435,51 @@ public class ChatClient
|
||||
return response.isSuccessful();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean submitLayout(String username, LayoutRoom[] rooms) throws IOException
|
||||
{
|
||||
HttpUrl url = RuneLiteAPI.getApiBase().newBuilder()
|
||||
.addPathSegment("chat")
|
||||
.addPathSegment("layout")
|
||||
.addQueryParameter("name", username)
|
||||
.build();
|
||||
|
||||
Request request = new Request.Builder()
|
||||
.post(RequestBody.create(RuneLiteAPI.JSON, RuneLiteAPI.GSON.toJson(rooms)))
|
||||
.url(url)
|
||||
.build();
|
||||
|
||||
try (Response response = RuneLiteAPI.CLIENT.newCall(request).execute())
|
||||
{
|
||||
return response.isSuccessful();
|
||||
}
|
||||
}
|
||||
|
||||
public LayoutRoom[] getLayout(String username) throws IOException
|
||||
{
|
||||
HttpUrl url = RuneLiteAPI.getApiBase().newBuilder()
|
||||
.addPathSegment("chat")
|
||||
.addPathSegment("layout")
|
||||
.addQueryParameter("name", username)
|
||||
.build();
|
||||
|
||||
Request request = new Request.Builder()
|
||||
.url(url)
|
||||
.build();
|
||||
|
||||
try (Response response = RuneLiteAPI.CLIENT.newCall(request).execute())
|
||||
{
|
||||
if (!response.isSuccessful())
|
||||
{
|
||||
throw new IOException("Unable to look up layout!");
|
||||
}
|
||||
|
||||
InputStream in = response.body().byteStream();
|
||||
return RuneLiteAPI.GSON.fromJson(new InputStreamReader(in), LayoutRoom[].class);
|
||||
}
|
||||
catch (JsonParseException ex)
|
||||
{
|
||||
throw new IOException(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright (c) 2019, Adam <Adam@sigterm.info>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (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.http.api.chat;
|
||||
|
||||
public enum LayoutRoom
|
||||
{
|
||||
START,
|
||||
END,
|
||||
SCAVENGERS,
|
||||
FARMING,
|
||||
EMPTY,
|
||||
|
||||
TEKTON,
|
||||
MUTTADILES,
|
||||
GUARDIANS,
|
||||
VESPULA,
|
||||
SHAMANS,
|
||||
VASA,
|
||||
VANGUARDS,
|
||||
MYSTICS,
|
||||
UNKNOWN_COMBAT,
|
||||
|
||||
CRABS,
|
||||
ICE_DEMON,
|
||||
TIGHTROPE,
|
||||
THIEVING,
|
||||
UNKNOWN_PUZZLE;
|
||||
}
|
||||
@@ -30,11 +30,13 @@ import java.util.concurrent.TimeUnit;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import net.runelite.http.api.chat.Duels;
|
||||
import net.runelite.http.api.chat.LayoutRoom;
|
||||
import net.runelite.http.api.chat.Task;
|
||||
import net.runelite.http.service.util.exception.NotFoundException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
@@ -208,4 +210,23 @@ public class ChatController
|
||||
}
|
||||
return duels;
|
||||
}
|
||||
|
||||
@PostMapping("/layout")
|
||||
public void submitLayout(@RequestParam String name, @RequestBody LayoutRoom[] rooms)
|
||||
{
|
||||
chatService.setLayout(name, rooms);
|
||||
}
|
||||
|
||||
@GetMapping("/layout")
|
||||
public LayoutRoom[] getLayout(@RequestParam String name)
|
||||
{
|
||||
LayoutRoom[] layout = chatService.getLayout(name);
|
||||
|
||||
if (layout == null)
|
||||
{
|
||||
throw new NotFoundException();
|
||||
}
|
||||
|
||||
return layout;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,9 +24,13 @@
|
||||
*/
|
||||
package net.runelite.http.service.chat;
|
||||
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.base.Splitter;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import java.time.Duration;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import net.runelite.http.api.chat.LayoutRoom;
|
||||
import net.runelite.http.api.chat.Task;
|
||||
import net.runelite.http.api.chat.Duels;
|
||||
import net.runelite.http.service.util.redis.RedisPool;
|
||||
@@ -198,4 +202,31 @@ public class ChatService
|
||||
jedis.expire(key, (int) EXPIRE.getSeconds());
|
||||
}
|
||||
}
|
||||
|
||||
public LayoutRoom[] getLayout(String name)
|
||||
{
|
||||
String layout;
|
||||
try (Jedis jedis = jedisPool.getResource())
|
||||
{
|
||||
layout = jedis.get("layout." + name);
|
||||
}
|
||||
|
||||
if (layout == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
List<String> roomList = Splitter.on(' ').splitToList(layout);
|
||||
return roomList.stream()
|
||||
.map(LayoutRoom::valueOf)
|
||||
.toArray(LayoutRoom[]::new);
|
||||
}
|
||||
|
||||
public void setLayout(String name, LayoutRoom[] rooms)
|
||||
{
|
||||
try (Jedis jedis = jedisPool.getResource())
|
||||
{
|
||||
jedis.setex("layout." + name, (int) EXPIRE.getSeconds(), Joiner.on(' ').join(rooms));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ injector {
|
||||
}
|
||||
|
||||
artifacts {
|
||||
add("runtime", tasks.inject.get().output) {
|
||||
add("runtimeOnly", tasks.inject.get().output) {
|
||||
builtBy(tasks.inject)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11318,5 +11318,14 @@ public final class ItemID
|
||||
public static final int SKELETON_LANTERN = 24327;
|
||||
public static final int BOUNTY_CRATE = 24329;
|
||||
public static final int BIRTHDAY_CAKE_24331 = 24331;
|
||||
public static final int BIRTHDAY_CAKE_24332 = 24332;
|
||||
public static final int DAGONHAI_ROBES_SET = 24333;
|
||||
public static final int BOUNTY_TARGET_TELEPORT = 24336;
|
||||
public static final int BOUNTY_HUNTER_HAT_TIER_1 = 24338;
|
||||
public static final int BOUNTY_HUNTER_HAT_TIER_2 = 24340;
|
||||
public static final int BOUNTY_HUNTER_HAT_TIER_3 = 24342;
|
||||
public static final int BOUNTY_HUNTER_HAT_TIER_4 = 24344;
|
||||
public static final int BOUNTY_HUNTER_HAT_TIER_5 = 24346;
|
||||
public static final int BOUNTY_HUNTER_HAT_TIER_6 = 24348;
|
||||
/* This file is automatically generated. Do not edit. */
|
||||
}
|
||||
|
||||
@@ -286,7 +286,7 @@ public final class NpcID
|
||||
public static final int DWARF = 290;
|
||||
public static final int CHAOS_DWARF = 291;
|
||||
public static final int DWARF_292 = 292;
|
||||
public static final int SNAILNECK = 293;
|
||||
public static final int ADVENTURER_JON = 293;
|
||||
public static final int DWARF_294 = 294;
|
||||
public static final int DWARF_295 = 295;
|
||||
public static final int DWARF_296 = 296;
|
||||
@@ -308,7 +308,6 @@ public final class NpcID
|
||||
public static final int FROG = 312;
|
||||
public static final int REACHER_313 = 313;
|
||||
public static final int DR_JEKYLL_314 = 314;
|
||||
public static final int GRASSLEGS = 315;
|
||||
public static final int PAUL = 317;
|
||||
public static final int DARK_CORE = 318;
|
||||
public static final int CORPOREAL_BEAST = 319;
|
||||
@@ -7161,8 +7160,6 @@ public final class NpcID
|
||||
public static final int REVENANT_DARK_BEAST = 7938;
|
||||
public static final int REVENANT_KNIGHT = 7939;
|
||||
public static final int REVENANT_DRAGON = 7940;
|
||||
public static final int EPIC_MAGER34 = 7941;
|
||||
public static final int EPIC_MAGER34_7942 = 7942;
|
||||
public static final int EMBLEM_TRADER_7943 = 7943;
|
||||
public static final int FISHING_SPOT_7946 = 7946;
|
||||
public static final int FISHING_SPOT_7947 = 7947;
|
||||
@@ -8267,7 +8264,7 @@ public final class NpcID
|
||||
public static final int ED_9200 = 9200;
|
||||
public static final int CRAB_9201 = 9201;
|
||||
public static final int TIDE = 9202;
|
||||
public static final int ADVENTURER_JON = 9244;
|
||||
public static final int ADVENTURER_JON_9244 = 9244;
|
||||
public static final int ARIANWYN_HARD = 9246;
|
||||
public static final int ESSYLLT_HARD = 9247;
|
||||
public static final int ARIANWYN_9248 = 9248;
|
||||
@@ -8319,8 +8316,5 @@ public final class NpcID
|
||||
public static final int TYPHOR_9296 = 9296;
|
||||
public static final int VRITRA = 9297;
|
||||
public static final int MAZ = 9298;
|
||||
public static final int MAD_MELVIN96 = 9299;
|
||||
public static final int GOBLIN_9300 = 9300;
|
||||
public static final int BUTTERFLY_9301 = 9301;
|
||||
/* This file is automatically generated. Do not edit. */
|
||||
}
|
||||
|
||||
@@ -12805,6 +12805,14 @@ public final class NullItemID
|
||||
public static final int NULL_24326 = 24326;
|
||||
public static final int NULL_24328 = 24328;
|
||||
public static final int NULL_24330 = 24330;
|
||||
public static final int NULL_24332 = 24332;
|
||||
public static final int NULL_24334 = 24334;
|
||||
public static final int NULL_24335 = 24335;
|
||||
public static final int NULL_24337 = 24337;
|
||||
public static final int NULL_24339 = 24339;
|
||||
public static final int NULL_24341 = 24341;
|
||||
public static final int NULL_24343 = 24343;
|
||||
public static final int NULL_24345 = 24345;
|
||||
public static final int NULL_24347 = 24347;
|
||||
public static final int NULL_24349 = 24349;
|
||||
/* This file is automatically generated. Do not edit. */
|
||||
}
|
||||
|
||||
@@ -18038,15 +18038,13 @@ public final class NullObjectID
|
||||
public static final int NULL_37430 = 37430;
|
||||
public static final int NULL_37432 = 37432;
|
||||
public static final int NULL_37433 = 37433;
|
||||
public static final int NULL_37439 = 37439;
|
||||
public static final int NULL_37441 = 37441;
|
||||
public static final int NULL_37442 = 37442;
|
||||
public static final int NULL_37443 = 37443;
|
||||
public static final int NULL_37436 = 37436;
|
||||
public static final int NULL_37437 = 37437;
|
||||
public static final int NULL_37438 = 37438;
|
||||
public static final int NULL_37446 = 37446;
|
||||
public static final int NULL_37447 = 37447;
|
||||
public static final int NULL_37448 = 37448;
|
||||
public static final int NULL_37449 = 37449;
|
||||
public static final int NULL_37450 = 37450;
|
||||
public static final int NULL_37451 = 37451;
|
||||
public static final int NULL_37452 = 37452;
|
||||
public static final int NULL_37453 = 37453;
|
||||
@@ -18054,7 +18052,5 @@ public final class NullObjectID
|
||||
public static final int NULL_37455 = 37455;
|
||||
public static final int NULL_37456 = 37456;
|
||||
public static final int NULL_37457 = 37457;
|
||||
public static final int NULL_37458 = 37458;
|
||||
public static final int NULL_37460 = 37460;
|
||||
/* This file is automatically generated. Do not edit. */
|
||||
}
|
||||
|
||||
@@ -19385,12 +19385,7 @@ public final class ObjectID
|
||||
public static final int ROUGH_WALL_37431 = 37431;
|
||||
public static final int STREAK_INFO = 37434;
|
||||
public static final int SWAMPY_SINK = 37435;
|
||||
public static final int BED_37436 = 37436;
|
||||
public static final int BED_37437 = 37437;
|
||||
public static final int BLACK_POWDER = 37438;
|
||||
public static final int SMOKE_BOMB = 37440;
|
||||
public static final int LOG_PILE_37444 = 37444;
|
||||
public static final int HOTSPOT_MARKER = 37445;
|
||||
public static final int FOUNTAIN_37459 = 37459;
|
||||
/* This file is automatically generated. Do not edit. */
|
||||
}
|
||||
|
||||
@@ -25,13 +25,14 @@
|
||||
*/
|
||||
package net.runelite.api.coords;
|
||||
|
||||
import static net.runelite.api.Constants.CHUNK_SIZE;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import javax.annotation.Nullable;
|
||||
import lombok.Value;
|
||||
import net.runelite.api.Client;
|
||||
import static net.runelite.api.Constants.CHUNK_SIZE;
|
||||
import net.runelite.api.Perspective;
|
||||
|
||||
/**
|
||||
@@ -97,8 +98,8 @@ public class WorldPoint
|
||||
* Checks whether a tile is located in the current scene.
|
||||
*
|
||||
* @param client the client
|
||||
* @param x the tiles x coordinate
|
||||
* @param y the tiles y coordinate
|
||||
* @param x the tiles x coordinate
|
||||
* @param y the tiles y coordinate
|
||||
* @return true if the tile is in the scene, false otherwise
|
||||
*/
|
||||
public static boolean isInScene(Client client, int x, int y)
|
||||
@@ -127,7 +128,7 @@ public class WorldPoint
|
||||
* Gets the coordinate of the tile that contains the passed local point.
|
||||
*
|
||||
* @param client the client
|
||||
* @param local the local coordinate
|
||||
* @param local the local coordinate
|
||||
* @return the tile coordinate containing the local point
|
||||
*/
|
||||
public static WorldPoint fromLocal(Client client, LocalPoint local)
|
||||
@@ -139,9 +140,9 @@ public class WorldPoint
|
||||
* Gets the coordinate of the tile that contains the passed local point.
|
||||
*
|
||||
* @param client the client
|
||||
* @param x the local x-axis coordinate
|
||||
* @param y the local x-axis coordinate
|
||||
* @param plane the plane
|
||||
* @param x the local x-axis coordinate
|
||||
* @param y the local x-axis coordinate
|
||||
* @param plane the plane
|
||||
* @return the tile coordinate containing the local point
|
||||
*/
|
||||
public static WorldPoint fromLocal(Client client, int x, int y, int plane)
|
||||
@@ -157,10 +158,11 @@ public class WorldPoint
|
||||
* Gets the coordinate of the tile that contains the passed local point,
|
||||
* accounting for instances.
|
||||
*
|
||||
* @param client the client
|
||||
* @param client the client
|
||||
* @param localPoint the local coordinate
|
||||
* @return the tile coordinate containing the local point
|
||||
*/
|
||||
@Nullable
|
||||
public static WorldPoint fromLocalInstance(Client client, LocalPoint localPoint)
|
||||
{
|
||||
if (client.isInInstancedRegion())
|
||||
@@ -173,6 +175,11 @@ public class WorldPoint
|
||||
int chunkX = sceneX / CHUNK_SIZE;
|
||||
int chunkY = sceneY / CHUNK_SIZE;
|
||||
|
||||
if (chunkX >= 13 || chunkY >= 13)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
// get the template chunk for the chunk
|
||||
int[][][] instanceTemplateChunks = client.getInstanceTemplateChunks();
|
||||
int templateChunk = instanceTemplateChunks[client.getPlane()][chunkX][chunkY];
|
||||
@@ -198,6 +205,7 @@ public class WorldPoint
|
||||
/**
|
||||
* Get occurrences of a tile on the scene, accounting for instances. There may be
|
||||
* more than one if the same template chunk occurs more than once on the scene.
|
||||
*
|
||||
* @param client
|
||||
* @param worldPoint
|
||||
* @return
|
||||
@@ -238,7 +246,7 @@ public class WorldPoint
|
||||
/**
|
||||
* Rotate the coordinates in the chunk according to chunk rotation
|
||||
*
|
||||
* @param point point
|
||||
* @param point point
|
||||
* @param rotation rotation
|
||||
* @return world point
|
||||
*/
|
||||
@@ -363,6 +371,7 @@ public class WorldPoint
|
||||
|
||||
/**
|
||||
* Checks if user in within certain zone specified by upper and lower bound
|
||||
*
|
||||
* @param lowerBound
|
||||
* @param upperBound
|
||||
* @param userLocation
|
||||
|
||||
@@ -46,6 +46,7 @@ public class WidgetID
|
||||
public static final int GRAND_EXCHANGE_GROUP_ID = 465;
|
||||
public static final int DEPOSIT_BOX_GROUP_ID = 192;
|
||||
public static final int INVENTORY_GROUP_ID = 149;
|
||||
public static final int PLAYER_TRADE_CONFIRM_GROUP_ID = 334;
|
||||
public static final int PLAYER_TRADE_SCREEN_GROUP_ID = 335;
|
||||
public static final int PLAYER_TRADE_INVENTORY_GROUP_ID = 336;
|
||||
public static final int FRIENDS_LIST_GROUP_ID = 429;
|
||||
@@ -154,7 +155,6 @@ public class WidgetID
|
||||
public static final int BEGINNER_CLUE_MAP_WIZARDS_TOWER = 356;
|
||||
public static final int SEED_BOX_GROUP_ID = 128;
|
||||
public static final int ITEMS_KEPT_ON_DEATH_GROUP_ID = 4;
|
||||
public static final int TRADING_SCREEN = 335;
|
||||
public static final int SEED_VAULT_GROUP_ID = 631;
|
||||
public static final int EXPLORERS_RING_ALCH_GROUP_ID = 483;
|
||||
public static final int LMS_GROUP_ID = 333;
|
||||
@@ -1089,7 +1089,7 @@ public class WidgetID
|
||||
|
||||
public static class TradeScreen
|
||||
{
|
||||
public static final int SECOND_GROUP_ID = 334;
|
||||
public static final int FIRST_TRADING_WITH = 31;
|
||||
public static final int SECOND_TRADING_WITH = 30;
|
||||
public static final int SECOND_MY_OFFER = 23;
|
||||
public static final int SECOND_THEIR_OFFER = 24;
|
||||
|
||||
@@ -782,7 +782,9 @@ public enum WidgetInfo
|
||||
|
||||
ACHIEVEMENT_DIARY_CONTAINER(WidgetID.ACHIEVEMENT_DIARY_GROUP_ID, WidgetID.AchievementDiary.CONTAINER),
|
||||
|
||||
SKILLS_CONTAINER(WidgetID.SKILLS_GROUP_ID, WidgetID.Skills.CONTAINER);
|
||||
SKILLS_CONTAINER(WidgetID.SKILLS_GROUP_ID, WidgetID.Skills.CONTAINER),
|
||||
|
||||
TRADING_WITH(WidgetID.PLAYER_TRADE_SCREEN_GROUP_ID, WidgetID.TradeScreen.FIRST_TRADING_WITH);
|
||||
|
||||
private final int groupId;
|
||||
private final int childId;
|
||||
|
||||
@@ -27,12 +27,6 @@ import org.apache.tools.ant.filters.ReplaceTokens
|
||||
import java.util.Date
|
||||
import java.text.SimpleDateFormat
|
||||
|
||||
buildscript {
|
||||
dependencies {
|
||||
classpath(gradleApi())
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id(Plugins.shadow.first) version Plugins.shadow.second
|
||||
java
|
||||
@@ -47,8 +41,8 @@ dependencies {
|
||||
annotationProcessor(Libraries.lombok)
|
||||
|
||||
compileOnly(Libraries.javax)
|
||||
compileOnly(Libraries.orangeExtensions)
|
||||
compileOnly(Libraries.lombok)
|
||||
compileOnly(Libraries.orangeExtensions)
|
||||
|
||||
implementation(Libraries.logback)
|
||||
implementation(Libraries.gson)
|
||||
@@ -64,36 +58,30 @@ dependencies {
|
||||
implementation(Libraries.substance)
|
||||
implementation(Libraries.jopt)
|
||||
implementation(Libraries.apacheCommonsText)
|
||||
implementation(Libraries.httpcore)
|
||||
implementation(Libraries.httpmime)
|
||||
implementation(Libraries.plexus)
|
||||
implementation(Libraries.javassist)
|
||||
implementation(Libraries.annotations)
|
||||
implementation(Libraries.jogampGluegen)
|
||||
implementation(Libraries.jogampJogl)
|
||||
implementation(Libraries.jooq)
|
||||
implementation(Libraries.jooqCodegen)
|
||||
implementation(Libraries.jooqMeta)
|
||||
implementation(Libraries.asmTree)
|
||||
implementation(Libraries.sentry)
|
||||
implementation(Libraries.slf4jApi)
|
||||
implementation(Libraries.jclCore)
|
||||
implementation(project(":http-api"))
|
||||
implementation(project(":runelite-api"))
|
||||
implementation(Libraries.jbsdiff) {
|
||||
exclude(module = "xz")
|
||||
}
|
||||
implementation(Libraries.naturalMouse)
|
||||
runtime(Libraries.trident)
|
||||
runtime(Libraries.jogampGluegenLinuxAmd64)
|
||||
runtime(Libraries.jogampGluegenLinuxI586)
|
||||
runtime(Libraries.jogampGluegenWindowsAmd64)
|
||||
runtime(Libraries.jogampGluegenWindowsI586)
|
||||
runtime(Libraries.jogampJoglLinuxAmd64)
|
||||
runtime(Libraries.jogampJoglLinuxI586)
|
||||
runtime(Libraries.jogampJoglWindowsAmd64)
|
||||
runtime(Libraries.jogampJoglWindowsI586)
|
||||
runtime(project(":injected-client"))
|
||||
runtime(project(":runescape-api"))
|
||||
|
||||
runtimeOnly(Libraries.trident)
|
||||
runtimeOnly(Libraries.jogampGluegenLinuxAmd64)
|
||||
runtimeOnly(Libraries.jogampGluegenLinuxI586)
|
||||
runtimeOnly(Libraries.jogampGluegenWindowsAmd64)
|
||||
runtimeOnly(Libraries.jogampGluegenWindowsI586)
|
||||
runtimeOnly(Libraries.jogampJoglLinuxAmd64)
|
||||
runtimeOnly(Libraries.jogampJoglLinuxI586)
|
||||
runtimeOnly(Libraries.jogampJoglWindowsAmd64)
|
||||
runtimeOnly(Libraries.jogampJoglWindowsI586)
|
||||
runtimeOnly(project(":injected-client"))
|
||||
runtimeOnly(project(":runescape-api"))
|
||||
|
||||
testAnnotationProcessor(Libraries.lombok)
|
||||
|
||||
@@ -112,27 +100,40 @@ fun formatDate(date: Date?) = with(date ?: Date()) {
|
||||
SimpleDateFormat("MM-dd-yyyy").format(this)
|
||||
}
|
||||
|
||||
fun launcherVersion(): String {
|
||||
if (project.hasProperty("releaseBuild")) {
|
||||
return ProjectVersions.launcherVersion
|
||||
}
|
||||
return "-1"
|
||||
}
|
||||
|
||||
tasks {
|
||||
build {
|
||||
finalizedBy("shadowJar")
|
||||
}
|
||||
|
||||
"processResources"(ProcessResources::class) {
|
||||
processResources {
|
||||
finalizedBy("filterResources")
|
||||
}
|
||||
|
||||
register<Copy>("filterResources") {
|
||||
val tokens = mapOf(
|
||||
"project.version" to ProjectVersions.rlVersion,
|
||||
"rs.version" to ProjectVersions.rsversion.toString(),
|
||||
"open.osrs.version" to ProjectVersions.openosrsVersion,
|
||||
"open.osrs.builddate" to formatDate(Date()),
|
||||
"launcher.version" to ProjectVersions.launcherVersion
|
||||
"launcher.version" to launcherVersion()
|
||||
)
|
||||
|
||||
inputs.properties(tokens)
|
||||
|
||||
from("src/main/resources") {
|
||||
include("open.osrs.properties")
|
||||
|
||||
filter<ReplaceTokens>("tokens" to tokens)
|
||||
}
|
||||
into("${buildDir}/resources/main")
|
||||
|
||||
filter(ReplaceTokens::class, "tokens" to tokens)
|
||||
filteringCharset = "UTF-8"
|
||||
}
|
||||
|
||||
jar {
|
||||
@@ -144,4 +145,16 @@ tasks {
|
||||
shadowJar {
|
||||
archiveClassifier.set("shaded")
|
||||
}
|
||||
|
||||
withType<BootstrapTask> {
|
||||
group = "openosrs"
|
||||
}
|
||||
|
||||
|
||||
register<JavaExec>("RuneLite.main()") {
|
||||
group = "openosrs"
|
||||
|
||||
classpath = project.sourceSets.main.get().runtimeClasspath
|
||||
main = "net.runelite.client.RuneLite"
|
||||
}
|
||||
}
|
||||
@@ -32,6 +32,8 @@ import com.google.inject.Inject;
|
||||
import com.google.inject.Injector;
|
||||
import io.reactivex.Completable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
import io.sentry.Sentry;
|
||||
import io.sentry.SentryClient;
|
||||
import java.io.File;
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.lang.management.RuntimeMXBean;
|
||||
@@ -77,7 +79,6 @@ import net.runelite.client.ui.overlay.arrow.ArrowWorldOverlay;
|
||||
import net.runelite.client.ui.overlay.infobox.InfoBoxOverlay;
|
||||
import net.runelite.client.ui.overlay.tooltip.TooltipOverlay;
|
||||
import net.runelite.client.ui.overlay.worldmap.WorldMapOverlay;
|
||||
import net.runelite.client.util.bootstrap.Bootstrapper;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@Singleton
|
||||
@@ -182,8 +183,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("bootstrap", "Builds a bootstrap with locally built jars");
|
||||
parser.accepts("bootstrap-staging", "Builds a testing bootstrap with locally built jars");
|
||||
final ArgumentAcceptingOptionSpec<String> proxyInfo = parser
|
||||
.accepts("proxy")
|
||||
.withRequiredArg().ofType(String.class);
|
||||
@@ -217,18 +216,6 @@ public class RuneLite
|
||||
logger.setLevel(Level.DEBUG);
|
||||
}
|
||||
|
||||
if (options.has("bootstrap"))
|
||||
{
|
||||
Bootstrapper.main(false);
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
if (options.has("bootstrap-staging"))
|
||||
{
|
||||
Bootstrapper.main(true);
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
if (options.has("proxy"))
|
||||
{
|
||||
String[] proxy = options.valueOf(proxyInfo).split(":");
|
||||
@@ -259,6 +246,10 @@ public class RuneLite
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SentryClient client = Sentry.init("https://fa31d674e44247fa93966c69a903770f@sentry.io/1811856");
|
||||
client.setRelease(RuneLiteProperties.getPlusVersion());
|
||||
|
||||
final ClientLoader clientLoader = new ClientLoader(options.valueOf(updateMode));
|
||||
Completable.fromAction(clientLoader::get)
|
||||
.subscribeOn(Schedulers.single())
|
||||
|
||||
@@ -27,6 +27,7 @@ package net.runelite.client;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Properties;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class RuneLiteProperties
|
||||
{
|
||||
@@ -40,7 +41,7 @@ public class RuneLiteProperties
|
||||
private static final String GITHUB_LINK = "runelite.github.link";
|
||||
private static final String WIKI_LINK = "runelite.wiki.link";
|
||||
private static final String PATREON_LINK = "runelite.patreon.link";
|
||||
private static final String LAUNCHER_VERSION_PROPERTY = "runelite.launcher.version";
|
||||
private static final String LAUNCHER_VERSION_PROPERTY = "launcher.version";
|
||||
private static final String TROUBLESHOOTING_LINK = "runelite.wiki.troubleshooting.link";
|
||||
private static final String BUILDING_LINK = "runelite.wiki.building.link";
|
||||
private static final String DNS_CHANGE_LINK = "runelite.dnschange.link";
|
||||
@@ -129,4 +130,11 @@ public class RuneLiteProperties
|
||||
{
|
||||
return properties.getProperty(DNS_CHANGE_LINK);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static String getLauncherVersion()
|
||||
{
|
||||
String launcherVersion = properties.getProperty(LAUNCHER_VERSION_PROPERTY);
|
||||
return launcherVersion.equals("-1") ? null : launcherVersion;
|
||||
}
|
||||
}
|
||||
@@ -46,7 +46,7 @@ import net.runelite.api.MessageNode;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.api.events.ResizeableChanged;
|
||||
import net.runelite.api.events.ScriptCallbackEvent;
|
||||
import net.runelite.api.events.VarbitChanged;
|
||||
|
||||
+70
-73
@@ -24,63 +24,56 @@
|
||||
*/
|
||||
package net.runelite.client.config;
|
||||
|
||||
import com.google.common.cache.Cache;
|
||||
import com.google.common.cache.CacheBuilder;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.InvocationHandler;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
class ConfigInvocationHandler implements InvocationHandler
|
||||
{
|
||||
// Special object to represent null values in the cache
|
||||
private static final Object NULL = new Object();
|
||||
|
||||
private final ConfigManager manager;
|
||||
private final Cache<Method, Object> cache = CacheBuilder.newBuilder()
|
||||
.maximumSize(128)
|
||||
.build();
|
||||
|
||||
// Caches for annotation values
|
||||
private static final Map<Class<?>, String> groupValueCache = new HashMap<>();
|
||||
private static final Map<Method, String> methodKeyNameCache = new HashMap<>();
|
||||
|
||||
public ConfigInvocationHandler(ConfigManager manager)
|
||||
ConfigInvocationHandler(ConfigManager manager)
|
||||
{
|
||||
this.manager = manager;
|
||||
}
|
||||
|
||||
private static String groupValueFromProxy(Class<?> proxyClass)
|
||||
{
|
||||
Class<?> iface = proxyClass.getInterfaces()[0];
|
||||
ConfigGroup group = iface.getAnnotation(ConfigGroup.class);
|
||||
|
||||
return group == null ? null : group.value();
|
||||
}
|
||||
|
||||
private static String keyNameFromMethod(Method method)
|
||||
{
|
||||
ConfigItem item = method.getAnnotation(ConfigItem.class);
|
||||
|
||||
return item == null ? null : item.keyName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
|
||||
{
|
||||
String itemKeyName, groupValue;
|
||||
try
|
||||
// Use cached configuration value if available
|
||||
if (args == null)
|
||||
{
|
||||
groupValue = groupValueCache.computeIfAbsent(proxy.getClass(), ConfigInvocationHandler::groupValueFromProxy);
|
||||
Object cachedValue = cache.getIfPresent(method);
|
||||
if (cachedValue != null)
|
||||
{
|
||||
return cachedValue == NULL ? null : cachedValue;
|
||||
}
|
||||
}
|
||||
catch (NullPointerException e)
|
||||
|
||||
Class<?> iface = proxy.getClass().getInterfaces()[0];
|
||||
|
||||
ConfigGroup group = iface.getAnnotation(ConfigGroup.class);
|
||||
ConfigItem item = method.getAnnotation(ConfigItem.class);
|
||||
|
||||
if (group == null)
|
||||
{
|
||||
log.warn("Configuration proxy class {} has no @ConfigGroup!", proxy.getClass());
|
||||
return null;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
itemKeyName = methodKeyNameCache.computeIfAbsent(method, ConfigInvocationHandler::keyNameFromMethod);
|
||||
}
|
||||
catch (NullPointerException e)
|
||||
if (item == null)
|
||||
{
|
||||
log.warn("Configuration method {} has no @ConfigItem!", method);
|
||||
return null;
|
||||
@@ -88,48 +81,46 @@ class ConfigInvocationHandler implements InvocationHandler
|
||||
|
||||
if (args == null)
|
||||
{
|
||||
log.trace("cache miss (size: {}, group: {}, key: {})", cache.size(), group.value(), item.keyName());
|
||||
|
||||
// Getting configuration item
|
||||
return manager.getConfigObjectFromCacheOrElse(groupValue, itemKeyName, (value) ->
|
||||
String value = manager.getConfiguration(group.value(), item.keyName());
|
||||
|
||||
if (value == null)
|
||||
{
|
||||
try
|
||||
if (method.isDefault())
|
||||
{
|
||||
value = manager.getConfiguration(value);
|
||||
if (value == null)
|
||||
{
|
||||
if (method.isDefault())
|
||||
{
|
||||
return callDefaultMethod(proxy, method, null);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// Convert value to return type
|
||||
Class<?> returnType = method.getReturnType();
|
||||
|
||||
try
|
||||
{
|
||||
return ConfigManager.stringToObject(value, returnType);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.warn("Unable to unmarshal {}.{} ", groupValue, itemKeyName, e);
|
||||
if (method.isDefault())
|
||||
{
|
||||
Object defaultValue = callDefaultMethod(proxy, method, null);
|
||||
|
||||
manager.setConfiguration(groupValue, itemKeyName, defaultValue);
|
||||
|
||||
return defaultValue;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
Object defaultValue = callDefaultMethod(proxy, method, null);
|
||||
cache.put(method, defaultValue == null ? NULL : defaultValue);
|
||||
return defaultValue;
|
||||
}
|
||||
catch (Throwable throwable)
|
||||
|
||||
cache.put(method, NULL);
|
||||
return null;
|
||||
}
|
||||
|
||||
// Convert value to return type
|
||||
Class<?> returnType = method.getReturnType();
|
||||
|
||||
try
|
||||
{
|
||||
Object objectValue = ConfigManager.stringToObject(value, returnType);
|
||||
cache.put(method, objectValue == null ? NULL : objectValue);
|
||||
return objectValue;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.warn("Unable to unmarshal {}.{} ", group.value(), item.keyName(), e);
|
||||
if (method.isDefault())
|
||||
{
|
||||
log.error("Unable to resolve configuration value {}.{}", groupValue, itemKeyName, throwable);
|
||||
return null;
|
||||
Object defaultValue = callDefaultMethod(proxy, method, null);
|
||||
|
||||
manager.setConfiguration(group.value(), item.keyName(), defaultValue);
|
||||
|
||||
return defaultValue;
|
||||
}
|
||||
});
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -137,13 +128,13 @@ class ConfigInvocationHandler implements InvocationHandler
|
||||
|
||||
if (args.length != 1)
|
||||
{
|
||||
throw new RuntimeException("Invalid number of arguments to configuration method");
|
||||
throw new RuntimeException("Invalid number of arguents to configuration method");
|
||||
}
|
||||
|
||||
Object newValue = args[0];
|
||||
|
||||
Class<?> type = method.getParameterTypes()[0];
|
||||
Object oldValue = manager.getConfiguration(groupValue, itemKeyName, type);
|
||||
Object oldValue = manager.getConfiguration(group.value(), item.keyName(), type);
|
||||
|
||||
if (Objects.equals(oldValue, newValue))
|
||||
{
|
||||
@@ -158,19 +149,19 @@ class ConfigInvocationHandler implements InvocationHandler
|
||||
if (Objects.equals(newValue, defaultValue))
|
||||
{
|
||||
// Just unset if it goes back to the default
|
||||
manager.unsetConfiguration(groupValue, itemKeyName);
|
||||
manager.unsetConfiguration(group.value(), item.keyName());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
if (newValue == null)
|
||||
{
|
||||
manager.unsetConfiguration(groupValue, itemKeyName);
|
||||
manager.unsetConfiguration(group.value(), item.keyName());
|
||||
}
|
||||
else
|
||||
{
|
||||
String newValueStr = ConfigManager.objectToString(newValue);
|
||||
manager.setConfiguration(groupValue, itemKeyName, newValueStr);
|
||||
manager.setConfiguration(group.value(), item.keyName(), newValueStr);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -188,4 +179,10 @@ class ConfigInvocationHandler implements InvocationHandler
|
||||
.bindTo(proxy)
|
||||
.invokeWithArguments(args);
|
||||
}
|
||||
}
|
||||
|
||||
void invalidate()
|
||||
{
|
||||
log.trace("cache invalidate");
|
||||
cache.invalidateAll();
|
||||
}
|
||||
}
|
||||
@@ -54,13 +54,12 @@ import java.util.Objects;
|
||||
import java.util.Properties;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.RuneLite;
|
||||
import static net.runelite.client.RuneLite.PROFILES_DIR;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
@@ -81,7 +80,6 @@ public class ConfigManager
|
||||
|
||||
private final ConfigInvocationHandler handler = new ConfigInvocationHandler(this);
|
||||
private final Properties properties = new Properties();
|
||||
private final Map<String, Object> configObjectCache = new HashMap<>();
|
||||
private final Map<String, String> pendingChanges = new HashMap<>();
|
||||
|
||||
@Inject
|
||||
@@ -154,6 +152,7 @@ public class ConfigManager
|
||||
|
||||
private synchronized void loadFromFile()
|
||||
{
|
||||
handler.invalidate();
|
||||
properties.clear();
|
||||
|
||||
try (FileInputStream in = new FileInputStream(SETTINGS_FILE))
|
||||
@@ -219,20 +218,6 @@ public class ConfigManager
|
||||
}
|
||||
}
|
||||
|
||||
// Attempts to fetch the config value from the cache if present. Otherwise it calls the get value function and caches the result
|
||||
Object getConfigObjectFromCacheOrElse(String groupName, String key, Function<String, Object> getValue)
|
||||
{
|
||||
String configItemKey = groupName + "." + key;
|
||||
return configObjectCache.computeIfAbsent(configItemKey, getValue);
|
||||
}
|
||||
|
||||
// Posts the configchanged event to the event bus and remove the changed key from the cache
|
||||
private void postConfigChanged(ConfigChanged configChanged)
|
||||
{
|
||||
configObjectCache.remove(configChanged.getGroup() + "." + configChanged.getKey());
|
||||
eventBus.post(ConfigChanged.class, configChanged);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T> T getConfig(Class<T> clazz)
|
||||
{
|
||||
@@ -257,11 +242,6 @@ public class ConfigManager
|
||||
return properties.getProperty(groupName + "." + key);
|
||||
}
|
||||
|
||||
public String getConfiguration(String propertyKey)
|
||||
{
|
||||
return properties.getProperty(propertyKey);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T> T getConfiguration(String groupName, String key, Class<T> clazz)
|
||||
{
|
||||
@@ -290,6 +270,7 @@ public class ConfigManager
|
||||
}
|
||||
|
||||
log.debug("Setting configuration value for {}.{} to {}", groupName, key, value);
|
||||
handler.invalidate();
|
||||
|
||||
synchronized (pendingChanges)
|
||||
{
|
||||
@@ -302,7 +283,7 @@ public class ConfigManager
|
||||
configChanged.setOldValue(oldValue);
|
||||
configChanged.setNewValue(value);
|
||||
|
||||
postConfigChanged(configChanged);
|
||||
eventBus.post(ConfigChanged.class, configChanged);
|
||||
}
|
||||
|
||||
public void setConfiguration(String groupName, String key, Object value)
|
||||
@@ -320,6 +301,7 @@ public class ConfigManager
|
||||
}
|
||||
|
||||
log.debug("Unsetting configuration value for {}.{}", groupName, key);
|
||||
handler.invalidate();
|
||||
|
||||
synchronized (pendingChanges)
|
||||
{
|
||||
|
||||
@@ -50,6 +50,29 @@ public interface OpenOSRSConfig extends Config
|
||||
}
|
||||
}
|
||||
|
||||
@ConfigTitleSection(
|
||||
keyName = "logTitle",
|
||||
name = "Error data",
|
||||
description = "",
|
||||
position = 1
|
||||
)
|
||||
default Title logTitle()
|
||||
{
|
||||
return new Title();
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
position = 3,
|
||||
keyName = "shareLogs",
|
||||
name = "Anonymous error data",
|
||||
description = "Share anonymous error data with the OpenOSRS developers",
|
||||
titleSection = "logTitle"
|
||||
)
|
||||
default boolean shareLogs()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@ConfigTitleSection(
|
||||
keyName = "pluginsTitle",
|
||||
name = "Plugins",
|
||||
|
||||
@@ -6,12 +6,16 @@ import io.reactivex.annotations.NonNull;
|
||||
import io.reactivex.disposables.CompositeDisposable;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.functions.Consumer;
|
||||
import io.sentry.Sentry;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.runelite.api.events.Event;
|
||||
import net.runelite.client.RuneLiteProperties;
|
||||
import net.runelite.client.config.OpenOSRSConfig;
|
||||
|
||||
@Slf4j
|
||||
@Singleton
|
||||
@@ -21,6 +25,9 @@ public class EventBus implements EventBusInterface
|
||||
private Map<Class<?>, Relay<Object>> subjectList = new HashMap<>();
|
||||
private Map<Object, CompositeDisposable> subscriptionsMap = new HashMap<>();
|
||||
|
||||
@Inject
|
||||
private OpenOSRSConfig openOSRSConfig;
|
||||
|
||||
@NonNull
|
||||
private <T> Relay<Object> getSubject(Class<T> eventClass)
|
||||
{
|
||||
@@ -54,14 +61,11 @@ public class EventBus implements EventBusInterface
|
||||
.cast(eventClass) // Cast it for easier usage
|
||||
.subscribe(action, error ->
|
||||
{
|
||||
if (error instanceof RuntimeException)
|
||||
log.error("Exception in eventbus", error);
|
||||
|
||||
if (RuneLiteProperties.getLauncherVersion() != null && openOSRSConfig.shareLogs())
|
||||
{
|
||||
log.error("Runtime Exception in eventbus", error);
|
||||
System.exit(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
log.error("Exception in eventbus", error);
|
||||
Sentry.capture(error);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -84,14 +88,11 @@ public class EventBus implements EventBusInterface
|
||||
.doFinally(() -> unregister(lifecycle))
|
||||
.subscribe(action, error ->
|
||||
{
|
||||
if (error instanceof RuntimeException)
|
||||
log.error("Exception in eventbus", error);
|
||||
|
||||
if (RuneLiteProperties.getLauncherVersion() != null && openOSRSConfig.shareLogs())
|
||||
{
|
||||
log.error("Runtime Exception in eventbus", error);
|
||||
System.exit(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
log.error("Exception in eventbus", error);
|
||||
Sentry.capture(error);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
+2
-1
@@ -22,9 +22,10 @@
|
||||
* (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.api.events;
|
||||
package net.runelite.client.events;
|
||||
|
||||
import lombok.Data;
|
||||
import net.runelite.api.events.Event;
|
||||
|
||||
/**
|
||||
* An event where a configuration entry has been modified.
|
||||
@@ -9,11 +9,10 @@
|
||||
|
||||
package net.runelite.client.game;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.Getter;
|
||||
import net.runelite.api.coords.WorldArea;
|
||||
@@ -193,6 +192,20 @@ public enum WorldLocation
|
||||
private final WorldArea worldArea;
|
||||
@Getter
|
||||
private final Location location;
|
||||
@Getter
|
||||
private static final Map<WorldArea, String> LOCATION_MAP;
|
||||
|
||||
static
|
||||
{
|
||||
ImmutableMap.Builder<WorldArea, String> builder = ImmutableMap.builder();
|
||||
|
||||
for (WorldLocation value : values())
|
||||
{
|
||||
builder.put(value.getWorldArea(), value.getName());
|
||||
}
|
||||
|
||||
LOCATION_MAP = builder.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a location used to get the name of a location by a WorldPoint
|
||||
@@ -210,6 +223,7 @@ public enum WorldLocation
|
||||
|
||||
/**
|
||||
* Returns all locations that aren't in the wild
|
||||
*
|
||||
* @return - A Collection of non-wilderness WorldLocations
|
||||
*/
|
||||
public static Collection<WorldLocation> getNonWildernessLocations()
|
||||
@@ -220,6 +234,7 @@ public enum WorldLocation
|
||||
|
||||
/**
|
||||
* Returns only the WorldLocations that are in the wilderness
|
||||
*
|
||||
* @return - A Collection of WorldLocations in the wilderness
|
||||
*/
|
||||
public static Collection<WorldLocation> getWildernessLocations()
|
||||
@@ -228,63 +243,70 @@ public enum WorldLocation
|
||||
PvPUtil.getWildernessLevelFrom(loc.worldArea.toWorldPoint()) > 0).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public static Map<WorldArea, String> getLocationMap()
|
||||
{
|
||||
Map<WorldArea, String> hashMap = new HashMap<>();
|
||||
Arrays.stream(values()).forEach(worldLocation ->
|
||||
hashMap.put(worldLocation.getWorldArea(), worldLocation.getName()));
|
||||
return hashMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the WorldLocation that a WorldPoint is in, or the closest WorldLocation to the point
|
||||
*
|
||||
* @param worldPoint - the WorldPoint to find the WorldLocation of
|
||||
* @return - Containing location or closest location if it isn't in any
|
||||
*/
|
||||
public static String location(WorldPoint worldPoint)
|
||||
{
|
||||
final Map<WorldArea, String> locationMap = getLocationMap();
|
||||
int dist = 10000;
|
||||
String s = "";
|
||||
WorldArea closestArea = null;
|
||||
for (Map.Entry<WorldArea, String> entry : locationMap.entrySet())
|
||||
|
||||
for (Map.Entry<WorldArea, String> entry : LOCATION_MAP.entrySet())
|
||||
{
|
||||
WorldArea worldArea = entry.getKey();
|
||||
final WorldArea worldArea = entry.getKey();
|
||||
|
||||
if (worldArea.toWorldPointList().contains(worldPoint))
|
||||
{
|
||||
s = entry.getValue();
|
||||
return s;
|
||||
}
|
||||
int distTo = worldArea.distanceTo(worldPoint);
|
||||
|
||||
final int distTo = worldArea.distanceTo(worldPoint);
|
||||
|
||||
if (distTo < dist)
|
||||
{
|
||||
dist = distTo;
|
||||
closestArea = worldArea;
|
||||
}
|
||||
}
|
||||
if (worldPoint.getY() > (Objects.requireNonNull(closestArea).toWorldPoint().getY() + closestArea.getHeight()))
|
||||
|
||||
if (closestArea == null)
|
||||
{
|
||||
return s;
|
||||
}
|
||||
|
||||
if (worldPoint.getY() > closestArea.toWorldPoint().getY() + closestArea.getHeight())
|
||||
{
|
||||
s = s + "N";
|
||||
}
|
||||
|
||||
if (worldPoint.getY() < closestArea.toWorldPoint().getY())
|
||||
{
|
||||
s = s + "S";
|
||||
}
|
||||
|
||||
if (worldPoint.getX() < closestArea.toWorldPoint().getX())
|
||||
{
|
||||
s = s + "W";
|
||||
}
|
||||
|
||||
if (worldPoint.getX() > (closestArea.toWorldPoint().getX() + closestArea.getWidth()))
|
||||
{
|
||||
s = s + "E";
|
||||
}
|
||||
|
||||
s = s + " of ";
|
||||
s = s + locationMap.get(closestArea);
|
||||
s = s + LOCATION_MAP.get(closestArea);
|
||||
|
||||
if (s.startsWith(" of "))
|
||||
{
|
||||
s = s.substring(3);
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
@@ -753,9 +753,9 @@ public class MenuManager
|
||||
for (String target : fromTarget)
|
||||
{
|
||||
final String s = Text.standardize(target);
|
||||
swaps.keySet().removeIf(e -> e.getTarget().equals(s));
|
||||
priorityEntries.removeIf(e -> e.getTarget().equals(s));
|
||||
hiddenEntries.removeIf(e -> e.getTarget().equals(s));
|
||||
swaps.keySet().removeIf(e -> e.getTarget() != null && e.getTarget().equals(s));
|
||||
priorityEntries.removeIf(e -> e.getTarget() != null && e.getTarget().equals(s));
|
||||
hiddenEntries.removeIf(e -> e.getTarget() != null && e.getTarget().equals(s));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -50,7 +50,6 @@ import net.runelite.api.TileItem;
|
||||
import net.runelite.api.TileObject;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.api.events.BeforeRender;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.DecorativeObjectChanged;
|
||||
import net.runelite.api.events.DecorativeObjectDespawned;
|
||||
import net.runelite.api.events.DecorativeObjectSpawned;
|
||||
@@ -72,6 +71,7 @@ import net.runelite.api.events.WallObjectSpawned;
|
||||
import net.runelite.client.Notifier;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.game.AgilityShortcut;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
|
||||
+1
-1
@@ -45,13 +45,13 @@ import net.runelite.api.Projectile;
|
||||
import net.runelite.api.coords.LocalPoint;
|
||||
import net.runelite.api.events.AnimationChanged;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.NpcSpawned;
|
||||
import net.runelite.api.events.ProjectileMoved;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.PluginType;
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ import com.google.inject.Provides;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
|
||||
+1
-1
@@ -30,12 +30,12 @@ import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.FocusChanged;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.config.Keybind;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.input.KeyManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
|
||||
+1
-1
@@ -47,7 +47,6 @@ import net.runelite.api.NullObjectID;
|
||||
import net.runelite.api.ObjectID;
|
||||
import net.runelite.api.Projectile;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameObjectDespawned;
|
||||
import net.runelite.api.events.GameObjectSpawned;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
@@ -57,6 +56,7 @@ import net.runelite.api.events.ProjectileSpawned;
|
||||
import net.runelite.client.Notifier;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.PluginType;
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ import net.runelite.api.GameState;
|
||||
import net.runelite.api.Skill;
|
||||
import net.runelite.api.VarPlayer;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.VarbitChanged;
|
||||
import net.runelite.api.events.WidgetHiddenChanged;
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
package net.runelite.client.plugins.bank;
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import com.google.common.collect.HashMultiset;
|
||||
import com.google.common.base.Strings;
|
||||
import com.google.common.collect.HashMultiset;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.Multiset;
|
||||
import com.google.inject.Provides;
|
||||
@@ -43,14 +43,13 @@ import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import net.runelite.api.Client;
|
||||
import static net.runelite.api.Constants.HIGH_ALCHEMY_MULTIPLIER;
|
||||
import net.runelite.api.FontID;
|
||||
import net.runelite.api.InventoryID;
|
||||
import net.runelite.api.Item;
|
||||
import net.runelite.api.FontID;
|
||||
import net.runelite.api.ItemContainer;
|
||||
import net.runelite.api.ItemDefinition;
|
||||
import net.runelite.api.ItemID;
|
||||
import net.runelite.api.MenuEntry;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.SpriteID;
|
||||
import net.runelite.api.VarClientInt;
|
||||
import net.runelite.api.VarClientStr;
|
||||
@@ -68,6 +67,7 @@ import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
|
||||
+7
@@ -51,7 +51,14 @@ class ContainerCalculation
|
||||
ContainerPrices calculate(Item[] items)
|
||||
{
|
||||
// Returns last calculation if inventory hasn't changed
|
||||
|
||||
if (items == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
final int newHash = hashItems(items);
|
||||
|
||||
if (containerPrices != null && hash == newHash)
|
||||
{
|
||||
return containerPrices;
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ import net.runelite.api.ItemID;
|
||||
import net.runelite.api.MenuOpcode;
|
||||
import net.runelite.api.VarClientInt;
|
||||
import net.runelite.api.VarClientStr;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.api.events.DraggingWidgetChanged;
|
||||
import net.runelite.api.events.FocusChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
|
||||
+49
-87
@@ -26,13 +26,9 @@
|
||||
*/
|
||||
package net.runelite.client.plugins.banlist;
|
||||
|
||||
import com.google.common.base.Splitter;
|
||||
import com.google.inject.Provides;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
@@ -41,14 +37,13 @@ import net.runelite.api.ChatMessageType;
|
||||
import net.runelite.api.ClanMember;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.events.ClanMemberJoined;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.WidgetHiddenChanged;
|
||||
import net.runelite.api.events.WidgetLoaded;
|
||||
import net.runelite.api.util.Text;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
import static net.runelite.api.widgets.WidgetID.TRADING_SCREEN;
|
||||
import static net.runelite.api.widgets.WidgetID.PLAYER_TRADE_SCREEN_GROUP_ID;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.chat.ChatColorType;
|
||||
@@ -57,15 +52,16 @@ import net.runelite.client.chat.ChatMessageManager;
|
||||
import net.runelite.client.chat.QueuedMessage;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.PluginType;
|
||||
import net.runelite.api.util.Text;
|
||||
import net.runelite.http.api.RuneLiteAPI;
|
||||
import okhttp3.Call;
|
||||
import okhttp3.Callback;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Ban List",
|
||||
@@ -83,16 +79,22 @@ public class BanListPlugin extends Plugin
|
||||
private final Set<String> wdrToxicSet = new HashSet<>();
|
||||
private final Set<String> runeWatchSet = new HashSet<>();
|
||||
private final Set<String> manualBans = new HashSet<>();
|
||||
|
||||
@Inject
|
||||
private Client client;
|
||||
|
||||
@Inject
|
||||
private ClientThread clientThread;
|
||||
|
||||
@Inject
|
||||
private BanListConfig config;
|
||||
|
||||
@Inject
|
||||
private ChatMessageManager chatMessageManager;
|
||||
|
||||
@Inject
|
||||
private EventBus eventBus;
|
||||
|
||||
private String tobNames = "";
|
||||
private boolean enableWDRScam;
|
||||
private boolean enableWDRToxic;
|
||||
@@ -111,12 +113,9 @@ public class BanListPlugin extends Plugin
|
||||
{
|
||||
updateConfig();
|
||||
addSubscriptions();
|
||||
List<String> bannedPlayers = Splitter
|
||||
.on(",")
|
||||
.trimResults()
|
||||
.omitEmptyStrings()
|
||||
.splitToList(config.getBannedPlayers());
|
||||
manualBans.addAll(bannedPlayers);
|
||||
|
||||
manualBans.addAll(Text.fromCSV(Text.standardize(config.getBannedPlayers())));
|
||||
|
||||
fetchFromWebsites();
|
||||
}
|
||||
|
||||
@@ -144,19 +143,11 @@ public class BanListPlugin extends Plugin
|
||||
{
|
||||
if (event.getGroup().equals("banlist") && event.getKey().equals("bannedPlayers"))
|
||||
{
|
||||
List<String> bannedPlayers = Splitter
|
||||
.on(",")
|
||||
.trimResults()
|
||||
.omitEmptyStrings()
|
||||
.splitToList(config.getBannedPlayers());
|
||||
manualBans.clear();
|
||||
|
||||
for (String bannedPlayer : bannedPlayers)
|
||||
{
|
||||
if (!manualBans.contains(bannedPlayer))
|
||||
{
|
||||
manualBans.add(Text.standardize(bannedPlayer));
|
||||
}
|
||||
}
|
||||
String newValue = event.getNewValue();
|
||||
|
||||
manualBans.addAll(Text.fromCSV(Text.standardize(newValue)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,11 +215,12 @@ public class BanListPlugin extends Plugin
|
||||
*/
|
||||
private void onWidgetLoaded(WidgetLoaded widgetLoaded)
|
||||
{
|
||||
if (this.highlightInTrade && widgetLoaded.getGroupId() == TRADING_SCREEN)
|
||||
if (this.highlightInTrade && widgetLoaded.getGroupId() == PLAYER_TRADE_SCREEN_GROUP_ID)
|
||||
{ //if trading window was loaded
|
||||
clientThread.invokeLater(() ->
|
||||
{
|
||||
Widget tradingWith = client.getWidget(335, 31);
|
||||
Widget tradingWith = client.getWidget(WidgetInfo.TRADING_WITH);
|
||||
|
||||
String name = tradingWith.getText().replaceAll("Trading With: ", "").toLowerCase();
|
||||
if (checkScamList(name) != null)
|
||||
{
|
||||
@@ -244,13 +236,12 @@ public class BanListPlugin extends Plugin
|
||||
|
||||
private void onGameTick(GameTick event)
|
||||
{
|
||||
|
||||
if (client.getWidget(WidgetInfo.THEATRE_OF_BLOOD_RAIDING_PARTY) == null)
|
||||
final Widget raidingParty = client.getWidget(WidgetInfo.THEATRE_OF_BLOOD_RAIDING_PARTY);
|
||||
if (raidingParty == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Widget raidingParty = client.getWidget(WidgetInfo.THEATRE_OF_BLOOD_RAIDING_PARTY);
|
||||
String allNames = raidingParty.getText();
|
||||
|
||||
if (allNames.equalsIgnoreCase(tobNames))
|
||||
@@ -262,19 +253,20 @@ public class BanListPlugin extends Plugin
|
||||
|
||||
String[] split = allNames.split("<br>");
|
||||
|
||||
for (int i = 0; i < 5; i++)
|
||||
for (String name : split)
|
||||
{
|
||||
String name = split[i];
|
||||
if (!name.equalsIgnoreCase("-"))
|
||||
if (!name.equals("-"))
|
||||
{
|
||||
ListType scamList = checkScamList(Text.standardize(name));
|
||||
String stdName = Text.standardize(name);
|
||||
|
||||
ListType scamList = checkScamList(stdName);
|
||||
|
||||
if (scamList != null)
|
||||
{
|
||||
sendWarning(name, scamList);
|
||||
}
|
||||
|
||||
ListType toxicList = checkToxicList(Text.standardize(name));
|
||||
ListType toxicList = checkToxicList(stdName);
|
||||
|
||||
if (toxicList != null)
|
||||
{
|
||||
@@ -284,29 +276,22 @@ public class BanListPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
boolean inTobParty()
|
||||
{
|
||||
return client.getVar(Varbits.THEATRE_OF_BLOOD) == 1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Compares player name to everything in the ban lists
|
||||
*/
|
||||
private ListType checkScamList(String nameToBeChecked)
|
||||
{
|
||||
if (wdrScamSet.size() > 0 && this.enableWDRScam && wdrScamSet.contains(nameToBeChecked))
|
||||
if (this.enableWDRScam && wdrScamSet.contains(nameToBeChecked))
|
||||
{
|
||||
return ListType.WEDORAIDSSCAM_LIST;
|
||||
}
|
||||
|
||||
if (runeWatchSet.size() > 0 && this.enableRuneWatch && runeWatchSet.contains(nameToBeChecked))
|
||||
if (this.enableRuneWatch && runeWatchSet.contains(nameToBeChecked))
|
||||
{
|
||||
return ListType.RUNEWATCH_LIST;
|
||||
}
|
||||
|
||||
if (manualBans.size() > 0 && manualBans.contains(nameToBeChecked))
|
||||
if (manualBans.contains(nameToBeChecked))
|
||||
{
|
||||
return ListType.MANUAL_LIST;
|
||||
}
|
||||
@@ -316,8 +301,7 @@ public class BanListPlugin extends Plugin
|
||||
|
||||
private ListType checkToxicList(String nameToBeChecked)
|
||||
{
|
||||
|
||||
if (wdrToxicSet.size() > 0 && this.enableWDRToxic && wdrToxicSet.contains(nameToBeChecked))
|
||||
if (this.enableWDRToxic && wdrToxicSet.contains(nameToBeChecked))
|
||||
{
|
||||
return ListType.WEDORAIDSTOXIC_LIST;
|
||||
}
|
||||
@@ -393,29 +377,7 @@ public class BanListPlugin extends Plugin
|
||||
Request request = new Request.Builder()
|
||||
.url("https://wdrdev.github.io/index")
|
||||
.build();
|
||||
RuneLiteAPI.CLIENT.newCall(request).enqueue(new Callback()
|
||||
{
|
||||
@Override
|
||||
public void onFailure(Call call, IOException e)
|
||||
{
|
||||
log.debug("error retrieving names from wdr");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponse(Call call, Response response) throws IOException
|
||||
{
|
||||
String text = response.body().string();
|
||||
text = text.substring(text.indexOf("<p>") + 3, text.indexOf("</p>"));
|
||||
text = text.replace("/", ",");
|
||||
text = text.replace(", $", "");
|
||||
|
||||
ArrayList<String> wdrList = new ArrayList<>(Arrays.asList(text.split(",")));
|
||||
ArrayList<String> wdrList2 = new ArrayList<>();
|
||||
wdrList.forEach((name) -> wdrList2.add(Text.standardize(name).toLowerCase()));
|
||||
|
||||
wdrScamSet.addAll(wdrList2);
|
||||
}
|
||||
});
|
||||
fetchAndParseWdr(request, wdrScamSet);
|
||||
|
||||
|
||||
Request secondRequest = new Request.Builder()
|
||||
@@ -424,13 +386,13 @@ public class BanListPlugin extends Plugin
|
||||
RuneLiteAPI.CLIENT.newCall(secondRequest).enqueue(new Callback()
|
||||
{
|
||||
@Override
|
||||
public void onFailure(Call call, IOException e)
|
||||
public void onFailure(@NotNull Call call, @NotNull IOException e)
|
||||
{
|
||||
log.debug("error retrieving names from runewatch");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponse(Call call, Response response) throws IOException
|
||||
public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException
|
||||
{
|
||||
String text = response.body().string();
|
||||
String mytext = text.substring(text.indexOf("lcp_instance_0"), text.indexOf("strong>Evidence Quality Suggestion"));
|
||||
@@ -450,27 +412,28 @@ public class BanListPlugin extends Plugin
|
||||
Request thirdRequest = new Request.Builder()
|
||||
.url("https://wdrdev.github.io/toxic")
|
||||
.build();
|
||||
RuneLiteAPI.CLIENT.newCall(thirdRequest).enqueue(new Callback()
|
||||
fetchAndParseWdr(thirdRequest, wdrToxicSet);
|
||||
}
|
||||
|
||||
private void fetchAndParseWdr(Request req, Set<String> tgtSet)
|
||||
{
|
||||
RuneLiteAPI.CLIENT.newCall(req).enqueue(new Callback()
|
||||
{
|
||||
@Override
|
||||
public void onFailure(Call call, IOException e)
|
||||
public void onFailure(@NotNull Call call, @NotNull IOException e)
|
||||
{
|
||||
log.debug("error retrieving names from wdr");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponse(Call call, Response response) throws IOException
|
||||
public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException
|
||||
{
|
||||
String text = response.body().string();
|
||||
text = text.substring(text.indexOf("<p>") + 3, text.indexOf("</p>"));
|
||||
text = text.replace("/", ",");
|
||||
text = text.replace(", $", "");
|
||||
|
||||
ArrayList<String> wdrToxicList = new ArrayList<>(Arrays.asList(text.split(",")));
|
||||
ArrayList<String> wdrToxicList2 = new ArrayList<>();
|
||||
wdrToxicList.forEach((name) -> wdrToxicList2.add(Text.standardize(name).toLowerCase()));
|
||||
|
||||
wdrToxicSet.addAll(wdrToxicList2);
|
||||
Text.fromCSV(text).forEach(str -> tgtSet.add(Text.standardize(str)));
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -485,16 +448,15 @@ public class BanListPlugin extends Plugin
|
||||
Widget widget = client.getWidget(WidgetInfo.CLAN_CHAT_LIST);
|
||||
for (Widget widgetChild : widget.getDynamicChildren())
|
||||
{
|
||||
ListType scamList = checkScamList(widgetChild.getText().toLowerCase());
|
||||
ListType toxicList = checkToxicList(widgetChild.getText().toLowerCase());
|
||||
String text = widgetChild.getText(), lc = text.toLowerCase();
|
||||
|
||||
if (scamList != null)
|
||||
if (checkScamList(lc) != null)
|
||||
{
|
||||
widgetChild.setText("<col=ff0000>" + widgetChild.getText() + "</col>");
|
||||
widgetChild.setText("<col=ff0000>" + text + "</col>");
|
||||
}
|
||||
else if (toxicList != null)
|
||||
else if (checkToxicList(lc) != null)
|
||||
{
|
||||
widgetChild.setText("<col=ff6400>" + widgetChild.getText() + "</col>");
|
||||
widgetChild.setText("<col=ff6400>" + text + "</col>");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
+2
-2
@@ -60,7 +60,6 @@ import net.runelite.api.Varbits;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.api.events.BeforeRender;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.InteractingChanged;
|
||||
import net.runelite.api.events.ItemDespawned;
|
||||
@@ -72,6 +71,7 @@ import net.runelite.api.events.NpcSpawned;
|
||||
import net.runelite.api.events.ProjectileSpawned;
|
||||
import net.runelite.api.events.VarbitChanged;
|
||||
import net.runelite.api.events.WidgetLoaded;
|
||||
import net.runelite.api.util.Text;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.api.widgets.WidgetID;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
@@ -83,6 +83,7 @@ import net.runelite.client.chat.ChatMessageManager;
|
||||
import net.runelite.client.chat.QueuedMessage;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.input.KeyListener;
|
||||
import net.runelite.client.input.KeyManager;
|
||||
@@ -97,7 +98,6 @@ import net.runelite.client.ui.overlay.infobox.InfoBox;
|
||||
import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
|
||||
import net.runelite.client.util.ColorUtil;
|
||||
import net.runelite.client.util.ImageUtil;
|
||||
import net.runelite.api.util.Text;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -42,7 +42,6 @@ import net.runelite.api.NullObjectID;
|
||||
import net.runelite.api.ObjectID;
|
||||
import net.runelite.api.SpriteID;
|
||||
import net.runelite.api.WallObject;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameObjectChanged;
|
||||
import net.runelite.api.events.GameObjectDespawned;
|
||||
import net.runelite.api.events.GameObjectSpawned;
|
||||
@@ -56,6 +55,7 @@ import net.runelite.api.widgets.WidgetID;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.game.SpriteManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
|
||||
+1
-1
@@ -35,12 +35,12 @@ import net.runelite.api.Client;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.MenuEntry;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.util.Text;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.menus.AbstractComparableEntry;
|
||||
import net.runelite.client.menus.MenuManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
|
||||
+2
-2
@@ -38,21 +38,21 @@ import net.runelite.api.GameState;
|
||||
import static net.runelite.api.NullObjectID.NULL_9092;
|
||||
import static net.runelite.api.ObjectID.CONVEYOR_BELT;
|
||||
import net.runelite.api.Skill;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameObjectDespawned;
|
||||
import net.runelite.api.events.GameObjectSpawned;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.util.Text;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
|
||||
import net.runelite.api.util.Text;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Blast Furnace",
|
||||
|
||||
@@ -39,7 +39,7 @@ import net.runelite.api.Client;
|
||||
import net.runelite.api.Constants;
|
||||
import net.runelite.api.Prayer;
|
||||
import net.runelite.api.Skill;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.StatChanged;
|
||||
|
||||
@@ -48,7 +48,7 @@ import static net.runelite.api.ProjectileID.CANNONBALL;
|
||||
import static net.runelite.api.ProjectileID.GRANITE_CANNONBALL;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameObjectSpawned;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.ItemContainerChanged;
|
||||
|
||||
@@ -37,7 +37,7 @@ public enum CannonSpots
|
||||
FIRE_GIANTS(new WorldPoint(2393, 9782, 0), new WorldPoint(2412, 9776, 0), new WorldPoint(2401, 9780, 0)),
|
||||
ABERRANT_SPECTRES(new WorldPoint(2456, 9791, 0)),
|
||||
HELLHOUNDS(new WorldPoint(2431, 9776, 0), new WorldPoint(2413, 9786, 0), new WorldPoint(2783, 9686, 0), new WorldPoint(3198, 10071, 0)),
|
||||
BLACK_DEMONS(new WorldPoint(2859, 9778, 0), new WorldPoint(2841, 9791, 0)),
|
||||
BLACK_DEMONS(new WorldPoint(2859, 9778, 0), new WorldPoint(2841, 9791, 0), new WorldPoint(1421, 10089, 1)),
|
||||
ELVES(new WorldPoint(2044, 4635, 0), new WorldPoint(3278, 6098, 0)),
|
||||
SUQAHS(new WorldPoint(2114, 3943, 0)),
|
||||
TROLLS(new WorldPoint(2401, 3856, 0)),
|
||||
|
||||
+2
-3
@@ -24,14 +24,12 @@
|
||||
*/
|
||||
package net.runelite.client.plugins.chatboxperformance;
|
||||
|
||||
import com.google.inject.Provides;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import com.google.inject.Provides;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.ScriptID;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.ScriptCallbackEvent;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
@@ -41,6 +39,7 @@ import net.runelite.api.widgets.WidgetType;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
|
||||
|
||||
+4
-4
@@ -28,9 +28,9 @@ 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;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.regex.PatternSyntaxException;
|
||||
@@ -42,14 +42,14 @@ import net.runelite.api.ChatMessageType;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.MessageNode;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.api.events.OverheadTextChanged;
|
||||
import net.runelite.api.events.ScriptCallbackEvent;
|
||||
import net.runelite.api.util.Text;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.api.util.Text;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
@PluginDescriptor(
|
||||
@@ -68,7 +68,7 @@ public class ChatFilterPlugin extends Plugin
|
||||
private static final String CENSOR_MESSAGE = "Hey, everyone, I just tried to say something very silly!";
|
||||
|
||||
private final CharMatcher jagexPrintableCharMatcher = Text.JAGEX_PRINTABLE_CHAR_MATCHER;
|
||||
private final List<Pattern> filteredPatterns = new ArrayList<>();
|
||||
private final List<Pattern> filteredPatterns = new CopyOnWriteArrayList<>();
|
||||
|
||||
@Inject
|
||||
private Client client;
|
||||
|
||||
+2
-2
@@ -39,19 +39,19 @@ import net.runelite.api.ScriptID;
|
||||
import net.runelite.api.VarClientInt;
|
||||
import net.runelite.api.VarClientStr;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.MenuOptionClicked;
|
||||
import net.runelite.api.util.Text;
|
||||
import net.runelite.api.vars.InputType;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.chat.ChatMessageManager;
|
||||
import net.runelite.client.chat.QueuedMessage;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.input.KeyListener;
|
||||
import net.runelite.client.input.KeyManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.api.util.Text;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Chat History",
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ import javax.inject.Singleton;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.MessageNode;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.client.Notifier;
|
||||
import net.runelite.client.RuneLiteProperties;
|
||||
|
||||
+2
-2
@@ -17,22 +17,22 @@ import net.runelite.api.MessageNode;
|
||||
import static net.runelite.api.ScriptID.CHATBOX_INPUT;
|
||||
import net.runelite.api.VarClientStr;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.MenuOpened;
|
||||
import net.runelite.api.events.MenuOptionClicked;
|
||||
import net.runelite.api.util.Text;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.chat.ChatMessageManager;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.input.KeyListener;
|
||||
import net.runelite.client.input.KeyManager;
|
||||
import net.runelite.client.menus.MenuManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.PluginType;
|
||||
import net.runelite.api.util.Text;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Chat Translator",
|
||||
|
||||
+4
-3
@@ -57,13 +57,14 @@ import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.ClanChanged;
|
||||
import net.runelite.api.events.ClanMemberJoined;
|
||||
import net.runelite.api.events.ClanMemberLeft;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.PlayerDespawned;
|
||||
import net.runelite.api.events.PlayerSpawned;
|
||||
import net.runelite.api.events.ScriptCallbackEvent;
|
||||
import net.runelite.api.events.VarClientStrChanged;
|
||||
import net.runelite.api.util.Text;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.api.widgets.WidgetType;
|
||||
@@ -80,7 +81,6 @@ import static net.runelite.client.ui.JagexColors.CHAT_CLAN_NAME_TRANSPARENT_BACK
|
||||
import static net.runelite.client.ui.JagexColors.CHAT_CLAN_TEXT_OPAQUE_BACKGROUND;
|
||||
import static net.runelite.client.ui.JagexColors.CHAT_CLAN_TEXT_TRANSPARENT_BACKGROUND;
|
||||
import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
|
||||
import net.runelite.api.util.Text;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Clan Chat",
|
||||
@@ -411,7 +411,8 @@ public class ClanChatPlugin extends Plugin
|
||||
|
||||
ChatMessageBuilder message = new ChatMessageBuilder()
|
||||
.append("[")
|
||||
.append(channelColor, client.getClanChatName());
|
||||
.append(channelColor, client.getClanChatName() == null ? "" : client.getClanChatName());
|
||||
|
||||
if (rankIcon > -1)
|
||||
{
|
||||
message
|
||||
|
||||
+1
-1
@@ -14,11 +14,11 @@ import net.runelite.api.GameState;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.PluginType;
|
||||
|
||||
+11
-1
@@ -60,7 +60,7 @@ import net.runelite.api.TileObject;
|
||||
import net.runelite.api.coords.LocalPoint;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.ItemContainerChanged;
|
||||
@@ -389,6 +389,11 @@ public class ClueScrollPlugin extends Plugin
|
||||
|
||||
for (WorldPoint location : locations)
|
||||
{
|
||||
if (location == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Only set the location hint arrow if we do not already have more accurate location
|
||||
if (location.isInScene(client)
|
||||
&& this.displayHintArrows
|
||||
@@ -681,6 +686,11 @@ public class ClueScrollPlugin extends Plugin
|
||||
final Tile tile = tiles[client.getPlane()][localLocation.getSceneX()][localLocation.getSceneY()];
|
||||
objectsToMark.clear();
|
||||
|
||||
if (tile == null || tile.getGameObjects() == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (GameObject object : tile.getGameObjects())
|
||||
{
|
||||
if (object == null)
|
||||
|
||||
+1
-1
@@ -168,7 +168,7 @@ public class CoordinateClue extends ClueScroll implements TextClueScroll, Locati
|
||||
.put(new WorldPoint(3051, 3736, 0), "East of the Wilderness Obelisk in 28 Wilderness.")
|
||||
.put(new WorldPoint(2316, 3814, 0), "West of Neitiznot, near the bridge.")
|
||||
.put(new WorldPoint(2872, 3937, 0), "Weiss.")
|
||||
.put(new WorldPoint(2835, 2998, 0), "Northeast corner of the Island of Stone.")
|
||||
.put(new WorldPoint(2484, 4016, 0), "Northeast corner of the Island of Stone.")
|
||||
// Master
|
||||
.put(new WorldPoint(2178, 3209, 0), "South of Elf Camp.")
|
||||
.put(new WorldPoint(2155, 3100, 0), "South of Port Tyras (BJS).")
|
||||
|
||||
+1
-1
@@ -311,7 +311,7 @@ public class CrypticClue extends ClueScroll implements TextClueScroll, NpcClueSc
|
||||
new CrypticClue("Search the eastern bookcase in Father Urhney's house.", BOOKCASE_9523, new WorldPoint(3149, 3177, 0), "Father Urhney's house is found in the western end of the Lumbridge Swamp."),
|
||||
new CrypticClue("Talk to Morgan in his house at Draynor Village.", "Morgan", new WorldPoint(3098, 3268, 0), "Morgan can be found in the house with the quest start map icon."),
|
||||
new CrypticClue("Talk to Charles at Port Piscarilius.", "Charles", new WorldPoint(1821, 3690, 0), "Charles is found by Veos' ship in Port Piscarilius."),
|
||||
new CrypticClue("Search the crate in Rommiks crafting shop in Rimmington.", CRATE_9534, new WorldPoint(2947, 3208, 0), "The crates in Rommik's Crafty Supplies in Rimmington."),
|
||||
new CrypticClue("Search the crate in Rommiks crafting shop in Rimmington.", CRATE_9533, new WorldPoint(2946, 3207, 0), "The crates in Rommik's Crafty Supplies in Rimmington."),
|
||||
new CrypticClue("Talk to Ali the Leaflet Dropper north of the Al Kharid mine.", "Ali the Leaflet Dropper", new WorldPoint(3283, 3329, 0), "Ali the Leaflet Dropper can be found roaming north of the Al Kharid mine."),
|
||||
new CrypticClue("Talk to the cook in the Blue Moon Inn in Varrock.", "Cook", new WorldPoint(3230, 3401, 0), "The Blue Moon Inn can be found by the southern entrance to Varrock."),
|
||||
new CrypticClue("Search the single crate in Horvik's smithy in Varrock.", CRATE_5106, new WorldPoint(3228, 3433, 0), "Horvik's Smithy is found north-east of of Varrock Square."),
|
||||
|
||||
+1
-1
@@ -132,7 +132,7 @@ public class EmoteClue extends ClueScroll implements TextClueScroll, LocationClu
|
||||
new EmoteClue("Laugh at the crossroads south of the Sinclair Mansion. Equip a cowl, a blue wizard robe top and an iron scimitar.", "Sinclair Mansion", ROAD_JUNCTION_SOUTH_OF_SINCLAIR_MANSION, new WorldPoint(2741, 3536, 0), LAUGH, item(LEATHER_COWL), item(BLUE_WIZARD_ROBE), item(IRON_SCIMITAR)),
|
||||
new EmoteClue("Laugh in front of the gem store in Ardougne market. Equip a Castlewars bracelet, a dragonstone amulet and a ring of forging.", "Ardougne", NEAR_THE_GEM_STALL_IN_ARDOUGNE_MARKET, new WorldPoint(2666, 3304, 0), LAUGH, any("Castle wars bracelet", range(CASTLE_WARS_BRACELET3, CASTLE_WARS_BRACELET1)), item(DRAGONSTONE_AMULET), item(RING_OF_FORGING)),
|
||||
new EmoteClue("Panic in the Limestone Mine. Equip bronze platelegs, a steel pickaxe and a steel medium helmet.", "Limestone Mine", LIMESTONE_MINE, new WorldPoint(3372, 3498, 0), PANIC, item(BRONZE_PLATELEGS), item(STEEL_PICKAXE), item(STEEL_MED_HELM)),
|
||||
new EmoteClue("Panic by the mausoleum in Morytania. Wave before you speak to me. Equip a mithril plate skirt, a maple longbow and no boots.", "Morytania", MAUSOLEUM_OFF_THE_MORYTANIA_COAST, new WorldPoint(3504, 3576, 0), PANIC, WAVE, item(MITHRIL_PLATESKIRT), item(MAPLE_LONGBOW), emptySlot("No boots", BOOTS)),
|
||||
new EmoteClue("Panic by the mausoleum in Morytania. Wave before you speak to me. Equip a mithril plate skirt, a maple longbow and no boots.", "Morytania mausoleum, access via the experiments cave", MAUSOLEUM_OFF_THE_MORYTANIA_COAST, new WorldPoint(3504, 3576, 0), PANIC, WAVE, item(MITHRIL_PLATESKIRT), item(MAPLE_LONGBOW), emptySlot("No boots", BOOTS)),
|
||||
new EmoteClue("Panic on the Wilderness volcano bridge. Beware of double agents! Equip any headband and crozier.", "Wilderness volcano", VOLCANO_IN_THE_NORTHEASTERN_WILDERNESS, new WorldPoint(3368, 3935, 0), PANIC, any("Any headband", range(RED_HEADBAND, BROWN_HEADBAND), range(WHITE_HEADBAND, GREEN_HEADBAND)), any("Any crozier", item(ANCIENT_CROZIER), item(ARMADYL_CROZIER), item(BANDOS_CROZIER), range(SARADOMIN_CROZIER, ZAMORAK_CROZIER))),
|
||||
new EmoteClue("Panic by the pilot on White Wolf Mountain. Beware of double agents! Equip mithril platelegs, a ring of life and a rune axe.", "White Wolf Mountain", GNOME_GLIDER_ON_WHITE_WOLF_MOUNTAIN, new WorldPoint(2847, 3499, 0), PANIC, item(MITHRIL_PLATELEGS), item(RING_OF_LIFE), item(RUNE_AXE)),
|
||||
new EmoteClue("Panic by the big egg where no one dare goes and the ground is burnt. Beware of double agents! Equip a dragon med helm, a TokTz-Ket-Xil, a brine sabre, rune platebody and an uncharged amulet of glory.", "Lava dragon isle", SOUTHEAST_CORNER_OF_LAVA_DRAGON_ISLE, new WorldPoint(3227, 3831, 0), PANIC, item(DRAGON_MED_HELM), item(TOKTZKETXIL), item(BRINE_SABRE), item(RUNE_PLATEBODY), item(AMULET_OF_GLORY)),
|
||||
|
||||
+1
-1
@@ -51,12 +51,12 @@ import net.runelite.api.NPCDefinition;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.api.events.AnimationChanged;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.HitsplatApplied;
|
||||
import net.runelite.api.kit.KitType;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.PluginType;
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ import net.runelite.api.Experience;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.Skill;
|
||||
import net.runelite.api.WorldType;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.ScriptCallbackEvent;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
|
||||
@@ -36,6 +36,7 @@ import javax.inject.Singleton;
|
||||
import static net.runelite.api.AnimationID.COOKING_FIRE;
|
||||
import static net.runelite.api.AnimationID.COOKING_RANGE;
|
||||
import net.runelite.api.Client;
|
||||
import static net.runelite.api.MenuOpcode.RUNELITE_OVERLAY;
|
||||
import static net.runelite.api.MenuOpcode.RUNELITE_OVERLAY_CONFIG;
|
||||
import net.runelite.api.Skill;
|
||||
import net.runelite.client.plugins.xptracker.XpTrackerService;
|
||||
@@ -53,6 +54,7 @@ class CookingOverlay extends Overlay
|
||||
{
|
||||
private static final int COOK_TIMEOUT = 3;
|
||||
private static final DecimalFormat FORMAT = new DecimalFormat("#.#");
|
||||
static final String COOKING_RESET = "Reset";
|
||||
|
||||
private final Client client;
|
||||
private final CookingPlugin plugin;
|
||||
@@ -68,6 +70,7 @@ class CookingOverlay extends Overlay
|
||||
this.plugin = plugin;
|
||||
this.xpTrackerService = xpTrackerService;
|
||||
getMenuEntries().add(new OverlayMenuEntry(RUNELITE_OVERLAY_CONFIG, OPTION_CONFIGURE, "Cooking overlay"));
|
||||
getMenuEntries().add(new OverlayMenuEntry(RUNELITE_OVERLAY, COOKING_RESET, "Cooking overlay"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+16
-1
@@ -38,19 +38,22 @@ import net.runelite.api.ChatMessageType;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.GraphicID;
|
||||
import net.runelite.api.ItemID;
|
||||
import net.runelite.api.MenuOpcode;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.SpotAnimationChanged;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.events.OverlayMenuClicked;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDependency;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.xptracker.XpTrackerPlugin;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
import net.runelite.client.ui.overlay.OverlayMenuEntry;
|
||||
import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
|
||||
|
||||
@PluginDescriptor(
|
||||
@@ -122,6 +125,18 @@ public class CookingPlugin extends Plugin
|
||||
eventBus.subscribe(GameTick.class, this, this::onGameTick);
|
||||
eventBus.subscribe(SpotAnimationChanged.class, this, this::onSpotAnimationChanged);
|
||||
eventBus.subscribe(ChatMessage.class, this, this::onChatMessage);
|
||||
eventBus.subscribe(OverlayMenuClicked.class, this, this::onOverlayMenuClicked);
|
||||
}
|
||||
|
||||
private void onOverlayMenuClicked(OverlayMenuClicked overlayMenuClicked)
|
||||
{
|
||||
OverlayMenuEntry overlayMenuEntry = overlayMenuClicked.getEntry();
|
||||
if (overlayMenuEntry.getMenuOpcode() == MenuOpcode.RUNELITE_OVERLAY
|
||||
&& overlayMenuClicked.getEntry().getOption().equals(CookingOverlay.COOKING_RESET)
|
||||
&& overlayMenuClicked.getOverlay() == overlay)
|
||||
{
|
||||
session = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void onGameTick(GameTick gameTick)
|
||||
|
||||
@@ -40,7 +40,6 @@ import static net.runelite.api.MenuOpcode.NPC_SECOND_OPTION;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.NpcID;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.HitsplatApplied;
|
||||
import net.runelite.api.events.InteractingChanged;
|
||||
@@ -53,6 +52,7 @@ import net.runelite.client.chat.ChatMessageManager;
|
||||
import net.runelite.client.chat.QueuedMessage;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
|
||||
@@ -57,20 +57,20 @@ import net.runelite.api.ProjectileID;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.NpcDespawned;
|
||||
import net.runelite.api.events.NpcSpawned;
|
||||
import net.runelite.api.events.ProjectileSpawned;
|
||||
import net.runelite.api.events.SpotAnimationChanged;
|
||||
import net.runelite.api.util.Text;
|
||||
import net.runelite.client.chat.ChatMessageManager;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.PluginType;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
import net.runelite.api.util.Text;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "CoX Helper",
|
||||
|
||||
+2
-4
@@ -25,6 +25,7 @@
|
||||
package net.runelite.client.plugins.customcursor;
|
||||
|
||||
import com.google.inject.Provides;
|
||||
import java.io.IOException;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
import javax.sound.sampled.AudioInputStream;
|
||||
@@ -33,17 +34,14 @@ import javax.sound.sampled.Clip;
|
||||
import javax.sound.sampled.FloatControl;
|
||||
import javax.sound.sampled.LineUnavailableException;
|
||||
import javax.sound.sampled.UnsupportedAudioFileException;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.ClientUI;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@Slf4j
|
||||
@PluginDescriptor(
|
||||
name = "Custom Cursor",
|
||||
|
||||
+3
-3
@@ -26,11 +26,9 @@
|
||||
|
||||
package net.runelite.client.plugins.dailytaskindicators;
|
||||
|
||||
import javax.inject.Singleton;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.vars.AccountType;
|
||||
import com.google.inject.Provides;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
import net.runelite.api.ChatMessageType;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.GameState;
|
||||
@@ -39,12 +37,14 @@ import net.runelite.api.VarPlayer;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.vars.AccountType;
|
||||
import net.runelite.client.chat.ChatColorType;
|
||||
import net.runelite.client.chat.ChatMessageBuilder;
|
||||
import net.runelite.client.chat.ChatMessageManager;
|
||||
import net.runelite.client.chat.QueuedMessage;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ public class Bones
|
||||
|
||||
public boolean add(Bone bone)
|
||||
{
|
||||
if (this.map == null)
|
||||
if (this.map == null || bone == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ import net.runelite.api.MenuEntry;
|
||||
import net.runelite.api.MenuOpcode;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.ItemDespawned;
|
||||
|
||||
+1
-1
@@ -59,7 +59,7 @@ import net.runelite.api.Client;
|
||||
import net.runelite.api.MenuEntry;
|
||||
import net.runelite.api.MenuOpcode;
|
||||
import net.runelite.api.SpriteID;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.api.events.MenuEntryAdded;
|
||||
import net.runelite.api.events.MenuOptionClicked;
|
||||
import net.runelite.api.widgets.JavaScriptCallback;
|
||||
|
||||
+3
-2
@@ -46,7 +46,7 @@ import net.runelite.api.GameState;
|
||||
import net.runelite.api.Skill;
|
||||
import net.runelite.api.WorldType;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.StatChanged;
|
||||
import net.runelite.api.events.VarbitChanged;
|
||||
@@ -399,7 +399,8 @@ public class DiscordPlugin extends Plugin
|
||||
return;
|
||||
}
|
||||
|
||||
final int playerRegionID = WorldPoint.fromLocalInstance(client, client.getLocalPlayer().getLocalLocation()).getRegionID();
|
||||
final WorldPoint worldPoint = WorldPoint.fromLocalInstance(client, client.getLocalPlayer().getLocalLocation());
|
||||
final int playerRegionID = worldPoint == null ? 0 : worldPoint.getRegionID();
|
||||
|
||||
if (playerRegionID == 0)
|
||||
{
|
||||
|
||||
+1
-1
@@ -38,12 +38,12 @@ import lombok.Getter;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.util.Text;
|
||||
import net.runelite.client.Notifier;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.PluginType;
|
||||
|
||||
+1
-1
@@ -45,7 +45,6 @@ import net.runelite.api.ItemID;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.api.events.AnimationChanged;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.PlayerDespawned;
|
||||
@@ -56,6 +55,7 @@ import net.runelite.api.kit.KitType;
|
||||
import net.runelite.api.util.Text;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.menus.MenuManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
|
||||
+13
-8
@@ -27,13 +27,16 @@
|
||||
package net.runelite.client.plugins.entityhider;
|
||||
|
||||
import com.google.inject.Provides;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.util.Text;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
@@ -41,10 +44,6 @@ import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Entity Hider",
|
||||
description = "Hide players, NPCs, and/or projectiles",
|
||||
@@ -91,13 +90,18 @@ public class EntityHiderPlugin extends Plugin
|
||||
{
|
||||
updateConfig();
|
||||
|
||||
if (event.getOldValue() == null || event.getNewValue() == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.getKey().equals("hideNPCsNames"))
|
||||
{
|
||||
List<String> oldList = Text.fromCSV(event.getOldValue());
|
||||
List<String> newList = Text.fromCSV(event.getNewValue());
|
||||
|
||||
ArrayList<String> removed = oldList.stream().filter(s -> !newList.contains(s)).collect(Collectors.toCollection(ArrayList::new));
|
||||
ArrayList<String> added = newList.stream().filter(s -> !oldList.contains(s)).collect(Collectors.toCollection(ArrayList::new));
|
||||
List<String> removed = oldList.stream().filter(s -> !newList.contains(s)).collect(Collectors.toCollection(ArrayList::new));
|
||||
List<String> added = newList.stream().filter(s -> !oldList.contains(s)).collect(Collectors.toCollection(ArrayList::new));
|
||||
|
||||
removed.forEach(client::removeHiddenNpcName);
|
||||
added.forEach(client::addHiddenNpcName);
|
||||
@@ -189,7 +193,8 @@ public class EntityHiderPlugin extends Plugin
|
||||
return true;
|
||||
}
|
||||
|
||||
final int playerRegionID = WorldPoint.fromLocalInstance(client, localPlayer.getLocalLocation()).getRegionID();
|
||||
final WorldPoint worldPoint = WorldPoint.fromLocalInstance(client, client.getLocalPlayer().getLocalLocation());
|
||||
final int playerRegionID = worldPoint == null ? 0 : worldPoint.getRegionID();
|
||||
|
||||
// 9520 = Castle Wars
|
||||
return playerRegionID != 9520;
|
||||
|
||||
+2
-2
@@ -44,15 +44,16 @@ import net.runelite.api.ChatMessageType;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.ItemDefinition;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.PlayerMenuOptionClicked;
|
||||
import net.runelite.api.kit.KitType;
|
||||
import net.runelite.api.util.Text;
|
||||
import net.runelite.client.chat.ChatColorType;
|
||||
import net.runelite.client.chat.ChatMessageBuilder;
|
||||
import net.runelite.client.chat.ChatMessageManager;
|
||||
import net.runelite.client.chat.QueuedMessage;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.menus.MenuManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
@@ -61,7 +62,6 @@ import net.runelite.client.plugins.PluginType;
|
||||
import net.runelite.client.ui.ClientToolbar;
|
||||
import net.runelite.client.ui.NavigationButton;
|
||||
import net.runelite.client.util.ImageUtil;
|
||||
import net.runelite.api.util.Text;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Equipment Inspector",
|
||||
|
||||
@@ -153,6 +153,10 @@ public class ExaminePlugin extends Plugin
|
||||
quantity = widgetItem != null && widgetItem.getId() >= 0 ? widgetItem.getQuantity() : 1;
|
||||
break;
|
||||
}
|
||||
case EXAMINE_ITEM_GROUND:
|
||||
type = ExamineType.ITEM;
|
||||
id = event.getIdentifier();
|
||||
break;
|
||||
case EXAMINE_ITEM_BANK_EQ:
|
||||
{
|
||||
type = ExamineType.ITEM_BANK_EQ;
|
||||
|
||||
+1
-3
@@ -43,7 +43,6 @@ import net.runelite.api.Skill;
|
||||
import net.runelite.api.SpriteID;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.WorldType;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.ScriptCallbackEvent;
|
||||
@@ -53,6 +52,7 @@ import net.runelite.api.widgets.WidgetID;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.game.NPCManager;
|
||||
import net.runelite.client.game.XpDropEvent;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
@@ -378,8 +378,6 @@ public class XpDropPlugin extends Plugin
|
||||
final int exp = intStack[intStackSize - 1];
|
||||
calculateDamageDealt(exp);
|
||||
}
|
||||
|
||||
client.setIntStackSize(intStackSize - 2);
|
||||
}
|
||||
else if (eventName.equals("hpXpGained"))
|
||||
{
|
||||
|
||||
+2
-2
@@ -44,10 +44,10 @@ import net.runelite.api.ScriptID;
|
||||
import net.runelite.api.SoundEffectID;
|
||||
import net.runelite.api.SpriteID;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.VarbitChanged;
|
||||
import net.runelite.api.events.WidgetLoaded;
|
||||
import net.runelite.api.util.Text;
|
||||
import net.runelite.api.widgets.JavaScriptCallback;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.api.widgets.WidgetID;
|
||||
@@ -56,11 +56,11 @@ import net.runelite.api.widgets.WidgetType;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.game.chatbox.ChatboxPanelManager;
|
||||
import net.runelite.client.game.chatbox.ChatboxTextInput;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.api.util.Text;
|
||||
|
||||
@Slf4j
|
||||
@PluginDescriptor(
|
||||
|
||||
@@ -35,7 +35,7 @@ import java.util.function.Supplier;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
|
||||
+1
-1
@@ -46,13 +46,13 @@ import net.runelite.api.GameState;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.NpcID;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.NpcDespawned;
|
||||
import net.runelite.api.events.NpcSpawned;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.game.NPCManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
|
||||
@@ -31,6 +31,7 @@ import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.GraphicID;
|
||||
import static net.runelite.api.MenuOpcode.RUNELITE_OVERLAY;
|
||||
import static net.runelite.api.MenuOpcode.RUNELITE_OVERLAY_CONFIG;
|
||||
import net.runelite.api.Skill;
|
||||
import net.runelite.client.plugins.xptracker.XpTrackerService;
|
||||
@@ -47,6 +48,7 @@ import net.runelite.client.ui.overlay.components.table.TableComponent;
|
||||
class FishingOverlay extends Overlay
|
||||
{
|
||||
private static final String FISHING_SPOT = "Fishing spot";
|
||||
static final String FISHING_RESET = "Reset";
|
||||
|
||||
private final Client client;
|
||||
private final FishingPlugin plugin;
|
||||
@@ -63,6 +65,7 @@ class FishingOverlay extends Overlay
|
||||
this.plugin = plugin;
|
||||
this.xpTrackerService = xpTrackerService;
|
||||
getMenuEntries().add(new OverlayMenuEntry(RUNELITE_OVERLAY_CONFIG, OPTION_CONFIGURE, "Fishing overlay"));
|
||||
getMenuEntries().add(new OverlayMenuEntry(RUNELITE_OVERLAY, FISHING_RESET, "Fishing overlay"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+16
-1
@@ -47,11 +47,11 @@ import net.runelite.api.GameState;
|
||||
import net.runelite.api.InventoryID;
|
||||
import net.runelite.api.ItemContainer;
|
||||
import net.runelite.api.ItemID;
|
||||
import net.runelite.api.MenuOpcode;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.coords.LocalPoint;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.InteractingChanged;
|
||||
@@ -66,11 +66,14 @@ import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.Notifier;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.events.OverlayMenuClicked;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDependency;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.xptracker.XpTrackerPlugin;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
import net.runelite.client.ui.overlay.OverlayMenuEntry;
|
||||
import net.runelite.client.util.ItemUtil;
|
||||
|
||||
@PluginDescriptor(
|
||||
@@ -205,6 +208,18 @@ public class FishingPlugin extends Plugin
|
||||
eventBus.subscribe(NpcDespawned.class, this, this::onNpcDespawned);
|
||||
eventBus.subscribe(VarbitChanged.class, this, this::onVarbitChanged);
|
||||
eventBus.subscribe(WidgetLoaded.class, this, this::onWidgetLoaded);
|
||||
eventBus.subscribe(OverlayMenuClicked.class, this, this::onOverlayMenuClicked);
|
||||
}
|
||||
|
||||
private void onOverlayMenuClicked(OverlayMenuClicked overlayMenuClicked)
|
||||
{
|
||||
OverlayMenuEntry overlayMenuEntry = overlayMenuClicked.getEntry();
|
||||
if (overlayMenuEntry.getMenuOpcode() == MenuOpcode.RUNELITE_OVERLAY
|
||||
&& overlayMenuClicked.getEntry().getOption().equals(FishingOverlay.FISHING_RESET)
|
||||
&& overlayMenuClicked.getOverlay() == overlay)
|
||||
{
|
||||
session.setLastFishCaught(null);
|
||||
}
|
||||
}
|
||||
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
|
||||
@@ -29,10 +29,10 @@ import com.google.inject.Provides;
|
||||
import com.google.inject.Singleton;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.FocusChanged;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.DrawManager;
|
||||
|
||||
+1
-1
@@ -39,13 +39,13 @@ import net.runelite.api.Player;
|
||||
import net.runelite.api.WorldType;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.LocalPlayerDeath;
|
||||
import net.runelite.api.events.NpcDespawned;
|
||||
import net.runelite.api.events.SpotAnimationChanged;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.PluginType;
|
||||
|
||||
+5
-4
@@ -55,7 +55,6 @@ import net.runelite.api.Skill;
|
||||
import net.runelite.api.SoundEffectID;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.events.AnimationChanged;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameObjectDespawned;
|
||||
import net.runelite.api.events.GameObjectSpawned;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
@@ -68,9 +67,11 @@ import net.runelite.api.events.VarbitChanged;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.events.NpcLootReceived;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.game.SkillIconManager;
|
||||
import net.runelite.client.game.XpDropEvent;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.PluginType;
|
||||
@@ -78,7 +79,6 @@ import static net.runelite.client.plugins.gauntlet.Hunllef.BossAttack.LIGHTNING;
|
||||
import static net.runelite.client.plugins.gauntlet.Hunllef.BossAttack.MAGIC;
|
||||
import static net.runelite.client.plugins.gauntlet.Hunllef.BossAttack.PRAYER;
|
||||
import static net.runelite.client.plugins.gauntlet.Hunllef.BossAttack.RANGE;
|
||||
import net.runelite.client.game.XpDropEvent;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
import net.runelite.client.ui.overlay.infobox.Counter;
|
||||
import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
|
||||
@@ -216,7 +216,8 @@ public class GauntletPlugin extends Plugin
|
||||
if (client.getGameState() != GameState.STARTING && client.getGameState() != GameState.UNKNOWN)
|
||||
{
|
||||
completeStartup = false;
|
||||
clientThread.invoke(() -> {
|
||||
clientThread.invoke(() ->
|
||||
{
|
||||
timer.initStates();
|
||||
completeStartup = true;
|
||||
});
|
||||
@@ -378,7 +379,7 @@ public class GauntletPlugin extends Plugin
|
||||
final Player player = (Player) actor;
|
||||
final int anim = player.getAnimation();
|
||||
|
||||
if (!player.getName().equals(client.getLocalPlayer().getName()) || anim == -1 || !PLAYER_ANIMATIONS.contains(anim))
|
||||
if (player.getName() == null || client.getLocalPlayer() == null || !player.getName().equals(client.getLocalPlayer().getName()) || anim == -1 || !PLAYER_ANIMATIONS.contains(anim))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -56,22 +56,22 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import net.runelite.api.BufferProvider;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.Constants;
|
||||
import net.runelite.api.Entity;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.Model;
|
||||
import net.runelite.api.NodeCache;
|
||||
import net.runelite.api.Perspective;
|
||||
import net.runelite.api.Entity;
|
||||
import net.runelite.api.Scene;
|
||||
import net.runelite.api.TileModel;
|
||||
import net.runelite.api.TilePaint;
|
||||
import net.runelite.api.Texture;
|
||||
import net.runelite.api.TextureProvider;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.TileModel;
|
||||
import net.runelite.api.TilePaint;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.hooks.DrawCallbacks;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.PluginInstantiationException;
|
||||
@@ -1194,7 +1194,9 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
||||
glDrawable.swapBuffers();
|
||||
}
|
||||
catch (GLException ignored)
|
||||
{ }
|
||||
{
|
||||
// Ignore
|
||||
}
|
||||
|
||||
drawManager.processDrawComplete(this::screenshot);
|
||||
}
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ import static net.runelite.api.ItemID.COINS_995;
|
||||
import net.runelite.api.MenuOpcode;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.api.events.FocusChanged;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.GrandExchangeOfferChanged;
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ import net.runelite.api.TileItem;
|
||||
import net.runelite.api.TileItemPile;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.api.events.ClientTick;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.api.events.FocusChanged;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
|
||||
+12
-3
@@ -47,24 +47,24 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import net.runelite.api.Client;
|
||||
import static net.runelite.api.Constants.CHUNK_SIZE;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.MenuOpcode;
|
||||
import net.runelite.api.MenuEntry;
|
||||
import net.runelite.api.MenuOpcode;
|
||||
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.FocusChanged;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.MenuEntryAdded;
|
||||
import net.runelite.api.events.MenuOptionClicked;
|
||||
import net.runelite.api.util.Text;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.input.KeyManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
import net.runelite.client.util.ColorUtil;
|
||||
import net.runelite.api.util.Text;
|
||||
|
||||
@Slf4j
|
||||
@PluginDescriptor(
|
||||
@@ -336,6 +336,10 @@ public class GroundMarkerPlugin extends Plugin
|
||||
return;
|
||||
}
|
||||
final WorldPoint loc = WorldPoint.fromLocalInstance(client, tile.getLocalLocation());
|
||||
if (loc == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
final int regionId = loc.getRegionID();
|
||||
|
||||
for (int i = this.amount.toInt(); i > 0; i--)
|
||||
@@ -419,6 +423,11 @@ public class GroundMarkerPlugin extends Plugin
|
||||
|
||||
WorldPoint worldPoint = WorldPoint.fromLocalInstance(client, localPoint);
|
||||
|
||||
if (worldPoint == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int regionId = worldPoint.getRegionID();
|
||||
GroundMarkerPoint point = new GroundMarkerPoint(regionId, worldPoint.getRegionX(), worldPoint.getRegionY(), client.getPlane(), group);
|
||||
log.debug("Updating point: {} - {}", point, worldPoint);
|
||||
|
||||
+1
-1
@@ -50,7 +50,6 @@ import net.runelite.api.TileObject;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.api.events.AnimationChanged;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.GameObjectChanged;
|
||||
import net.runelite.api.events.GameObjectDespawned;
|
||||
import net.runelite.api.events.GameObjectSpawned;
|
||||
@@ -61,6 +60,7 @@ import net.runelite.api.events.GroundObjectSpawned;
|
||||
import net.runelite.api.events.VarbitChanged;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user