Merge branch 'master' into rebasetob
This commit is contained in:
@@ -10,12 +10,6 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- 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
|
- name: Make gradlew executable
|
||||||
run: chmod +x ./gradlew
|
run: chmod +x ./gradlew
|
||||||
- name: Update Gradle Wrapper
|
- name: Update Gradle Wrapper
|
||||||
@@ -28,4 +22,4 @@ jobs:
|
|||||||
PULL_REQUEST_TITLE: 'project: Update gradle wrapper'
|
PULL_REQUEST_TITLE: 'project: Update gradle wrapper'
|
||||||
PULL_REQUEST_BODY: This is an auto-generated PR with an updated gradle version
|
PULL_REQUEST_BODY: This is an auto-generated PR with an updated gradle version
|
||||||
COMMIT_MESSAGE: 'project: Update gradle wrapper'
|
COMMIT_MESSAGE: 'project: Update gradle wrapper'
|
||||||
PULL_REQUEST_LABELS: automated-pull-request, gradle
|
PULL_REQUEST_LABELS: automated-pull-request, gradle
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
name: OpenOSRS - CI (PR)
|
name: OpenOSRS - CI (PR)
|
||||||
|
|
||||||
on: pull_request
|
on:
|
||||||
|
pull_request:
|
||||||
|
types: ['opened', 'edited', 'reopened', 'synchronize']
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
pr-lint:
|
pr-lint:
|
||||||
@@ -10,7 +12,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: PR title lint
|
- name: PR title lint
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
uses: seferov/pr-lint-action@master
|
uses: seferov/pr-lint-action@v1.0.3
|
||||||
with:
|
with:
|
||||||
title-regex: '^([\w-/]+): \w+'
|
title-regex: '^([\w-/]+): \w+'
|
||||||
|
|
||||||
@@ -35,7 +37,7 @@ jobs:
|
|||||||
- name: Assembling
|
- name: Assembling
|
||||||
run: ./gradlew assemble --console=plain
|
run: ./gradlew assemble --console=plain
|
||||||
- name: Building
|
- name: Building
|
||||||
run: ./gradlew build --stacktrace -x test -x checkstyleMain --console=plain
|
run: ./gradlew build --stacktrace -x test -x checkstyleMain -x checkstyleTest --console=plain
|
||||||
|
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -116,4 +118,4 @@ jobs:
|
|||||||
if: github.event_name == 'pull_request' && github.actor == 'OpenOSRS'
|
if: github.event_name == 'pull_request' && github.actor == 'OpenOSRS'
|
||||||
uses: hmarr/auto-approve-action@v2.0.0
|
uses: hmarr/auto-approve-action@v2.0.0
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.Owain }}
|
github-token: ${{ secrets.Owain }}
|
||||||
|
|||||||
@@ -10,12 +10,6 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- 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
|
- name: Set up JDK 11
|
||||||
uses: actions/setup-java@v1
|
uses: actions/setup-java@v1
|
||||||
with:
|
with:
|
||||||
@@ -42,4 +36,4 @@ jobs:
|
|||||||
PULL_REQUEST_TITLE: 'Client: Update NPC stats'
|
PULL_REQUEST_TITLE: 'Client: Update NPC stats'
|
||||||
PULL_REQUEST_BODY: This is an auto-generated PR with changes from the OSRS wiki
|
PULL_REQUEST_BODY: This is an auto-generated PR with changes from the OSRS wiki
|
||||||
COMMIT_MESSAGE: 'Client: Update NPC stats'
|
COMMIT_MESSAGE: 'Client: Update NPC stats'
|
||||||
PULL_REQUEST_LABELS: automated-pull-request, NPC stats
|
PULL_REQUEST_LABELS: automated-pull-request, NPC stats
|
||||||
|
|||||||
@@ -2,15 +2,17 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
# OpenOSRS
|
# OpenOSRS
|
||||||
|
|
||||||
[/badge.svg)](https://github.com/open-osrs/runelite/actions?query=workflow%3A%22OpenOSRS+-+CI+%28push%29%22)
|
[/badge.svg)](https://github.com/open-osrs/runelite/actions?query=workflow%3A%22OpenOSRS+-+CI+%28push%29%22)
|
||||||
[](http://hits.dwyl.io/open-osrs/runelite)
|
[](http://hits.dwyl.io/open-osrs/runelite)
|
||||||
[OpenOSRS](https://openosrs.com) is an extended version of [RuneLite](https://github.com/runelite/runelite) that provides more functionality and less restrictions while staying more open-source. We are not affiliated with RuneLite.
|
[OpenOSRS](https://openosrs.com) is an extended version of [RuneLite](https://github.com/runelite/runelite) that provides more functionality and less restrictions while staying fully open-source. We are not affiliated with RuneLite.
|
||||||
|
|
||||||
|
## Discord
|
||||||
|
|
||||||
## Discord
|
|
||||||
[](https://discord.gg/HN5gf3m)
|
[](https://discord.gg/HN5gf3m)
|
||||||
|
|
||||||
## Project Layout
|
## Project Layout
|
||||||
|
|
||||||
- [cache](cache/src/main/java/net/runelite/cache) - Libraries used for reading/writing cache files, as well as the data in it
|
- [cache](cache/src/main/java/net/runelite/cache) - Libraries used for reading/writing cache files, as well as the data in it
|
||||||
- [deobfuscator](deobfuscator/src/main/java/net/runelite/deob) - Can decompile and cleanup gamepacks as well as map updates to newer revs
|
- [deobfuscator](deobfuscator/src/main/java/net/runelite/deob) - Can decompile and cleanup gamepacks as well as map updates to newer revs
|
||||||
@@ -23,38 +25,18 @@
|
|||||||
- [runescape-api](runescape-api/src/main/java/net/runelite) - Mappings correspond to these interfaces, runelite-api is a subset of this
|
- [runescape-api](runescape-api/src/main/java/net/runelite) - Mappings correspond to these interfaces, runelite-api is a subset of this
|
||||||
- [runelite-client](runelite-client/src/main/java/net/runelite/client) - Game client with plugins
|
- [runelite-client](runelite-client/src/main/java/net/runelite/client) - Game client with plugins
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
|
|
||||||
We have migrated the project to Gradle. Information on how to setup and build the project can be found at https://github.com/open-osrs/runelite/wiki/Building-with-IntelliJ-IDEA
|
We have migrated the project to Gradle. Information on how to setup and build the project can be found at https://github.com/open-osrs/runelite/wiki/Building-with-IntelliJ-IDEA
|
||||||
|
|
||||||
## Private Servers
|
## License
|
||||||
Currently we support RSMod which can be found at: https://github.com/Tomm0017/rsmod but should work with any server that follows osrs protocol.
|
|
||||||
```
|
|
||||||
Gradle
|
|
||||||
enter
|
|
||||||
run --args='--rs=RSPS'
|
|
||||||
into the tasks box
|
|
||||||
|
|
||||||
Jar
|
|
||||||
Use -rs=RSPS arg.
|
|
||||||
|
|
||||||
Exe
|
|
||||||
Use --clientargs="--rs=RSPS" arg.
|
|
||||||
|
|
||||||
-----
|
|
||||||
|
|
||||||
Codebase is set to 127.0.0.1 by default and can be changed in the Private Server plugin (requires restart)
|
|
||||||
Update modulus in Private Server plugin.
|
|
||||||
|
|
||||||
Disable Default World plugin if you have it enabled, this causes issues with codebase.
|
|
||||||
```
|
|
||||||
## License
|
|
||||||
|
|
||||||
OpenOSRS is licensed under the BSD 2-clause license. See the license header in the respective file to be sure.
|
OpenOSRS is licensed under the BSD 2-clause license. See the license header in the respective file to be sure.
|
||||||
|
|
||||||
## Contribute and Develop
|
## Contribute and Develop
|
||||||
|
|
||||||
We've set up a separate document for our [contribution guidelines](https://github.com/open-osrs/runelite/blob/master/.github/CONTRIBUTING.md).
|
We've set up a separate document for our [contribution guidelines](https://github.com/open-osrs/runelite/blob/master/.github/CONTRIBUTING.md).
|
||||||
|
|
||||||
## Supported By
|
## Supported By
|
||||||
|
|
||||||
OpenOSRS uses profiling tools provided by [](https://www.yourkit.com/java/profiler/)
|
OpenOSRS uses profiling tools provided by [](https://www.yourkit.com/java/profiler/)
|
||||||
|
|||||||
@@ -122,13 +122,6 @@ subprojects {
|
|||||||
options.encoding = "UTF-8"
|
options.encoding = "UTF-8"
|
||||||
}
|
}
|
||||||
|
|
||||||
withType<AbstractArchiveTask> {
|
|
||||||
isPreserveFileTimestamps = false
|
|
||||||
isReproducibleFileOrder = true
|
|
||||||
dirMode = 493
|
|
||||||
fileMode = 420
|
|
||||||
}
|
|
||||||
|
|
||||||
withType<Checkstyle> {
|
withType<Checkstyle> {
|
||||||
group = "verification"
|
group = "verification"
|
||||||
|
|
||||||
|
|||||||
@@ -1,85 +1,42 @@
|
|||||||
import org.gradle.api.Plugin
|
import org.gradle.api.Plugin
|
||||||
import org.gradle.api.Project
|
import org.gradle.api.Project
|
||||||
import org.gradle.kotlin.dsl.get
|
import org.gradle.kotlin.dsl.*
|
||||||
import org.gradle.kotlin.dsl.register
|
|
||||||
import java.io.File
|
|
||||||
|
|
||||||
class BootstrapPlugin : Plugin<Project> {
|
class BootstrapPlugin : Plugin<Project> {
|
||||||
override fun apply(project: Project) {
|
override fun apply(project: Project): Unit = with(project) {
|
||||||
project.tasks.register<BootstrapTask>("bootstrapStaging") {
|
val clientJar by configurations.creating {
|
||||||
dependsOn("jar")
|
isCanBeConsumed = false
|
||||||
dependsOn("shadowJar")
|
isCanBeResolved = true
|
||||||
|
isTransitive = false
|
||||||
type = "staging"
|
}
|
||||||
clientJar = project.tasks["jar"].outputs.files.singleFile
|
val bootstrapDependencies by configurations.creating {
|
||||||
|
extendsFrom(clientJar)
|
||||||
dependsOn(project.parent!!.project(":runelite-api").tasks["jar"])
|
isCanBeConsumed = false
|
||||||
dependsOn(project.parent!!.project(":runescape-api").tasks["jar"])
|
isCanBeResolved = true
|
||||||
dependsOn(project.parent!!.project(":http-api").tasks["jar"])
|
isTransitive = false
|
||||||
dependsOn(project.parent!!.project(":injected-client").tasks["jar"])
|
|
||||||
|
|
||||||
doLast {
|
|
||||||
|
|
||||||
project.copy {
|
|
||||||
from(project.tasks["jar"])
|
|
||||||
from(project.parent!!.project(":runelite-api").tasks["jar"])
|
|
||||||
from(project.parent!!.project(":runescape-api").tasks["jar"])
|
|
||||||
from(project.parent!!.project(":http-api").tasks["jar"])
|
|
||||||
from(project.parent!!.project(":injected-client").tasks["jar"])
|
|
||||||
|
|
||||||
into("${project.buildDir}/bootstrap/${type}/")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
project.tasks.register<BootstrapTask>("bootstrapStable") {
|
dependencies {
|
||||||
dependsOn("jar")
|
clientJar(tasks["jar"].outputs.files)
|
||||||
dependsOn("shadowJar")
|
bootstrapDependencies(project(":runelite-api"))
|
||||||
|
bootstrapDependencies(project(":runescape-api"))
|
||||||
type = "stable"
|
bootstrapDependencies(project(":http-api"))
|
||||||
clientJar = project.tasks["jar"].outputs.files.singleFile
|
bootstrapDependencies(project(":injected-client"))
|
||||||
|
|
||||||
dependsOn(project.parent!!.project(":runelite-api").tasks["jar"])
|
|
||||||
dependsOn(project.parent!!.project(":runescape-api").tasks["jar"])
|
|
||||||
dependsOn(project.parent!!.project(":http-api").tasks["jar"])
|
|
||||||
dependsOn(project.parent!!.project(":injected-client").tasks["jar"])
|
|
||||||
|
|
||||||
doLast {
|
|
||||||
|
|
||||||
project.copy {
|
|
||||||
from(project.tasks["jar"])
|
|
||||||
from(project.parent!!.project(":runelite-api").tasks["jar"])
|
|
||||||
from(project.parent!!.project(":runescape-api").tasks["jar"])
|
|
||||||
from(project.parent!!.project(":http-api").tasks["jar"])
|
|
||||||
from(project.parent!!.project(":injected-client").tasks["jar"])
|
|
||||||
|
|
||||||
into("${project.buildDir}/bootstrap/${type}/")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
project.tasks.register<BootstrapTask>("bootstrapNightly") {
|
tasks.register<BootstrapTask>("bootstrapStaging", "staging")
|
||||||
dependsOn("jar")
|
tasks.register<BootstrapTask>("bootstrapNightly", "nightly")
|
||||||
dependsOn("shadowJar")
|
tasks.register<BootstrapTask>("bootstrapStable", "stable")
|
||||||
|
|
||||||
type = "nightly"
|
tasks.withType<BootstrapTask> {
|
||||||
clientJar = project.tasks["jar"].outputs.files.singleFile
|
dependsOn(bootstrapDependencies)
|
||||||
|
|
||||||
dependsOn(project.parent!!.project(":runelite-api").tasks["jar"])
|
this.clientJar = clientJar.singleFile
|
||||||
dependsOn(project.parent!!.project(":runescape-api").tasks["jar"])
|
|
||||||
dependsOn(project.parent!!.project(":http-api").tasks["jar"])
|
|
||||||
dependsOn(project.parent!!.project(":injected-client").tasks["jar"])
|
|
||||||
|
|
||||||
doLast {
|
doLast {
|
||||||
|
copy {
|
||||||
project.copy {
|
from(bootstrapDependencies)
|
||||||
from(project.tasks["jar"])
|
into("${buildDir}/bootstrap/${type}/")
|
||||||
from(project.parent!!.project(":runelite-api").tasks["jar"])
|
|
||||||
from(project.parent!!.project(":runescape-api").tasks["jar"])
|
|
||||||
from(project.parent!!.project(":http-api").tasks["jar"])
|
|
||||||
from(project.parent!!.project(":injected-client").tasks["jar"])
|
|
||||||
|
|
||||||
into("${project.buildDir}/bootstrap/${type}/")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import org.gradle.api.DefaultTask
|
import org.gradle.api.DefaultTask
|
||||||
import org.gradle.api.tasks.Input
|
import org.gradle.api.tasks.Input
|
||||||
import org.gradle.api.tasks.InputFile
|
import org.gradle.api.tasks.InputFile
|
||||||
import org.gradle.api.tasks.Optional
|
|
||||||
import org.gradle.api.tasks.PathSensitive
|
import org.gradle.api.tasks.PathSensitive
|
||||||
import org.gradle.api.tasks.PathSensitivity
|
import org.gradle.api.tasks.PathSensitivity
|
||||||
import org.gradle.api.tasks.TaskAction
|
import org.gradle.api.tasks.TaskAction
|
||||||
@@ -9,12 +8,9 @@ import org.gradle.kotlin.dsl.extra
|
|||||||
import org.gradle.kotlin.dsl.get
|
import org.gradle.kotlin.dsl.get
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.security.MessageDigest
|
import java.security.MessageDigest
|
||||||
|
import javax.inject.Inject
|
||||||
|
|
||||||
open class BootstrapTask : DefaultTask() {
|
open class BootstrapTask @Inject constructor(@Input val type: String) : DefaultTask() {
|
||||||
|
|
||||||
@Input
|
|
||||||
@Optional
|
|
||||||
var type: String? = "stable"
|
|
||||||
|
|
||||||
@InputFile
|
@InputFile
|
||||||
@PathSensitive(PathSensitivity.ABSOLUTE)
|
@PathSensitive(PathSensitivity.ABSOLUTE)
|
||||||
@@ -27,10 +23,10 @@ open class BootstrapTask : DefaultTask() {
|
|||||||
val launcherArguments = arrayOf("-XX:+DisableAttachMechanism", "-Drunelite.launcher.nojvm=true", "-Xmx512m", "-Xss2m", "-XX:CompileThreshold=1500", "-Xincgc", "-XX:+UseConcMarkSweepGC", "-XX:+UseParNewGC", "-Djna.nosys=true")
|
val launcherArguments = arrayOf("-XX:+DisableAttachMechanism", "-Drunelite.launcher.nojvm=true", "-Xmx512m", "-Xss2m", "-XX:CompileThreshold=1500", "-Xincgc", "-XX:+UseConcMarkSweepGC", "-XX:+UseParNewGC", "-Djna.nosys=true")
|
||||||
|
|
||||||
@Input
|
@Input
|
||||||
val clientJvmArguments = arrayOf("-XX:+DisableAttachMechanism", "-Xmx512m", "-Xss2m", "-XX:CompileThreshold=1500", "-Xincgc", "-XX:+UseConcMarkSweepGC", "-XX:+UseParNewGC", "-Djna.nosys=true")
|
val clientJvmArguments = arrayOf("-XX:+DisableAttachMechanism", "-Xmx512m", "-Xss2m", "-XX:CompileThreshold=1500", "-Xincgc", "-XX:+UseConcMarkSweepGC", "-XX:+UseParNewGC", "-Djna.nosys=true", "-Dawt.useSystemAAFontSettings=on", "-Dswing.aatext=true")
|
||||||
|
|
||||||
@Input
|
@Input
|
||||||
val clientJvm9Arguments = arrayOf("-XX:+DisableAttachMechanism", "-Xmx512m", "-Xss2m", "-XX:CompileThreshold=1500", "-Djna.nosys=true")
|
val clientJvm9Arguments = arrayOf("-XX:+DisableAttachMechanism", "-Xmx512m", "-Xss2m", "-XX:CompileThreshold=1500", "-Djna.nosys=true", "-Dawt.useSystemAAFontSettings=on", "-Dswing.aatext=true")
|
||||||
|
|
||||||
private fun hash(file: ByteArray): String {
|
private fun hash(file: ByteArray): String {
|
||||||
return MessageDigest.getInstance("SHA-256").digest(file).fold("", { str, it -> str + "%02x".format(it) })
|
return MessageDigest.getInstance("SHA-256").digest(file).fold("", { str, it -> str + "%02x".format(it) })
|
||||||
@@ -42,10 +38,11 @@ open class BootstrapTask : DefaultTask() {
|
|||||||
project.configurations["runtimeClasspath"].resolvedConfiguration.resolvedArtifacts.forEach {
|
project.configurations["runtimeClasspath"].resolvedConfiguration.resolvedArtifacts.forEach {
|
||||||
val module = it.moduleVersion.id.toString()
|
val module = it.moduleVersion.id.toString()
|
||||||
|
|
||||||
val name = module.split(":")[1]
|
val splat = module.split(":")
|
||||||
val group = module.split(":")[0]
|
val name = splat[1]
|
||||||
val version = module.split(":")[2]
|
val group = splat[0]
|
||||||
var path = ""
|
val version = splat[2]
|
||||||
|
lateinit var path: String
|
||||||
|
|
||||||
if (it.file.name.contains(ProjectVersions.rlVersion)) {
|
if (it.file.name.contains(ProjectVersions.rlVersion)) {
|
||||||
path = "https://github.com/open-osrs/hosting/raw/master/${type}/${it.file.name}"
|
path = "https://github.com/open-osrs/hosting/raw/master/${type}/${it.file.name}"
|
||||||
@@ -84,7 +81,7 @@ open class BootstrapTask : DefaultTask() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@TaskAction
|
@TaskAction
|
||||||
fun boostrap() {
|
fun bootstrap() {
|
||||||
val json = JsonBuilder(
|
val json = JsonBuilder(
|
||||||
"projectVersion" to ProjectVersions.openosrsVersion,
|
"projectVersion" to ProjectVersions.openosrsVersion,
|
||||||
"minimumLauncherVersion" to ProjectVersions.launcherVersion,
|
"minimumLauncherVersion" to ProjectVersions.launcherVersion,
|
||||||
@@ -103,4 +100,4 @@ open class BootstrapTask : DefaultTask() {
|
|||||||
out.println(json)
|
out.println(json)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,11 +27,11 @@ const val kotlinVersion = "1.3.50"
|
|||||||
|
|
||||||
object ProjectVersions {
|
object ProjectVersions {
|
||||||
const val launcherVersion = "2.0.4"
|
const val launcherVersion = "2.0.4"
|
||||||
const val rlVersion = "1.5.40-SNAPSHOT"
|
const val rlVersion = "1.5.42"
|
||||||
|
|
||||||
const val openosrsVersion = "2.1.12.0-SNAPSHOT"
|
const val openosrsVersion = "2.1.15.0"
|
||||||
|
|
||||||
const val rsversion = 185
|
const val rsversion = 186
|
||||||
const val cacheversion = 165
|
const val cacheversion = 165
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,4 @@
|
|||||||
*/
|
*/
|
||||||
package net.runelite.cache.definitions;
|
package net.runelite.cache.definitions;
|
||||||
|
|
||||||
public interface WorldMapTypeBase
|
public interface WorldMapTypeBase {}
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -25,13 +25,12 @@
|
|||||||
|
|
||||||
package net.runelite.cache.definitions.loaders;
|
package net.runelite.cache.definitions.loaders;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import net.runelite.cache.definitions.ItemDefinition;
|
import net.runelite.cache.definitions.ItemDefinition;
|
||||||
import net.runelite.cache.io.InputStream;
|
import net.runelite.cache.io.InputStream;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
public class ItemLoader
|
public class ItemLoader
|
||||||
{
|
{
|
||||||
private static final Logger logger = LoggerFactory.getLogger(ItemLoader.class);
|
private static final Logger logger = LoggerFactory.getLogger(ItemLoader.class);
|
||||||
@@ -40,7 +39,7 @@ public class ItemLoader
|
|||||||
{
|
{
|
||||||
ItemDefinition def = new ItemDefinition(id);
|
ItemDefinition def = new ItemDefinition(id);
|
||||||
InputStream is = new InputStream(b);
|
InputStream is = new InputStream(b);
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
int opcode = is.readUnsignedByte();
|
int opcode = is.readUnsignedByte();
|
||||||
|
|||||||
@@ -25,7 +25,6 @@
|
|||||||
|
|
||||||
package net.runelite.cache;
|
package net.runelite.cache;
|
||||||
|
|
||||||
|
|
||||||
import com.google.common.io.Files;
|
import com.google.common.io.Files;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|||||||
@@ -32,6 +32,8 @@
|
|||||||
<module name="SuppressionCommentFilter"/>
|
<module name="SuppressionCommentFilter"/>
|
||||||
<module name="LeftCurly">
|
<module name="LeftCurly">
|
||||||
<property name="option" value="nl"/>
|
<property name="option" value="nl"/>
|
||||||
|
<!-- allow {} on anonymous classes and lambdas-->
|
||||||
|
<property name="tokens" value="ANNOTATION_DEF, CLASS_DEF, CTOR_DEF, ENUM_CONSTANT_DEF, ENUM_DEF, INTERFACE_DEF, LITERAL_CASE, LITERAL_CATCH, LITERAL_DEFAULT, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, METHOD_DEF, STATIC_INIT"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="RightCurly">
|
<module name="RightCurly">
|
||||||
<property name="option" value="alone"/>
|
<property name="option" value="alone"/>
|
||||||
@@ -42,12 +44,12 @@
|
|||||||
<property name="message" value="Indent must use tab characters"/>
|
<property name="message" value="Indent must use tab characters"/>
|
||||||
<property name="ignoreComments" value="true"/>
|
<property name="ignoreComments" value="true"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="RegexpSinglelineJava">
|
<module name="AvoidStarImport">
|
||||||
<property name="format" value="import (?!static|java\.awt).*\*"/>
|
<property name="allowStaticMemberImports" value="true"/>
|
||||||
<property name="message" value="Multiline imports are disallowed if they are not static"/>
|
</module>
|
||||||
<property name="ignoreComments" value="true"/>
|
<module name="WhitespaceAround">
|
||||||
|
<property name="allowEmptyTypes" value="true"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="WhitespaceAround"/>
|
|
||||||
<module name="WhitespaceAfter">
|
<module name="WhitespaceAfter">
|
||||||
<property name="tokens" value="COMMA"/>
|
<property name="tokens" value="COMMA"/>
|
||||||
</module>
|
</module>
|
||||||
@@ -57,6 +59,11 @@
|
|||||||
<property name="format" value="else[ \t]*[\r\n]+[ \t]*if"/>
|
<property name="format" value="else[ \t]*[\r\n]+[ \t]*if"/>
|
||||||
<property name="message" value="Newline should not be between else and if"/>
|
<property name="message" value="Newline should not be between else and if"/>
|
||||||
</module>
|
</module>
|
||||||
|
<module name="RegexpMultiline">
|
||||||
|
<property name="format" value="^[\r\n\s]+import"/>
|
||||||
|
<property name="maximum" value="1"/>
|
||||||
|
<property name="message" value="There should not be empty lines in the imports list"/>
|
||||||
|
</module>
|
||||||
<module name="SuppressionFilter">
|
<module name="SuppressionFilter">
|
||||||
<property name="file" value="${config_loc}/suppressions.xml"/>
|
<property name="file" value="${config_loc}/suppressions.xml"/>
|
||||||
</module>
|
</module>
|
||||||
|
|||||||
@@ -90,4 +90,25 @@ tasks {
|
|||||||
filter(ReplaceTokens::class, "tokens" to tokens)
|
filter(ReplaceTokens::class, "tokens" to tokens)
|
||||||
filteringCharset = "UTF-8"
|
filteringCharset = "UTF-8"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
register<JavaExec>("Downloader.main()") {
|
||||||
|
group = "gamepack"
|
||||||
|
|
||||||
|
classpath = project.sourceSets.main.get().runtimeClasspath
|
||||||
|
main = "net.runelite.gamepack.Downloader"
|
||||||
|
}
|
||||||
|
|
||||||
|
register<JavaExec>("Deob.main()") {
|
||||||
|
group = "gamepack"
|
||||||
|
|
||||||
|
classpath = project.sourceSets.main.get().runtimeClasspath
|
||||||
|
main = "net.runelite.deob.Deob"
|
||||||
|
}
|
||||||
|
|
||||||
|
register<JavaExec>("UpdateMappings.main()") {
|
||||||
|
group = "gamepack"
|
||||||
|
|
||||||
|
classpath = project.sourceSets.main.get().runtimeClasspath
|
||||||
|
main = "net.runelite.deob.updater.UpdateMappings"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ package net.runelite.asm.attributes;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import net.runelite.asm.Type;
|
import net.runelite.asm.Type;
|
||||||
import net.runelite.asm.attributes.annotation.Annotation;
|
import net.runelite.asm.attributes.annotation.Annotation;
|
||||||
import net.runelite.asm.attributes.annotation.Element;
|
import net.runelite.asm.attributes.annotation.Element;
|
||||||
|
|||||||
+1
-4
@@ -25,7 +25,4 @@
|
|||||||
|
|
||||||
package net.runelite.asm.attributes.code.instruction.types;
|
package net.runelite.asm.attributes.code.instruction.types;
|
||||||
|
|
||||||
public interface ArrayStoreInstruction extends MappableInstruction
|
public interface ArrayStoreInstruction extends MappableInstruction {}
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
+1
-4
@@ -25,7 +25,4 @@
|
|||||||
|
|
||||||
package net.runelite.asm.attributes.code.instruction.types;
|
package net.runelite.asm.attributes.code.instruction.types;
|
||||||
|
|
||||||
public interface ComparisonInstruction
|
public interface ComparisonInstruction {}
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
+1
-4
@@ -25,7 +25,4 @@
|
|||||||
|
|
||||||
package net.runelite.asm.attributes.code.instruction.types;
|
package net.runelite.asm.attributes.code.instruction.types;
|
||||||
|
|
||||||
public interface ConversionInstruction
|
public interface ConversionInstruction {}
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
+1
-3
@@ -25,6 +25,4 @@
|
|||||||
|
|
||||||
package net.runelite.asm.attributes.code.instruction.types;
|
package net.runelite.asm.attributes.code.instruction.types;
|
||||||
|
|
||||||
public interface GetFieldInstruction extends FieldInstruction
|
public interface GetFieldInstruction extends FieldInstruction {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|||||||
+1
-4
@@ -25,7 +25,4 @@
|
|||||||
|
|
||||||
package net.runelite.asm.attributes.code.instruction.types;
|
package net.runelite.asm.attributes.code.instruction.types;
|
||||||
|
|
||||||
public interface ReturnInstruction
|
public interface ReturnInstruction {}
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
+1
-3
@@ -25,6 +25,4 @@
|
|||||||
|
|
||||||
package net.runelite.asm.attributes.code.instruction.types;
|
package net.runelite.asm.attributes.code.instruction.types;
|
||||||
|
|
||||||
public interface SetFieldInstruction extends FieldInstruction, MappableInstruction
|
public interface SetFieldInstruction extends FieldInstruction, MappableInstruction {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|||||||
-1
@@ -40,7 +40,6 @@ import net.runelite.asm.execution.InstructionContext;
|
|||||||
import net.runelite.asm.execution.Stack;
|
import net.runelite.asm.execution.Stack;
|
||||||
import net.runelite.asm.execution.StackContext;
|
import net.runelite.asm.execution.StackContext;
|
||||||
import static net.runelite.asm.execution.StaticStep.stepInto;
|
import static net.runelite.asm.execution.StaticStep.stepInto;
|
||||||
|
|
||||||
import net.runelite.asm.execution.Value;
|
import net.runelite.asm.execution.Value;
|
||||||
import net.runelite.asm.pool.Method;
|
import net.runelite.asm.pool.Method;
|
||||||
import net.runelite.asm.signature.Signature;
|
import net.runelite.asm.signature.Signature;
|
||||||
|
|||||||
@@ -25,11 +25,10 @@
|
|||||||
|
|
||||||
package net.runelite.asm.execution;
|
package net.runelite.asm.execution;
|
||||||
|
|
||||||
import net.runelite.asm.Type;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import net.runelite.asm.Method;
|
import net.runelite.asm.Method;
|
||||||
|
import net.runelite.asm.Type;
|
||||||
|
|
||||||
public class Stack
|
public class Stack
|
||||||
{
|
{
|
||||||
@@ -40,13 +39,13 @@ public class Stack
|
|||||||
{
|
{
|
||||||
stack = new StackContext[sz * 2]; // XXX FIXME
|
stack = new StackContext[sz * 2]; // XXX FIXME
|
||||||
}
|
}
|
||||||
|
|
||||||
public Stack(Stack other)
|
public Stack(Stack other)
|
||||||
{
|
{
|
||||||
this.size = other.size;
|
this.size = other.size;
|
||||||
this.stack = other.stack.clone();
|
this.stack = other.stack.clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void printStack(StackContext ctx, int level)
|
private void printStack(StackContext ctx, int level)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < level; ++i)
|
for (int i = 0; i < level; ++i)
|
||||||
@@ -66,7 +65,7 @@ public class Stack
|
|||||||
printStack(stack[c], 0);
|
printStack(stack[c], 0);
|
||||||
throw new RuntimeException("Stack overflow");
|
throw new RuntimeException("Stack overflow");
|
||||||
}
|
}
|
||||||
|
|
||||||
assert !i.getType().equals(Type.VOID);
|
assert !i.getType().equals(Type.VOID);
|
||||||
|
|
||||||
stack[size] = i;
|
stack[size] = i;
|
||||||
@@ -80,12 +79,12 @@ public class Stack
|
|||||||
|
|
||||||
return stack[--size];
|
return stack[--size];
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getSize()
|
public int getSize()
|
||||||
{
|
{
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<StackContext> getStack()
|
public List<StackContext> getStack()
|
||||||
{
|
{
|
||||||
return Arrays.asList(stack);
|
return Arrays.asList(stack);
|
||||||
|
|||||||
@@ -25,10 +25,9 @@
|
|||||||
|
|
||||||
package net.runelite.asm.execution;
|
package net.runelite.asm.execution;
|
||||||
|
|
||||||
import net.runelite.asm.Type;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import net.runelite.asm.Type;
|
||||||
|
|
||||||
public class VariableContext
|
public class VariableContext
|
||||||
{
|
{
|
||||||
@@ -46,13 +45,13 @@ public class VariableContext
|
|||||||
type = ctx.getType();
|
type = ctx.getType();
|
||||||
value = ctx.getValue();
|
value = ctx.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
public VariableContext(Type type) // for entrypoints
|
public VariableContext(Type type) // for entrypoints
|
||||||
{
|
{
|
||||||
this.type = type;
|
this.type = type;
|
||||||
value = Value.UNKNOWN;
|
value = Value.UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
public VariableContext(InstructionContext i, VariableContext other)
|
public VariableContext(InstructionContext i, VariableContext other)
|
||||||
{
|
{
|
||||||
ic = i;
|
ic = i;
|
||||||
@@ -60,24 +59,24 @@ public class VariableContext
|
|||||||
type = other.type;
|
type = other.type;
|
||||||
value = other.value;
|
value = other.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public VariableContext(InstructionContext i, Type type, Value value)
|
public VariableContext(InstructionContext i, Type type, Value value)
|
||||||
{
|
{
|
||||||
ic = i;
|
ic = i;
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public StackContext getStackContext()
|
public StackContext getStackContext()
|
||||||
{
|
{
|
||||||
return ctx;
|
return ctx;
|
||||||
}
|
}
|
||||||
|
|
||||||
public InstructionContext getInstructionWhichStored()
|
public InstructionContext getInstructionWhichStored()
|
||||||
{
|
{
|
||||||
return ic;
|
return ic;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Type getType()
|
public Type getType()
|
||||||
{
|
{
|
||||||
return type;
|
return type;
|
||||||
@@ -87,7 +86,7 @@ public class VariableContext
|
|||||||
{
|
{
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addRead(InstructionContext ctx)
|
public void addRead(InstructionContext ctx)
|
||||||
{
|
{
|
||||||
if (!read.contains(ctx))
|
if (!read.contains(ctx))
|
||||||
@@ -103,7 +102,7 @@ public class VariableContext
|
|||||||
{
|
{
|
||||||
return isParameter;
|
return isParameter;
|
||||||
}
|
}
|
||||||
|
|
||||||
public VariableContext markParameter()
|
public VariableContext markParameter()
|
||||||
{
|
{
|
||||||
isParameter = true;
|
isParameter = true;
|
||||||
|
|||||||
@@ -25,9 +25,8 @@
|
|||||||
|
|
||||||
package net.runelite.asm.pool;
|
package net.runelite.asm.pool;
|
||||||
|
|
||||||
import net.runelite.asm.Type;
|
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import net.runelite.asm.Type;
|
||||||
|
|
||||||
public class Field
|
public class Field
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -24,8 +24,6 @@
|
|||||||
*/
|
*/
|
||||||
package net.runelite.asm.signature;
|
package net.runelite.asm.signature;
|
||||||
|
|
||||||
import net.runelite.asm.Type;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@@ -33,6 +31,7 @@ import java.util.List;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
import net.runelite.asm.Type;
|
||||||
|
|
||||||
public class Signature
|
public class Signature
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
*/
|
*/
|
||||||
package net.runelite.deob;
|
package net.runelite.deob;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import net.runelite.asm.ClassFile;
|
import net.runelite.asm.ClassFile;
|
||||||
import net.runelite.asm.Field;
|
import net.runelite.asm.Field;
|
||||||
import net.runelite.asm.Method;
|
import net.runelite.asm.Method;
|
||||||
@@ -33,8 +34,6 @@ import net.runelite.asm.attributes.annotation.Annotation;
|
|||||||
import net.runelite.asm.attributes.annotation.Element;
|
import net.runelite.asm.attributes.annotation.Element;
|
||||||
import net.runelite.asm.signature.Signature;
|
import net.runelite.asm.signature.Signature;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class DeobAnnotations
|
public class DeobAnnotations
|
||||||
{
|
{
|
||||||
public static final Type OBFUSCATED_NAME = new Type("Lnet/runelite/mapping/ObfuscatedName;");
|
public static final Type OBFUSCATED_NAME = new Type("Lnet/runelite/mapping/ObfuscatedName;");
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
package net.runelite.deob.deobfuscators;
|
package net.runelite.deob.deobfuscators;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import net.runelite.asm.ClassFile;
|
import net.runelite.asm.ClassFile;
|
||||||
import net.runelite.asm.ClassGroup;
|
import net.runelite.asm.ClassGroup;
|
||||||
import net.runelite.asm.Field;
|
import net.runelite.asm.Field;
|
||||||
@@ -35,31 +36,29 @@ import net.runelite.deob.DeobAnnotations;
|
|||||||
import net.runelite.deob.Deobfuscator;
|
import net.runelite.deob.Deobfuscator;
|
||||||
import net.runelite.deob.util.NameMappings;
|
import net.runelite.deob.util.NameMappings;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class RenameUnique implements Deobfuscator
|
public class RenameUnique implements Deobfuscator
|
||||||
{
|
{
|
||||||
private Renamer renamer;
|
private Renamer renamer;
|
||||||
|
|
||||||
private void generateClassNames(NameMappings map, ClassGroup group)
|
private void generateClassNames(NameMappings map, ClassGroup group)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
for (ClassFile cf : group.getClasses())
|
for (ClassFile cf : group.getClasses())
|
||||||
{
|
{
|
||||||
if (cf.getName().length() > Deob.OBFUSCATED_NAME_MAX_LEN)
|
if (cf.getName().length() > Deob.OBFUSCATED_NAME_MAX_LEN)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
map.map(cf.getPoolClass(), "class" + i++);
|
map.map(cf.getPoolClass(), "class" + i++);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void generateFieldNames(NameMappings map, ClassGroup group)
|
private void generateFieldNames(NameMappings map, ClassGroup group)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
for (ClassFile cf : group.getClasses())
|
for (ClassFile cf : group.getClasses())
|
||||||
for (Field field : cf.getFields())
|
for (Field field : cf.getFields())
|
||||||
{
|
{
|
||||||
@@ -67,7 +66,7 @@ public class RenameUnique implements Deobfuscator
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
map.map(field.getPoolField(), "field" + i++);
|
map.map(field.getPoolField(), "field" + i++);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -75,7 +74,7 @@ public class RenameUnique implements Deobfuscator
|
|||||||
private void generateMethodNames(NameMappings map, ClassGroup group)
|
private void generateMethodNames(NameMappings map, ClassGroup group)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
for (ClassFile cf : group.getClasses())
|
for (ClassFile cf : group.getClasses())
|
||||||
for (Method method : cf.getMethods())
|
for (Method method : cf.getMethods())
|
||||||
{
|
{
|
||||||
@@ -83,16 +82,16 @@ public class RenameUnique implements Deobfuscator
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Method> virtualMethods = VirtualMethods.getVirtualMethods(method);
|
List<Method> virtualMethods = VirtualMethods.getVirtualMethods(method);
|
||||||
assert !virtualMethods.isEmpty();
|
assert !virtualMethods.isEmpty();
|
||||||
|
|
||||||
String name;
|
String name;
|
||||||
if (virtualMethods.size() == 1)
|
if (virtualMethods.size() == 1)
|
||||||
name = "method" + i++;
|
name = "method" + i++;
|
||||||
else
|
else
|
||||||
name = "vmethod" + i++;
|
name = "vmethod" + i++;
|
||||||
|
|
||||||
for (Method m : virtualMethods)
|
for (Method m : virtualMethods)
|
||||||
map.map(m.getPoolMethod(), name);
|
map.map(m.getPoolMethod(), name);
|
||||||
}
|
}
|
||||||
@@ -103,13 +102,13 @@ public class RenameUnique implements Deobfuscator
|
|||||||
{
|
{
|
||||||
group.buildClassGraph();
|
group.buildClassGraph();
|
||||||
group.lookup();
|
group.lookup();
|
||||||
|
|
||||||
NameMappings mappings = new NameMappings();
|
NameMappings mappings = new NameMappings();
|
||||||
|
|
||||||
this.generateClassNames(mappings, group);
|
this.generateClassNames(mappings, group);
|
||||||
this.generateFieldNames(mappings, group);
|
this.generateFieldNames(mappings, group);
|
||||||
this.generateMethodNames(mappings, group);
|
this.generateMethodNames(mappings, group);
|
||||||
|
|
||||||
renamer = new Renamer(mappings);
|
renamer = new Renamer(mappings);
|
||||||
renamer.run(group);
|
renamer.run(group);
|
||||||
}
|
}
|
||||||
|
|||||||
-1
@@ -25,7 +25,6 @@
|
|||||||
package net.runelite.deob.deobfuscators.packethandler;
|
package net.runelite.deob.deobfuscators.packethandler;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
import net.runelite.asm.Type;
|
import net.runelite.asm.Type;
|
||||||
import net.runelite.asm.attributes.code.Instruction;
|
import net.runelite.asm.attributes.code.Instruction;
|
||||||
import net.runelite.asm.execution.InstructionContext;
|
import net.runelite.asm.execution.InstructionContext;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package net.runelite.gamepack;
|
package net.runelite.gamepack;
|
||||||
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
@@ -58,4 +57,9 @@ public class Downloader
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args)
|
||||||
|
{
|
||||||
|
gamepack();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
+1
-4
@@ -24,7 +24,4 @@
|
|||||||
*/
|
*/
|
||||||
package net.runelite.deob.deobfuscators.unusedclass;
|
package net.runelite.deob.deobfuscators.unusedclass;
|
||||||
|
|
||||||
public class EmptyClass
|
public class EmptyClass {}
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
+1
-4
@@ -24,7 +24,4 @@
|
|||||||
*/
|
*/
|
||||||
package net.runelite.deob.deobfuscators.unusedclass;
|
package net.runelite.deob.deobfuscators.unusedclass;
|
||||||
|
|
||||||
public interface EmptyInterface
|
public interface EmptyInterface {}
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -70,9 +70,7 @@ public class HookImporter
|
|||||||
Assert.assertNotNull(is);
|
Assert.assertNotNull(is);
|
||||||
|
|
||||||
Gson gson = new Gson();
|
Gson gson = new Gson();
|
||||||
java.lang.reflect.Type type = new TypeToken<Map<String, ClassHook>>()
|
java.lang.reflect.Type type = new TypeToken<Map<String, ClassHook>>() {}.getType();
|
||||||
{
|
|
||||||
}.getType();
|
|
||||||
hooks = gson.fromJson(new InputStreamReader(is), type);
|
hooks = gson.fromJson(new InputStreamReader(is), type);
|
||||||
|
|
||||||
group = JarUtil.loadJar(IN);
|
group = JarUtil.loadJar(IN);
|
||||||
|
|||||||
@@ -81,9 +81,7 @@ public class HookImporter
|
|||||||
|
|
||||||
InputStream is = getClass().getResourceAsStream("hooks.json");
|
InputStream is = getClass().getResourceAsStream("hooks.json");
|
||||||
Gson gson = new Gson();
|
Gson gson = new Gson();
|
||||||
java.lang.reflect.Type type = new TypeToken<List<HookClass>>()
|
java.lang.reflect.Type type = new TypeToken<List<HookClass>>() {}.getType();
|
||||||
{
|
|
||||||
}.getType();
|
|
||||||
hooks = gson.fromJson(new InputStreamReader(is), type);
|
hooks = gson.fromJson(new InputStreamReader(is), type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-all.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|||||||
@@ -115,9 +115,7 @@ public class AnimationClient
|
|||||||
{
|
{
|
||||||
InputStream in = response.body().byteStream();
|
InputStream in = response.body().byteStream();
|
||||||
// CHECKSTYLE:OFF
|
// CHECKSTYLE:OFF
|
||||||
return RuneLiteAPI.GSON.fromJson(new InputStreamReader(in), new TypeToken<List<AnimationKey>>()
|
return RuneLiteAPI.GSON.fromJson(new InputStreamReader(in), new TypeToken<List<AnimationKey>>() {}.getType());
|
||||||
{
|
|
||||||
}.getType());
|
|
||||||
// CHECKSTYLE:ON
|
// CHECKSTYLE:ON
|
||||||
}
|
}
|
||||||
catch (JsonParseException ex)
|
catch (JsonParseException ex)
|
||||||
|
|||||||
@@ -35,8 +35,7 @@ public enum HiscoreEndpoint
|
|||||||
HARDCORE_IRONMAN("Hardcore Ironman", "https://services.runescape.com/m=hiscore_oldschool_hardcore_ironman/index_lite.ws"),
|
HARDCORE_IRONMAN("Hardcore Ironman", "https://services.runescape.com/m=hiscore_oldschool_hardcore_ironman/index_lite.ws"),
|
||||||
ULTIMATE_IRONMAN("Ultimate Ironman", "https://services.runescape.com/m=hiscore_oldschool_ultimate/index_lite.ws"),
|
ULTIMATE_IRONMAN("Ultimate Ironman", "https://services.runescape.com/m=hiscore_oldschool_ultimate/index_lite.ws"),
|
||||||
DEADMAN("Deadman", "https://services.runescape.com/m=hiscore_oldschool_deadman/index_lite.ws"),
|
DEADMAN("Deadman", "https://services.runescape.com/m=hiscore_oldschool_deadman/index_lite.ws"),
|
||||||
SEASONAL_DEADMAN("Seasonal Deadman", "https://services.runescape.com/m=hiscore_oldschool_seasonal/index_lite.ws"),
|
LEAGUE("Twisted League", "https://services.runescape.com/m=hiscore_oldschool_seasonal/index_lite.ws");
|
||||||
DEADMAN_TOURNAMENT("Deadman Tournament", "https://services.runescape.com/m=hiscore_oldschool_tournament/index_lite.ws");
|
|
||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
private final HttpUrl hiscoreURL;
|
private final HttpUrl hiscoreURL;
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ public class HiscoreResult
|
|||||||
private Skill runecraft;
|
private Skill runecraft;
|
||||||
private Skill hunter;
|
private Skill hunter;
|
||||||
private Skill construction;
|
private Skill construction;
|
||||||
|
private Skill leaguePoints;
|
||||||
private Skill bountyHunterHunter;
|
private Skill bountyHunterHunter;
|
||||||
private Skill bountyHunterRogue;
|
private Skill bountyHunterRogue;
|
||||||
private Skill clueScrollAll;
|
private Skill clueScrollAll;
|
||||||
@@ -115,6 +116,8 @@ public class HiscoreResult
|
|||||||
return getHunter();
|
return getHunter();
|
||||||
case CONSTRUCTION:
|
case CONSTRUCTION:
|
||||||
return getConstruction();
|
return getConstruction();
|
||||||
|
case LEAGUE_POINTS:
|
||||||
|
return getLeaguePoints();
|
||||||
case OVERALL:
|
case OVERALL:
|
||||||
return getOverall();
|
return getOverall();
|
||||||
case BOUNTY_HUNTER_HUNTER:
|
case BOUNTY_HUNTER_HUNTER:
|
||||||
|
|||||||
@@ -26,8 +26,6 @@ package net.runelite.http.api.hiscore;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import net.runelite.http.api.hiscore.HiscoreResult;
|
|
||||||
import net.runelite.http.api.hiscore.Skill;
|
|
||||||
|
|
||||||
public class HiscoreResultBuilder
|
public class HiscoreResultBuilder
|
||||||
{
|
{
|
||||||
@@ -77,9 +75,9 @@ public class HiscoreResultBuilder
|
|||||||
hiscoreResult.setRunecraft(skills.get(21));
|
hiscoreResult.setRunecraft(skills.get(21));
|
||||||
hiscoreResult.setHunter(skills.get(22));
|
hiscoreResult.setHunter(skills.get(22));
|
||||||
hiscoreResult.setConstruction(skills.get(23));
|
hiscoreResult.setConstruction(skills.get(23));
|
||||||
hiscoreResult.setBountyHunterHunter(skills.get(24));
|
hiscoreResult.setLeaguePoints(skills.get(24));
|
||||||
hiscoreResult.setBountyHunterRogue(skills.get(25));
|
hiscoreResult.setBountyHunterHunter(skills.get(25));
|
||||||
hiscoreResult.setLastManStanding(skills.get(26));
|
hiscoreResult.setBountyHunterRogue(skills.get(26));
|
||||||
hiscoreResult.setClueScrollAll(skills.get(27));
|
hiscoreResult.setClueScrollAll(skills.get(27));
|
||||||
hiscoreResult.setClueScrollBeginner(skills.get(28));
|
hiscoreResult.setClueScrollBeginner(skills.get(28));
|
||||||
hiscoreResult.setClueScrollEasy(skills.get(29));
|
hiscoreResult.setClueScrollEasy(skills.get(29));
|
||||||
@@ -87,6 +85,7 @@ public class HiscoreResultBuilder
|
|||||||
hiscoreResult.setClueScrollHard(skills.get(31));
|
hiscoreResult.setClueScrollHard(skills.get(31));
|
||||||
hiscoreResult.setClueScrollElite(skills.get(32));
|
hiscoreResult.setClueScrollElite(skills.get(32));
|
||||||
hiscoreResult.setClueScrollMaster(skills.get(33));
|
hiscoreResult.setClueScrollMaster(skills.get(33));
|
||||||
|
hiscoreResult.setLastManStanding(skills.get(34));
|
||||||
return hiscoreResult;
|
return hiscoreResult;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,16 +50,17 @@ public enum HiscoreSkill
|
|||||||
RUNECRAFT("Runecraft"),
|
RUNECRAFT("Runecraft"),
|
||||||
HUNTER("Hunter"),
|
HUNTER("Hunter"),
|
||||||
CONSTRUCTION("Construction"),
|
CONSTRUCTION("Construction"),
|
||||||
|
LEAGUE_POINTS("League Points"),
|
||||||
BOUNTY_HUNTER_HUNTER("Bounty Hunter - Hunter"),
|
BOUNTY_HUNTER_HUNTER("Bounty Hunter - Hunter"),
|
||||||
BOUNTY_HUNTER_ROGUE("Bounty Hunter - Rogue"),
|
BOUNTY_HUNTER_ROGUE("Bounty Hunter - Rogue"),
|
||||||
LAST_MAN_STANDING("Last Man Standing"),
|
|
||||||
CLUE_SCROLL_ALL("Clue Scrolls (all)"),
|
CLUE_SCROLL_ALL("Clue Scrolls (all)"),
|
||||||
CLUE_SCROLL_BEGINNER("Clue Scrolls (beginner)"),
|
CLUE_SCROLL_BEGINNER("Clue Scrolls (beginner)"),
|
||||||
CLUE_SCROLL_EASY("Clue Scrolls (easy)"),
|
CLUE_SCROLL_EASY("Clue Scrolls (easy)"),
|
||||||
CLUE_SCROLL_MEDIUM("Clue Scrolls (medium)"),
|
CLUE_SCROLL_MEDIUM("Clue Scrolls (medium)"),
|
||||||
CLUE_SCROLL_HARD("Clue Scrolls (hard)"),
|
CLUE_SCROLL_HARD("Clue Scrolls (hard)"),
|
||||||
CLUE_SCROLL_ELITE("Clue Scrolls (elite)"),
|
CLUE_SCROLL_ELITE("Clue Scrolls (elite)"),
|
||||||
CLUE_SCROLL_MASTER("Clue Scrolls (master)");
|
CLUE_SCROLL_MASTER("Clue Scrolls (master)"),
|
||||||
|
LAST_MAN_STANDING("Last Man Standing");
|
||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
|
|
||||||
|
|||||||
@@ -102,9 +102,7 @@ public class LootTrackerClient
|
|||||||
}
|
}
|
||||||
|
|
||||||
InputStream in = response.body().byteStream();
|
InputStream in = response.body().byteStream();
|
||||||
return RuneLiteAPI.GSON.fromJson(new InputStreamReader(in), new TypeToken<List<LootRecord>>()
|
return RuneLiteAPI.GSON.fromJson(new InputStreamReader(in), new TypeToken<List<LootRecord>>() {}.getType());
|
||||||
{
|
|
||||||
}.getType());
|
|
||||||
}
|
}
|
||||||
catch (JsonParseException ex)
|
catch (JsonParseException ex)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
package net.runelite.http.api.worlds;
|
package net.runelite.http.api.worlds;
|
||||||
|
|
||||||
import com.google.gson.JsonParseException;
|
import com.google.gson.JsonParseException;
|
||||||
import io.reactivex.Observable;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
@@ -50,7 +50,7 @@ public class WorldClient
|
|||||||
this.client = client;
|
this.client = client;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Observable<WorldResult> lookupWorlds()
|
public WorldResult lookupWorlds() throws IOException
|
||||||
{
|
{
|
||||||
HttpUrl url = RuneLiteAPI.getApiBase().newBuilder()
|
HttpUrl url = RuneLiteAPI.getApiBase().newBuilder()
|
||||||
.addPathSegment("worlds.js")
|
.addPathSegment("worlds.js")
|
||||||
@@ -58,27 +58,24 @@ public class WorldClient
|
|||||||
|
|
||||||
logger.debug("Built URI: {}", url);
|
logger.debug("Built URI: {}", url);
|
||||||
|
|
||||||
return Observable.defer(() ->
|
Request request = new Request.Builder()
|
||||||
|
.url(url)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
try (Response response = client.newCall(request).execute())
|
||||||
{
|
{
|
||||||
Request request = new Request.Builder()
|
if (!response.isSuccessful())
|
||||||
.url(url)
|
|
||||||
.build();
|
|
||||||
|
|
||||||
try (Response response = client.newCall(request).execute())
|
|
||||||
{
|
{
|
||||||
if (!response.isSuccessful())
|
logger.debug("Error looking up worlds: {}", response);
|
||||||
{
|
throw new IOException("unsuccessful response looking up worlds");
|
||||||
logger.debug("Error looking up worlds: {}", response);
|
}
|
||||||
return Observable.just(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
InputStream in = response.body().byteStream();
|
InputStream in = response.body().byteStream();
|
||||||
return Observable.just(RuneLiteAPI.GSON.fromJson(new InputStreamReader(in), WorldResult.class));
|
return RuneLiteAPI.GSON.fromJson(new InputStreamReader(in), WorldResult.class);
|
||||||
}
|
}
|
||||||
catch (JsonParseException ex)
|
catch (JsonParseException ex)
|
||||||
{
|
{
|
||||||
return Observable.error(ex);
|
throw new IOException(ex);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -34,6 +34,5 @@ public enum WorldType
|
|||||||
LAST_MAN_STANDING,
|
LAST_MAN_STANDING,
|
||||||
TOURNAMENT,
|
TOURNAMENT,
|
||||||
DEADMAN,
|
DEADMAN,
|
||||||
SEASONAL_DEADMAN,
|
LEAGUE;
|
||||||
DEADMAN_TOURNAMENT
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,10 +16,6 @@
|
|||||||
|
|
||||||
package net.runelite.http.api.ws;
|
package net.runelite.http.api.ws;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.JsonElement;
|
import com.google.gson.JsonElement;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
@@ -31,6 +27,9 @@ import com.google.gson.internal.Streams;
|
|||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
import com.google.gson.stream.JsonReader;
|
import com.google.gson.stream.JsonReader;
|
||||||
import com.google.gson.stream.JsonWriter;
|
import com.google.gson.stream.JsonWriter;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adapts values whose runtime type may differ from their declaration type. This
|
* Adapts values whose runtime type may differ from their declaration type. This
|
||||||
|
|||||||
@@ -27,6 +27,4 @@ package net.runelite.http.api.ws.messages.party;
|
|||||||
import net.runelite.api.events.Event;
|
import net.runelite.api.events.Event;
|
||||||
import net.runelite.http.api.ws.WebsocketMessage;
|
import net.runelite.http.api.ws.WebsocketMessage;
|
||||||
|
|
||||||
public class Part extends WebsocketMessage implements Event
|
public class Part extends WebsocketMessage implements Event {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -30,6 +30,4 @@ import net.runelite.api.events.Event;
|
|||||||
|
|
||||||
@Value
|
@Value
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class UserSync extends PartyMemberMessage implements Event
|
public class UserSync extends PartyMemberMessage implements Event {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -101,9 +101,7 @@ public class XteaClient
|
|||||||
{
|
{
|
||||||
InputStream in = response.body().byteStream();
|
InputStream in = response.body().byteStream();
|
||||||
// CHECKSTYLE:OFF
|
// CHECKSTYLE:OFF
|
||||||
return RuneLiteAPI.GSON.fromJson(new InputStreamReader(in), new TypeToken<List<XteaKey>>()
|
return RuneLiteAPI.GSON.fromJson(new InputStreamReader(in), new TypeToken<List<XteaKey>>() {}.getType());
|
||||||
{
|
|
||||||
}.getType());
|
|
||||||
// CHECKSTYLE:ON
|
// CHECKSTYLE:ON
|
||||||
}
|
}
|
||||||
catch (JsonParseException ex)
|
catch (JsonParseException ex)
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ public class ChatController
|
|||||||
{
|
{
|
||||||
private static final Pattern STRING_VALIDATION = Pattern.compile("[^a-zA-Z0-9' -]");
|
private static final Pattern STRING_VALIDATION = Pattern.compile("[^a-zA-Z0-9' -]");
|
||||||
private static final int STRING_MAX_LENGTH = 50;
|
private static final int STRING_MAX_LENGTH = 50;
|
||||||
|
private static final int MAX_LAYOUT_ROOMS = 16;
|
||||||
|
|
||||||
private final Cache<KillCountKey, Integer> killCountCache = CacheBuilder.newBuilder()
|
private final Cache<KillCountKey, Integer> killCountCache = CacheBuilder.newBuilder()
|
||||||
.expireAfterWrite(2, TimeUnit.MINUTES)
|
.expireAfterWrite(2, TimeUnit.MINUTES)
|
||||||
@@ -214,6 +215,11 @@ public class ChatController
|
|||||||
@PostMapping("/layout")
|
@PostMapping("/layout")
|
||||||
public void submitLayout(@RequestParam String name, @RequestBody LayoutRoom[] rooms)
|
public void submitLayout(@RequestParam String name, @RequestBody LayoutRoom[] rooms)
|
||||||
{
|
{
|
||||||
|
if (rooms.length > MAX_LAYOUT_ROOMS)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
chatService.setLayout(name, rooms);
|
chatService.setLayout(name, rooms);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-3
@@ -110,9 +110,7 @@ public class TwitterService
|
|||||||
}
|
}
|
||||||
|
|
||||||
InputStream in = response.body().byteStream();
|
InputStream in = response.body().byteStream();
|
||||||
Type listType = new TypeToken<List<TwitterStatusesResponseItem>>()
|
Type listType = new TypeToken<List<TwitterStatusesResponseItem>>() {}.getType();
|
||||||
{
|
|
||||||
}.getType();
|
|
||||||
List<TwitterStatusesResponseItem> statusesResponse = RuneLiteAPI.GSON
|
List<TwitterStatusesResponseItem> statusesResponse = RuneLiteAPI.GSON
|
||||||
.fromJson(new InputStreamReader(in), listType);
|
.fromJson(new InputStreamReader(in), listType);
|
||||||
|
|
||||||
|
|||||||
@@ -58,9 +58,7 @@ public class OsbuddyClient
|
|||||||
throw new IOException("Error retrieving summary from OSBuddy: " + responseOk.message());
|
throw new IOException("Error retrieving summary from OSBuddy: " + responseOk.message());
|
||||||
}
|
}
|
||||||
|
|
||||||
Type type = new TypeToken<Map<Integer, OsbuddySummaryItem>>()
|
Type type = new TypeToken<Map<Integer, OsbuddySummaryItem>>() {}.getType();
|
||||||
{
|
|
||||||
}.getType();
|
|
||||||
|
|
||||||
return RuneLiteAPI.GSON.fromJson(responseOk.body().string(), type);
|
return RuneLiteAPI.GSON.fromJson(responseOk.body().string(), type);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-2
@@ -26,9 +26,8 @@
|
|||||||
|
|
||||||
package net.runelite.http.service.util;
|
package net.runelite.http.service.util;
|
||||||
|
|
||||||
import net.runelite.http.api.hiscore.HiscoreEndpoint;
|
|
||||||
|
|
||||||
import java.beans.PropertyEditorSupport;
|
import java.beans.PropertyEditorSupport;
|
||||||
|
import net.runelite.http.api.hiscore.HiscoreEndpoint;
|
||||||
|
|
||||||
public class HiscoreEndpointEditor extends PropertyEditorSupport
|
public class HiscoreEndpointEditor extends PropertyEditorSupport
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-4
@@ -29,7 +29,4 @@ import org.springframework.http.HttpStatus;
|
|||||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||||
|
|
||||||
@ResponseStatus(code = HttpStatus.NOT_FOUND, reason = "Not found")
|
@ResponseStatus(code = HttpStatus.NOT_FOUND, reason = "Not found")
|
||||||
public class NotFoundException extends RuntimeException
|
public class NotFoundException extends RuntimeException {}
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -35,9 +35,8 @@ enum ServiceWorldType
|
|||||||
HIGH_RISK(WorldType.HIGH_RISK, 1 << 10),
|
HIGH_RISK(WorldType.HIGH_RISK, 1 << 10),
|
||||||
LAST_MAN_STANDING(WorldType.LAST_MAN_STANDING, 1 << 14),
|
LAST_MAN_STANDING(WorldType.LAST_MAN_STANDING, 1 << 14),
|
||||||
TOURNAMENT(WorldType.TOURNAMENT, 1 << 25),
|
TOURNAMENT(WorldType.TOURNAMENT, 1 << 25),
|
||||||
DEADMAN_TOURNAMENT(WorldType.DEADMAN_TOURNAMENT, 1 << 26),
|
|
||||||
DEADMAN(WorldType.DEADMAN, 1 << 29),
|
DEADMAN(WorldType.DEADMAN, 1 << 29),
|
||||||
SEASONAL_DEADMAN(WorldType.SEASONAL_DEADMAN, 1 << 30);
|
LEAGUE(WorldType.LEAGUE, 1 << 30);
|
||||||
|
|
||||||
private final WorldType apiType;
|
private final WorldType apiType;
|
||||||
private final int mask;
|
private final int mask;
|
||||||
|
|||||||
+4
-2
@@ -60,16 +60,17 @@ public class HiscoreServiceTest
|
|||||||
+ "638177,1,0\n"
|
+ "638177,1,0\n"
|
||||||
+ "516239,9,1000\n"
|
+ "516239,9,1000\n"
|
||||||
+ "492790,1,0\n"
|
+ "492790,1,0\n"
|
||||||
|
+ "2,2460\n" // leagues
|
||||||
+ "-1,-1\n"
|
+ "-1,-1\n"
|
||||||
+ "73,1738\n"
|
+ "73,1738\n"
|
||||||
+ "-1,-1\n"
|
|
||||||
+ "531,1432\n"
|
+ "531,1432\n"
|
||||||
+ "324,212\n"
|
+ "324,212\n"
|
||||||
+ "8008,131\n"
|
+ "8008,131\n"
|
||||||
+ "1337,911\n"
|
+ "1337,911\n"
|
||||||
+ "42,14113\n"
|
+ "42,14113\n"
|
||||||
+ "1,777\n"
|
+ "1,777\n"
|
||||||
+ "254,92\n";
|
+ "254,92\n"
|
||||||
|
+ "-1,-1\n"; // lms
|
||||||
|
|
||||||
private final MockWebServer server = new MockWebServer();
|
private final MockWebServer server = new MockWebServer();
|
||||||
|
|
||||||
@@ -105,6 +106,7 @@ public class HiscoreServiceTest
|
|||||||
Assert.assertEquals(777, result.getClueScrollElite().getLevel());
|
Assert.assertEquals(777, result.getClueScrollElite().getLevel());
|
||||||
Assert.assertEquals(254, result.getClueScrollMaster().getRank());
|
Assert.assertEquals(254, result.getClueScrollMaster().getRank());
|
||||||
Assert.assertEquals(-1, result.getLastManStanding().getLevel());
|
Assert.assertEquals(-1, result.getLastManStanding().getLevel());
|
||||||
|
Assert.assertEquals(2460, result.getLeaguePoints().getLevel());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,34 +32,46 @@ plugins {
|
|||||||
id("com.openosrs.injector")
|
id("com.openosrs.injector")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val vanillaDep by configurations.creating
|
||||||
|
val rsapiDep by configurations.creating
|
||||||
|
val rsclientDep by configurations.creating
|
||||||
|
val mixinsDep by configurations.creating
|
||||||
|
val combined by configurations.creating {
|
||||||
|
extendsFrom(rsapiDep, rsclientDep, mixinsDep, vanillaDep)
|
||||||
|
isCanBeResolved = true
|
||||||
|
isCanBeConsumed = false
|
||||||
|
}
|
||||||
|
|
||||||
configurations {
|
configurations {
|
||||||
create("vanilla")
|
all {
|
||||||
create("injected-client")
|
isTransitive = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
"vanilla"(Libraries.vanilla)
|
vanillaDep(Libraries.vanilla)
|
||||||
|
rsapiDep(project(":runescape-api"))
|
||||||
|
rsclientDep(project(":runescape-client"))
|
||||||
|
mixinsDep(project(":runelite-mixins"))
|
||||||
}
|
}
|
||||||
|
|
||||||
injector {
|
injector {
|
||||||
mixins.set(tasks.getByPath(":runelite-mixins:jar").outputs.files.singleFile)
|
mixins.set(mixinsDep.singleFile)
|
||||||
rsapi.set(tasks.getByPath(":runescape-api:jar").outputs.files.singleFile)
|
rsapi.set(rsapiDep.singleFile)
|
||||||
rsclient.set(tasks.getByPath(":runescape-client:jar").outputs.files.singleFile)
|
rsclient.set(rsclientDep.singleFile)
|
||||||
vanilla.set(project.file(configurations["vanilla"].asPath))
|
vanilla.set(vanillaDep.singleFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
artifacts {
|
sourceSets {
|
||||||
add("runtimeOnly", tasks.inject.get().output) {
|
main {
|
||||||
builtBy(tasks.inject)
|
output.dir(tasks.inject.get().output.get().asFile.parentFile, "builtBy" to tasks.inject)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// keep the sourcesets etc but remove useless tasks
|
// keep the sourcesets etc but remove useless tasks
|
||||||
tasks {
|
tasks {
|
||||||
build {
|
inject {
|
||||||
dependsOn(":runelite-mixins:build")
|
dependsOn(configurations["combined"])
|
||||||
dependsOn(":runescape-api:build")
|
|
||||||
dependsOn(":runescape-client:build")
|
|
||||||
}
|
}
|
||||||
classes {
|
classes {
|
||||||
enabled = false
|
enabled = false
|
||||||
@@ -73,4 +85,4 @@ tasks {
|
|||||||
processResources {
|
processResources {
|
||||||
enabled = false
|
enabled = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,4 @@
|
|||||||
*/
|
*/
|
||||||
package net.runelite.protocol.api.handshake;
|
package net.runelite.protocol.api.handshake;
|
||||||
|
|
||||||
public abstract class HandshakePacket
|
public abstract class HandshakePacket {}
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
+1
-4
@@ -29,7 +29,4 @@ import lombok.EqualsAndHashCode;
|
|||||||
|
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class LoginHandshakePacket extends HandshakePacket
|
public class LoginHandshakePacket extends HandshakePacket {}
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -148,6 +148,10 @@ public enum ChatMessageType
|
|||||||
* A message that times out after 10 seconds.
|
* A message that times out after 10 seconds.
|
||||||
*/
|
*/
|
||||||
TENSECTIMEOUT(107),
|
TENSECTIMEOUT(107),
|
||||||
|
/**
|
||||||
|
* The "Welcome to RuneScape" message
|
||||||
|
*/
|
||||||
|
WELCOME(108),
|
||||||
/**
|
/**
|
||||||
* An unknown message type.
|
* An unknown message type.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -341,11 +341,12 @@ public interface Client extends GameShell
|
|||||||
* Gets the logged in player instance.
|
* Gets the logged in player instance.
|
||||||
*
|
*
|
||||||
* @return the logged in player
|
* @return the logged in player
|
||||||
*
|
* <p>
|
||||||
* (getLocalPlayerIndex returns the local index, useful for menus/interacting)
|
* (getLocalPlayerIndex returns the local index, useful for menus/interacting)
|
||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable
|
||||||
Player getLocalPlayer();
|
Player getLocalPlayer();
|
||||||
|
|
||||||
int getLocalPlayerIndex();
|
int getLocalPlayerIndex();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -957,36 +958,42 @@ public interface Client extends GameShell
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the music volume
|
* Gets the music volume
|
||||||
|
*
|
||||||
* @return volume 0-255 inclusive
|
* @return volume 0-255 inclusive
|
||||||
*/
|
*/
|
||||||
int getMusicVolume();
|
int getMusicVolume();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the music volume
|
* Sets the music volume
|
||||||
|
*
|
||||||
* @param volume 0-255 inclusive
|
* @param volume 0-255 inclusive
|
||||||
*/
|
*/
|
||||||
void setMusicVolume(int volume);
|
void setMusicVolume(int volume);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the sound effect volume
|
* Gets the sound effect volume
|
||||||
|
*
|
||||||
* @return volume 0-127 inclusive
|
* @return volume 0-127 inclusive
|
||||||
*/
|
*/
|
||||||
int getSoundEffectVolume();
|
int getSoundEffectVolume();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the sound effect volume
|
* Sets the sound effect volume
|
||||||
|
*
|
||||||
* @param volume 0-127 inclusive
|
* @param volume 0-127 inclusive
|
||||||
*/
|
*/
|
||||||
void setSoundEffectVolume(int volume);
|
void setSoundEffectVolume(int volume);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the area sound effect volume
|
* Gets the area sound effect volume
|
||||||
|
*
|
||||||
* @return volume 0-127 inclusive
|
* @return volume 0-127 inclusive
|
||||||
*/
|
*/
|
||||||
int getAreaSoundEffectVolume();
|
int getAreaSoundEffectVolume();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the area sound effect volume
|
* Sets the area sound effect volume
|
||||||
|
*
|
||||||
* @param volume 0-127 inclusive
|
* @param volume 0-127 inclusive
|
||||||
*/
|
*/
|
||||||
void setAreaSoundEffectVolume(int volume);
|
void setAreaSoundEffectVolume(int volume);
|
||||||
@@ -1554,6 +1561,13 @@ public interface Client extends GameShell
|
|||||||
*/
|
*/
|
||||||
void setNPCsHidden2D(boolean state);
|
void setNPCsHidden2D(boolean state);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets whether Pets from other players are hidden.
|
||||||
|
*
|
||||||
|
* @param state new pet hidden state
|
||||||
|
*/
|
||||||
|
void setPetsHidden(boolean state);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets whether attacking players or NPCs are hidden.
|
* Sets whether attacking players or NPCs are hidden.
|
||||||
*
|
*
|
||||||
@@ -1777,7 +1791,7 @@ public interface Client extends GameShell
|
|||||||
/**
|
/**
|
||||||
* @param param0 This is SceneX for gameObject, index for items, and 0 for npc.
|
* @param param0 This is SceneX for gameObject, index for items, and 0 for npc.
|
||||||
* @param param1 This is SceneY for gameObject, static for items, and 0 for npc.
|
* @param param1 This is SceneY for gameObject, static for items, and 0 for npc.
|
||||||
* @param opcode Menu entry Action opcode.
|
* @param opcode Menu entry Action opcode.
|
||||||
* @param id Targets ID
|
* @param id Targets ID
|
||||||
* @param menuEntry Do these actually matter?
|
* @param menuEntry Do these actually matter?
|
||||||
* @param targetString Do these actually matter?
|
* @param targetString Do these actually matter?
|
||||||
@@ -1865,26 +1879,25 @@ public interface Client extends GameShell
|
|||||||
/**
|
/**
|
||||||
* Scales values from pixels onto canvas
|
* Scales values from pixels onto canvas
|
||||||
*
|
*
|
||||||
* @see net.runelite.client.util.ImageUtil#resizeSprite(Client, Sprite, int, int)
|
* @param canvas the array we're writing to
|
||||||
*
|
* @param pixels pixels to draw
|
||||||
* @param canvas the array we're writing to
|
* @param color should be 0
|
||||||
* @param pixels pixels to draw
|
* @param pixelX x index
|
||||||
* @param color should be 0
|
* @param pixelY y index
|
||||||
* @param pixelX x index
|
* @param canvasIdx index in canvas (canvas[canvasIdx])
|
||||||
* @param pixelY y index
|
|
||||||
* @param canvasIdx index in canvas (canvas[canvasIdx])
|
|
||||||
* @param canvasOffset x offset
|
* @param canvasOffset x offset
|
||||||
* @param newWidth new width
|
* @param newWidth new width
|
||||||
* @param newHeight new height
|
* @param newHeight new height
|
||||||
* @param pixelWidth pretty much horizontal scale
|
* @param pixelWidth pretty much horizontal scale
|
||||||
* @param pixelHeight pretty much vertical scale
|
* @param pixelHeight pretty much vertical scale
|
||||||
* @param oldWidth old width
|
* @param oldWidth old width
|
||||||
|
* @see net.runelite.client.util.ImageUtil#resizeSprite(Client, Sprite, int, int)
|
||||||
*/
|
*/
|
||||||
void scaleSprite(int[] canvas, int[] pixels, int color, int pixelX, int pixelY, int canvasIdx, int canvasOffset, int newWidth, int newHeight, int pixelWidth, int pixelHeight, int oldWidth);
|
void scaleSprite(int[] canvas, int[] pixels, int color, int pixelX, int pixelY, int canvasIdx, int canvasOffset, int newWidth, int newHeight, int pixelWidth, int pixelHeight, int oldWidth);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the MenuEntry at client.getMenuOptionCount() - 1
|
* Get the MenuEntry at client.getMenuOptionCount() - 1
|
||||||
*
|
* <p>
|
||||||
* This is useful so you don't have to use getMenuEntries,
|
* This is useful so you don't have to use getMenuEntries,
|
||||||
* which will create a big array, when you only want to change
|
* which will create a big array, when you only want to change
|
||||||
* the left click one.
|
* the left click one.
|
||||||
@@ -1893,7 +1906,7 @@ public interface Client extends GameShell
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the MenuEntry at client.getMenuOptionCount() - 1
|
* Set the MenuEntry at client.getMenuOptionCount() - 1
|
||||||
*
|
* <p>
|
||||||
* This is useful so you don't have to use setMenuEntries,
|
* This is useful so you don't have to use setMenuEntries,
|
||||||
* which will arraycopy a big array to several smaller arrays lol,
|
* which will arraycopy a big array to several smaller arrays lol,
|
||||||
* when you only want to change the left click one.
|
* when you only want to change the left click one.
|
||||||
|
|||||||
@@ -27,6 +27,4 @@ package net.runelite.api;
|
|||||||
/**
|
/**
|
||||||
* Represents the friend and ignore list manager.
|
* Represents the friend and ignore list manager.
|
||||||
*/
|
*/
|
||||||
public interface FriendManager
|
public interface FriendManager {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -98,13 +98,14 @@ public enum InventoryID
|
|||||||
|
|
||||||
public static InventoryID getValue(int value)
|
public static InventoryID getValue(int value)
|
||||||
{
|
{
|
||||||
for (InventoryID e: InventoryID.values())
|
for (InventoryID e : InventoryID.values())
|
||||||
{
|
{
|
||||||
if (e.id == value)
|
if (e.id == value)
|
||||||
{
|
{
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
|
||||||
|
throw new IllegalArgumentException("No InventoryID with id " + value + " exists");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -11327,5 +11327,45 @@ public final class ItemID
|
|||||||
public static final int BOUNTY_HUNTER_HAT_TIER_4 = 24344;
|
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_5 = 24346;
|
||||||
public static final int BOUNTY_HUNTER_HAT_TIER_6 = 24348;
|
public static final int BOUNTY_HUNTER_HAT_TIER_6 = 24348;
|
||||||
|
public static final int SCROLL_BOX_BEGINNER = 24361;
|
||||||
|
public static final int SCROLL_BOX_EASY = 24362;
|
||||||
|
public static final int SCROLL_BOX_MEDIUM = 24363;
|
||||||
|
public static final int SCROLL_BOX_HARD = 24364;
|
||||||
|
public static final int SCROLL_BOX_ELITE = 24365;
|
||||||
|
public static final int SCROLL_BOX_MASTER = 24366;
|
||||||
|
public static final int CABBAGE_24367 = 24367;
|
||||||
|
public static final int TWISTED_SLAYER_HELMET = 24370;
|
||||||
|
public static final int TWISTED_LEAGUE_DRAGON_TROPHY = 24372;
|
||||||
|
public static final int TWISTED_LEAGUE_RUNE_TROPHY = 24374;
|
||||||
|
public static final int TWISTED_LEAGUE_ADAMANT_TROPHY = 24376;
|
||||||
|
public static final int TWISTED_LEAGUE_MITHRIL_TROPHY = 24378;
|
||||||
|
public static final int TWISTED_LEAGUE_STEEL_TROPHY = 24380;
|
||||||
|
public static final int TWISTED_LEAGUE_IRON_TROPHY = 24382;
|
||||||
|
public static final int TWISTED_LEAGUE_BRONZE_TROPHY = 24384;
|
||||||
|
public static final int TWISTED_HAT_T3 = 24387;
|
||||||
|
public static final int TWISTED_COAT_T3 = 24389;
|
||||||
|
public static final int TWISTED_TROUSERS_T3 = 24391;
|
||||||
|
public static final int TWISTED_BOOTS_T3 = 24393;
|
||||||
|
public static final int TWISTED_CANE = 24395;
|
||||||
|
public static final int TWISTED_HAT_T2 = 24397;
|
||||||
|
public static final int TWISTED_COAT_T2 = 24399;
|
||||||
|
public static final int TWISTED_TROUSERS_T2 = 24401;
|
||||||
|
public static final int TWISTED_BOOTS_T2 = 24403;
|
||||||
|
public static final int TWISTED_HAT_T1 = 24405;
|
||||||
|
public static final int TWISTED_COAT_T1 = 24407;
|
||||||
|
public static final int TWISTED_TROUSERS_T1 = 24409;
|
||||||
|
public static final int TWISTED_BOOTS_T1 = 24411;
|
||||||
|
public static final int TWISTED_LEAGUE_BANNER = 24413;
|
||||||
|
public static final int RUNE_POUCH_L = 24416;
|
||||||
|
public static final int INQUISITORS_MACE = 24417;
|
||||||
|
public static final int SIRENS_TOME = 24418;
|
||||||
|
public static final int INQUISITORS_GREAT_HELM = 24419;
|
||||||
|
public static final int INQUISITORS_HAUBERK = 24420;
|
||||||
|
public static final int INQUISITORS_PLATESKIRT = 24421;
|
||||||
|
public static final int NIGHTMARE_STAFF = 24422;
|
||||||
|
public static final int HARMONISED_NIGHTMARE_STAFF = 24423;
|
||||||
|
public static final int VOLATILE_NIGHTMARE_STAFF = 24424;
|
||||||
|
public static final int ELDRITCH_NIGHTMARE_STAFF = 24425;
|
||||||
|
public static final int CABBAGE_24426 = 24426;
|
||||||
/* This file is automatically generated. Do not edit. */
|
/* This file is automatically generated. Do not edit. */
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,4 @@ package net.runelite.api;
|
|||||||
/**
|
/**
|
||||||
* Detects when the window is focused or unfocused.
|
* Detects when the window is focused or unfocused.
|
||||||
*/
|
*/
|
||||||
public interface KeyFocusListener
|
public interface KeyFocusListener {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -0,0 +1,54 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2018 Magic fTail
|
||||||
|
* 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.api;
|
||||||
|
|
||||||
|
public final class ModelID
|
||||||
|
{
|
||||||
|
public static final int ANVIL = 1251;
|
||||||
|
public static final int WILLOW_TREE = 1570;
|
||||||
|
public static final int SLAYER_SKILL_MODEL = 1733;
|
||||||
|
public static final int FIREMAKING_SKILL_MODEL = 2260;
|
||||||
|
public static final int STEEL_KITESHIELD = 2339;
|
||||||
|
public static final int PURE_ESSENCE = 2349;
|
||||||
|
public static final int RAW_TUNA = 2355;
|
||||||
|
public static final int CLEAN_HERB = 2364;
|
||||||
|
public static final int HAMMER = 2376;
|
||||||
|
public static final int BLUE_WIZARD_HAT = 2483;
|
||||||
|
public static final int CHISEL = 2489;
|
||||||
|
public static final int HIGHWAYMAN_MASK = 2500;
|
||||||
|
public static final int STEEL_PICKAXE = 2529;
|
||||||
|
public static final int SHORTBOW = 2562;
|
||||||
|
public static final int STEEL_LONGSWORD = 2602;
|
||||||
|
public static final int STEEL_SWORD = 2604;
|
||||||
|
public static final int STEEL_ARROW = 2711;
|
||||||
|
public static final int PRAYER_SKILL_MODEL = 3325;
|
||||||
|
public static final int STRENGTH_SKILL_MODEL = 3327;
|
||||||
|
public static final int AGILITY_SKILL_MODEL = 3328;
|
||||||
|
public static final int HEARTH = 3326;
|
||||||
|
public static final int WATERING_CAN = 7331;
|
||||||
|
public static final int SAW = 12309;
|
||||||
|
public static final int FOOTPRINT = 19980;
|
||||||
|
public static final int COOKING_SKILL_MODEL = 27611;
|
||||||
|
}
|
||||||
@@ -48,6 +48,8 @@ public interface NPCDefinition
|
|||||||
|
|
||||||
boolean isClickable();
|
boolean isClickable();
|
||||||
|
|
||||||
|
boolean isFollower();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets whether the NPC is visible on the mini-map.
|
* Gets whether the NPC is visible on the mini-map.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -27,6 +27,4 @@ package net.runelite.api;
|
|||||||
/**
|
/**
|
||||||
* Represents a chat entity that has a name.
|
* Represents a chat entity that has a name.
|
||||||
*/
|
*/
|
||||||
public interface Nameable extends Comparable
|
public interface Nameable extends Comparable {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -308,7 +308,8 @@ public final class NpcID
|
|||||||
public static final int FROG = 312;
|
public static final int FROG = 312;
|
||||||
public static final int REACHER_313 = 313;
|
public static final int REACHER_313 = 313;
|
||||||
public static final int DR_JEKYLL_314 = 314;
|
public static final int DR_JEKYLL_314 = 314;
|
||||||
public static final int PAUL = 317;
|
public static final int LEAGUES_TUTOR = 315;
|
||||||
|
public static final int LEAGUES_TUTOR_316 = 316;
|
||||||
public static final int DARK_CORE = 318;
|
public static final int DARK_CORE = 318;
|
||||||
public static final int CORPOREAL_BEAST = 319;
|
public static final int CORPOREAL_BEAST = 319;
|
||||||
public static final int DARK_ENERGY_CORE = 320;
|
public static final int DARK_ENERGY_CORE = 320;
|
||||||
@@ -7160,6 +7161,7 @@ public final class NpcID
|
|||||||
public static final int REVENANT_DARK_BEAST = 7938;
|
public static final int REVENANT_DARK_BEAST = 7938;
|
||||||
public static final int REVENANT_KNIGHT = 7939;
|
public static final int REVENANT_KNIGHT = 7939;
|
||||||
public static final int REVENANT_DRAGON = 7940;
|
public static final int REVENANT_DRAGON = 7940;
|
||||||
|
public static final int PAUL = 7941;
|
||||||
public static final int EMBLEM_TRADER_7943 = 7943;
|
public static final int EMBLEM_TRADER_7943 = 7943;
|
||||||
public static final int FISHING_SPOT_7946 = 7946;
|
public static final int FISHING_SPOT_7946 = 7946;
|
||||||
public static final int FISHING_SPOT_7947 = 7947;
|
public static final int FISHING_SPOT_7947 = 7947;
|
||||||
|
|||||||
@@ -12814,5 +12814,43 @@ public final class NullItemID
|
|||||||
public static final int NULL_24345 = 24345;
|
public static final int NULL_24345 = 24345;
|
||||||
public static final int NULL_24347 = 24347;
|
public static final int NULL_24347 = 24347;
|
||||||
public static final int NULL_24349 = 24349;
|
public static final int NULL_24349 = 24349;
|
||||||
|
public static final int NULL_24350 = 24350;
|
||||||
|
public static final int NULL_24351 = 24351;
|
||||||
|
public static final int NULL_24352 = 24352;
|
||||||
|
public static final int NULL_24353 = 24353;
|
||||||
|
public static final int NULL_24354 = 24354;
|
||||||
|
public static final int NULL_24355 = 24355;
|
||||||
|
public static final int NULL_24356 = 24356;
|
||||||
|
public static final int NULL_24357 = 24357;
|
||||||
|
public static final int NULL_24358 = 24358;
|
||||||
|
public static final int NULL_24359 = 24359;
|
||||||
|
public static final int NULL_24360 = 24360;
|
||||||
|
public static final int NULL_24368 = 24368;
|
||||||
|
public static final int NULL_24369 = 24369;
|
||||||
|
public static final int NULL_24371 = 24371;
|
||||||
|
public static final int NULL_24373 = 24373;
|
||||||
|
public static final int NULL_24375 = 24375;
|
||||||
|
public static final int NULL_24377 = 24377;
|
||||||
|
public static final int NULL_24379 = 24379;
|
||||||
|
public static final int NULL_24381 = 24381;
|
||||||
|
public static final int NULL_24383 = 24383;
|
||||||
|
public static final int NULL_24385 = 24385;
|
||||||
|
public static final int NULL_24386 = 24386;
|
||||||
|
public static final int NULL_24388 = 24388;
|
||||||
|
public static final int NULL_24390 = 24390;
|
||||||
|
public static final int NULL_24392 = 24392;
|
||||||
|
public static final int NULL_24394 = 24394;
|
||||||
|
public static final int NULL_24396 = 24396;
|
||||||
|
public static final int NULL_24398 = 24398;
|
||||||
|
public static final int NULL_24400 = 24400;
|
||||||
|
public static final int NULL_24402 = 24402;
|
||||||
|
public static final int NULL_24404 = 24404;
|
||||||
|
public static final int NULL_24406 = 24406;
|
||||||
|
public static final int NULL_24408 = 24408;
|
||||||
|
public static final int NULL_24410 = 24410;
|
||||||
|
public static final int NULL_24412 = 24412;
|
||||||
|
public static final int NULL_24414 = 24414;
|
||||||
|
public static final int NULL_24415 = 24415;
|
||||||
|
public static final int NULL_24427 = 24427;
|
||||||
/* This file is automatically generated. Do not edit. */
|
/* This file is automatically generated. Do not edit. */
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13793,6 +13793,9 @@ public final class NullObjectID
|
|||||||
public static final int NULL_29134 = 29134;
|
public static final int NULL_29134 = 29134;
|
||||||
public static final int NULL_29135 = 29135;
|
public static final int NULL_29135 = 29135;
|
||||||
public static final int NULL_29150 = 29150;
|
public static final int NULL_29150 = 29150;
|
||||||
|
public static final int NULL_29154 = 29154;
|
||||||
|
public static final int NULL_29155 = 29155;
|
||||||
|
public static final int NULL_29156 = 29156;
|
||||||
public static final int NULL_29228 = 29228;
|
public static final int NULL_29228 = 29228;
|
||||||
public static final int NULL_29229 = 29229;
|
public static final int NULL_29229 = 29229;
|
||||||
public static final int NULL_29265 = 29265;
|
public static final int NULL_29265 = 29265;
|
||||||
@@ -18041,6 +18044,8 @@ public final class NullObjectID
|
|||||||
public static final int NULL_37436 = 37436;
|
public static final int NULL_37436 = 37436;
|
||||||
public static final int NULL_37437 = 37437;
|
public static final int NULL_37437 = 37437;
|
||||||
public static final int NULL_37438 = 37438;
|
public static final int NULL_37438 = 37438;
|
||||||
|
public static final int NULL_37439 = 37439;
|
||||||
|
public static final int NULL_37440 = 37440;
|
||||||
public static final int NULL_37446 = 37446;
|
public static final int NULL_37446 = 37446;
|
||||||
public static final int NULL_37447 = 37447;
|
public static final int NULL_37447 = 37447;
|
||||||
public static final int NULL_37448 = 37448;
|
public static final int NULL_37448 = 37448;
|
||||||
@@ -18052,5 +18057,22 @@ public final class NullObjectID
|
|||||||
public static final int NULL_37455 = 37455;
|
public static final int NULL_37455 = 37455;
|
||||||
public static final int NULL_37456 = 37456;
|
public static final int NULL_37456 = 37456;
|
||||||
public static final int NULL_37457 = 37457;
|
public static final int NULL_37457 = 37457;
|
||||||
|
public static final int NULL_37467 = 37467;
|
||||||
|
public static final int NULL_37468 = 37468;
|
||||||
|
public static final int NULL_37469 = 37469;
|
||||||
|
public static final int NULL_37470 = 37470;
|
||||||
|
public static final int NULL_37471 = 37471;
|
||||||
|
public static final int NULL_37472 = 37472;
|
||||||
|
public static final int NULL_37473 = 37473;
|
||||||
|
public static final int NULL_37474 = 37474;
|
||||||
|
public static final int NULL_37475 = 37475;
|
||||||
|
public static final int NULL_37476 = 37476;
|
||||||
|
public static final int NULL_37477 = 37477;
|
||||||
|
public static final int NULL_37478 = 37478;
|
||||||
|
public static final int NULL_37479 = 37479;
|
||||||
|
public static final int NULL_37480 = 37480;
|
||||||
|
public static final int NULL_37481 = 37481;
|
||||||
|
public static final int NULL_37490 = 37490;
|
||||||
|
public static final int NULL_37491 = 37491;
|
||||||
/* This file is automatically generated. Do not edit. */
|
/* This file is automatically generated. Do not edit. */
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15349,9 +15349,6 @@ public final class ObjectID
|
|||||||
public static final int MAHOGANY_ADVENTURE_LOG = 29151;
|
public static final int MAHOGANY_ADVENTURE_LOG = 29151;
|
||||||
public static final int GILDED_ADVENTURE_LOG = 29152;
|
public static final int GILDED_ADVENTURE_LOG = 29152;
|
||||||
public static final int MARBLE_ADVENTURE_LOG = 29153;
|
public static final int MARBLE_ADVENTURE_LOG = 29153;
|
||||||
public static final int BASIC_JEWELLERY_BOX = 29154;
|
|
||||||
public static final int FANCY_JEWELLERY_BOX = 29155;
|
|
||||||
public static final int ORNATE_JEWELLERY_BOX = 29156;
|
|
||||||
public static final int BOSS_LAIR_DISPLAY = 29157;
|
public static final int BOSS_LAIR_DISPLAY = 29157;
|
||||||
public static final int KRAKEN_DISPLAY = 29158;
|
public static final int KRAKEN_DISPLAY = 29158;
|
||||||
public static final int ZULRAH_DISPLAY = 29159;
|
public static final int ZULRAH_DISPLAY = 29159;
|
||||||
@@ -16927,7 +16924,7 @@ public final class ObjectID
|
|||||||
public static final int CORPOREAL_BEAST_DISPLAY = 31921;
|
public static final int CORPOREAL_BEAST_DISPLAY = 31921;
|
||||||
public static final int GILDED_ADVENTURE_LOG_31922 = 31922;
|
public static final int GILDED_ADVENTURE_LOG_31922 = 31922;
|
||||||
public static final int ALTAR_OF_THE_OCCULT_31923 = 31923;
|
public static final int ALTAR_OF_THE_OCCULT_31923 = 31923;
|
||||||
public static final int ORNATE_JEWELLERY_BOX_31924 = 31924;
|
public static final int ORNATE_JEWELLERY_BOX = 31924;
|
||||||
public static final int MOUNTED_MAX_CAPE_31925 = 31925;
|
public static final int MOUNTED_MAX_CAPE_31925 = 31925;
|
||||||
public static final int BURNING_BRAZIER_31926 = 31926;
|
public static final int BURNING_BRAZIER_31926 = 31926;
|
||||||
public static final int PYROMANCER = 31927;
|
public static final int PYROMANCER = 31927;
|
||||||
@@ -19385,7 +19382,83 @@ public final class ObjectID
|
|||||||
public static final int ROUGH_WALL_37431 = 37431;
|
public static final int ROUGH_WALL_37431 = 37431;
|
||||||
public static final int STREAK_INFO = 37434;
|
public static final int STREAK_INFO = 37434;
|
||||||
public static final int SWAMPY_SINK = 37435;
|
public static final int SWAMPY_SINK = 37435;
|
||||||
|
public static final int SHUTTERED_WINDOW_37441 = 37441;
|
||||||
|
public static final int DECORATIVE_WINDOW_37442 = 37442;
|
||||||
|
public static final int STAINEDGLASS_WINDOW_37443 = 37443;
|
||||||
public static final int LOG_PILE_37444 = 37444;
|
public static final int LOG_PILE_37444 = 37444;
|
||||||
public static final int HOTSPOT_MARKER = 37445;
|
public static final int HOTSPOT_MARKER = 37445;
|
||||||
|
public static final int DECORATIVE_WINDOW_37450 = 37450;
|
||||||
|
public static final int STAINEDGLASS_WINDOW_37458 = 37458;
|
||||||
|
public static final int DECORATIVE_WINDOW_37459 = 37459;
|
||||||
|
public static final int STAINEDGLASS_WINDOW_37460 = 37460;
|
||||||
|
public static final int DECORATIVE_WINDOW_37461 = 37461;
|
||||||
|
public static final int STAINEDGLASS_WINDOW_37462 = 37462;
|
||||||
|
public static final int DOOR_37463 = 37463;
|
||||||
|
public static final int DOOR_37464 = 37464;
|
||||||
|
public static final int DOOR_37465 = 37465;
|
||||||
|
public static final int DOOR_37466 = 37466;
|
||||||
|
public static final int LEAGUE_FIRSTS_BOARD = 37482;
|
||||||
|
public static final int DRAGON_TROPHY_DISPLAY = 37483;
|
||||||
|
public static final int DRAGON_TROPHY_DISPLAY_37484 = 37484;
|
||||||
|
public static final int DRAGON_TROPHY_DISPLAY_37485 = 37485;
|
||||||
|
public static final int DRAGON_TROPHY_DISPLAY_37486 = 37486;
|
||||||
|
public static final int DRAGON_TROPHY_DISPLAY_37487 = 37487;
|
||||||
|
public static final int DRAGON_TROPHY_DISPLAY_37488 = 37488;
|
||||||
|
public static final int DRAGON_TROPHY_DISPLAY_37489 = 37489;
|
||||||
|
public static final int BASIC_JEWELLERY_BOX = 37492;
|
||||||
|
public static final int BASIC_JEWELLERY_BOX_37493 = 37493;
|
||||||
|
public static final int BASIC_JEWELLERY_BOX_37494 = 37494;
|
||||||
|
public static final int BASIC_JEWELLERY_BOX_37495 = 37495;
|
||||||
|
public static final int BASIC_JEWELLERY_BOX_37496 = 37496;
|
||||||
|
public static final int BASIC_JEWELLERY_BOX_37497 = 37497;
|
||||||
|
public static final int BASIC_JEWELLERY_BOX_37498 = 37498;
|
||||||
|
public static final int BASIC_JEWELLERY_BOX_37499 = 37499;
|
||||||
|
public static final int BASIC_JEWELLERY_BOX_37500 = 37500;
|
||||||
|
public static final int FANCY_JEWELLERY_BOX = 37501;
|
||||||
|
public static final int FANCY_JEWELLERY_BOX_37502 = 37502;
|
||||||
|
public static final int FANCY_JEWELLERY_BOX_37503 = 37503;
|
||||||
|
public static final int FANCY_JEWELLERY_BOX_37504 = 37504;
|
||||||
|
public static final int FANCY_JEWELLERY_BOX_37505 = 37505;
|
||||||
|
public static final int FANCY_JEWELLERY_BOX_37506 = 37506;
|
||||||
|
public static final int FANCY_JEWELLERY_BOX_37507 = 37507;
|
||||||
|
public static final int FANCY_JEWELLERY_BOX_37508 = 37508;
|
||||||
|
public static final int FANCY_JEWELLERY_BOX_37509 = 37509;
|
||||||
|
public static final int FANCY_JEWELLERY_BOX_37510 = 37510;
|
||||||
|
public static final int FANCY_JEWELLERY_BOX_37511 = 37511;
|
||||||
|
public static final int FANCY_JEWELLERY_BOX_37512 = 37512;
|
||||||
|
public static final int FANCY_JEWELLERY_BOX_37513 = 37513;
|
||||||
|
public static final int FANCY_JEWELLERY_BOX_37514 = 37514;
|
||||||
|
public static final int FANCY_JEWELLERY_BOX_37515 = 37515;
|
||||||
|
public static final int FANCY_JEWELLERY_BOX_37516 = 37516;
|
||||||
|
public static final int FANCY_JEWELLERY_BOX_37517 = 37517;
|
||||||
|
public static final int FANCY_JEWELLERY_BOX_37518 = 37518;
|
||||||
|
public static final int FANCY_JEWELLERY_BOX_37519 = 37519;
|
||||||
|
public static final int ORNATE_JEWELLERY_BOX_37520 = 37520;
|
||||||
|
public static final int ORNATE_JEWELLERY_BOX_37521 = 37521;
|
||||||
|
public static final int ORNATE_JEWELLERY_BOX_37522 = 37522;
|
||||||
|
public static final int ORNATE_JEWELLERY_BOX_37523 = 37523;
|
||||||
|
public static final int ORNATE_JEWELLERY_BOX_37524 = 37524;
|
||||||
|
public static final int ORNATE_JEWELLERY_BOX_37525 = 37525;
|
||||||
|
public static final int ORNATE_JEWELLERY_BOX_37526 = 37526;
|
||||||
|
public static final int ORNATE_JEWELLERY_BOX_37527 = 37527;
|
||||||
|
public static final int ORNATE_JEWELLERY_BOX_37528 = 37528;
|
||||||
|
public static final int ORNATE_JEWELLERY_BOX_37529 = 37529;
|
||||||
|
public static final int ORNATE_JEWELLERY_BOX_37530 = 37530;
|
||||||
|
public static final int ORNATE_JEWELLERY_BOX_37531 = 37531;
|
||||||
|
public static final int ORNATE_JEWELLERY_BOX_37532 = 37532;
|
||||||
|
public static final int ORNATE_JEWELLERY_BOX_37533 = 37533;
|
||||||
|
public static final int ORNATE_JEWELLERY_BOX_37534 = 37534;
|
||||||
|
public static final int ORNATE_JEWELLERY_BOX_37535 = 37535;
|
||||||
|
public static final int ORNATE_JEWELLERY_BOX_37536 = 37536;
|
||||||
|
public static final int ORNATE_JEWELLERY_BOX_37537 = 37537;
|
||||||
|
public static final int ORNATE_JEWELLERY_BOX_37538 = 37538;
|
||||||
|
public static final int ORNATE_JEWELLERY_BOX_37539 = 37539;
|
||||||
|
public static final int ORNATE_JEWELLERY_BOX_37540 = 37540;
|
||||||
|
public static final int ORNATE_JEWELLERY_BOX_37541 = 37541;
|
||||||
|
public static final int ORNATE_JEWELLERY_BOX_37542 = 37542;
|
||||||
|
public static final int ORNATE_JEWELLERY_BOX_37543 = 37543;
|
||||||
|
public static final int ORNATE_JEWELLERY_BOX_37544 = 37544;
|
||||||
|
public static final int ORNATE_JEWELLERY_BOX_37545 = 37545;
|
||||||
|
public static final int ORNATE_JEWELLERY_BOX_37546 = 37546;
|
||||||
/* This file is automatically generated. Do not edit. */
|
/* This file is automatically generated. Do not edit. */
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -273,9 +273,12 @@ public enum VarPlayer
|
|||||||
QUEST_ENTER_THE_ABYSS(492),
|
QUEST_ENTER_THE_ABYSS(492),
|
||||||
QUEST_ALFRED_GRIMHANDS_BARCRAWL(77),
|
QUEST_ALFRED_GRIMHANDS_BARCRAWL(77),
|
||||||
QUEST_ALFRED_GRIMHANDS_BARCRAWL_STATE_76(76),
|
QUEST_ALFRED_GRIMHANDS_BARCRAWL_STATE_76(76),
|
||||||
QUEST_THE_MAGE_ARENA(267);
|
QUEST_THE_MAGE_ARENA(267),
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 0 = 2 buttons, 1 = 1 button
|
||||||
|
*/
|
||||||
|
MOUSE_BUTTONS(170);
|
||||||
|
|
||||||
public final int id;
|
public final int id;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -698,7 +698,37 @@ public enum Varbits
|
|||||||
|
|
||||||
WITHDRAW_X_AMOUNT(3960),
|
WITHDRAW_X_AMOUNT(3960),
|
||||||
|
|
||||||
IN_PVP_AREA(8121);
|
IN_PVP_AREA(8121),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Twisted league
|
||||||
|
*/
|
||||||
|
TWISTED_LEAGUE_RELIC_1(10049),
|
||||||
|
TWISTED_LEAGUE_RELIC_2(10050),
|
||||||
|
TWISTED_LEAGUE_RELIC_3(10051),
|
||||||
|
TWISTED_LEAGUE_RELIC_4(10052),
|
||||||
|
TWISTED_LEAGUE_RELIC_5(10053),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Value of hotkey varbits can be 0-13
|
||||||
|
* 0 corresponds to no hotkey set
|
||||||
|
* 1-12 correspond to F1-F12 respectively
|
||||||
|
* 13 corresponds to escape
|
||||||
|
*/
|
||||||
|
COMBAT_TAB_HOTKEY(4675),
|
||||||
|
STATS_TAB_HOTKEY(4676),
|
||||||
|
QUESTS_TAB_HOTKEY(4677),
|
||||||
|
INVENTORY_TAB_HOTKEY(4678),
|
||||||
|
EQUIPMENT_TAB_HOTKEY(4679),
|
||||||
|
PRAYER_TAB_HOTKEY(4680),
|
||||||
|
SPELLBOOK_TAB_HOTKEY(4682),
|
||||||
|
FRIENDS_TAB_HOTKEY(4684),
|
||||||
|
ACCOUNT_MANAGEMENT_TAB_HOTKEY(6517),
|
||||||
|
LOGOUT_TAB_HOTKEY(4689),
|
||||||
|
OPTIONS_TAB_HOTKEY(4686),
|
||||||
|
EMOTES_TAB_HOTKEY(4687),
|
||||||
|
CLAN_TAB_HOTKEY(4683),
|
||||||
|
MUSIC_TAB_HOTKEY(4688);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The raw varbit ID.
|
* The raw varbit ID.
|
||||||
|
|||||||
@@ -1,3 +1,27 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2018, Tomas Slusny <slusnucky@gmail.com>
|
||||||
|
* 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.api;
|
package net.runelite.api;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@@ -36,18 +60,14 @@ public enum WorldType
|
|||||||
* Tournament world type.
|
* Tournament world type.
|
||||||
*/
|
*/
|
||||||
TOURNAMENT(1 << 25),
|
TOURNAMENT(1 << 25),
|
||||||
/**
|
|
||||||
* Deadman Tournament world type.
|
|
||||||
*/
|
|
||||||
DEADMAN_TOURNAMENT(1 << 26),
|
|
||||||
/**
|
/**
|
||||||
* Deadman world type.
|
* Deadman world type.
|
||||||
*/
|
*/
|
||||||
DEADMAN(1 << 29),
|
DEADMAN(1 << 29),
|
||||||
/**
|
/**
|
||||||
* Seasonal deadman world type.
|
* League world type
|
||||||
*/
|
*/
|
||||||
SEASONAL_DEADMAN(1 << 30);
|
LEAGUE(1 << 30);
|
||||||
|
|
||||||
private final int mask;
|
private final int mask;
|
||||||
|
|
||||||
@@ -58,44 +78,34 @@ public enum WorldType
|
|||||||
|
|
||||||
private static final EnumSet<WorldType> PVP_WORLD_TYPES = EnumSet.of(
|
private static final EnumSet<WorldType> PVP_WORLD_TYPES = EnumSet.of(
|
||||||
DEADMAN,
|
DEADMAN,
|
||||||
DEADMAN_TOURNAMENT,
|
PVP
|
||||||
PVP,
|
|
||||||
SEASONAL_DEADMAN
|
|
||||||
);
|
);
|
||||||
|
|
||||||
private static final EnumSet<WorldType> DEADMAN_WORLD_TYPES = EnumSet.of(
|
private static final EnumSet<WorldType> DEADMAN_WORLD_TYPES = EnumSet.of(
|
||||||
DEADMAN,
|
DEADMAN
|
||||||
DEADMAN_TOURNAMENT,
|
|
||||||
SEASONAL_DEADMAN
|
|
||||||
);
|
);
|
||||||
|
|
||||||
private static final EnumSet<WorldType> HIGHRISK_WORLD_TYPES = EnumSet.of(
|
private static final EnumSet<WorldType> HIGHRISK_WORLD_TYPES = EnumSet.of(
|
||||||
HIGH_RISK
|
HIGH_RISK
|
||||||
);
|
);
|
||||||
|
|
||||||
private static final EnumSet<WorldType> ALL_HIGHRISK_WORLD_TYPES = EnumSet.of(
|
private static final EnumSet<WorldType> ALL_HIGHRISK_WORLD_TYPES = EnumSet.of(
|
||||||
HIGH_RISK,
|
HIGH_RISK,
|
||||||
DEADMAN,
|
DEADMAN
|
||||||
DEADMAN_TOURNAMENT,
|
|
||||||
SEASONAL_DEADMAN
|
|
||||||
);
|
);
|
||||||
|
|
||||||
private static final EnumSet<WorldType> ALL_PVP_WORLD_TYPES = EnumSet.of(
|
private static final EnumSet<WorldType> ALL_PVP_WORLD_TYPES = EnumSet.of(
|
||||||
HIGH_RISK,
|
HIGH_RISK,
|
||||||
DEADMAN,
|
DEADMAN,
|
||||||
DEADMAN_TOURNAMENT,
|
PVP
|
||||||
PVP,
|
|
||||||
SEASONAL_DEADMAN
|
|
||||||
);
|
);
|
||||||
|
|
||||||
private static final EnumSet<WorldType> ALL_PK_WORLD_TYPES = EnumSet.of(
|
private static final EnumSet<WorldType> ALL_PK_WORLD_TYPES = EnumSet.of(
|
||||||
HIGH_RISK,
|
HIGH_RISK,
|
||||||
DEADMAN,
|
DEADMAN,
|
||||||
DEADMAN_TOURNAMENT,
|
|
||||||
PVP,
|
PVP,
|
||||||
SEASONAL_DEADMAN,
|
|
||||||
BOUNTY
|
BOUNTY
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create enum set of world types from mask.
|
* Create enum set of world types from mask.
|
||||||
@@ -137,10 +147,10 @@ public enum WorldType
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks whether a world having a {@link Collection} of {@link WorldType}s is a PVP/DEADMAN/HIGHRISK world.
|
* Checks whether a world having a {@link Collection} of {@link WorldType}s is a PVP world.
|
||||||
*
|
*
|
||||||
* @param worldTypes A {@link Collection} of {@link WorldType}s describing the given world.
|
* @param worldTypes A {@link Collection} of {@link WorldType}s describing the given world.
|
||||||
* @return True if the given worldtypes of the world are a PVP/DEADMAN/HIGHRISK world, false otherwise.
|
* @return True if the given worldtypes of the world are a PVP world, false otherwise.
|
||||||
* @see Client#getWorldType()
|
* @see Client#getWorldType()
|
||||||
*/
|
*/
|
||||||
public static boolean isPvpWorld(final Collection<WorldType> worldTypes)
|
public static boolean isPvpWorld(final Collection<WorldType> worldTypes)
|
||||||
@@ -157,19 +167,19 @@ public enum WorldType
|
|||||||
{
|
{
|
||||||
return worldTypes.stream().anyMatch(HIGHRISK_WORLD_TYPES::contains);
|
return worldTypes.stream().anyMatch(HIGHRISK_WORLD_TYPES::contains);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isAllHighRiskWorld(final Collection<WorldType> worldTypes)
|
public static boolean isAllHighRiskWorld(final Collection<WorldType> worldTypes)
|
||||||
{
|
{
|
||||||
return worldTypes.stream().anyMatch(ALL_HIGHRISK_WORLD_TYPES::contains);
|
return worldTypes.stream().anyMatch(ALL_HIGHRISK_WORLD_TYPES::contains);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isAllPvpWorld(final Collection<WorldType> worldTypes)
|
public static boolean isAllPvpWorld(final Collection<WorldType> worldTypes)
|
||||||
{
|
{
|
||||||
return worldTypes.stream().anyMatch(ALL_PVP_WORLD_TYPES::contains);
|
return worldTypes.stream().anyMatch(ALL_PVP_WORLD_TYPES::contains);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isAllPKWorld(final Collection<WorldType> worldTypes)
|
public static boolean isAllPKWorld(final Collection<WorldType> worldTypes)
|
||||||
{
|
{
|
||||||
return worldTypes.stream().anyMatch(ALL_PK_WORLD_TYPES::contains);
|
return worldTypes.stream().anyMatch(ALL_PK_WORLD_TYPES::contains);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -33,6 +33,4 @@ import java.lang.annotation.RetentionPolicy;
|
|||||||
*/
|
*/
|
||||||
@Documented
|
@Documented
|
||||||
@Retention(RetentionPolicy.SOURCE)
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
public @interface VisibleForDevtools
|
public @interface VisibleForDevtools {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import javax.annotation.Nullable;
|
|||||||
import lombok.Value;
|
import lombok.Value;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import static net.runelite.api.Constants.CHUNK_SIZE;
|
import static net.runelite.api.Constants.CHUNK_SIZE;
|
||||||
|
import static net.runelite.api.Constants.REGION_SIZE;
|
||||||
import net.runelite.api.Perspective;
|
import net.runelite.api.Perspective;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -416,6 +417,6 @@ public class WorldPoint
|
|||||||
|
|
||||||
private static int getRegionOffset(final int position)
|
private static int getRegionOffset(final int position)
|
||||||
{
|
{
|
||||||
return position & 0x3f;
|
return position & (REGION_SIZE - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
package net.runelite.api.events;
|
package net.runelite.api.events;
|
||||||
|
|
||||||
public interface Event
|
public interface Event {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|||||||
+8
-11
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2018, Matthew Steglinski <https://github.com/sainttx>
|
* Copyright (c) 2019, Adam <Adam@sigterm.info>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -24,15 +24,12 @@
|
|||||||
*/
|
*/
|
||||||
package net.runelite.api.events;
|
package net.runelite.api.events;
|
||||||
|
|
||||||
/**
|
import lombok.Value;
|
||||||
* An event when the local player dies.
|
import net.runelite.api.Skill;
|
||||||
*/
|
|
||||||
public class LocalPlayerDeath implements Event
|
|
||||||
{
|
|
||||||
public static final LocalPlayerDeath INSTANCE = new LocalPlayerDeath();
|
|
||||||
|
|
||||||
private LocalPlayerDeath()
|
@Value
|
||||||
{
|
public class FakeXpDrop implements Event
|
||||||
// noop
|
{
|
||||||
}
|
private final Skill skill;
|
||||||
|
private final int xp;
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package net.runelite.api.events;
|
||||||
|
|
||||||
|
import lombok.Value;
|
||||||
|
import net.runelite.api.Player;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This will fire whenever the {@link net.runelite.api.PlayerAppearance} hash changes.
|
||||||
|
*/
|
||||||
|
@Value
|
||||||
|
public class PlayerAppearanceChanged implements Event
|
||||||
|
{
|
||||||
|
private Player player;
|
||||||
|
}
|
||||||
@@ -24,13 +24,13 @@
|
|||||||
*/
|
*/
|
||||||
package net.runelite.api.hooks;
|
package net.runelite.api.hooks;
|
||||||
|
|
||||||
import net.runelite.api.MainBufferProvider;
|
|
||||||
import net.runelite.api.events.Event;
|
|
||||||
import net.runelite.api.widgets.WidgetItem;
|
|
||||||
import java.awt.Graphics;
|
import java.awt.Graphics;
|
||||||
import java.awt.event.KeyEvent;
|
import java.awt.event.KeyEvent;
|
||||||
import java.awt.event.MouseEvent;
|
import java.awt.event.MouseEvent;
|
||||||
import java.awt.event.MouseWheelEvent;
|
import java.awt.event.MouseWheelEvent;
|
||||||
|
import net.runelite.api.MainBufferProvider;
|
||||||
|
import net.runelite.api.events.Event;
|
||||||
|
import net.runelite.api.widgets.WidgetItem;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface of callbacks the injected client uses to send events
|
* Interface of callbacks the injected client uses to send events
|
||||||
@@ -42,14 +42,14 @@ public interface Callbacks
|
|||||||
*
|
*
|
||||||
* @param event the event
|
* @param event the event
|
||||||
*/
|
*/
|
||||||
<T> void post(Class<T> eventClass, Event event);
|
<T extends Event, E extends T> void post(Class<T> eventClass, E event);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Post a deferred event, which gets delayed until the next cycle.
|
* Post a deferred event, which gets delayed until the next cycle.
|
||||||
*
|
*
|
||||||
* @param event the event
|
* @param event the event
|
||||||
*/
|
*/
|
||||||
<T> void postDeferred(Class<T> eventClass, Event event);
|
<T extends Event, E extends T> void postDeferred(Class<T> eventClass, E event);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called each client cycle.
|
* Called each client cycle.
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ package net.runelite.api.widgets;
|
|||||||
|
|
||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import net.runelite.api.FontTypeFace;
|
import net.runelite.api.FontTypeFace;
|
||||||
import net.runelite.api.Point;
|
import net.runelite.api.Point;
|
||||||
import net.runelite.api.Sprite;
|
import net.runelite.api.Sprite;
|
||||||
@@ -243,13 +242,6 @@ public interface Widget
|
|||||||
*/
|
*/
|
||||||
void setName(String name);
|
void setName(String name);
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the model ID displayed in the widget.
|
|
||||||
*
|
|
||||||
* @return the model ID
|
|
||||||
*/
|
|
||||||
int getModelId();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the sprite ID displayed in the widget.
|
* Gets the sprite ID displayed in the widget.
|
||||||
*
|
*
|
||||||
@@ -295,6 +287,76 @@ public interface Widget
|
|||||||
*/
|
*/
|
||||||
int getIndex();
|
int getIndex();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the model ID displayed in the widget.
|
||||||
|
*
|
||||||
|
* @return the model ID
|
||||||
|
*/
|
||||||
|
int getModelId();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the model ID displayed in the widget
|
||||||
|
*
|
||||||
|
* @param modelId the new model ID
|
||||||
|
*/
|
||||||
|
void setModelId(int modelId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the x rotation of the model displayed in the widget
|
||||||
|
*
|
||||||
|
* @return the x rotation
|
||||||
|
*/
|
||||||
|
int getRotationX();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the x rotation of the model displayed in the widget
|
||||||
|
*
|
||||||
|
* @param rotationX 0 = no rotation, 2047 = full rotation, outside range = crash
|
||||||
|
*/
|
||||||
|
void setRotationX(int rotationX);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the y rotation of the model displayed in the widget
|
||||||
|
*
|
||||||
|
* @return the y rotation
|
||||||
|
*/
|
||||||
|
int getRotationY();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the y rotation of the model displayed in the widget
|
||||||
|
*
|
||||||
|
* @param rotationY 0 = no rotation, 2047 = full rotation, outside range = crash
|
||||||
|
*/
|
||||||
|
void setRotationY(int rotationY);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the z rotation of the model displayed in the widget
|
||||||
|
*
|
||||||
|
* @return the z rotation
|
||||||
|
*/
|
||||||
|
int getRotationZ();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the z rotation of the model displayed in the widget
|
||||||
|
*
|
||||||
|
* @param rotationZ 0 = no rotation, 2047 = full rotation, outside range = crash
|
||||||
|
*/
|
||||||
|
void setRotationZ(int rotationZ);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the amount zoomed in on the model displayed in the widget
|
||||||
|
*
|
||||||
|
* @return the amount zoomed in
|
||||||
|
*/
|
||||||
|
int getModelZoom();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the amount zoomed in on the model displayed in the widget
|
||||||
|
*
|
||||||
|
* @param modelZoom the new zoom amount
|
||||||
|
*/
|
||||||
|
void setModelZoom(int modelZoom);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the location the widget is being drawn on the canvas.
|
* Gets the location the widget is being drawn on the canvas.
|
||||||
* <p>
|
* <p>
|
||||||
|
|||||||
@@ -162,6 +162,7 @@ public class WidgetID
|
|||||||
public static final int JEWELLERY_BOX_GROUP_ID = 590;
|
public static final int JEWELLERY_BOX_GROUP_ID = 590;
|
||||||
public static final int OPTIONS_GROUP_ID = 261;
|
public static final int OPTIONS_GROUP_ID = 261;
|
||||||
public static final int THEATRE_OF_BLOOD_PARTY_GROUP_ID = 28;
|
public static final int THEATRE_OF_BLOOD_PARTY_GROUP_ID = 28;
|
||||||
|
public static final int GWD_KC_GROUP_ID = 406;
|
||||||
|
|
||||||
static class WorldMap
|
static class WorldMap
|
||||||
{
|
{
|
||||||
@@ -361,126 +362,126 @@ public class WidgetID
|
|||||||
|
|
||||||
static class Viewport
|
static class Viewport
|
||||||
{
|
{
|
||||||
static final int MINIMAP_RESIZABLE_WIDGET = 17;
|
static final int MINIMAP_RESIZABLE_WIDGET = 18;
|
||||||
static final int MINIMAP_RESIZABLE_CLICKBOX = 18;
|
static final int MINIMAP_RESIZABLE_CLICKBOX = 19;
|
||||||
static final int MINIMAP_RESIZABLE_DRAW_AREA = 25;
|
static final int MINIMAP_RESIZABLE_DRAW_AREA = 26;
|
||||||
static final int MINIMAP_RESIZABLE_DECORATIONS = 27;
|
static final int MINIMAP_RESIZABLE_DECORATIONS = 28;
|
||||||
static final int MINIMAP_RESIZABLE_ORB_HOLDER = 28;
|
static final int MINIMAP_RESIZABLE_ORB_HOLDER = 29;
|
||||||
static final int MINIMAP_RESIZABLE_LOGOUT_BUTTON = 30;
|
static final int MINIMAP_RESIZABLE_LOGOUT_BUTTON = 31;
|
||||||
static final int FIXED_VIEWPORT = 17;
|
static final int FIXED_VIEWPORT = 17;
|
||||||
static final int RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX = 12;
|
static final int RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX = 13;
|
||||||
static final int RESIZABLE_VIEWPORT_BOTTOM_LINE = 12;
|
static final int RESIZABLE_VIEWPORT_BOTTOM_LINE = 13;
|
||||||
}
|
}
|
||||||
|
|
||||||
static class FixedViewport
|
static class FixedViewport
|
||||||
{
|
{
|
||||||
static final int MINIMAP = 3;
|
static final int MINIMAP = 3;
|
||||||
static final int MINIMAP_DRAW_AREA = 8;
|
static final int MINIMAP_DRAW_AREA = 8;
|
||||||
static final int MULTICOMBAT_INDICATOR = 20;
|
static final int MULTICOMBAT_INDICATOR = 21;
|
||||||
static final int BANK_PIN = 21;
|
static final int BANK_PIN = 22;
|
||||||
static final int CLAN_CHAT_TAB = 31;
|
static final int CLAN_CHAT_TAB = 32;
|
||||||
static final int FRIENDS_TAB = 33;
|
static final int FRIENDS_TAB = 34;
|
||||||
static final int IGNORES_TAB = 32;
|
static final int IGNORES_TAB = 33;
|
||||||
static final int LOGOUT_TAB = 34;
|
static final int LOGOUT_TAB = 35;
|
||||||
static final int OPTIONS_TAB = 35;
|
static final int OPTIONS_TAB = 36;
|
||||||
static final int EMOTES_TAB = 36;
|
static final int EMOTES_TAB = 37;
|
||||||
static final int MUSIC_TAB = 37;
|
static final int MUSIC_TAB = 38;
|
||||||
static final int CLAN_CHAT_ICON = 38;
|
static final int CLAN_CHAT_ICON = 39;
|
||||||
static final int FRIENDS_ICON = 40;
|
static final int FRIENDS_ICON = 41;
|
||||||
static final int IGNORES_ICON = 39;
|
static final int IGNORES_ICON = 40;
|
||||||
static final int LOGOUT_ICON = 41;
|
static final int LOGOUT_ICON = 42;
|
||||||
static final int OPTIONS_ICON = 42;
|
static final int OPTIONS_ICON = 43;
|
||||||
static final int EMOTES_ICON = 43;
|
static final int EMOTES_ICON = 44;
|
||||||
static final int MUSIC_ICON = 44;
|
static final int MUSIC_ICON = 45;
|
||||||
static final int COMBAT_TAB = 48;
|
static final int COMBAT_TAB = 49;
|
||||||
static final int STATS_TAB = 49;
|
static final int STATS_TAB = 50;
|
||||||
static final int QUESTS_TAB = 50;
|
static final int QUESTS_TAB = 51;
|
||||||
static final int INVENTORY_TAB = 51;
|
static final int INVENTORY_TAB = 52;
|
||||||
static final int EQUIPMENT_TAB = 52;
|
static final int EQUIPMENT_TAB = 53;
|
||||||
static final int PRAYER_TAB = 53;
|
static final int PRAYER_TAB = 54;
|
||||||
static final int MAGIC_TAB = 54;
|
static final int MAGIC_TAB = 55;
|
||||||
static final int COMBAT_ICON = 55;
|
static final int COMBAT_ICON = 56;
|
||||||
static final int STATS_ICON = 56;
|
static final int STATS_ICON = 57;
|
||||||
static final int QUESTS_ICON = 57;
|
static final int QUESTS_ICON = 58;
|
||||||
static final int INVENTORY_ICON = 58;
|
static final int INVENTORY_ICON = 59;
|
||||||
static final int EQUIPMENT_ICON = 59;
|
static final int EQUIPMENT_ICON = 60;
|
||||||
static final int PRAYER_ICON = 60;
|
static final int PRAYER_ICON = 61;
|
||||||
static final int MAGIC_ICON = 61;
|
static final int MAGIC_ICON = 62;
|
||||||
static final int ROOT_INTERFACE_CONTAINER = 62;
|
static final int ROOT_INTERFACE_CONTAINER = 63;
|
||||||
static final int BANK_CONTAINER = 64;
|
static final int BANK_CONTAINER = 65;
|
||||||
static final int INTERFACE_CONTAINER = 65;
|
static final int INTERFACE_CONTAINER = 66;
|
||||||
static final int INVENTORY_CONTAINER = 69;
|
static final int INVENTORY_CONTAINER = 70;
|
||||||
}
|
}
|
||||||
|
|
||||||
static class ResizableViewport
|
static class ResizableViewport
|
||||||
{
|
{
|
||||||
static final int ITEMS_KEPT_ON_DEATH = 13;
|
static final int ITEMS_KEPT_ON_DEATH = 13;
|
||||||
static final int BANK_PIN = 13;
|
static final int BANK_PIN = 13;
|
||||||
static final int MULTICOMBAT_INDICATOR = 16;
|
static final int MULTICOMBAT_INDICATOR = 17;
|
||||||
static final int CLAN_CHAT_TAB = 35;
|
static final int CLAN_CHAT_TAB = 36;
|
||||||
static final int FRIENDS_TAB = 37;
|
static final int FRIENDS_TAB = 38;
|
||||||
static final int IGNORES_TAB = 36;
|
static final int IGNORES_TAB = 37;
|
||||||
static final int LOGOUT_TAB = 38;
|
static final int LOGOUT_TAB = 39;
|
||||||
static final int OPTIONS_TAB = 39;
|
static final int OPTIONS_TAB = 40;
|
||||||
static final int EMOTES_TAB = 40;
|
static final int EMOTES_TAB = 41;
|
||||||
static final int MUSIC_TAB = 41;
|
static final int MUSIC_TAB = 42;
|
||||||
static final int CLAN_CHAT_ICON = 42;
|
static final int CLAN_CHAT_ICON = 43;
|
||||||
static final int FRIENDS_ICON = 44;
|
static final int FRIENDS_ICON = 45;
|
||||||
static final int IGNORES_ICON = 43;
|
static final int IGNORES_ICON = 44;
|
||||||
static final int LOGOUT_ICON = 45;
|
static final int LOGOUT_ICON = 46;
|
||||||
static final int OPTIONS_ICON = 46;
|
static final int OPTIONS_ICON = 47;
|
||||||
static final int EMOTES_ICON = 47;
|
static final int EMOTES_ICON = 48;
|
||||||
static final int MUSIC_ICON = 48;
|
static final int MUSIC_ICON = 49;
|
||||||
static final int COMBAT_TAB = 51;
|
static final int COMBAT_TAB = 52;
|
||||||
static final int STATS_TAB = 52;
|
static final int STATS_TAB = 53;
|
||||||
static final int QUESTS_TAB = 53;
|
static final int QUESTS_TAB = 54;
|
||||||
static final int INVENTORY_TAB = 54;
|
static final int INVENTORY_TAB = 55;
|
||||||
static final int EQUIPMENT_TAB = 55;
|
static final int EQUIPMENT_TAB = 56;
|
||||||
static final int PRAYER_TAB = 56;
|
static final int PRAYER_TAB = 57;
|
||||||
static final int MAGIC_TAB = 57;
|
static final int MAGIC_TAB = 58;
|
||||||
static final int COMBAT_ICON = 58;
|
static final int COMBAT_ICON = 59;
|
||||||
static final int STATS_ICON = 59;
|
static final int STATS_ICON = 60;
|
||||||
static final int QUESTS_ICON = 60;
|
static final int QUESTS_ICON = 61;
|
||||||
static final int INVENTORY_ICON = 61;
|
static final int INVENTORY_ICON = 62;
|
||||||
static final int EQUIPMENT_ICON = 62;
|
static final int EQUIPMENT_ICON = 63;
|
||||||
static final int PRAYER_ICON = 63;
|
static final int PRAYER_ICON = 64;
|
||||||
static final int MAGIC_ICON = 64;
|
static final int MAGIC_ICON = 65;
|
||||||
static final int INTERFACE_CONTAINER = 65;
|
static final int INTERFACE_CONTAINER = 66;
|
||||||
static final int INVENTORY_CONTAINER = 71;
|
static final int INVENTORY_CONTAINER = 72;
|
||||||
}
|
}
|
||||||
|
|
||||||
static class ResizableViewportBottomLine
|
static class ResizableViewportBottomLine
|
||||||
{
|
{
|
||||||
static final int BANK_PIN = 13;
|
static final int BANK_PIN = 13;
|
||||||
static final int LOGOUT_BUTTON_OVERLAY = 29;
|
static final int LOGOUT_BUTTON_OVERLAY = 30;
|
||||||
static final int CMB_TAB = 50;
|
static final int CMB_TAB = 50;
|
||||||
static final int CMB_ICON = 57;
|
static final int CMB_ICON = 58;
|
||||||
static final int SKILLS_TAB = 51;
|
static final int SKILLS_TAB = 51;
|
||||||
static final int SKILLS_ICON = 58;
|
static final int SKILLS_ICON = 59;
|
||||||
static final int QUESTS_TAB = 52;
|
static final int QUESTS_TAB = 52;
|
||||||
static final int QUESTS_ICON = 59;
|
static final int QUESTS_ICON = 60;
|
||||||
static final int INVENTORY_TAB = 53;
|
static final int INVENTORY_TAB = 54;
|
||||||
static final int INVENTORY_ICON = 60;
|
static final int INVENTORY_ICON = 61;
|
||||||
static final int EQUIP_TAB = 54;
|
static final int EQUIP_TAB = 54;
|
||||||
static final int EQUIP_ICON = 61;
|
static final int EQUIP_ICON = 62;
|
||||||
static final int PRAYER_TAB = 55;
|
static final int PRAYER_TAB = 56;
|
||||||
static final int PRAYER_ICON = 62;
|
static final int PRAYER_ICON = 63;
|
||||||
static final int MAGIC_TAB = 56;
|
static final int SPELL_TAB = 56;
|
||||||
static final int SPELL_ICON = 53;
|
static final int SPELL_ICON = 53;
|
||||||
static final int FC_TAB = 35;
|
static final int FC_TAB = 35;
|
||||||
static final int FC_ICON = 41;
|
static final int FC_ICON = 42;
|
||||||
static final int IGNORE_TAB = 36;
|
static final int IGNORE_TAB = 36;
|
||||||
static final int IGNORE_ICON = 42;
|
static final int IGNORE_ICON = 42;
|
||||||
static final int FRIEND_TAB = 37;
|
static final int FRIEND_TAB = 37;
|
||||||
static final int FRIEND_ICON = 43;
|
static final int FRIEND_ICON = 44;
|
||||||
static final int SETTINGS_TAB = 38;
|
static final int SETTINGS_TAB = 38;
|
||||||
static final int SETTINGS_ICON = 44;
|
static final int SETTINGS_ICON = 45;
|
||||||
static final int EMOTE_TAB = 39;
|
static final int EMOTE_TAB = 39;
|
||||||
static final int EMOTE_ICON = 45;
|
static final int EMOTE_ICON = 46;
|
||||||
static final int MUSIC_TAB = 40;
|
static final int MUSIC_TAB = 40;
|
||||||
static final int MUSIC_ICON = 46;
|
static final int MUSIC_ICON = 47;
|
||||||
static final int MAGIC_ICON = 63;
|
static final int MAGIC_ICON = 64;
|
||||||
static final int INVENTORY_CONTAINER = 71;
|
static final int INVENTORY_CONTAINER = 72;
|
||||||
}
|
}
|
||||||
|
|
||||||
static class Chatbox
|
static class Chatbox
|
||||||
@@ -659,6 +660,11 @@ public class WidgetID
|
|||||||
static final int REWARD_TEXT = 57;
|
static final int REWARD_TEXT = 57;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static class GWD
|
||||||
|
{
|
||||||
|
static final int CONTAINER = 7;
|
||||||
|
}
|
||||||
|
|
||||||
static class LevelUp
|
static class LevelUp
|
||||||
{
|
{
|
||||||
static final int SKILL = 1;
|
static final int SKILL = 1;
|
||||||
@@ -830,164 +836,178 @@ public class WidgetID
|
|||||||
|
|
||||||
static class SpellBook
|
static class SpellBook
|
||||||
{
|
{
|
||||||
static final int FILTERED_SPELLS_PARENT = 1;
|
|
||||||
static final int FILTERED_SPELLS_BOUNDS = 3;
|
static final int FILTERED_SPELLS_BOUNDS = 3;
|
||||||
|
static final int TOOLTIP = 189;
|
||||||
|
|
||||||
// NORMAL SPELLS
|
// NORMAL SPELLS
|
||||||
static final int LUMBRIDGE_HOME_TELEPORT = 4;
|
static final int LUMBRIDGE_HOME_TELEPORT = 5;
|
||||||
static final int WIND_STRIKE = 5;
|
static final int WIND_STRIKE = 6;
|
||||||
static final int CONFUSE = 6;
|
static final int CONFUSE = 7;
|
||||||
static final int ENCHANT_CROSSBOW_BOLT = 7;
|
static final int ENCHANT_CROSSBOW_BOLT = 8;
|
||||||
static final int WATER_STRIKE = 8;
|
static final int WATER_STRIKE = 9;
|
||||||
static final int LVL_1_ENCHANT = 9;
|
static final int LVL_1_ENCHANT = 10;
|
||||||
static final int EARTH_STRIKE = 10;
|
static final int EARTH_STRIKE = 11;
|
||||||
static final int WEAKEN = 11;
|
static final int WEAKEN = 12;
|
||||||
static final int FIRE_STRIKE = 12;
|
static final int FIRE_STRIKE = 13;
|
||||||
static final int BONES_TO_BANANAS = 13;
|
static final int BONES_TO_BANANAS = 14;
|
||||||
static final int WIND_BOLT = 14;
|
static final int WIND_BOLT = 15;
|
||||||
static final int CURSE = 15;
|
static final int CURSE = 16;
|
||||||
static final int BIND = 16;
|
static final int BIND = 17;
|
||||||
static final int LOW_LEVEL_ALCHEMY = 17;
|
static final int LOW_LEVEL_ALCHEMY = 18;
|
||||||
static final int WATER_BOLT = 18;
|
static final int WATER_BOLT = 19;
|
||||||
static final int VARROCK_TELEPORT = 19;
|
static final int VARROCK_TELEPORT = 20;
|
||||||
static final int LVL_2_ENCHANT = 20;
|
static final int LVL_2_ENCHANT = 21;
|
||||||
static final int EARTH_BOLT = 21;
|
static final int EARTH_BOLT = 22;
|
||||||
static final int LUMBRIDGE_TELEPORT = 22;
|
static final int LUMBRIDGE_TELEPORT = 23;
|
||||||
static final int TELEKINETIC_GRAB = 23;
|
static final int TELEKINETIC_GRAB = 24;
|
||||||
static final int FIRE_BOLT = 24;
|
static final int FIRE_BOLT = 25;
|
||||||
static final int FALADOR_TELEPORT = 25;
|
static final int FALADOR_TELEPORT = 26;
|
||||||
static final int CRUMBLE_UNDEAD = 26;
|
static final int CRUMBLE_UNDEAD = 27;
|
||||||
static final int TELEPORT_TO_HOUSE = 27;
|
static final int TELEPORT_TO_HOUSE = 28;
|
||||||
static final int WIND_BLAST = 28;
|
static final int WIND_BLAST = 29;
|
||||||
static final int SUPERHEAT_ITEM = 29;
|
static final int SUPERHEAT_ITEM = 30;
|
||||||
static final int CAMELOT_TELEPORT = 30;
|
static final int CAMELOT_TELEPORT = 31;
|
||||||
static final int WATER_BLAST = 31;
|
static final int WATER_BLAST = 32;
|
||||||
static final int LVL_3_ENCHANT = 32;
|
static final int LVL_3_ENCHANT = 33;
|
||||||
static final int IBAN_BLAST = 33;
|
static final int IBAN_BLAST = 34;
|
||||||
static final int SNARE = 34;
|
static final int SNARE = 35;
|
||||||
static final int MAGIC_DART = 35;
|
static final int MAGIC_DART = 36;
|
||||||
static final int ARDOUGNE_TELEPORT = 36;
|
static final int ARDOUGNE_TELEPORT = 37;
|
||||||
static final int EARTH_BLAST = 37;
|
static final int EARTH_BLAST = 38;
|
||||||
static final int HIGH_LEVEL_ALCHEMY = 38;
|
static final int HIGH_LEVEL_ALCHEMY = 39;
|
||||||
static final int CHARGE_WATER_ORB = 39;
|
static final int CHARGE_WATER_ORB = 40;
|
||||||
static final int LVL_4_ENCHANT = 40;
|
static final int LVL_4_ENCHANT = 41;
|
||||||
static final int WATCHTOWER_TELEPORT = 41;
|
static final int WATCHTOWER_TELEPORT = 42;
|
||||||
static final int FIRE_BLAST = 42;
|
static final int FIRE_BLAST = 43;
|
||||||
static final int CHARGE_EARTH_ORB = 43;
|
static final int CHARGE_EARTH_ORB = 44;
|
||||||
static final int BONES_TO_PEACHES = 44;
|
static final int BONES_TO_PEACHES = 45;
|
||||||
static final int SARADOMIN_STRIKE = 45;
|
static final int SARADOMIN_STRIKE = 46;
|
||||||
static final int CLAWS_OF_GUTHIX = 46;
|
static final int CLAWS_OF_GUTHIX = 47;
|
||||||
static final int FLAMES_OF_ZAMORAK = 47;
|
static final int FLAMES_OF_ZAMORAK = 48;
|
||||||
static final int TROLLHEIM_TELEPORT = 48;
|
static final int TROLLHEIM_TELEPORT = 49;
|
||||||
static final int WIND_WAVE = 49;
|
static final int WIND_WAVE = 50;
|
||||||
static final int CHARGE_FIRE_ORB = 50;
|
static final int CHARGE_FIRE_ORB = 51;
|
||||||
static final int TELEPORT_TO_APE_ATOLL = 51;
|
static final int TELEPORT_TO_APE_ATOLL = 52;
|
||||||
static final int WATER_WAVE = 52;
|
static final int WATER_WAVE = 53;
|
||||||
static final int CHARGE_AIR_ORB = 53;
|
static final int CHARGE_AIR_ORB = 54;
|
||||||
static final int VULNERABILITY = 54;
|
static final int VULNERABILITY = 55;
|
||||||
static final int LVL_5_ENCHANT = 55;
|
static final int LVL_5_ENCHANT = 56;
|
||||||
static final int TELEPORT_TO_KOUREND = 56;
|
static final int TELEPORT_TO_KOUREND = 57;
|
||||||
static final int EARTH_WAVE = 57;
|
static final int EARTH_WAVE = 58;
|
||||||
static final int ENFEEBLE = 58;
|
static final int ENFEEBLE = 59;
|
||||||
static final int TELEOTHER_LUMBRIDGE = 59;
|
static final int TELEOTHER_LUMBRIDGE = 60;
|
||||||
static final int FIRE_WAVE = 60;
|
static final int FIRE_WAVE = 61;
|
||||||
static final int ENTANGLE = 61;
|
static final int ENTANGLE = 62;
|
||||||
static final int STUN = 62;
|
static final int STUN = 63;
|
||||||
static final int CHARGE = 63;
|
static final int CHARGE = 64;
|
||||||
static final int WIND_SURGE = 64;
|
static final int WIND_SURGE = 65;
|
||||||
static final int TELEOTHER_FALADOR = 65;
|
static final int TELEOTHER_FALADOR = 66;
|
||||||
static final int WATER_SURGE = 66;
|
static final int WATER_SURGE = 67;
|
||||||
static final int TELE_BLOCK = 67;
|
static final int TELE_BLOCK = 68;
|
||||||
static final int BOUNTY_TARGET_TELEPORT = 68;
|
static final int BOUNTY_TARGET_TELEPORT = 69;
|
||||||
static final int LVL_6_ENCHANT = 69;
|
static final int LVL_6_ENCHANT = 70;
|
||||||
static final int TELEOTHER_CAMELOT = 70;
|
static final int TELEOTHER_CAMELOT = 71;
|
||||||
static final int EARTH_SURGE = 71;
|
static final int EARTH_SURGE = 72;
|
||||||
static final int LVL_7_ENCHANT = 72;
|
static final int LVL_7_ENCHANT = 73;
|
||||||
static final int FIRE_SURGE = 73;
|
static final int FIRE_SURGE = 74;
|
||||||
|
|
||||||
// ANCIENT SPELLS
|
// ANCIENT SPELLS
|
||||||
static final int ICE_RUSH = 74;
|
static final int ICE_RUSH = 75;
|
||||||
static final int ICE_BLITZ = 75;
|
static final int ICE_BLITZ = 76;
|
||||||
static final int ICE_BURST = 76;
|
static final int ICE_BURST = 77;
|
||||||
static final int ICE_BARRAGE = 77;
|
static final int ICE_BARRAGE = 78;
|
||||||
static final int BLOOD_RUSH = 78;
|
static final int BLOOD_RUSH = 79;
|
||||||
static final int BLOOD_BLITZ = 79;
|
static final int BLOOD_BLITZ = 80;
|
||||||
static final int BLOOD_BURST = 80;
|
static final int BLOOD_BURST = 81;
|
||||||
static final int BLOOD_BARRAGE = 81;
|
static final int BLOOD_BARRAGE = 82;
|
||||||
static final int SMOKE_RUSH = 82;
|
static final int SMOKE_RUSH = 83;
|
||||||
static final int SMOKE_BLITZ = 83;
|
static final int SMOKE_BLITZ = 84;
|
||||||
static final int SMOKE_BURST = 84;
|
static final int SMOKE_BURST = 85;
|
||||||
static final int SMOKE_BARRAGE = 85;
|
static final int SMOKE_BARRAGE = 86;
|
||||||
static final int SHADOW_RUSH = 86;
|
static final int SHADOW_RUSH = 87;
|
||||||
static final int SHADOW_BLITZ = 87;
|
static final int SHADOW_BLITZ = 88;
|
||||||
static final int SHADOW_BURST = 88;
|
static final int SHADOW_BURST = 89;
|
||||||
static final int SHADOW_BARRAGE = 89;
|
static final int SHADOW_BARRAGE = 90;
|
||||||
static final int PADDEWWA_TELEPORT = 90;
|
static final int PADDEWWA_TELEPORT = 91;
|
||||||
static final int SENNTISTEN_TELEPORT = 91;
|
static final int SENNTISTEN_TELEPORT = 92;
|
||||||
static final int KHARYRLL_TELEPORT = 92;
|
static final int KHARYRLL_TELEPORT = 93;
|
||||||
static final int LASSAR_TELEPORT = 93;
|
static final int LASSAR_TELEPORT = 94;
|
||||||
static final int DAREEYAK_TELEPORT = 94;
|
static final int DAREEYAK_TELEPORT = 95;
|
||||||
static final int CARRALLANGER_TELEPORT = 95;
|
static final int CARRALLANGER_TELEPORT = 96;
|
||||||
static final int ANNAKARL_TELEPORT = 96;
|
static final int ANNAKARL_TELEPORT = 97;
|
||||||
static final int GHORROCK_TELEPORT = 97;
|
static final int GHORROCK_TELEPORT = 98;
|
||||||
static final int EDGEVILLE_HOME_TELEPORT = 98;
|
static final int EDGEVILLE_HOME_TELEPORT = 99;
|
||||||
static final int TOOLTIP = 188;
|
|
||||||
|
|
||||||
|
|
||||||
// LUNAR SPELLS
|
// LUNAR SPELLS
|
||||||
static final int LUNAR_HOME_TELEPORT = 99;
|
static final int LUNAR_HOME_TELEPORT = 100;
|
||||||
static final int BAKE_PIE = 100;
|
static final int BAKE_PIE = 101;
|
||||||
static final int CURE_PLANT = 101;
|
static final int CURE_PLANT = 102;
|
||||||
static final int MONSTER_EXAMINE = 102;
|
static final int MONSTER_EXAMINE = 103;
|
||||||
static final int NPC_CONTACT = 103;
|
static final int NPC_CONTACT = 104;
|
||||||
static final int CURE_OTHER = 104;
|
static final int CURE_OTHER = 105;
|
||||||
static final int HUMIDIFY = 105;
|
static final int HUMIDIFY = 106;
|
||||||
static final int MOONCLAN_TELEPORT = 106;
|
static final int MOONCLAN_TELEPORT = 107;
|
||||||
static final int TELE_GROUP_MOONCLAN = 107;
|
static final int TELE_GROUP_MOONCLAN = 108;
|
||||||
static final int CURE_ME = 108;
|
static final int CURE_ME = 109;
|
||||||
static final int HUNTER_KIT = 109;
|
static final int HUNTER_KIT = 110;
|
||||||
static final int WATERBIRTH_TELEPORT = 110;
|
static final int WATERBIRTH_TELEPORT = 111;
|
||||||
static final int TELE_GROUP_WATERBIRTH = 111;
|
static final int TELE_GROUP_WATERBIRTH = 112;
|
||||||
static final int CURE_GROUP = 112;
|
static final int CURE_GROUP = 113;
|
||||||
static final int STAT_SPY = 113;
|
static final int STAT_SPY = 114;
|
||||||
static final int BARBARIAN_TELEPORT = 114;
|
static final int BARBARIAN_TELEPORT = 115;
|
||||||
static final int TELE_GROUP_BARBARIAN = 115;
|
static final int TELE_GROUP_BARBARIAN = 116;
|
||||||
static final int SUPERGLASS_MAKE = 116;
|
static final int SUPERGLASS_MAKE = 117;
|
||||||
static final int TAN_LEATHER = 117;
|
static final int TAN_LEATHER = 118;
|
||||||
static final int KHAZARD_TELEPORT = 118;
|
static final int KHAZARD_TELEPORT = 119;
|
||||||
static final int TELE_GROUP_KHAZARD = 119;
|
static final int TELE_GROUP_KHAZARD = 120;
|
||||||
static final int DREAM = 120;
|
static final int DREAM = 121;
|
||||||
static final int STRING_JEWELLERY = 121;
|
static final int STRING_JEWELLERY = 122;
|
||||||
static final int STAT_RESTORE_POT_SHARE = 122;
|
static final int STAT_RESTORE_POT_SHARE = 123;
|
||||||
static final int MAGIC_IMBUE = 123;
|
static final int MAGIC_IMBUE = 124;
|
||||||
static final int FERTILE_SOIL = 124;
|
static final int FERTILE_SOIL = 125;
|
||||||
static final int BOOST_POTION_SHARE = 125;
|
static final int BOOST_POTION_SHARE = 126;
|
||||||
static final int FISHING_GUILD_TELEPORT = 126;
|
static final int FISHING_GUILD_TELEPORT = 127;
|
||||||
static final int TELE_GROUP_FISHING_GUILD = 127;
|
static final int TELE_GROUP_FISHING_GUILD = 128;
|
||||||
static final int PLANK_MAKE = 128;
|
static final int PLANK_MAKE = 129;
|
||||||
static final int CATHERBY_TELEPORT = 129;
|
static final int CATHERBY_TELEPORT = 130;
|
||||||
static final int TELE_GROUP_CATHERBY = 130;
|
static final int TELE_GROUP_CATHERBY = 131;
|
||||||
static final int RECHARGE_DRAGONSTONE = 131;
|
static final int RECHARGE_DRAGONSTONE = 132;
|
||||||
static final int ICE_PLATEAU_TELEPORT = 132;
|
static final int ICE_PLATEAU_TELEPORT = 133;
|
||||||
static final int TELE_GROUP_ICE_PLATEAU = 133;
|
static final int TELE_GROUP_ICE_PLATEAU = 134;
|
||||||
static final int ENERGY_TRANSFER = 134;
|
static final int ENERGY_TRANSFER = 135;
|
||||||
static final int HEAL_OTHER = 135;
|
static final int HEAL_OTHER = 136;
|
||||||
static final int VENGEANCE_OTHER = 136;
|
static final int VENGEANCE_OTHER = 137;
|
||||||
static final int VENGEANCE = 137;
|
static final int VENGEANCE = 138;
|
||||||
static final int HEAL_GROUP = 138;
|
static final int HEAL_GROUP = 139;
|
||||||
static final int SPELLBOOK_SWAP = 139;
|
static final int SPELLBOOK_SWAP = 140;
|
||||||
static final int GEOMANCY = 140;
|
static final int GEOMANCY = 141;
|
||||||
static final int SPIN_FLAX = 141;
|
static final int SPIN_FLAX = 142;
|
||||||
static final int OURANIA_TELEPORT = 142;
|
static final int OURANIA_TELEPORT = 143;
|
||||||
|
|
||||||
// ARCEUUS SPELLS
|
// ARCEUUS SPELLS
|
||||||
static final int ARCEUUS_HOME_TELEPORT = 143;
|
static final int ARCEUUS_HOME_TELEPORT = 144;
|
||||||
static final int BATTLEFRONT_TELEPORT = 178;
|
static final int BATTLEFRONT_TELEPORT = 179;
|
||||||
|
}
|
||||||
|
|
||||||
static final int FILTER_SECTION_PARENT = 181;
|
static class StandardSpellBook
|
||||||
static final int FILTER_BUTTONS_PARENT = 184;
|
{
|
||||||
static final int FILTER_BUTTON_PARENT = 185;
|
static final int LUMBRIDGE_HOME_TELEPORT = 5;
|
||||||
static final int FILTER_BUTTON = 187;
|
static final int KOUREND_HOME_TELEPORT = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
static class AncientSpellBook
|
||||||
|
{
|
||||||
|
static final int EDGEVILLE_HOME_TELEPORT = 99;
|
||||||
|
}
|
||||||
|
|
||||||
|
static class LunarSpellBook
|
||||||
|
{
|
||||||
|
static final int LUNAR_HOME_TELEPORT = 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
static class ArceuusSpellBook
|
||||||
|
{
|
||||||
|
static final int ARCEUUS_HOME_TELEPORT = 144;
|
||||||
}
|
}
|
||||||
|
|
||||||
static class Pvp
|
static class Pvp
|
||||||
@@ -1025,7 +1045,7 @@ public class WidgetID
|
|||||||
|
|
||||||
static class FullScreenMap
|
static class FullScreenMap
|
||||||
{
|
{
|
||||||
static final int ROOT = 25;
|
static final int ROOT = 26;
|
||||||
}
|
}
|
||||||
|
|
||||||
static class QuestList
|
static class QuestList
|
||||||
|
|||||||
@@ -271,7 +271,7 @@ public enum WidgetInfo
|
|||||||
RESIZABLE_VIEWPORT_BOTTOM_LINE_EQUIPMENT_ICON(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewportBottomLine.EQUIP_ICON),
|
RESIZABLE_VIEWPORT_BOTTOM_LINE_EQUIPMENT_ICON(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewportBottomLine.EQUIP_ICON),
|
||||||
RESIZABLE_VIEWPORT_BOTTOM_LINE_COMBAT_ICON(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewportBottomLine.CMB_ICON),
|
RESIZABLE_VIEWPORT_BOTTOM_LINE_COMBAT_ICON(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewportBottomLine.CMB_ICON),
|
||||||
RESIZABLE_VIEWPORT_BOTTOM_LINE_STATS_ICON(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewportBottomLine.SKILLS_ICON),
|
RESIZABLE_VIEWPORT_BOTTOM_LINE_STATS_ICON(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewportBottomLine.SKILLS_ICON),
|
||||||
RESIZABLE_VIEWPORT_BOTTOM_LINE_MAGIC_TAB(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewportBottomLine.MAGIC_TAB),
|
RESIZABLE_VIEWPORT_BOTTOM_LINE_MAGIC_TAB(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewportBottomLine.SPELL_TAB),
|
||||||
RESIZABLE_VIEWPORT_BOTTOM_LINE_MAGIC_ICON(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewportBottomLine.MAGIC_ICON),
|
RESIZABLE_VIEWPORT_BOTTOM_LINE_MAGIC_ICON(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewportBottomLine.MAGIC_ICON),
|
||||||
RESIZABLE_VIEWPORT_BOTTOM_LINE_FRIEND_ICON(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewportBottomLine.FRIEND_ICON),
|
RESIZABLE_VIEWPORT_BOTTOM_LINE_FRIEND_ICON(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewportBottomLine.FRIEND_ICON),
|
||||||
RESIZABLE_VIEWPORT_BOTTOM_LINE_FRIEND_CHAT_ICON(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewportBottomLine.FC_ICON),
|
RESIZABLE_VIEWPORT_BOTTOM_LINE_FRIEND_CHAT_ICON(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewportBottomLine.FC_ICON),
|
||||||
@@ -430,6 +430,8 @@ public enum WidgetInfo
|
|||||||
MOTHERLODE_MINE(WidgetID.MOTHERLODE_MINE_GROUP_ID, 0),
|
MOTHERLODE_MINE(WidgetID.MOTHERLODE_MINE_GROUP_ID, 0),
|
||||||
|
|
||||||
THEATRE_OF_BLOOD_PARTY(WidgetID.THEATRE_OF_BLOOD_PARTY_GROUP_ID, WidgetID.TheatreOfBloodParty.CONTAINER),
|
THEATRE_OF_BLOOD_PARTY(WidgetID.THEATRE_OF_BLOOD_PARTY_GROUP_ID, WidgetID.TheatreOfBloodParty.CONTAINER),
|
||||||
|
|
||||||
|
GWD_KC(WidgetID.GWD_KC_GROUP_ID, WidgetID.GWD.CONTAINER),
|
||||||
|
|
||||||
PUZZLE_BOX(WidgetID.PUZZLE_BOX_GROUP_ID, WidgetID.PuzzleBox.VISIBLE_BOX),
|
PUZZLE_BOX(WidgetID.PUZZLE_BOX_GROUP_ID, WidgetID.PuzzleBox.VISIBLE_BOX),
|
||||||
|
|
||||||
@@ -512,6 +514,7 @@ public enum WidgetInfo
|
|||||||
|
|
||||||
PVP_FOG_OVERLAY(WidgetID.PVP_GROUP_ID, WidgetID.Pvp.FOG_OVERLAY),
|
PVP_FOG_OVERLAY(WidgetID.PVP_GROUP_ID, WidgetID.Pvp.FOG_OVERLAY),
|
||||||
PVP_CONTAINER(WidgetID.PVP_GROUP_ID, WidgetID.Pvp.PVP_WIDGET_CONTAINER),
|
PVP_CONTAINER(WidgetID.PVP_GROUP_ID, WidgetID.Pvp.PVP_WIDGET_CONTAINER),
|
||||||
|
|
||||||
PVP_SKULL_CONTAINER(WidgetID.PVP_GROUP_ID, WidgetID.Pvp.SKULL_CONTAINER),
|
PVP_SKULL_CONTAINER(WidgetID.PVP_GROUP_ID, WidgetID.Pvp.SKULL_CONTAINER),
|
||||||
PVP_SKULL(WidgetID.PVP_GROUP_ID, WidgetID.Pvp.SKULL),
|
PVP_SKULL(WidgetID.PVP_GROUP_ID, WidgetID.Pvp.SKULL),
|
||||||
PVP_ATTACK_RANGE(WidgetID.PVP_GROUP_ID, WidgetID.Pvp.ATTACK_RANGE),
|
PVP_ATTACK_RANGE(WidgetID.PVP_GROUP_ID, WidgetID.Pvp.ATTACK_RANGE),
|
||||||
@@ -523,10 +526,9 @@ public enum WidgetInfo
|
|||||||
PVP_KILLDEATH_COUNTER(WidgetID.PVP_GROUP_ID, WidgetID.Pvp.KILLDEATH_RATIO),
|
PVP_KILLDEATH_COUNTER(WidgetID.PVP_GROUP_ID, WidgetID.Pvp.KILLDEATH_RATIO),
|
||||||
|
|
||||||
SPELLBOOK(WidgetID.SPELLBOOK_GROUP_ID, 0),
|
SPELLBOOK(WidgetID.SPELLBOOK_GROUP_ID, 0),
|
||||||
SPELLBOOK_FILTERED_SPELLS_PARENT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FILTERED_SPELLS_PARENT),
|
|
||||||
SPELLBOOK_FILTERED_BOUNDS(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FILTERED_SPELLS_BOUNDS),
|
SPELLBOOK_FILTERED_BOUNDS(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FILTERED_SPELLS_BOUNDS),
|
||||||
|
|
||||||
/* STANDARD SPELL BOOK WIDGETS*/
|
/* STANDARD SPELL BOOK WIDGETS*/
|
||||||
SPELL_LUMBRIDGE_HOME_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LUMBRIDGE_HOME_TELEPORT),
|
SPELL_LUMBRIDGE_HOME_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LUMBRIDGE_HOME_TELEPORT),
|
||||||
SPELL_WIND_STRIKE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WIND_STRIKE),
|
SPELL_WIND_STRIKE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.WIND_STRIKE),
|
||||||
SPELL_CONFUSE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CONFUSE),
|
SPELL_CONFUSE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.CONFUSE),
|
||||||
@@ -597,7 +599,7 @@ public enum WidgetInfo
|
|||||||
SPELL_LVL_7_ENCHANT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LVL_7_ENCHANT),
|
SPELL_LVL_7_ENCHANT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LVL_7_ENCHANT),
|
||||||
SPELL_FIRE_SURGE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FIRE_SURGE),
|
SPELL_FIRE_SURGE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FIRE_SURGE),
|
||||||
SPELL_BOUNTY_TARGET_TELEPORT2(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BOUNTY_TARGET_TELEPORT),
|
SPELL_BOUNTY_TARGET_TELEPORT2(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BOUNTY_TARGET_TELEPORT),
|
||||||
/* END OF STANDARD SPELL BOOK WIDGETS*/
|
/* END OF STANDARD SPELL BOOK WIDGETS*/
|
||||||
|
|
||||||
/* ANCIENT SPELL BOOK WIDGETS*/
|
/* ANCIENT SPELL BOOK WIDGETS*/
|
||||||
SPELL_ICE_RUSH(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ICE_RUSH),
|
SPELL_ICE_RUSH(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ICE_RUSH),
|
||||||
@@ -626,9 +628,9 @@ public enum WidgetInfo
|
|||||||
SPELL_GHORROCK_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.GHORROCK_TELEPORT),
|
SPELL_GHORROCK_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.GHORROCK_TELEPORT),
|
||||||
SPELL_EDGEVILLE_HOME_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.EDGEVILLE_HOME_TELEPORT),
|
SPELL_EDGEVILLE_HOME_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.EDGEVILLE_HOME_TELEPORT),
|
||||||
SPELL_BOUNTY_TARGET_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BOUNTY_TARGET_TELEPORT),
|
SPELL_BOUNTY_TARGET_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BOUNTY_TARGET_TELEPORT),
|
||||||
/* END OF ANCIENT SPELL BOOK WIDGETS*/
|
/* END OF ANCIENT SPELL BOOK WIDGETS*/
|
||||||
|
|
||||||
/* LUNAR SPELL BOOK WIDGETS*/
|
/* LUNAR SPELL BOOK WIDGETS*/
|
||||||
SPELL_LUNAR_HOME_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LUNAR_HOME_TELEPORT),
|
SPELL_LUNAR_HOME_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.LUNAR_HOME_TELEPORT),
|
||||||
SPELL_VENGEANCE_OTHER(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.VENGEANCE_OTHER),
|
SPELL_VENGEANCE_OTHER(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.VENGEANCE_OTHER),
|
||||||
SPELL_VENGEANCE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.VENGEANCE),
|
SPELL_VENGEANCE(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.VENGEANCE),
|
||||||
@@ -674,17 +676,13 @@ public enum WidgetInfo
|
|||||||
SPELL_GEOMANCY(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.GEOMANCY),
|
SPELL_GEOMANCY(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.GEOMANCY),
|
||||||
SPELL_SPIN_FLAX(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SPIN_FLAX),
|
SPELL_SPIN_FLAX(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.SPIN_FLAX),
|
||||||
SPELL_OURANIA_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.OURANIA_TELEPORT),
|
SPELL_OURANIA_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.OURANIA_TELEPORT),
|
||||||
/* END OF LUNAR SPELL BOOK WIDGETS*/
|
/* END OF LUNAR SPELL BOOK WIDGETS*/
|
||||||
SPELL_TOOLTIP(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TOOLTIP),
|
SPELL_TOOLTIP(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.TOOLTIP),
|
||||||
/* ARCEUUS SPELL BOOK WIDGETS*/
|
/* ARCEUUS SPELL BOOK WIDGETS*/
|
||||||
|
SPELL_KOUREND_HOME_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.StandardSpellBook.KOUREND_HOME_TELEPORT),
|
||||||
SPELL_ARCEUUS_HOME_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ARCEUUS_HOME_TELEPORT),
|
SPELL_ARCEUUS_HOME_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.ARCEUUS_HOME_TELEPORT),
|
||||||
SPELL_BATTLEFRONT_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BATTLEFRONT_TELEPORT),
|
SPELL_BATTLEFRONT_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.BATTLEFRONT_TELEPORT),
|
||||||
/* END OF ARCEUUS SPELL BOOK WIDGETS*/
|
/* END OF ARCEUUS SPELL BOOK WIDGETS*/
|
||||||
SPELLBOOK_FILTER_SECTION_PARENT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FILTER_SECTION_PARENT),
|
|
||||||
SPELLBOOK_FILTER_BUTTONS_PARENT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FILTER_BUTTONS_PARENT),
|
|
||||||
SPELLBOOK_FILTER_BUTTON_PARENT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FILTER_BUTTON_PARENT),
|
|
||||||
SPELLBOOK_FILTER_BUTTON(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.SpellBook.FILTER_BUTTON),
|
|
||||||
|
|
||||||
|
|
||||||
KOUREND_FAVOUR_OVERLAY(WidgetID.KOUREND_FAVOUR_GROUP_ID, WidgetID.KourendFavour.KOUREND_FAVOUR_OVERLAY),
|
KOUREND_FAVOUR_OVERLAY(WidgetID.KOUREND_FAVOUR_GROUP_ID, WidgetID.KourendFavour.KOUREND_FAVOUR_OVERLAY),
|
||||||
ZEAH_MESS_HALL_COOKING_DISPLAY(WidgetID.ZEAH_MESS_HALL_GROUP_ID, WidgetID.Zeah.MESS_HALL_COOKING_DISPLAY),
|
ZEAH_MESS_HALL_COOKING_DISPLAY(WidgetID.ZEAH_MESS_HALL_GROUP_ID, WidgetID.Zeah.MESS_HALL_COOKING_DISPLAY),
|
||||||
@@ -696,7 +694,6 @@ public enum WidgetInfo
|
|||||||
MULTICOMBAT_FIXED(WidgetID.FIXED_VIEWPORT_GROUP_ID, WidgetID.FixedViewport.MULTICOMBAT_INDICATOR),
|
MULTICOMBAT_FIXED(WidgetID.FIXED_VIEWPORT_GROUP_ID, WidgetID.FixedViewport.MULTICOMBAT_INDICATOR),
|
||||||
MULTICOMBAT_RESIZEABLE(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewport.MULTICOMBAT_INDICATOR),
|
MULTICOMBAT_RESIZEABLE(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewport.MULTICOMBAT_INDICATOR),
|
||||||
|
|
||||||
|
|
||||||
FULLSCREEN_MAP_ROOT(WidgetID.FULLSCREEN_MAP_GROUP_ID, WidgetID.FullScreenMap.ROOT),
|
FULLSCREEN_MAP_ROOT(WidgetID.FULLSCREEN_MAP_GROUP_ID, WidgetID.FullScreenMap.ROOT),
|
||||||
|
|
||||||
QUESTLIST_BOX(WidgetID.QUESTLIST_GROUP_ID, WidgetID.QuestList.BOX),
|
QUESTLIST_BOX(WidgetID.QUESTLIST_GROUP_ID, WidgetID.QuestList.BOX),
|
||||||
@@ -758,8 +755,8 @@ public enum WidgetInfo
|
|||||||
XP_DROP_7(WidgetID.EXPERIENCE_DROP_GROUP_ID, WidgetID.ExperienceDrop.DROP_7),
|
XP_DROP_7(WidgetID.EXPERIENCE_DROP_GROUP_ID, WidgetID.ExperienceDrop.DROP_7),
|
||||||
|
|
||||||
ITEMS_KEPT_CUSTOM_TEXT_CONTAINER(WidgetID.KEPT_ON_DEATH_GROUP_ID, WidgetID.KeptOnDeath.CUSTOM_TEXT_CONTAINER),
|
ITEMS_KEPT_CUSTOM_TEXT_CONTAINER(WidgetID.KEPT_ON_DEATH_GROUP_ID, WidgetID.KeptOnDeath.CUSTOM_TEXT_CONTAINER),
|
||||||
ITEMS_KEPT_ON_DEATH_CONTAINER(WidgetID.ITEMS_KEPT_ON_DEATH_GROUP_ID, WidgetID.KeptOnDeath.KEPT_ITEMS_CONTAINER),
|
|
||||||
ITEMS_KEPT_ON_DEATH_TEXT(WidgetID.ITEMS_KEPT_ON_DEATH_GROUP_ID, WidgetID.KeptOnDeath.KEPT_ITEMS_TEXT),
|
ITEMS_KEPT_ON_DEATH_TEXT(WidgetID.ITEMS_KEPT_ON_DEATH_GROUP_ID, WidgetID.KeptOnDeath.KEPT_ITEMS_TEXT),
|
||||||
|
ITEMS_KEPT_ON_DEATH_CONTAINER(WidgetID.ITEMS_KEPT_ON_DEATH_GROUP_ID, WidgetID.KeptOnDeath.KEPT_ITEMS_CONTAINER),
|
||||||
ITEMS_LOST_ON_DEATH_TEXT(WidgetID.ITEMS_KEPT_ON_DEATH_GROUP_ID, WidgetID.KeptOnDeath.LOST_ITEMS_TEXT),
|
ITEMS_LOST_ON_DEATH_TEXT(WidgetID.ITEMS_KEPT_ON_DEATH_GROUP_ID, WidgetID.KeptOnDeath.LOST_ITEMS_TEXT),
|
||||||
ITEMS_LOST_ON_DEATH_CONTAINER(WidgetID.ITEMS_KEPT_ON_DEATH_GROUP_ID, WidgetID.KeptOnDeath.LOST_ITEMS_CONTAINER),
|
ITEMS_LOST_ON_DEATH_CONTAINER(WidgetID.ITEMS_KEPT_ON_DEATH_GROUP_ID, WidgetID.KeptOnDeath.LOST_ITEMS_CONTAINER),
|
||||||
ITEMS_KEPT_INFORMATION_CONTAINER(WidgetID.ITEMS_KEPT_ON_DEATH_GROUP_ID, WidgetID.KeptOnDeath.INFORMATION_CONTAINER),
|
ITEMS_KEPT_INFORMATION_CONTAINER(WidgetID.ITEMS_KEPT_ON_DEATH_GROUP_ID, WidgetID.KeptOnDeath.INFORMATION_CONTAINER),
|
||||||
|
|||||||
@@ -89,10 +89,11 @@ dependencies {
|
|||||||
|
|
||||||
testImplementation(Libraries.guiceGrapher)
|
testImplementation(Libraries.guiceGrapher)
|
||||||
testImplementation(Libraries.guiceTestlib)
|
testImplementation(Libraries.guiceTestlib)
|
||||||
testImplementation(Libraries.junit)
|
|
||||||
testImplementation(Libraries.hamcrest)
|
testImplementation(Libraries.hamcrest)
|
||||||
|
testImplementation(Libraries.junit)
|
||||||
testImplementation(Libraries.mockitoCore)
|
testImplementation(Libraries.mockitoCore)
|
||||||
testImplementation(Libraries.mockitoInline)
|
testImplementation(Libraries.mockitoInline)
|
||||||
|
testImplementation(Libraries.okhttp3Webserver)
|
||||||
testImplementation(Libraries.slf4jApi)
|
testImplementation(Libraries.slf4jApi)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -192,9 +192,9 @@ public class Notifier
|
|||||||
case SOLID_UNTIL_CANCELLED:
|
case SOLID_UNTIL_CANCELLED:
|
||||||
case FLASH_UNTIL_CANCELLED:
|
case FLASH_UNTIL_CANCELLED:
|
||||||
// Any interaction with the client since the notification started will cancel it after the minimum duration
|
// Any interaction with the client since the notification started will cancel it after the minimum duration
|
||||||
if (client.getMouseIdleTicks() < MINIMUM_FLASH_DURATION_TICKS
|
if ((client.getMouseIdleTicks() < MINIMUM_FLASH_DURATION_TICKS
|
||||||
|| client.getKeyboardIdleTicks() < MINIMUM_FLASH_DURATION_TICKS
|
|| client.getKeyboardIdleTicks() < MINIMUM_FLASH_DURATION_TICKS
|
||||||
|| client.getMouseLastPressedMillis() > mouseLastPressedMillis)
|
|| client.getMouseLastPressedMillis() > mouseLastPressedMillis) && clientUI.isFocused())
|
||||||
{
|
{
|
||||||
flashStart = null;
|
flashStart = null;
|
||||||
}
|
}
|
||||||
@@ -316,7 +316,7 @@ public class Notifier
|
|||||||
|
|
||||||
private static Process sendCommand(final List<String> commands) throws IOException
|
private static Process sendCommand(final List<String> commands) throws IOException
|
||||||
{
|
{
|
||||||
return new ProcessBuilder(commands.toArray(new String[commands.size()]))
|
return new ProcessBuilder(commands.toArray(new String[0]))
|
||||||
.redirectErrorStream(true)
|
.redirectErrorStream(true)
|
||||||
.start();
|
.start();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ import lombok.Getter;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.events.GameStateChanged;
|
import net.runelite.api.events.GameStateChanged;
|
||||||
|
import net.runelite.api.events.ScriptCallbackEvent;
|
||||||
import net.runelite.client.account.SessionManager;
|
import net.runelite.client.account.SessionManager;
|
||||||
import net.runelite.client.callback.Hooks;
|
import net.runelite.client.callback.Hooks;
|
||||||
import net.runelite.client.chat.ChatMessageManager;
|
import net.runelite.client.chat.ChatMessageManager;
|
||||||
@@ -61,6 +62,7 @@ import net.runelite.client.eventbus.EventBus;
|
|||||||
import net.runelite.client.game.ClanManager;
|
import net.runelite.client.game.ClanManager;
|
||||||
import net.runelite.client.game.ItemManager;
|
import net.runelite.client.game.ItemManager;
|
||||||
import net.runelite.client.game.LootManager;
|
import net.runelite.client.game.LootManager;
|
||||||
|
import net.runelite.client.game.PlayerManager;
|
||||||
import net.runelite.client.game.XpDropManager;
|
import net.runelite.client.game.XpDropManager;
|
||||||
import net.runelite.client.game.chatbox.ChatboxPanelManager;
|
import net.runelite.client.game.chatbox.ChatboxPanelManager;
|
||||||
import net.runelite.client.graphics.ModelOutlineRenderer;
|
import net.runelite.client.graphics.ModelOutlineRenderer;
|
||||||
@@ -86,6 +88,7 @@ import org.slf4j.LoggerFactory;
|
|||||||
public class RuneLite
|
public class RuneLite
|
||||||
{
|
{
|
||||||
public static final File RUNELITE_DIR = new File(System.getProperty("user.home"), ".runelite");
|
public static final File RUNELITE_DIR = new File(System.getProperty("user.home"), ".runelite");
|
||||||
|
public static final File CACHE_DIR = new File(RUNELITE_DIR, "cache");
|
||||||
public static final File PROFILES_DIR = new File(RUNELITE_DIR, "profiles");
|
public static final File PROFILES_DIR = new File(RUNELITE_DIR, "profiles");
|
||||||
public static final File PLUGIN_DIR = new File(RUNELITE_DIR, "plugins");
|
public static final File PLUGIN_DIR = new File(RUNELITE_DIR, "plugins");
|
||||||
public static final File SCREENSHOT_DIR = new File(RUNELITE_DIR, "screenshots");
|
public static final File SCREENSHOT_DIR = new File(RUNELITE_DIR, "screenshots");
|
||||||
@@ -156,6 +159,9 @@ public class RuneLite
|
|||||||
@Inject
|
@Inject
|
||||||
private Provider<XpDropManager> xpDropManager;
|
private Provider<XpDropManager> xpDropManager;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private Provider<PlayerManager> playerManager;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private Provider<ChatboxPanelManager> chatboxPanelManager;
|
private Provider<ChatboxPanelManager> chatboxPanelManager;
|
||||||
|
|
||||||
@@ -236,7 +242,7 @@ public class RuneLite
|
|||||||
|
|
||||||
Authenticator.setDefault(new Authenticator()
|
Authenticator.setDefault(new Authenticator()
|
||||||
{
|
{
|
||||||
private PasswordAuthentication auth = new PasswordAuthentication(user, pass);
|
private final PasswordAuthentication auth = new PasswordAuthentication(user, pass);
|
||||||
|
|
||||||
protected PasswordAuthentication getPasswordAuthentication()
|
protected PasswordAuthentication getPasswordAuthentication()
|
||||||
{
|
{
|
||||||
@@ -288,8 +294,6 @@ public class RuneLite
|
|||||||
RuneLiteSplashScreen.setError("Error while loading!", "Please check your internet connection and your DNS settings.");
|
RuneLiteSplashScreen.setError("Error while loading!", "Please check your internet connection and your DNS settings.");
|
||||||
});
|
});
|
||||||
|
|
||||||
RuneLiteSplashScreen.stage(0, "Starting OpenOSRS injector");
|
|
||||||
|
|
||||||
PROFILES_DIR.mkdirs();
|
PROFILES_DIR.mkdirs();
|
||||||
|
|
||||||
final long start = System.currentTimeMillis();
|
final long start = System.currentTimeMillis();
|
||||||
@@ -306,7 +310,7 @@ public class RuneLite
|
|||||||
log.info("Client initialization took {}ms. Uptime: {}ms", end - start, uptime);
|
log.info("Client initialization took {}ms. Uptime: {}ms", end - start, uptime);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void start() throws Exception
|
private void start() throws Exception
|
||||||
{
|
{
|
||||||
// Load RuneLite or Vanilla client
|
// Load RuneLite or Vanilla client
|
||||||
final boolean isOutdated = client == null;
|
final boolean isOutdated = client == null;
|
||||||
@@ -364,9 +368,11 @@ public class RuneLite
|
|||||||
commandManager.get();
|
commandManager.get();
|
||||||
lootManager.get();
|
lootManager.get();
|
||||||
xpDropManager.get();
|
xpDropManager.get();
|
||||||
|
playerManager.get();
|
||||||
chatboxPanelManager.get();
|
chatboxPanelManager.get();
|
||||||
|
|
||||||
eventBus.subscribe(GameStateChanged.class, this, hooks::onGameStateChanged);
|
eventBus.subscribe(GameStateChanged.class, this, hooks::onGameStateChanged);
|
||||||
|
eventBus.subscribe(ScriptCallbackEvent.class, this, hooks::onScriptCallbackEvent);
|
||||||
|
|
||||||
// Add core overlays
|
// Add core overlays
|
||||||
WidgetOverlay.createOverlays(client).forEach(overlayManager::add);
|
WidgetOverlay.createOverlays(client).forEach(overlayManager::add);
|
||||||
|
|||||||
@@ -41,8 +41,8 @@ import net.runelite.client.callback.Hooks;
|
|||||||
import net.runelite.client.chat.ChatMessageManager;
|
import net.runelite.client.chat.ChatMessageManager;
|
||||||
import net.runelite.client.config.ChatColorConfig;
|
import net.runelite.client.config.ChatColorConfig;
|
||||||
import net.runelite.client.config.ConfigManager;
|
import net.runelite.client.config.ConfigManager;
|
||||||
import net.runelite.client.config.RuneLiteConfig;
|
|
||||||
import net.runelite.client.config.OpenOSRSConfig;
|
import net.runelite.client.config.OpenOSRSConfig;
|
||||||
|
import net.runelite.client.config.RuneLiteConfig;
|
||||||
import net.runelite.client.eventbus.EventBus;
|
import net.runelite.client.eventbus.EventBus;
|
||||||
import net.runelite.client.game.ItemManager;
|
import net.runelite.client.game.ItemManager;
|
||||||
import net.runelite.client.menus.MenuManager;
|
import net.runelite.client.menus.MenuManager;
|
||||||
@@ -75,7 +75,7 @@ public class RuneLiteModule extends AbstractModule
|
|||||||
bindConstant().annotatedWith(Names.named("developerMode")).to(developerMode);
|
bindConstant().annotatedWith(Names.named("developerMode")).to(developerMode);
|
||||||
bind(ScheduledExecutorService.class).toInstance(new ExecutorServiceExceptionLogger(Executors.newSingleThreadScheduledExecutor()));
|
bind(ScheduledExecutorService.class).toInstance(new ExecutorServiceExceptionLogger(Executors.newSingleThreadScheduledExecutor()));
|
||||||
bind(OkHttpClient.class).toInstance(RuneLiteAPI.CLIENT.newBuilder()
|
bind(OkHttpClient.class).toInstance(RuneLiteAPI.CLIENT.newBuilder()
|
||||||
.cache(new Cache(new File(RuneLite.RUNELITE_DIR, "cache" + File.separator + "okhttp"), MAX_OKHTTP_CACHE_SIZE))
|
.cache(new Cache(new File(RuneLite.CACHE_DIR, "okhttp"), MAX_OKHTTP_CACHE_SIZE))
|
||||||
.build());
|
.build());
|
||||||
bind(MenuManager.class);
|
bind(MenuManager.class);
|
||||||
bind(ChatMessageManager.class);
|
bind(ChatMessageManager.class);
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import java.util.Iterator;
|
|||||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
||||||
import java.util.function.BooleanSupplier;
|
import java.util.function.BooleanSupplier;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
@@ -41,6 +42,7 @@ public class ClientThread implements Executor
|
|||||||
private final ConcurrentLinkedQueue<BooleanSupplier> invokes = new ConcurrentLinkedQueue<>();
|
private final ConcurrentLinkedQueue<BooleanSupplier> invokes = new ConcurrentLinkedQueue<>();
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
|
@Nullable
|
||||||
private Client client;
|
private Client client;
|
||||||
|
|
||||||
public void invoke(Runnable r)
|
public void invoke(Runnable r)
|
||||||
|
|||||||
@@ -47,12 +47,15 @@ import net.runelite.api.Entity;
|
|||||||
import net.runelite.api.MainBufferProvider;
|
import net.runelite.api.MainBufferProvider;
|
||||||
import net.runelite.api.NullItemID;
|
import net.runelite.api.NullItemID;
|
||||||
import net.runelite.api.RenderOverview;
|
import net.runelite.api.RenderOverview;
|
||||||
|
import net.runelite.api.Skill;
|
||||||
import net.runelite.api.WorldMapManager;
|
import net.runelite.api.WorldMapManager;
|
||||||
import net.runelite.api.events.BeforeMenuRender;
|
import net.runelite.api.events.BeforeMenuRender;
|
||||||
import net.runelite.api.events.BeforeRender;
|
import net.runelite.api.events.BeforeRender;
|
||||||
import net.runelite.api.events.Event;
|
import net.runelite.api.events.Event;
|
||||||
|
import net.runelite.api.events.FakeXpDrop;
|
||||||
import net.runelite.api.events.GameStateChanged;
|
import net.runelite.api.events.GameStateChanged;
|
||||||
import net.runelite.api.events.GameTick;
|
import net.runelite.api.events.GameTick;
|
||||||
|
import net.runelite.api.events.ScriptCallbackEvent;
|
||||||
import net.runelite.api.hooks.Callbacks;
|
import net.runelite.api.hooks.Callbacks;
|
||||||
import net.runelite.api.hooks.DrawCallbacks;
|
import net.runelite.api.hooks.DrawCallbacks;
|
||||||
import net.runelite.api.widgets.Widget;
|
import net.runelite.api.widgets.Widget;
|
||||||
@@ -136,6 +139,7 @@ public class Hooks implements Callbacks
|
|||||||
/**
|
/**
|
||||||
* Get the Graphics2D for the MainBufferProvider image
|
* Get the Graphics2D for the MainBufferProvider image
|
||||||
* This caches the Graphics2D instance so it can be reused
|
* This caches the Graphics2D instance so it can be reused
|
||||||
|
*
|
||||||
* @param mainBufferProvider
|
* @param mainBufferProvider
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@@ -156,13 +160,13 @@ public class Hooks implements Callbacks
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T> void post(Class<T> eventClass, Event event)
|
public <T extends Event, E extends T> void post(Class<T> eventClass, E event)
|
||||||
{
|
{
|
||||||
eventBus.post(eventClass, event);
|
eventBus.post(eventClass, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T> void postDeferred(Class<T> eventClass, Event event)
|
public <T extends Event, E extends T> void postDeferred(Class<T> eventClass, E event)
|
||||||
{
|
{
|
||||||
deferredEventBus.post(eventClass, event);
|
deferredEventBus.post(eventClass, event);
|
||||||
}
|
}
|
||||||
@@ -544,4 +548,25 @@ public class Hooks implements Callbacks
|
|||||||
client.getCallbacks().post(BeforeMenuRender.class, event);
|
client.getCallbacks().post(BeforeMenuRender.class, event);
|
||||||
return event.isConsumed();
|
return event.isConsumed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onScriptCallbackEvent(ScriptCallbackEvent scriptCallbackEvent)
|
||||||
|
{
|
||||||
|
if (!scriptCallbackEvent.getEventName().equals("fakeXpDrop"))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final int[] intStack = client.getIntStack();
|
||||||
|
final int intStackSize = client.getIntStackSize();
|
||||||
|
|
||||||
|
final int statId = intStack[intStackSize - 2];
|
||||||
|
final int xp = intStack[intStackSize - 1];
|
||||||
|
|
||||||
|
Skill skill = Skill.values()[statId];
|
||||||
|
FakeXpDrop fakeXpDrop = new FakeXpDrop(
|
||||||
|
skill,
|
||||||
|
xp
|
||||||
|
);
|
||||||
|
eventBus.post(FakeXpDrop.class, fakeXpDrop);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,8 +25,8 @@
|
|||||||
package net.runelite.client.chat;
|
package net.runelite.client.chat;
|
||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import net.runelite.client.util.ColorUtil;
|
|
||||||
import net.runelite.api.util.Text;
|
import net.runelite.api.util.Text;
|
||||||
|
import net.runelite.client.util.ColorUtil;
|
||||||
|
|
||||||
public class ChatMessageBuilder
|
public class ChatMessageBuilder
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -46,13 +46,13 @@ import net.runelite.api.MessageNode;
|
|||||||
import net.runelite.api.Player;
|
import net.runelite.api.Player;
|
||||||
import net.runelite.api.Varbits;
|
import net.runelite.api.Varbits;
|
||||||
import net.runelite.api.events.ChatMessage;
|
import net.runelite.api.events.ChatMessage;
|
||||||
import net.runelite.client.events.ConfigChanged;
|
|
||||||
import net.runelite.api.events.ResizeableChanged;
|
import net.runelite.api.events.ResizeableChanged;
|
||||||
import net.runelite.api.events.ScriptCallbackEvent;
|
import net.runelite.api.events.ScriptCallbackEvent;
|
||||||
import net.runelite.api.events.VarbitChanged;
|
import net.runelite.api.events.VarbitChanged;
|
||||||
import net.runelite.client.callback.ClientThread;
|
import net.runelite.client.callback.ClientThread;
|
||||||
import net.runelite.client.config.ChatColorConfig;
|
import net.runelite.client.config.ChatColorConfig;
|
||||||
import net.runelite.client.eventbus.EventBus;
|
import net.runelite.client.eventbus.EventBus;
|
||||||
|
import net.runelite.client.events.ConfigChanged;
|
||||||
import net.runelite.client.ui.JagexColors;
|
import net.runelite.client.ui.JagexColors;
|
||||||
import net.runelite.client.util.ColorUtil;
|
import net.runelite.client.util.ColorUtil;
|
||||||
|
|
||||||
|
|||||||
@@ -37,6 +37,4 @@ import java.lang.annotation.Target;
|
|||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
@Target(ElementType.METHOD)
|
@Target(ElementType.METHOD)
|
||||||
@Documented
|
@Documented
|
||||||
public @interface Alpha
|
public @interface Alpha {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
package net.runelite.client.config;
|
package net.runelite.client.config;
|
||||||
|
|
||||||
public class Button
|
public class Button {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -24,6 +24,4 @@
|
|||||||
*/
|
*/
|
||||||
package net.runelite.client.config;
|
package net.runelite.client.config;
|
||||||
|
|
||||||
public interface Config
|
public interface Config {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|||||||
+2
-7
@@ -26,12 +26,11 @@ package net.runelite.client.config;
|
|||||||
|
|
||||||
import com.google.common.cache.Cache;
|
import com.google.common.cache.Cache;
|
||||||
import com.google.common.cache.CacheBuilder;
|
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.InvocationHandler;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import net.runelite.client.util.ReflectUtil;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
class ConfigInvocationHandler implements InvocationHandler
|
class ConfigInvocationHandler implements InvocationHandler
|
||||||
@@ -169,12 +168,8 @@ class ConfigInvocationHandler implements InvocationHandler
|
|||||||
|
|
||||||
static Object callDefaultMethod(Object proxy, Method method, Object[] args) throws Throwable
|
static Object callDefaultMethod(Object proxy, Method method, Object[] args) throws Throwable
|
||||||
{
|
{
|
||||||
// Call the default method implementation - https://rmannibucau.wordpress.com/2014/03/27/java-8-default-interface-methods-and-jdk-dynamic-proxies/
|
|
||||||
Constructor<MethodHandles.Lookup> constructor = MethodHandles.Lookup.class.getDeclaredConstructor(Class.class, int.class);
|
|
||||||
constructor.setAccessible(true);
|
|
||||||
|
|
||||||
Class<?> declaringClass = method.getDeclaringClass();
|
Class<?> declaringClass = method.getDeclaringClass();
|
||||||
return constructor.newInstance(declaringClass, MethodHandles.Lookup.PUBLIC | MethodHandles.Lookup.PRIVATE)
|
return ReflectUtil.privateLookupIn(declaringClass)
|
||||||
.unreflectSpecial(method, declaringClass)
|
.unreflectSpecial(method, declaringClass)
|
||||||
.bindTo(proxy)
|
.bindTo(proxy)
|
||||||
.invokeWithArguments(args);
|
.invokeWithArguments(args);
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ public @interface ConfigItem
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* For Config items that have a value of multiple enums,
|
* For Config items that have a value of multiple enums,
|
||||||
|
*
|
||||||
* @return the number of rows that are display in the item without having to scroll.
|
* @return the number of rows that are display in the item without having to scroll.
|
||||||
*/
|
*/
|
||||||
int displayRows() default 2;
|
int displayRows() default 2;
|
||||||
@@ -82,6 +83,7 @@ public @interface ConfigItem
|
|||||||
/**
|
/**
|
||||||
* Use this to indicate the enum class that is going to be used in the multiple select config.
|
* Use this to indicate the enum class that is going to be used in the multiple select config.
|
||||||
* This implementation made debugging problems with multiple selects a lot easier
|
* This implementation made debugging problems with multiple selects a lot easier
|
||||||
|
*
|
||||||
* @return The Enum that will be used for the multiple select
|
* @return The Enum that will be used for the multiple select
|
||||||
*/
|
*/
|
||||||
Class<? extends Enum> enumClass() default Enum.class;
|
Class<? extends Enum> enumClass() default Enum.class;
|
||||||
|
|||||||
@@ -59,10 +59,10 @@ import javax.inject.Inject;
|
|||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.runelite.api.coords.WorldPoint;
|
import net.runelite.api.coords.WorldPoint;
|
||||||
import net.runelite.client.events.ConfigChanged;
|
|
||||||
import net.runelite.client.RuneLite;
|
import net.runelite.client.RuneLite;
|
||||||
import static net.runelite.client.RuneLite.PROFILES_DIR;
|
import static net.runelite.client.RuneLite.PROFILES_DIR;
|
||||||
import net.runelite.client.eventbus.EventBus;
|
import net.runelite.client.eventbus.EventBus;
|
||||||
|
import net.runelite.client.events.ConfigChanged;
|
||||||
import net.runelite.client.util.ColorUtil;
|
import net.runelite.client.util.ColorUtil;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
package net.runelite.client.config;
|
package net.runelite.client.config;
|
||||||
|
|
||||||
public class Title
|
public class Title {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public class DatabaseManager
|
|||||||
Settings settings = new Settings();
|
Settings settings = new Settings();
|
||||||
settings.setExecuteLogging(false);
|
settings.setExecuteLogging(false);
|
||||||
|
|
||||||
return DSL.using(connection, SQLDialect.H2, settings);
|
return DSL.using(connection, SQLDialect.H2, settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean checkTableExists(String table)
|
public boolean checkTableExists(String table)
|
||||||
|
|||||||
@@ -2,10 +2,14 @@ package net.runelite.client.eventbus;
|
|||||||
|
|
||||||
import com.jakewharton.rxrelay2.PublishRelay;
|
import com.jakewharton.rxrelay2.PublishRelay;
|
||||||
import com.jakewharton.rxrelay2.Relay;
|
import com.jakewharton.rxrelay2.Relay;
|
||||||
|
import io.reactivex.ObservableTransformer;
|
||||||
|
import io.reactivex.Scheduler;
|
||||||
import io.reactivex.annotations.NonNull;
|
import io.reactivex.annotations.NonNull;
|
||||||
|
import io.reactivex.annotations.Nullable;
|
||||||
import io.reactivex.disposables.CompositeDisposable;
|
import io.reactivex.disposables.CompositeDisposable;
|
||||||
import io.reactivex.disposables.Disposable;
|
import io.reactivex.disposables.Disposable;
|
||||||
import io.reactivex.functions.Consumer;
|
import io.reactivex.functions.Consumer;
|
||||||
|
import io.reactivex.schedulers.Schedulers;
|
||||||
import io.sentry.Sentry;
|
import io.sentry.Sentry;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -15,21 +19,25 @@ import javax.inject.Singleton;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.runelite.api.events.Event;
|
import net.runelite.api.events.Event;
|
||||||
import net.runelite.client.RuneLiteProperties;
|
import net.runelite.client.RuneLiteProperties;
|
||||||
|
import net.runelite.client.callback.ClientThread;
|
||||||
import net.runelite.client.config.OpenOSRSConfig;
|
import net.runelite.client.config.OpenOSRSConfig;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Singleton
|
@Singleton
|
||||||
public class EventBus implements EventBusInterface
|
public class EventBus implements EventBusInterface
|
||||||
{
|
{
|
||||||
private Map<Object, Object> subscriptionList = new HashMap<>();
|
private final Map<Object, Object> subscriptionList = new HashMap<>();
|
||||||
private Map<Class<?>, Relay<Object>> subjectList = new HashMap<>();
|
private final Map<Class<?>, Relay<Object>> subjectList = new HashMap<>();
|
||||||
private Map<Object, CompositeDisposable> subscriptionsMap = new HashMap<>();
|
private final Map<Object, CompositeDisposable> subscriptionsMap = new HashMap<>();
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private OpenOSRSConfig openOSRSConfig;
|
private OpenOSRSConfig openOSRSConfig;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private ClientThread clientThread;
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
private <T> Relay<Object> getSubject(Class<T> eventClass)
|
private <T extends Event> Relay<Object> getSubject(Class<T> eventClass)
|
||||||
{
|
{
|
||||||
return subjectList.computeIfAbsent(eventClass, k -> PublishRelay.create().toSerialized());
|
return subjectList.computeIfAbsent(eventClass, k -> PublishRelay.create().toSerialized());
|
||||||
}
|
}
|
||||||
@@ -47,34 +55,65 @@ public class EventBus implements EventBusInterface
|
|||||||
return compositeDisposable;
|
return compositeDisposable;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
private <T> ObservableTransformer<T, T> applyTake(int until)
|
||||||
// Subscribe on lifecycle (for example from plugin startUp -> shutdown)
|
|
||||||
public <T> void subscribe(Class<T> eventClass, @NonNull Object lifecycle, @NonNull Consumer<T> action)
|
|
||||||
{
|
{
|
||||||
if (subscriptionList.containsKey(lifecycle) && eventClass.equals(subscriptionList.get(lifecycle)))
|
return observable -> until > 0 ? observable.take(until) : observable;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Scheduler getScheduler(EventScheduler scheduler)
|
||||||
|
{
|
||||||
|
Scheduler subscribeScheduler;
|
||||||
|
switch (scheduler)
|
||||||
{
|
{
|
||||||
return;
|
case COMPUTATION:
|
||||||
|
subscribeScheduler = Schedulers.computation();
|
||||||
|
break;
|
||||||
|
case IO:
|
||||||
|
subscribeScheduler = Schedulers.io();
|
||||||
|
break;
|
||||||
|
case NEWTHREAD:
|
||||||
|
subscribeScheduler = Schedulers.newThread();
|
||||||
|
break;
|
||||||
|
case SINGLE:
|
||||||
|
subscribeScheduler = Schedulers.single();
|
||||||
|
break;
|
||||||
|
case TRAMPOLINE:
|
||||||
|
subscribeScheduler = Schedulers.trampoline();
|
||||||
|
break;
|
||||||
|
case CLIENT:
|
||||||
|
subscribeScheduler = Schedulers.from(clientThread);
|
||||||
|
break;
|
||||||
|
case DEFAULT:
|
||||||
|
default:
|
||||||
|
subscribeScheduler = null;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
Disposable disposable = getSubject(eventClass)
|
return subscribeScheduler;
|
||||||
.filter(Objects::nonNull) // Filter out null objects, better safe than sorry
|
}
|
||||||
.cast(eventClass) // Cast it for easier usage
|
|
||||||
.subscribe(action, error ->
|
|
||||||
{
|
|
||||||
log.error("Exception in eventbus", error);
|
|
||||||
|
|
||||||
if (RuneLiteProperties.getLauncherVersion() != null && openOSRSConfig.shareLogs())
|
private <T> ObservableTransformer<T, T> applyScheduler(EventScheduler eventScheduler, boolean subscribe)
|
||||||
{
|
{
|
||||||
Sentry.capture(error);
|
Scheduler scheduler = getScheduler(eventScheduler);
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
getCompositeDisposable(lifecycle).add(disposable);
|
return observable -> scheduler == null ? observable : subscribe ? observable.subscribeOn(scheduler) : observable.observeOn(scheduler);
|
||||||
subscriptionList.put(lifecycle, eventClass);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T> void subscribe(Class<T> eventClass, @NonNull Object lifecycle, @NonNull Consumer<T> action, int takeUntil)
|
public <T extends Event> void subscribe(Class<T> eventClass, @NonNull Object lifecycle, @NonNull Consumer<T> action)
|
||||||
|
{
|
||||||
|
subscribe(eventClass, lifecycle, action, -1, EventScheduler.DEFAULT, EventScheduler.DEFAULT);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <T extends Event> void subscribe(Class<T> eventClass, @NonNull Object lifecycle, @NonNull Consumer<T> action, int takeUtil)
|
||||||
|
{
|
||||||
|
subscribe(eventClass, lifecycle, action, takeUtil, EventScheduler.DEFAULT, EventScheduler.DEFAULT);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
// Subscribe on lifecycle (for example from plugin startUp -> shutdown)
|
||||||
|
public <T extends Event> void subscribe(Class<T> eventClass, @NonNull Object lifecycle, @NonNull Consumer<T> action, int takeUntil, @Nullable EventScheduler subscribe, @Nullable EventScheduler observe)
|
||||||
{
|
{
|
||||||
if (subscriptionList.containsKey(lifecycle) && eventClass.equals(subscriptionList.get(lifecycle)))
|
if (subscriptionList.containsKey(lifecycle) && eventClass.equals(subscriptionList.get(lifecycle)))
|
||||||
{
|
{
|
||||||
@@ -82,10 +121,12 @@ public class EventBus implements EventBusInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
Disposable disposable = getSubject(eventClass)
|
Disposable disposable = getSubject(eventClass)
|
||||||
|
.compose(applyTake(takeUntil))
|
||||||
.filter(Objects::nonNull) // Filter out null objects, better safe than sorry
|
.filter(Objects::nonNull) // Filter out null objects, better safe than sorry
|
||||||
.cast(eventClass) // Cast it for easier usage
|
.cast(eventClass) // Cast it for easier usage
|
||||||
.take(takeUntil)
|
|
||||||
.doFinally(() -> unregister(lifecycle))
|
.doFinally(() -> unregister(lifecycle))
|
||||||
|
.compose(applyScheduler(subscribe, true))
|
||||||
|
.compose(applyScheduler(observe, false))
|
||||||
.subscribe(action, error ->
|
.subscribe(action, error ->
|
||||||
{
|
{
|
||||||
log.error("Exception in eventbus", error);
|
log.error("Exception in eventbus", error);
|
||||||
@@ -113,7 +154,7 @@ public class EventBus implements EventBusInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T> void post(Class<T> eventClass, @NonNull Event event)
|
public <T extends Event> void post(Class<? extends T> eventClass, @NonNull T event)
|
||||||
{
|
{
|
||||||
getSubject(eventClass).accept(event);
|
getSubject(eventClass).accept(event);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,11 +6,13 @@ import net.runelite.api.events.Event;
|
|||||||
|
|
||||||
public interface EventBusInterface
|
public interface EventBusInterface
|
||||||
{
|
{
|
||||||
<T> void subscribe(Class<T> eventClass, @NonNull Object lifecycle, @NonNull Consumer<T> action);
|
<T extends Event> void subscribe(Class<T> eventClass, @NonNull Object lifecycle, @NonNull Consumer<T> action);
|
||||||
|
|
||||||
<T> void subscribe(Class<T> eventClass, @NonNull Object lifecycle, @NonNull Consumer<T> action, int takeUntil);
|
<T extends Event> void subscribe(Class<T> eventClass, @NonNull Object lifecycle, @NonNull Consumer<T> action, int takeUntil);
|
||||||
|
|
||||||
|
<T extends Event> void subscribe(Class<T> eventClass, @NonNull Object lifecycle, @NonNull Consumer<T> action, int takeUntil, EventScheduler subscribe, EventScheduler observe);
|
||||||
|
|
||||||
void unregister(@NonNull Object lifecycle);
|
void unregister(@NonNull Object lifecycle);
|
||||||
|
|
||||||
<T> void post(Class<T> eventClass, @NonNull Event event);
|
<T extends Event> void post(Class<? extends T> eventClass, @NonNull T event);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package net.runelite.client.eventbus;
|
||||||
|
|
||||||
|
import io.reactivex.annotations.Nullable;
|
||||||
|
|
||||||
|
public enum EventScheduler
|
||||||
|
{
|
||||||
|
DEFAULT(null),
|
||||||
|
COMPUTATION("computation"),
|
||||||
|
IO("io"),
|
||||||
|
NEWTHREAD("newThread"),
|
||||||
|
SINGLE("single"),
|
||||||
|
TRAMPOLINE("trampoline"),
|
||||||
|
CLIENT("client");
|
||||||
|
|
||||||
|
public final String scheduler;
|
||||||
|
|
||||||
|
EventScheduler(@Nullable String scheduler)
|
||||||
|
{
|
||||||
|
this.scheduler = scheduler;
|
||||||
|
}
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user