Merge pull request #3045 from Owain94/rev-200

This commit is contained in:
Owain van Brakel
2021-10-06 14:08:29 +02:00
committed by GitHub
750 changed files with 51179 additions and 55232 deletions
+3 -3
View File
@@ -25,11 +25,11 @@
object ProjectVersions { object ProjectVersions {
const val launcherVersion = "2.2.0" const val launcherVersion = "2.2.0"
const val rlVersion = "1.7.24" const val rlVersion = "1.7.25"
const val openosrsVersion = "4.10.0" const val openosrsVersion = "4.12.0"
const val rsversion = 199 const val rsversion = 200
const val cacheversion = 165 const val cacheversion = 165
const val lombokVersion = "1.18.20" const val lombokVersion = "1.18.20"
+5 -5
View File
@@ -38,14 +38,14 @@ dependencies {
compileOnly(group = "org.projectlombok", name = "lombok", version = ProjectVersions.lombokVersion) compileOnly(group = "org.projectlombok", name = "lombok", version = ProjectVersions.lombokVersion)
implementation(group = "com.google.code.gson", name = "gson", version = "2.8.6") implementation(group = "com.google.code.gson", name = "gson", version = "2.8.5")
implementation(group = "com.google.guava", name = "guava", version = "30.0-jre") implementation(group = "com.google.guava", name = "guava", version = "30.1.1-jre")
implementation(group = "commons-cli", name = "commons-cli", version = "1.4") implementation(group = "commons-cli", name = "commons-cli", version = "1.4")
implementation(group = "io.netty", name = "netty-buffer", version = "4.1.54.Final") implementation(group = "io.netty", name = "netty-buffer", version = "4.1.54.Final")
implementation(group = "com.squareup.okhttp3", name = "okhttp", version = "4.9.0") implementation(group = "com.squareup.okhttp3", name = "okhttp", version = "4.9.1")
implementation(group = "org.antlr", name = "antlr4-runtime", version = "4.8-1") implementation(group = "org.antlr", name = "antlr4-runtime", version = "4.8-1")
implementation(group = "org.apache.commons", name = "commons-compress", version = "1.20") implementation(group = "org.apache.commons", name = "commons-compress", version = "1.21")
implementation(group = "org.slf4j", name = "slf4j-api", version = "1.7.30") implementation(group = "org.slf4j", name = "slf4j-api", version = "1.7.32")
testAnnotationProcessor(group = "org.projectlombok", name = "lombok", version = ProjectVersions.lombokVersion) testAnnotationProcessor(group = "org.projectlombok", name = "lombok", version = ProjectVersions.lombokVersion)
+4 -4
View File
@@ -40,15 +40,15 @@ dependencies {
implementation(project(":runelite-api")) implementation(project(":runelite-api"))
implementation(project(":runescape-api")) implementation(project(":runescape-api"))
implementation(project(":cache")) implementation(project(":cache"))
implementation(group = "org.jetbrains", name = "annotations", version = "20.1.0") implementation(group = "org.jetbrains", name = "annotations", version = "22.0.0")
implementation(group = "org.ow2.asm", name = "asm", version = "9.0") implementation(group = "org.ow2.asm", name = "asm", version = "9.0")
implementation(group = "org.ow2.asm", name = "asm-util", version = "9.0") implementation(group = "org.ow2.asm", name = "asm-util", version = "9.0")
implementation(group = "net.runelite", name = "fernflower", version = "07082019") implementation(group = "net.runelite", name = "fernflower", version = "07082019")
implementation(group = "com.google.code.gson", name = "gson", version = "2.8.6") implementation(group = "com.google.code.gson", name = "gson", version = "2.8.6")
implementation(group = "com.google.guava", name = "guava", version = "23.2-jre") implementation(group = "com.google.guava", name = "guava", version = "30.1.1-jre")
implementation(group = "org.slf4j", name = "slf4j-api", version = "1.7.12") implementation(group = "org.slf4j", name = "slf4j-api", version = "1.7.32")
runtimeOnly(group = "org.slf4j", name = "slf4j-simple", version = "1.7.12") runtimeOnly(group = "org.slf4j", name = "slf4j-simple", version = "1.7.32")
testImplementation(deobjars) testImplementation(deobjars)
testImplementation(group = "junit", name = "junit", version = "4.12") testImplementation(group = "junit", name = "junit", version = "4.12")
+1 -1
View File
@@ -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-7.2-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-all.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
+6 -6
View File
@@ -34,14 +34,14 @@ dependencies {
implementation(project(":runelite-api")) implementation(project(":runelite-api"))
implementation(group = "com.google.code.gson", name = "gson", version = "2.8.5") implementation(group = "com.google.code.gson", name = "gson", version = "2.8.5")
implementation(group = "com.google.guava", name = "guava", version = "23.2-jre") implementation(group = "com.google.guava", name = "guava", version = "30.1.1-jre")
implementation(group = "com.squareup.okhttp3", name = "okhttp", version = "3.7.0") implementation(group = "com.squareup.okhttp3", name = "okhttp", version = "4.9.1")
implementation(group = "org.apache.commons", name = "commons-csv", version = "1.4") implementation(group = "org.apache.commons", name = "commons-csv", version = "1.9.0")
implementation(group = "org.slf4j", name = "slf4j-api", version = "1.7.12") implementation(group = "org.slf4j", name = "slf4j-api", version = "1.7.32")
testImplementation(group = "com.squareup.okhttp3", name = "mockwebserver", version = "4.9.0") testImplementation(group = "com.squareup.okhttp3", name = "mockwebserver", version = "4.9.1")
testImplementation(group = "junit", name = "junit", version = "4.12") testImplementation(group = "junit", name = "junit", version = "4.12")
testImplementation(group = "org.slf4j", name = "slf4j-simple", version = "1.7.12") testImplementation(group = "org.slf4j", name = "slf4j-simple", version = "1.7.32")
} }
tasks { tasks {
@@ -0,0 +1,52 @@
/*
* Copyright (c) 2021, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.http.service;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.TaskScheduler;
import org.springframework.scheduling.annotation.SchedulingConfigurer;
import org.springframework.scheduling.concurrent.ConcurrentTaskScheduler;
import org.springframework.scheduling.config.ScheduledTaskRegistrar;
@Configuration
public class SpringSchedulingConfigurer implements SchedulingConfigurer
{
@Override
public void configureTasks(ScheduledTaskRegistrar taskRegistrar)
{
// this is from ScheduledTaskRegistrar.scheduleTasks() but modified to give the scheduler thread a
// recognizable name
ScheduledExecutorService scheduledExecutorService = Executors.newSingleThreadScheduledExecutor(
new ThreadFactoryBuilder()
.setNameFormat("scheduler-%d")
.build()
);
TaskScheduler scheduler = new ConcurrentTaskScheduler(scheduledExecutorService);
taskRegistrar.setTaskScheduler(scheduler);
}
}
+5 -5
View File
@@ -24,11 +24,11 @@ dependencies {
implementation(project(":runescape-client")) implementation(project(":runescape-client"))
implementation(project(":runelite-mixins")) implementation(project(":runelite-mixins"))
implementation(group = "org.ow2.asm", name = "asm", version = "8.0.1") implementation(group = "org.ow2.asm", name = "asm", version = "9.0")
implementation(group = "org.ow2.asm", name = "asm-util", version = "8.0.1") implementation(group = "org.ow2.asm", name = "asm-util", version = "9.0")
implementation(group = "org.jetbrains", name = "annotations", version = "19.0.0") implementation(group = "org.jetbrains", name = "annotations", version = "22.0.0")
implementation(group = "com.google.guava", name = "guava", version = "23.2-jre") implementation(group = "com.google.guava", name = "guava", version = "30.1.1-jre")
implementation(group = "net.sf.jopt-simple", name = "jopt-simple", version = "5.0.1") implementation(group = "net.sf.jopt-simple", name = "jopt-simple", version = "5.0.4")
} }
tasks.register<JavaExec>("inject") { tasks.register<JavaExec>("inject") {
@@ -18,9 +18,11 @@ import com.openosrs.injector.injectors.RSApiInjector;
import com.openosrs.injector.injectors.raw.AddPlayerToMenu; import com.openosrs.injector.injectors.raw.AddPlayerToMenu;
import com.openosrs.injector.injectors.raw.ClearColorBuffer; import com.openosrs.injector.injectors.raw.ClearColorBuffer;
import com.openosrs.injector.injectors.raw.DrawMenu; import com.openosrs.injector.injectors.raw.DrawMenu;
import com.openosrs.injector.injectors.raw.GraphicsObject;
import com.openosrs.injector.injectors.raw.Occluder; import com.openosrs.injector.injectors.raw.Occluder;
import com.openosrs.injector.injectors.raw.RasterizerAlpha; import com.openosrs.injector.injectors.raw.RasterizerAlpha;
import com.openosrs.injector.injectors.raw.RenderDraw; import com.openosrs.injector.injectors.raw.RenderDraw;
import com.openosrs.injector.injectors.raw.RuneliteObject;
import com.openosrs.injector.injectors.raw.ScriptVM; import com.openosrs.injector.injectors.raw.ScriptVM;
import com.openosrs.injector.rsapi.RSApi; import com.openosrs.injector.rsapi.RSApi;
import com.openosrs.injector.transformers.InjectTransformer; import com.openosrs.injector.transformers.InjectTransformer;
@@ -109,6 +111,8 @@ public class Injector extends InjectData implements InjectTaskHandler
inject(new CreateAnnotations(this)); inject(new CreateAnnotations(this));
inject(new RuneliteObject(this));
inject(new InterfaceInjector(this)); inject(new InterfaceInjector(this));
inject(new RasterizerAlpha(this)); inject(new RasterizerAlpha(this));
@@ -138,6 +142,8 @@ public class Injector extends InjectData implements InjectTaskHandler
inject(new AddPlayerToMenu(this)); inject(new AddPlayerToMenu(this));
inject(new GraphicsObject(this));
validate(new InjectorValidator(this)); validate(new InjectorValidator(this));
transform(new SourceChanger(this)); transform(new SourceChanger(this));
@@ -7,7 +7,6 @@
*/ */
package com.openosrs.injector.injection; package com.openosrs.injector.injection;
import com.google.common.collect.ImmutableMap;
import com.openosrs.injector.InjectUtil; import com.openosrs.injector.InjectUtil;
import com.openosrs.injector.injectors.Injector; import com.openosrs.injector.injectors.Injector;
import com.openosrs.injector.rsapi.RSApi; import com.openosrs.injector.rsapi.RSApi;
@@ -45,7 +44,7 @@ public abstract class InjectData
/** /**
* Deobfuscated ClassFiles -> Vanilla ClassFiles * Deobfuscated ClassFiles -> Vanilla ClassFiles
*/ */
public Map<ClassFile, ClassFile> toVanilla; public final Map<ClassFile, ClassFile> toVanilla = new HashMap<>();
/** /**
* Strings -> Deobfuscated ClassFiles * Strings -> Deobfuscated ClassFiles
@@ -53,17 +52,15 @@ public abstract class InjectData
* - Obfuscated name * - Obfuscated name
* - RSApi implementing name * - RSApi implementing name
*/ */
private final Map<String, ClassFile> toDeob = new HashMap<>(); public final Map<String, ClassFile> toDeob = new HashMap<>();
public abstract void runChildInjector(Injector injector); public abstract void runChildInjector(Injector injector);
public void initToVanilla() public void initToVanilla()
{ {
ImmutableMap.Builder<ClassFile, ClassFile> toVanillaB = ImmutableMap.builder();
for (final ClassFile deobClass : deobfuscated) for (final ClassFile deobClass : deobfuscated)
{ {
if (deobClass.getName().startsWith("net/runelite/")) if (deobClass.getName().startsWith("net/runelite/") || deobClass.getName().startsWith("netscape"))
{ {
continue; continue;
} }
@@ -73,13 +70,14 @@ public abstract class InjectData
{ {
toDeob.put(obName, deobClass); toDeob.put(obName, deobClass);
// Can't be null
final ClassFile obClass = this.vanilla.findClass(obName); final ClassFile obClass = this.vanilla.findClass(obName);
toVanillaB.put(deobClass, obClass);
}
}
this.toVanilla = toVanillaB.build(); if (obClass != null)
{
toVanilla.put(deobClass, obClass);
}
}
}
} }
/** /**
@@ -0,0 +1,56 @@
/*
* Copyright (c) 2021, Owain van Brakel <https://github.com/Owain94>
* All rights reserved.
*
* This code is licensed under GPL3, see the complete license in
* the LICENSE file in the root directory of this submodule.
*/
package com.openosrs.injector.injectors.raw;
import com.openosrs.injector.injection.InjectData;
import com.openosrs.injector.injectors.AbstractInjector;
import net.runelite.asm.ClassFile;
import net.runelite.asm.Method;
import net.runelite.asm.attributes.Code;
import net.runelite.asm.attributes.code.Instructions;
import net.runelite.asm.attributes.code.instructions.ALoad;
import net.runelite.asm.attributes.code.instructions.InvokeSpecial;
import net.runelite.asm.attributes.code.instructions.VReturn;
import net.runelite.asm.signature.Signature;
public class GraphicsObject extends AbstractInjector
{
public GraphicsObject(InjectData inject)
{
super(inject);
}
public void inject()
{
final ClassFile graphicsObjectVanilla = inject.toVanilla(
inject.getDeobfuscated()
.findClass("GraphicsObject")
);
final ClassFile renderableVanilla = inject.toVanilla(
inject.getDeobfuscated()
.findClass("Renderable")
);
graphicsObjectVanilla.clearFinal();
Method initGraphicsObject = new Method(graphicsObjectVanilla, "<init>", new Signature("()V"));
initGraphicsObject.setPublic();
final Code code = new Code(initGraphicsObject);
code.setMaxStack(1);
initGraphicsObject.setCode(code);
graphicsObjectVanilla.addMethod(initGraphicsObject);
Instructions ins = code.getInstructions();
ins.addInstruction(new ALoad(ins, 0));
ins.addInstruction(new InvokeSpecial(ins, new net.runelite.asm.pool.Method(renderableVanilla.getPoolClass(), "<init>", new Signature("()V"))));
ins.addInstruction(new VReturn(ins));
}
}
@@ -0,0 +1,103 @@
/*
* Copyright (c) 2021, Owain van Brakel <https://github.com/Owain94>
* All rights reserved.
*
* This code is licensed under GPL3, see the complete license in
* the LICENSE file in the root directory of this submodule.
*/
package com.openosrs.injector.injectors.raw;
import com.openosrs.injector.injection.InjectData;
import com.openosrs.injector.injectors.AbstractInjector;
import java.util.List;
import net.runelite.asm.ClassFile;
import net.runelite.asm.Method;
import net.runelite.asm.attributes.Code;
import net.runelite.asm.attributes.code.Instruction;
import net.runelite.asm.attributes.code.InstructionType;
import net.runelite.asm.attributes.code.Instructions;
import net.runelite.asm.attributes.code.instructions.ALoad;
import net.runelite.asm.attributes.code.instructions.Dup;
import net.runelite.asm.attributes.code.instructions.InvokeSpecial;
import net.runelite.asm.attributes.code.instructions.New;
import net.runelite.asm.attributes.code.instructions.Return;
import net.runelite.asm.attributes.code.instructions.VReturn;
import net.runelite.asm.signature.Signature;
import org.objectweb.asm.Opcodes;
public class RuneliteObject extends AbstractInjector
{
private static final String RUNELITE_OBJECT = "RuneLiteObject";
public RuneliteObject(InjectData inject)
{
super(inject);
}
public void inject()
{
ClassFile runeliteObjectVanilla = inject.vanilla.findClass(RUNELITE_OBJECT);
final ClassFile graphicsObjectVanilla = inject.toVanilla(
inject.getDeobfuscated()
.findClass("GraphicsObject")
);
graphicsObjectVanilla.clearFinal();
final ClassFile clientVanilla = inject.toVanilla(
inject.getDeobfuscated()
.findClass("Client")
);
final ClassFile runeLiteObjectDeob = inject.getDeobfuscated()
.findClass(RUNELITE_OBJECT);
if (runeliteObjectVanilla == null)
{
runeliteObjectVanilla = new ClassFile(inject.vanilla);
runeliteObjectVanilla.setName(RUNELITE_OBJECT);
runeliteObjectVanilla.setParentClass(graphicsObjectVanilla.getPoolClass());
runeliteObjectVanilla.setAccess(Opcodes.ACC_PUBLIC);
runeliteObjectVanilla.setVersion(Opcodes.V1_8);
inject.vanilla.addClass(runeliteObjectVanilla);
inject.toVanilla.put(runeLiteObjectDeob, runeliteObjectVanilla);
}
{
Method initRuneliteObject = new Method(runeliteObjectVanilla, "<init>", new Signature("()V"));
initRuneliteObject.setPublic();
final Code code = new Code(initRuneliteObject);
code.setMaxStack(1);
initRuneliteObject.setCode(code);
runeliteObjectVanilla.addMethod(initRuneliteObject);
final Instructions instructions = code.getInstructions();
final List<Instruction> ins = instructions.getInstructions();
ins.add(new ALoad(instructions, 0));
ins.add(new InvokeSpecial(instructions, new net.runelite.asm.pool.Method(graphicsObjectVanilla.getPoolClass(), "<init>", new Signature("()V"))));
ins.add(new VReturn(instructions));
}
{
Method copy = new Method(clientVanilla, "createRuneLiteObject", new Signature("()Lnet/runelite/api/RuneLiteObject;"));
copy.setPublic();
final Code code = new Code(copy);
code.setMaxStack(2);
copy.setCode(code);
clientVanilla.addMethod(copy);
final Instructions instructions = code.getInstructions();
final List<Instruction> ins = instructions.getInstructions();
ins.add(new New(instructions, runeliteObjectVanilla.getPoolClass()));
ins.add(new Dup(instructions));
ins.add(new InvokeSpecial(instructions, new net.runelite.asm.pool.Method(runeliteObjectVanilla.getPoolClass(), "<init>", new Signature("()V"))));
ins.add(new Return(instructions, InstructionType.ARETURN));
}
}
}
+3 -3
View File
@@ -31,9 +31,9 @@ dependencies {
compileOnly(group = "org.projectlombok", name = "lombok", version = ProjectVersions.lombokVersion) compileOnly(group = "org.projectlombok", name = "lombok", version = ProjectVersions.lombokVersion)
implementation(group = "com.google.code.findbugs", name = "jsr305", version = "3.0.2") implementation(group = "com.google.code.findbugs", name = "jsr305", version = "3.0.2")
implementation(group = "com.google.guava", name = "guava", version = "23.2-jre") implementation(group = "com.google.guava", name = "guava", version = "30.1.1-jre")
implementation(group = "org.apache.commons", name = "commons-text", version = "1.2") implementation(group = "org.apache.commons", name = "commons-text", version = "1.9")
implementation(group = "org.slf4j", name = "slf4j-api", version = "1.7.12") implementation(group = "org.slf4j", name = "slf4j-api", version = "1.7.32")
testImplementation(group = "junit", name = "junit", version = "4.12") testImplementation(group = "junit", name = "junit", version = "4.12")
} }
@@ -179,7 +179,7 @@ public final class AnimationID
public static final int MAGIC_ENCHANTING_BOLTS = 4462; public static final int MAGIC_ENCHANTING_BOLTS = 4462;
public static final int BURYING_BONES = 827; public static final int BURYING_BONES = 827;
public static final int USING_GILDED_ALTAR = 3705; public static final int USING_GILDED_ALTAR = 3705;
public static final int LOOKING_INTO = 832; public static final int LOOKING_INTO = 832; // Generic animation used for filling water vessels, Shades of Mort'ton, etc.
public static final int DIG = 830; public static final int DIG = 830;
public static final int DEMONIC_GORILLA_MAGIC_ATTACK = 7225; public static final int DEMONIC_GORILLA_MAGIC_ATTACK = 7225;
public static final int DEMONIC_GORILLA_MELEE_ATTACK = 7226; public static final int DEMONIC_GORILLA_MELEE_ATTACK = 7226;
@@ -176,6 +176,9 @@ public enum ChatMessageType
* Clan wars challenge for clans rather than FCs * Clan wars challenge for clans rather than FCs
*/ */
CLAN_CLAN_WARS_CHALLENGE(110), CLAN_CLAN_WARS_CHALLENGE(110),
CLAN_GIM_FORM_GROUP(111),
CLAN_GIM_GROUP_WITH(112),
/** /**
* An unknown message type. * An unknown message type.
*/ */
@@ -2292,4 +2292,22 @@ public interface Client extends GameEngine
*/ */
@Nullable @Nullable
ClanSettings getGuestClanSettings(); ClanSettings getGuestClanSettings();
/**
* Get clan channel by id.
* @param clanId the clan id
* @return
* @see net.runelite.api.clan.ClanID
*/
@Nullable
ClanChannel getClanChannel(int clanId);
/**
* Get clan settings by id
* @param clanId the clan id
* @return
* @see net.runelite.api.clan.ClanID
*/
@Nullable
ClanSettings getClanSettings(int clanId);
} }
@@ -25,7 +25,7 @@
*/ */
package net.runelite.api; package net.runelite.api;
public class GraphicID public final class GraphicID
{ {
public static final int WINE_MAKE = 47; public static final int WINE_MAKE = 47;
public static final int SPLASH = 85; public static final int SPLASH = 85;
@@ -12151,5 +12151,51 @@ public final class ItemID
public static final int COMBAT_POTION2_26152 = 26152; public static final int COMBAT_POTION2_26152 = 26152;
public static final int COMBAT_POTION1_26153 = 26153; public static final int COMBAT_POTION1_26153 = 26153;
public static final int MOUNT_KARUULM_DIARY = 26154; public static final int MOUNT_KARUULM_DIARY = 26154;
public static final int GROUP_IRON_HELM = 26156;
public static final int GROUP_IRON_PLATEBODY = 26158;
public static final int GROUP_IRON_PLATEBODY_26160 = 26160;
public static final int GROUP_IRON_PLATEBODY_26162 = 26162;
public static final int GROUP_IRON_PLATEBODY_26164 = 26164;
public static final int GROUP_IRON_PLATELEGS = 26166;
public static final int GROUP_IRON_BRACERS = 26168;
public static final int HARDCORE_GROUP_IRON_HELM = 26170;
public static final int HARDCORE_GROUP_IRON_PLATEBODY = 26172;
public static final int HARDCORE_GROUP_IRON_PLATEBODY_26174 = 26174;
public static final int HARDCORE_GROUP_IRON_PLATEBODY_26176 = 26176;
public static final int HARDCORE_GROUP_IRON_PLATEBODY_26178 = 26178;
public static final int HARDCORE_GROUP_IRON_PLATELEGS = 26180;
public static final int HARDCORE_GROUP_IRON_BRACERS = 26182;
public static final int BLUE_ICON_26184 = 26184;
public static final int BLUE_ICON_26185 = 26185;
public static final int BLUE_ICON_26186 = 26186;
public static final int BLUE_ICON_26187 = 26187;
public static final int BLUE_ICON_26188 = 26188;
public static final int BLUE_ICON_26189 = 26189;
public static final int BLUE_ICON_26190 = 26190;
public static final int BLUE_ICON_26191 = 26191;
public static final int BLUE_ICON_26192 = 26192;
public static final int BLUE_ICON_26193 = 26193;
public static final int BLUE_ICON_26194 = 26194;
public static final int BLUE_ICON_26195 = 26195;
public static final int BLUE_ICON_26196 = 26196;
public static final int BLUE_ICON_26197 = 26197;
public static final int BLUE_ICON_26198 = 26198;
public static final int BLUE_ICON_26199 = 26199;
public static final int RED_ICON_26200 = 26200;
public static final int RED_ICON_26201 = 26201;
public static final int RED_ICON_26202 = 26202;
public static final int RED_ICON_26203 = 26203;
public static final int RED_ICON_26204 = 26204;
public static final int RED_ICON_26205 = 26205;
public static final int RED_ICON_26206 = 26206;
public static final int RED_ICON_26207 = 26207;
public static final int RED_ICON_26208 = 26208;
public static final int RED_ICON_26209 = 26209;
public static final int RED_ICON_26210 = 26210;
public static final int RED_ICON_26211 = 26211;
public static final int RED_ICON_26212 = 26212;
public static final int RED_ICON_26213 = 26213;
public static final int RED_ICON_26214 = 26214;
public static final int RED_ICON_26215 = 26215;
/* This file is automatically generated. Do not edit. */ /* This file is automatically generated. Do not edit. */
} }
@@ -43,6 +43,11 @@ public interface Node
*/ */
Node getPrevious(); Node getPrevious();
/**
* Unlink.
*/
void unlink();
/** /**
* Gets the hash value of the node. * Gets the hash value of the node.
* *
@@ -9470,5 +9470,12 @@ public final class NpcID
public static final int GUARD_11209 = 11209; public static final int GUARD_11209 = 11209;
public static final int GUARD_11210 = 11210; public static final int GUARD_11210 = 11210;
public static final int PRIFDDINAS_GUARD_11211 = 11211; public static final int PRIFDDINAS_GUARD_11211 = 11211;
public static final int D3AD1I_F15HER = 11225;
public static final int BOAR31337KILLER = 11226;
public static final int ENRAGED_BOAR = 11227;
public static final int R0CK_5MASHER = 11228;
public static final int REGENT = 11229;
public static final int GROUP_STORAGE_TUTOR = 11230;
public static final int GROUP_IRON_TUTOR = 11231;
/* This file is automatically generated. Do not edit. */ /* This file is automatically generated. Do not edit. */
} }
@@ -13794,5 +13794,20 @@ public final class NullItemID
public static final int NULL_26145 = 26145; public static final int NULL_26145 = 26145;
public static final int NULL_26148 = 26148; public static final int NULL_26148 = 26148;
public static final int NULL_26155 = 26155; public static final int NULL_26155 = 26155;
public static final int NULL_26157 = 26157;
public static final int NULL_26159 = 26159;
public static final int NULL_26161 = 26161;
public static final int NULL_26163 = 26163;
public static final int NULL_26165 = 26165;
public static final int NULL_26167 = 26167;
public static final int NULL_26169 = 26169;
public static final int NULL_26171 = 26171;
public static final int NULL_26173 = 26173;
public static final int NULL_26175 = 26175;
public static final int NULL_26177 = 26177;
public static final int NULL_26179 = 26179;
public static final int NULL_26181 = 26181;
public static final int NULL_26183 = 26183;
public static final int NULL_26216 = 26216;
/* This file is automatically generated. Do not edit. */ /* This file is automatically generated. Do not edit. */
} }
@@ -20991,5 +20991,9 @@ public final class NullObjectID
public static final int NULL_42802 = 42802; public static final int NULL_42802 = 42802;
public static final int NULL_42804 = 42804; public static final int NULL_42804 = 42804;
public static final int NULL_42816 = 42816; public static final int NULL_42816 = 42816;
public static final int NULL_42829 = 42829;
public static final int NULL_42830 = 42830;
public static final int NULL_42835 = 42835;
public static final int NULL_42836 = 42836;
/* This file is automatically generated. Do not edit. */ /* This file is automatically generated. Do not edit. */
} }
@@ -21812,5 +21812,21 @@ public final class ObjectID
public static final int BANNER_42814 = 42814; public static final int BANNER_42814 = 42814;
public static final int BANNER_42815 = 42815; public static final int BANNER_42815 = 42815;
public static final int ROCKS_42817 = 42817; public static final int ROCKS_42817 = 42817;
public static final int LIGHT_42818 = 42818;
public static final int PORTAL_42819 = 42819;
public static final int PORTAL_42820 = 42820;
public static final int PLANTS = 42821;
public static final int STATUE_42822 = 42822;
public static final int STATUE_42823 = 42823;
public static final int FURNACE_42824 = 42824;
public static final int ANVIL_42825 = 42825;
public static final int ROWBOAT_42826 = 42826;
public static final int ARMOUR_CRATE = 42827;
public static final int HARDCORE_ARMOUR_CRATE = 42828;
public static final int OAK_42831 = 42831;
public static final int TREE_42832 = 42832;
public static final int ROCKS_42833 = 42833;
public static final int CHEST_42834 = 42834;
public static final int BANK_BOOTH_42837 = 42837;
/* This file is automatically generated. Do not edit. */ /* This file is automatically generated. Do not edit. */
} }
@@ -27,7 +27,7 @@ package net.runelite.api;
/** /**
* @see ParamHolder * @see ParamHolder
*/ */
public class ParamID public final class ParamID
{ {
/** /**
* @see SettingID * @see SettingID
@@ -123,24 +123,25 @@ public class Perspective
y -= client.getCameraY(); y -= client.getCameraY();
z -= client.getCameraZ(); z -= client.getCameraZ();
int cameraPitch = client.getCameraPitch(); final int cameraPitch = client.getCameraPitch();
int cameraYaw = client.getCameraYaw(); final int cameraYaw = client.getCameraYaw();
int pitchSin = SINE[cameraPitch]; final int pitchSin = SINE[cameraPitch];
int pitchCos = COSINE[cameraPitch]; final int pitchCos = COSINE[cameraPitch];
int yawSin = SINE[cameraYaw]; final int yawSin = SINE[cameraYaw];
int yawCos = COSINE[cameraYaw]; final int yawCos = COSINE[cameraYaw];
int var8 = yawCos * x + y * yawSin >> 16; final int
y = yawCos * y - yawSin * x >> 16; x1 = x * yawCos + y * yawSin >> 16,
x = var8; y1 = y * yawCos - x * yawSin >> 16,
var8 = pitchCos * z - y * pitchSin >> 16; y2 = z * pitchCos - y1 * pitchSin >> 16,
y = z * pitchSin + y * pitchCos >> 16; z1 = y1 * pitchCos + z * pitchSin >> 16;
if (y >= 50) if (z1 >= 50)
{ {
int pointX = client.getViewportWidth() / 2 + x * client.getScale() / y; final int scale = client.getScale();
int pointY = client.getViewportHeight() / 2 + var8 * client.getScale() / y; final int pointX = client.getViewportWidth() / 2 + x1 * scale / z1;
final int pointY = client.getViewportHeight() / 2 + y2 * scale / z1;
return new Point( return new Point(
pointX + client.getViewportXOffset(), pointX + client.getViewportXOffset(),
pointY + client.getViewportYOffset()); pointY + client.getViewportYOffset());
@@ -151,9 +152,88 @@ public class Perspective
} }
/** /**
* Translates a model's vertices into 2d space * Translates a model's vertices into 2d space. There is a separate implementation for GPU since GPU
* uses a slightly more precise projection that can cause features like model outlines being noticeably
* off otherwise.
*/ */
public static void modelToCanvas(Client client, int end, int x3dCenter, int y3dCenter, int z3dCenter, int rotate, int[] x3d, int[] y3d, int[] z3d, int[] x2d, int[] y2d) public static void modelToCanvas(Client client, int end, int x3dCenter, int y3dCenter, int z3dCenter, int rotate, int[] x3d, int[] y3d, int[] z3d, int[] x2d, int[] y2d)
{
if (client.isGpu())
{
modelToCanvasGpu(client, end, x3dCenter, y3dCenter, z3dCenter, rotate, x3d, y3d, z3d, x2d, y2d);
}
else
{
modelToCanvasCpu(client, end, x3dCenter, y3dCenter, z3dCenter, rotate, x3d, y3d, z3d, x2d, y2d);
}
}
private static void modelToCanvasGpu(Client client, int end, int x3dCenter, int y3dCenter, int z3dCenter, int rotate, int[] x3d, int[] y3d, int[] z3d, int[] x2d, int[] y2d)
{
final int
cameraPitch = client.getCameraPitch(),
cameraYaw = client.getCameraYaw();
final float
pitchSin = SINE[cameraPitch] / 65536.0f,
pitchCos = COSINE[cameraPitch] / 65536.0f,
yawSin = SINE[cameraYaw] / 65536.0f,
yawCos = COSINE[cameraYaw] / 65536.0f,
rotateSin = SINE[rotate] / 65536.0f,
rotateCos = COSINE[rotate] / 65536.0f,
cx = x3dCenter - client.getCameraX(),
cy = y3dCenter - client.getCameraY(),
cz = z3dCenter - client.getCameraZ(),
viewportXMiddle = client.getViewportWidth() / 2f,
viewportYMiddle = client.getViewportHeight() / 2f,
viewportXOffset = client.getViewportXOffset(),
viewportYOffset = client.getViewportYOffset(),
zoom3d = client.getScale();
for (int i = 0; i < end; i++)
{
float x = x3d[i];
float y = y3d[i];
float z = z3d[i];
if (rotate != 0)
{
float x0 = x;
x = x0 * rotateCos + y * rotateSin;
y = y * rotateCos - x0 * rotateSin;
}
x += cx;
y += cy;
z += cz;
final float
x1 = x * yawCos + y * yawSin,
y1 = y * yawCos - x * yawSin,
y2 = z * pitchCos - y1 * pitchSin,
z1 = y1 * pitchCos + z * pitchSin;
int viewX, viewY;
if (z1 < 50)
{
viewX = Integer.MIN_VALUE;
viewY = Integer.MIN_VALUE;
}
else
{
viewX = Math.round((viewportXMiddle + x1 * zoom3d / z1) + viewportXOffset);
viewY = Math.round((viewportYMiddle + y2 * zoom3d / z1) + viewportYOffset);
}
x2d[i] = viewX;
y2d[i] = viewY;
}
}
private static void modelToCanvasCpu(Client client, int end, int x3dCenter, int y3dCenter, int z3dCenter, int rotate, int[] x3d, int[] y3d, int[] z3d, int[] x2d, int[] y2d)
{ {
final int final int
cameraPitch = client.getCameraPitch(), cameraPitch = client.getCameraPitch(),
@@ -29,7 +29,7 @@ package net.runelite.api;
* <p> * <p>
* Note: This class is not complete and may be missing mapped IDs. * Note: This class is not complete and may be missing mapped IDs.
*/ */
public class ProjectileID public final class ProjectileID
{ {
public static final int CANNONBALL = 53; public static final int CANNONBALL = 53;
public static final int GRANITE_CANNONBALL = 1443; public static final int GRANITE_CANNONBALL = 1443;
@@ -71,6 +71,56 @@ public interface Scene
*/ */
void removeGameObject(GameObject gameObject); void removeGameObject(GameObject gameObject);
/**
* Remove a game object from the scene
* @param plane
* @param x
* @param y
*/
void removeGameObject(int plane, int x, int y);
/**
* Remove a game object from the scene
* @param wallObject
*/
void removeWallObject(WallObject wallObject);
/**
* Remove a wall object from the scene
* @param plane
* @param x
* @param y
*/
void removeWallObject(int plane, int x, int y);
/**
* Remove a decorative object from the scene
* @param decorativeObject
*/
void removeDecorativeObject(DecorativeObject decorativeObject);
/**
* Remove a decorative object from the scene
* @param plane
* @param x
* @param y
*/
void removeDecorativeObject(int plane, int x, int y);
/**
* Remove a ground object from the scene
* @param groundObject
*/
void removeGroundObject(GroundObject groundObject);
/**
* Remove a ground object from the scene
* @param plane
* @param x
* @param y
*/
void removeGroundObject(int plane, int x, int y);
void generateHouses(); void generateHouses();
void setRoofRemovalMode(int flags); void setRoofRemovalMode(int flags);
@@ -257,7 +257,7 @@ public final class ScriptID
/** /**
* Builds the widget for making an offer in Grand Exchange * Builds the widget for making an offer in Grand Exchange
*/ */
@ScriptArguments(integer = 15) @ScriptArguments(integer = 16)
public static final int GE_OFFERS_SETUP_BUILD = 779; public static final int GE_OFFERS_SETUP_BUILD = 779;
/** /**
@@ -411,4 +411,18 @@ public final class ScriptID
@ScriptArguments(integer = 6) @ScriptArguments(integer = 6)
public static final int COLLECTION_DRAW_LIST = 2730; public static final int COLLECTION_DRAW_LIST = 2730;
/**
* Draws the active notification in increasing sizes (increasing horizontally first, then vertically) to show a
* starting animation.
*/
@ScriptArguments(integer = 3)
public static final int NOTIFICATION_START = 3346;
/**
* Draws the active notification in full size for a specified number of client ticks. In essence, delayed between
* the open and close animations.
*/
@ScriptArguments(integer = 1)
public static final int NOTIFICATION_DELAY = 3347;
} }
@@ -27,7 +27,7 @@ package net.runelite.api;
/** /**
* @see ParamID#SETTING_ID * @see ParamID#SETTING_ID
*/ */
public class SettingID public final class SettingID
{ {
public static final int CAMERA_ZOOM = 14; public static final int CAMERA_ZOOM = 14;
@@ -1209,17 +1209,52 @@ public final class SpriteID
public static final int KOUREND_FAVOUR_LOVAKENGJ_ICON = 1244; public static final int KOUREND_FAVOUR_LOVAKENGJ_ICON = 1244;
public static final int KOUREND_FAVOUR_PISCARILIUS_ICON = 1245; public static final int KOUREND_FAVOUR_PISCARILIUS_ICON = 1245;
public static final int KOUREND_FAVOUR_SHAYZIEN_ICON = 1246; public static final int KOUREND_FAVOUR_SHAYZIEN_ICON = 1246;
/* Unmapped: 1247~1296 */ public static final int SPELL_BASIC_REANIMATION = 1247;
public static final int SPELL_ADEPT_REANIMATION = 1248;
public static final int SPELL_EXPERT_REANIMATION = 1249;
public static final int SPELL_MASTER_REANIMATION = 1250;
/* Unmapped: 1251 */
public static final int SPELL_ARCEUUS_LIBRARY_TELEPORT = 1252;
public static final int SPELL_DRAYNOR_MANOR_TELEPORT = 1253;
public static final int SPELL_SALVE_GRAVEYARD_TELEPORT = 1254;
/* Unmapped: 1255 */
public static final int SPELL_MIND_ALTAR_TELEPORT = 1256;
public static final int SPELL_RESPAWN_TELEPORT = 1257;
/* Unmapped 1258 */
public static final int SPELL_FENKENSTRAINS_CASTLE_TELEPORT = 1259;
public static final int SPELL_WEST_ARDOUGNE_TELEPORT = 1260;
public static final int SPELL_HARMONY_ISLAND_TELEPORT = 1261;
public static final int SPELL_BARROWS_TELEPORT = 1262;
public static final int SPELL_APE_ATOLL_TELEPORT = 1263;
public static final int SPELL_CEMETERY_TELEPORT = 1264;
/* Unmapped: 1265 */
public static final int SPELL_RESURRECT_CROPS = 1266;
public static final int SPELL_GHOSTLY_GRASP = 1267;
public static final int SPELL_SKELETAL_GRASP = 1268;
public static final int SPELL_UNDEAD_GRASP = 1269;
public static final int SPELL_RESURRECT_LESSER_GHOST = 1270;
/* Unmapped: 1271~1296 */
public static final int QUESTS_PAGE_ICON_PURPLE_KOUREND = 1297; public static final int QUESTS_PAGE_ICON_PURPLE_KOUREND = 1297;
public static final int UNUSED_TAB_QUESTS_GREEN_ACHIEVEMENT_DIARIES = 1298; public static final int UNUSED_TAB_QUESTS_GREEN_ACHIEVEMENT_DIARIES = 1298;
public static final int TAB_QUESTS_GREEN_ACHIEVEMENT_DIARIES = 1299; public static final int TAB_QUESTS_GREEN_ACHIEVEMENT_DIARIES = 1299;
/* Unmapped: 1300~1305 */ /* Unmapped: 1300~1301 */
public static final int SPELL_INFERIOR_DEMONBANE = 1302;
public static final int SPELL_SUPERIOR_DEMONBANE = 1303;
public static final int SPELL_DARK_DEMONBANE = 1304;
public static final int SPELL_MARK_OF_DARKNESS = 1305;
public static final int SPELL_WARD_OF_ARCEUUS = 1306; public static final int SPELL_WARD_OF_ARCEUUS = 1306;
/* Unmapped: 1307~1309 */ public static final int SPELL_LESSER_CORRUPTION = 1307;
public static final int SPELL_GREATER_CORRUPTION = 1308;
/* Unmapped: 1309 */
public static final int SPELL_DEATH_CHARGE = 1310; public static final int SPELL_DEATH_CHARGE = 1310;
/* Unmapped: 1311~1314 */ public static final int SPELL_DEMONIC_OFFERING = 1311;
public static final int SPELL_SINISTER_OFFERING = 1312;
/* Unmapped: 1313~1314 */
public static final int SPELL_SHADOW_VEIL = 1315; public static final int SPELL_SHADOW_VEIL = 1315;
/* Unmapped: 1316~1324 */ public static final int SPELL_DARK_LURE = 1316;
public static final int SPELL_VILE_VIGOUR = 1317;
public static final int SPELL_DEGRIME = 1318;
/* Unmapped: 1319~1324 */
public static final int SPELL_WARD_OF_ARCEUUS_DISABLED = 1325; public static final int SPELL_WARD_OF_ARCEUUS_DISABLED = 1325;
/* Unmapped: 1326 */ /* Unmapped: 1326 */
public static final int SPELL_GREATER_CORRUPTION_DISABLED = 1327; public static final int SPELL_GREATER_CORRUPTION_DISABLED = 1327;
@@ -1300,10 +1335,10 @@ public final class SpriteID
public static final int UNKNOWN_WHITE_REFRESH_ARROWS = 1412; public static final int UNKNOWN_WHITE_REFRESH_ARROWS = 1412;
public static final int TAB_QUESTS_PURPLE_KOUREND_UNUSED = 1413; public static final int TAB_QUESTS_PURPLE_KOUREND_UNUSED = 1413;
public static final int TAB_QUESTS_PURPLE_KOUREND = 1414; public static final int TAB_QUESTS_PURPLE_KOUREND = 1414;
public static final int UNKNOWN_GREEN_BAR = 1415; public static final int HEALTHBAR_COX_GREEN = 1415;
public static final int UNKNOWN_BLUE_BAR = 1416; public static final int HEALTHBAR_COX_BLUE = 1416;
public static final int UNKNOWN_YELLOW_BAR = 1417; public static final int HEALTHBAR_COX_YELLOW = 1417;
public static final int UNKNOWN_RED_BAR = 1418; public static final int HEALTHBAR_COX_RED = 1418;
/* Unmapped: 1419 */ /* Unmapped: 1419 */
public static final int PRAYER_RIGOUR = 1420; public static final int PRAYER_RIGOUR = 1420;
public static final int PRAYER_AUGURY = 1421; public static final int PRAYER_AUGURY = 1421;
@@ -1530,9 +1565,69 @@ public final class SpriteID
public static final int HEALTHBAR_DEFAULT_BACK_140PX = 2189; public static final int HEALTHBAR_DEFAULT_BACK_140PX = 2189;
public static final int HEALTHBAR_DEFAULT_FRONT_160PX = 2190; public static final int HEALTHBAR_DEFAULT_FRONT_160PX = 2190;
public static final int HEALTHBAR_DEFAULT_BACK_160PX = 2191; public static final int HEALTHBAR_DEFAULT_BACK_160PX = 2191;
/* Unmapped: 2192~2306 */
public static final int TAB_CLAN_CHAT = 2307; public static final int TAB_CLAN_CHAT = 2307;
/* Unmapped: 2308~2419 */
public static final int WIKI_DESELECTED = 2420; public static final int WIKI_DESELECTED = 2420;
public static final int WIKI_SELECTED = 2421; public static final int WIKI_SELECTED = 2421;
/* Unmapped: 2422~2430 */
public static final int HEALTHBAR_DEFAULT_FRONT_40PX = 2431;
public static final int HEALTHBAR_DEFAULT_BACK_40PX = 2432;
public static final int HEALTHBAR_CYAN_FRONT_30PX = 2433;
public static final int HEALTHBAR_CYAN_BACK_30PX = 2434;
public static final int HEALTHBAR_CYAN_FRONT_40PX = 2435;
public static final int HEALTHBAR_CYAN_BACK_40PX = 2436;
public static final int HEALTHBAR_CYAN_FRONT_50PX = 2437;
public static final int HEALTHBAR_CYAN_BACK_50PX = 2438;
public static final int HEALTHBAR_CYAN_FRONT_60PX = 2439;
public static final int HEALTHBAR_CYAN_BACK_60PX = 2440;
public static final int HEALTHBAR_CYAN_FRONT_80PX = 2441;
public static final int HEALTHBAR_CYAN_BACK_80PX = 2442;
public static final int HEALTHBAR_CYAN_FRONT_100PX = 2443;
public static final int HEALTHBAR_CYAN_BACK_100PX = 2444;
public static final int HEALTHBAR_CYAN_FRONT_120PX = 2445;
public static final int HEALTHBAR_CYAN_BACK_120PX = 2446;
public static final int HEALTHBAR_CYAN_FRONT_140PX = 2447;
public static final int HEALTHBAR_CYAN_BACK_140PX = 2448;
public static final int HEALTHBAR_CYAN_FRONT_160PX = 2449;
public static final int HEALTHBAR_CYAN_BACK_160PX = 2450;
public static final int HEALTHBAR_ORANGE_FRONT_30PX = 2451;
public static final int HEALTHBAR_ORANGE_BACK_30PX = 2452;
public static final int HEALTHBAR_ORANGE_FRONT_40PX = 2453;
public static final int HEALTHBAR_ORANGE_BACK_40PX = 2454;
public static final int HEALTHBAR_ORANGE_FRONT_50PX = 2455;
public static final int HEALTHBAR_ORANGE_BACK_50PX = 2456;
public static final int HEALTHBAR_ORANGE_FRONT_60PX = 2457;
public static final int HEALTHBAR_ORANGE_BACK_60PX = 2458;
public static final int HEALTHBAR_ORANGE_FRONT_80PX = 2459;
public static final int HEALTHBAR_ORANGE_BACK_80PX = 2460;
public static final int HEALTHBAR_ORANGE_FRONT_100PX = 2461;
public static final int HEALTHBAR_ORANGE_BACK_100PX = 2462;
public static final int HEALTHBAR_ORANGE_FRONT_120PX = 2463;
public static final int HEALTHBAR_ORANGE_BACK_120PX = 2464;
public static final int HEALTHBAR_ORANGE_FRONT_140PX = 2465;
public static final int HEALTHBAR_ORANGE_BACK_140PX = 2466;
public static final int HEALTHBAR_ORANGE_FRONT_160PX = 2467;
public static final int HEALTHBAR_ORANGE_BACK_160PX = 2468;
public static final int HEALTHBAR_YELLOW_FRONT_30PX = 2469;
public static final int HEALTHBAR_YELLOW_BACK_30PX = 2470;
public static final int HEALTHBAR_YELLOW_FRONT_40PX = 2471;
public static final int HEALTHBAR_YELLOW_BACK_40PX = 2472;
public static final int HEALTHBAR_YELLOW_FRONT_50PX = 2473;
public static final int HEALTHBAR_YELLOW_BACK_50PX = 2474;
public static final int HEALTHBAR_YELLOW_FRONT_60PX = 2475;
public static final int HEALTHBAR_YELLOW_BACK_60PX = 2476;
public static final int HEALTHBAR_YELLOW_FRONT_80PX = 2477;
public static final int HEALTHBAR_YELLOW_BACK_80PX = 2478;
public static final int HEALTHBAR_YELLOW_FRONT_100PX = 2479;
public static final int HEALTHBAR_YELLOW_BACK_100PX = 2480;
public static final int HEALTHBAR_YELLOW_FRONT_120PX = 2481;
public static final int HEALTHBAR_YELLOW_BACK_120PX = 2482;
public static final int HEALTHBAR_YELLOW_FRONT_140PX = 2483;
public static final int HEALTHBAR_YELLOW_BACK_140PX = 2484;
public static final int HEALTHBAR_YELLOW_FRONT_160PX = 2485;
public static final int HEALTHBAR_YELLOW_BACK_160PX = 2486;
/* Unmapped: 2487~2824 */
public static final int FRIENDS_CHAT_RANK_SMILEY_FRIEND = 2825; public static final int FRIENDS_CHAT_RANK_SMILEY_FRIEND = 2825;
public static final int FRIENDS_CHAT_RANK_CROWN_JAGEX_MODERATOR = 2826; public static final int FRIENDS_CHAT_RANK_CROWN_JAGEX_MODERATOR = 2826;
public static final int FRIENDS_CHAT_RANK_KEY_CHANNEL_OWNER = 2827; public static final int FRIENDS_CHAT_RANK_KEY_CHANNEL_OWNER = 2827;
@@ -1546,8 +1641,22 @@ public final class SpriteID
public static final int SETTINGS_SLIDER_HANDLE_BLUE = 2858; public static final int SETTINGS_SLIDER_HANDLE_BLUE = 2858;
public static final int SETTINGS_SLIDER_HANDLE_RED = 2859; public static final int SETTINGS_SLIDER_HANDLE_RED = 2859;
public static final int SETTINGS_SLIDER_HANDLE_GREEN = 2860; public static final int SETTINGS_SLIDER_HANDLE_GREEN = 2860;
/* Unmapped: 2861~2980 */ /* Unmapped: 2861~2966 */
public static final int HEALTHBAR_BLUE_FRONT_50PX = 2967;
public static final int HEALTHBAR_BLUE_BACK_50PX = 2968;
/* Unmapped: 2968~2970 */
public static final int HEALTHBAR_DEFAULT_FRONT_70PX = 2971;
public static final int HEALTHBAR_DEFAULT_BACK_70PX = 2972;
public static final int HEALTHBAR_CYAN_FRONT_70PX = 2973;
public static final int HEALTHBAR_CYAN_BACK_70PX = 2974;
public static final int HEALTHBAR_ORANGE_FRONT_70PX = 2975;
public static final int HEALTHBAR_ORANGE_BACK_70PX = 2976;
public static final int HEALTHBAR_YELLOW_FRONT_70PX = 2977;
public static final int HEALTHBAR_YELLOW_BACK_70PX = 2978;
/* Unmapped: 2979, 2980 */
public static final int SPELL_RESURRECT_SUPERIOR_SKELETON = 2981; public static final int SPELL_RESURRECT_SUPERIOR_SKELETON = 2981;
/* Unmapped: 2982~2986 */ /* Unmapped: 2982~2983 */
public static final int SPELL_RESURRECT_GREATER_ZOMBIE = 2984;
/* Unmapped: 2985~2986 */
public static final int SPELL_RESURRECT_SUPERIOR_SKELETON_DISABLED = 2987; public static final int SPELL_RESURRECT_SUPERIOR_SKELETON_DISABLED = 2987;
} }
@@ -29,7 +29,7 @@ package net.runelite.api;
* @see StructComposition * @see StructComposition
* @see Client#getStructComposition(int) * @see Client#getStructComposition(int)
*/ */
public class StructID public final class StructID
{ {
public static final int SETTINGS_MUSIC_VOLUME = 2753; public static final int SETTINGS_MUSIC_VOLUME = 2753;
public static final int SETTINGS_EFFECT_VOLUME = 2754; public static final int SETTINGS_EFFECT_VOLUME = 2754;
@@ -42,7 +42,9 @@ public enum VarClientStr
CHATBOX_TYPED_TEXT(335), CHATBOX_TYPED_TEXT(335),
INPUT_TEXT(359), INPUT_TEXT(359),
PRIVATE_MESSAGE_TARGET(360), PRIVATE_MESSAGE_TARGET(360),
RECENT_FRIENDS_CHAT(362); RECENT_FRIENDS_CHAT(362),
NOTIFICATION_TOP_TEXT(387),
NOTIFICATION_BOTTOM_TEXT(388);
private final int index; private final int index;
} }
@@ -633,7 +633,17 @@ public enum Varbits
* *
* @see <a href="https://oldschool.runescape.wiki/w/Minimap#Special_attack_orb">The OSRS Wiki's Minimap page</a> * @see <a href="https://oldschool.runescape.wiki/w/Minimap#Special_attack_orb">The OSRS Wiki's Minimap page</a>
*/ */
PVP_SPEC_ORB(8121); PVP_SPEC_ORB(8121),
/**
* Collection Log notification settings whenever a new item is added
*
* 0 = no notification
* 1 = chat notification only
* 2 = popup notification only
* 3 = chat and popup
*/
COLLECTION_LOG_NOTIFICATION(11959);
/** /**
* The raw varbit ID. * The raw varbit ID.
@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2018, Kruithne <kruithne@gmail.com> * Copyright (c) 2021, 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
@@ -22,13 +22,16 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
package net.runelite.client.plugins.skillcalculator.beans; package net.runelite.api.clan;
import lombok.Getter; public final class ClanID
@Getter
public class SkillDataBonus
{ {
private String name; /**
private float value; * The primary clan.
*/
public static final int CLAN = 0;
/**
* The group ironman clan.
*/
public static final int GROUP_IRONMAN = 1;
} }
@@ -115,8 +115,8 @@ public class LocalPoint
public static LocalPoint fromScene(int x, int y) public static LocalPoint fromScene(int x, int y)
{ {
return new LocalPoint( return new LocalPoint(
(x << Perspective.LOCAL_COORD_BITS) + (1 << Perspective.LOCAL_COORD_BITS - 1) - 1, (x << Perspective.LOCAL_COORD_BITS) + (1 << Perspective.LOCAL_COORD_BITS - 1),
(y << Perspective.LOCAL_COORD_BITS) + (1 << Perspective.LOCAL_COORD_BITS - 1) - 1 (y << Perspective.LOCAL_COORD_BITS) + (1 << Perspective.LOCAL_COORD_BITS - 1)
); );
} }
@@ -160,6 +160,26 @@ public class WorldArea
return distanceTo2D(new WorldArea(other, 1, 1)); return distanceTo2D(new WorldArea(other, 1, 1));
} }
/**
* Checks whether a tile is contained within the area and in the same plane.
*
* @return {@code true} if the tile is contained within the bounds of this area, {@code false} otherwise.
*/
public boolean contains(WorldPoint worldPoint)
{
return distanceTo(worldPoint) == 0;
}
/**
* Checks whether a tile is contained within the area while ignoring the plane.
*
* @return {@code true} if the tile is contained within the bounds of this area regardless of plane, {@code false} otherwise.
*/
public boolean contains2D(WorldPoint worldPoint)
{
return distanceTo2D(worldPoint) == 0;
}
/** /**
* Checks whether this area is within melee distance of another. * Checks whether this area is within melee distance of another.
* <p> * <p>
@@ -45,6 +45,14 @@ import net.runelite.api.Tile;
@Value @Value
public class WorldPoint public class WorldPoint
{ {
private static final int[] REGION_MIRRORS = {
// Prifddinas
12894, 8755,
12895, 8756,
13150, 9011,
13151, 9012
};
/** /**
* X-axis coordinate. * X-axis coordinate.
*/ */
@@ -524,4 +532,65 @@ public class WorldPoint
} }
return distance; return distance;
} }
/**
* Translate a coordinate either between overworld and real, or real and overworld
*
* @param worldPoint
* @param toOverworld whether to convert to overworld coordinates, or to real coordinates
* @return
*/
public static WorldPoint getMirrorPoint(WorldPoint worldPoint, boolean toOverworld)
{
int region = worldPoint.getRegionID();
for (int i = 0; i < REGION_MIRRORS.length; i += 2)
{
int real = REGION_MIRRORS[i];
int overworld = REGION_MIRRORS[i + 1];
// Test against what we are converting from
if (region == (toOverworld ? real : overworld))
{
return fromRegion(toOverworld ? overworld : real,
worldPoint.getRegionX(), worldPoint.getRegionY(), worldPoint.getPlane());
}
}
return worldPoint;
}
/**
* Checks whether this tile is located within any of the given areas.
*
* @param worldAreas areas to check within
* @return {@code true} if any area contains this point, {@code false} otherwise.
*/
public boolean isInArea(WorldArea... worldAreas)
{
for (WorldArea area : worldAreas)
{
if (area.contains(this))
{
return true;
}
}
return false;
}
/**
* Checks whether this tile is located within any of the given areas, disregarding any plane differences.
*
* @param worldAreas areas to check within
* @return {@code true} if any area contains this point, {@code false} otherwise.
*/
public boolean isInArea2D(WorldArea... worldAreas)
{
for (WorldArea area : worldAreas)
{
if (area.contains2D(this))
{
return true;
}
}
return false;
}
} }
@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019, HSJ <https://github.com/HSJ-OSRS> * Copyright (c) 2018, Matthew Steglinski <https://github.com/sainttx>
* 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
@@ -33,5 +33,5 @@ import net.runelite.api.Actor;
@Value @Value
public class ActorDeath public class ActorDeath
{ {
Actor actor; private final Actor actor;
} }
@@ -1,7 +1,31 @@
/*
* Copyright (c) 2016-2017, Abel Briggs
* 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.events; package net.runelite.api.events;
import net.runelite.api.Actor;
import lombok.Data; import lombok.Data;
import net.runelite.api.Actor;
/** /**
* An event where the {@link Actor} has changed animations. * An event where the {@link Actor} has changed animations.
@@ -33,7 +33,6 @@ public class AreaSoundEffectPlayed
{ {
@Nullable @Nullable
private final Actor source; private final Actor source;
private int soundId; private int soundId;
private int sceneX; private int sceneX;
private int sceneY; private int sceneY;
@@ -24,11 +24,11 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import net.runelite.api.ChatMessageType;
import net.runelite.api.MessageNode;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import net.runelite.api.ChatMessageType;
import net.runelite.api.MessageNode;
/** /**
* An event where a new chat message is received. * An event where a new chat message is received.
@@ -47,9 +47,9 @@ public class CommandExecuted
/** /**
* The name of the command entered. * The name of the command entered.
*/ */
String command; private String command;
/** /**
* The command arguments that have been entered. * The command arguments that have been entered.
*/ */
String[] arguments; private String[] arguments;
} }
@@ -24,9 +24,9 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import lombok.Data;
import net.runelite.api.DecorativeObject; import net.runelite.api.DecorativeObject;
import net.runelite.api.Tile; import net.runelite.api.Tile;
import lombok.Data;
/** /**
* An event where the {@link DecorativeObject} attached to a {@link Tile} * An event where the {@link DecorativeObject} attached to a {@link Tile}
@@ -24,9 +24,9 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import lombok.Data;
import net.runelite.api.DecorativeObject; import net.runelite.api.DecorativeObject;
import net.runelite.api.Tile; import net.runelite.api.Tile;
import lombok.Data;
/** /**
* An event where the {@link DecorativeObject} attached to a {@link Tile} * An event where the {@link DecorativeObject} attached to a {@link Tile}
@@ -24,9 +24,9 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import lombok.Data;
import net.runelite.api.DecorativeObject; import net.runelite.api.DecorativeObject;
import net.runelite.api.Tile; import net.runelite.api.Tile;
import lombok.Data;
/** /**
* An event where a {@link DecorativeObject} is attached to a {@link Tile}. * An event where a {@link DecorativeObject} is attached to a {@link Tile}.
@@ -30,6 +30,6 @@ import net.runelite.api.Skill;
@Value @Value
public class FakeXpDrop public class FakeXpDrop
{ {
Skill skill; private final Skill skill;
int xp; private final int xp;
} }
@@ -35,5 +35,5 @@ public class FriendsChatChanged
/** /**
* Whether or not the client is now in a friends chat. * Whether or not the client is now in a friends chat.
*/ */
boolean joined; private boolean joined;
} }
@@ -33,5 +33,5 @@ public class FriendsChatMemberJoined
/** /**
* The member that joined * The member that joined
*/ */
FriendsChatMember member; private FriendsChatMember member;
} }
@@ -33,5 +33,5 @@ public class FriendsChatMemberLeft
/** /**
* The member that left * The member that left
*/ */
FriendsChatMember member; private FriendsChatMember member;
} }
@@ -24,9 +24,9 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import lombok.Data;
import net.runelite.api.GameObject; import net.runelite.api.GameObject;
import net.runelite.api.Tile; import net.runelite.api.Tile;
import lombok.Data;
/** /**
* An event where a {@link GameObject} on a {@link Tile} is removed. * An event where a {@link GameObject} on a {@link Tile} is removed.
@@ -37,9 +37,9 @@ public class GameObjectSpawned
/** /**
* The affected tile. * The affected tile.
*/ */
Tile tile; private Tile tile;
/** /**
* The newly spawned game object. * The newly spawned game object.
*/ */
GameObject gameObject; private GameObject gameObject;
} }
@@ -24,8 +24,8 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import net.runelite.api.GameState;
import lombok.Data; import lombok.Data;
import net.runelite.api.GameState;
/** /**
* An event where the clients game state has changed. * An event where the clients game state has changed.
@@ -24,20 +24,21 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import net.runelite.api.GrandExchangeOffer;
import lombok.Data; import lombok.Data;
import net.runelite.api.GrandExchangeOffer;
import net.runelite.api.GrandExchangeOfferState;
/** /**
* An event where a {GrandExchangeOffer} has been updated with * An event where a {@link GrandExchangeOffer} has been updated with
* new information. * new information.
* <p> * <p>
* When the client initially logs in, this event is called for all grand * When the client initially logs in, this event is called for all grand
* exchange slots with the {GrandExchangeOfferState#EMPTY} state, * exchange slots with the {@link GrandExchangeOfferState#EMPTY} state,
* regardless of whether any slots have offers. Once the exchange is * regardless of whether any slots have offers. Once the exchange is
* initialized, the client then updates any offers with items as it * initialized, the client then updates any offers with items as it
* receives information from the server. * receives information from the server.
* <p> * <p>
* See {GrandExchangeOfferState} for potential states an offer * See {@link GrandExchangeOfferState} for potential states an offer
* can change into. * can change into.
*/ */
@Data @Data
@@ -1,3 +1,27 @@
/*
* Copyright (c) 2018, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.api.events; package net.runelite.api.events;
import lombok.Data; import lombok.Data;
@@ -24,8 +24,8 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import net.runelite.api.GraphicsObject;
import lombok.Value; import lombok.Value;
import net.runelite.api.GraphicsObject;
/** /**
* An event where a new {@link GraphicsObject} has been created. * An event where a new {@link GraphicsObject} has been created.
@@ -36,5 +36,5 @@ public class GraphicsObjectCreated
/** /**
* The newly created graphics object. * The newly created graphics object.
*/ */
GraphicsObject graphicsObject; private final GraphicsObject graphicsObject;
} }
@@ -24,9 +24,9 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import lombok.Data;
import net.runelite.api.GroundObject; import net.runelite.api.GroundObject;
import net.runelite.api.Tile; import net.runelite.api.Tile;
import lombok.Data;
/** /**
* An event where the {@link GroundObject} on a {@link Tile} has been changed. * An event where the {@link GroundObject} on a {@link Tile} has been changed.
@@ -24,9 +24,9 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import lombok.Data;
import net.runelite.api.GroundObject; import net.runelite.api.GroundObject;
import net.runelite.api.Tile; import net.runelite.api.Tile;
import lombok.Data;
/** /**
* An event where a {@link GroundObject} on a {@link Tile} has been removed. * An event where a {@link GroundObject} on a {@link Tile} has been removed.
@@ -24,9 +24,9 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import lombok.Data;
import net.runelite.api.GroundObject; import net.runelite.api.GroundObject;
import net.runelite.api.Tile; import net.runelite.api.Tile;
import lombok.Data;
/** /**
* An event where a {@link GroundObject} is added to a {@link Tile}. * An event where a {@link GroundObject} is added to a {@link Tile}.
@@ -24,9 +24,9 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import lombok.Data;
import net.runelite.api.Actor; import net.runelite.api.Actor;
import net.runelite.api.Hitsplat; import net.runelite.api.Hitsplat;
import lombok.Data;
/** /**
* An event called when a {@link Hitsplat} is processed on an {@link Actor}. * An event called when a {@link Hitsplat} is processed on an {@link Actor}.
@@ -1,7 +1,31 @@
/*
* Copyright (c) 2018, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.api.events; package net.runelite.api.events;
import net.runelite.api.Actor;
import lombok.Value; import lombok.Value;
import net.runelite.api.Actor;
/** /**
* An event called when the actor an actor is interacting with changes * An event called when the actor an actor is interacting with changes
@@ -9,10 +33,10 @@ import lombok.Value;
@Value @Value
public class InteractingChanged public class InteractingChanged
{ {
Actor source; private final Actor source;
/** /**
* Target actor, may be null * Target actor, may be null
*/ */
Actor target; private final Actor target;
} }
@@ -24,8 +24,8 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import net.runelite.api.ItemContainer;
import lombok.Value; import lombok.Value;
import net.runelite.api.ItemContainer;
/** /**
* An event called whenever the stack size of an {@link net.runelite.api.Item} * An event called whenever the stack size of an {@link net.runelite.api.Item}
@@ -44,10 +44,10 @@ public class ItemContainerChanged
/** /**
* The modified container's ID. * The modified container's ID.
*/ */
int containerId; private final int containerId;
/** /**
* The modified item container. * The modified item container.
*/ */
ItemContainer itemContainer; private final ItemContainer itemContainer;
} }
@@ -25,9 +25,8 @@
package net.runelite.api.events; package net.runelite.api.events;
import lombok.Value; import lombok.Value;
import net.runelite.api.TileItem;
import net.runelite.api.Tile; import net.runelite.api.Tile;
import lombok.Value; import net.runelite.api.TileItem;
/** /**
* Called when an item pile despawns from the ground. When the client loads a new scene, * Called when an item pile despawns from the ground. When the client loads a new scene,
@@ -36,6 +35,6 @@ import lombok.Value;
@Value @Value
public class ItemDespawned public class ItemDespawned
{ {
Tile tile; private final Tile tile;
TileItem item; private final TileItem item;
} }
@@ -25,9 +25,8 @@
package net.runelite.api.events; package net.runelite.api.events;
import lombok.Value; import lombok.Value;
import net.runelite.api.TileItem;
import net.runelite.api.Tile; import net.runelite.api.Tile;
import lombok.Value; import net.runelite.api.TileItem;
/** /**
* Called when the quantity of an item pile changes. * Called when the quantity of an item pile changes.
@@ -35,8 +34,8 @@ import lombok.Value;
@Value @Value
public class ItemQuantityChanged public class ItemQuantityChanged
{ {
TileItem item; private final TileItem item;
Tile tile; private final Tile tile;
int oldQuantity; private final int oldQuantity;
int newQuantity; private final int newQuantity;
} }
@@ -25,9 +25,8 @@
package net.runelite.api.events; package net.runelite.api.events;
import lombok.Value; import lombok.Value;
import net.runelite.api.TileItem;
import net.runelite.api.Tile; import net.runelite.api.Tile;
import lombok.Value; import net.runelite.api.TileItem;
/** /**
* Called when an item pile spawns on the ground. When the client loads a new scene, * Called when an item pile spawns on the ground. When the client loads a new scene,
@@ -36,6 +35,6 @@ import lombok.Value;
@Value @Value
public class ItemSpawned public class ItemSpawned
{ {
Tile tile; private final Tile tile;
TileItem item; private final TileItem item;
} }
@@ -24,8 +24,8 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import net.runelite.api.Nameable;
import lombok.Value; import lombok.Value;
import net.runelite.api.Nameable;
/** /**
* An event where a {@link Nameable} has had their name changed. * An event where a {@link Nameable} has had their name changed.
@@ -36,5 +36,5 @@ public class NameableNameChanged
/** /**
* The nameable that changed names. * The nameable that changed names.
*/ */
Nameable nameable; private final Nameable nameable;
} }
@@ -37,11 +37,10 @@ public class NpcChanged
/** /**
* The NPC of which the composition changed. * The NPC of which the composition changed.
*/ */
NPC npc; private final NPC npc;
/** /**
* The old composition of the NPC * The old composition of the NPC
*/ */
NPCComposition old; private final NPCComposition old;
} }
@@ -24,9 +24,9 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import lombok.Value;
import net.runelite.api.Actor; import net.runelite.api.Actor;
import net.runelite.api.NPC; import net.runelite.api.NPC;
import lombok.Value;
/** /**
* An event where an {@link NPC} has despawned. * An event where an {@link NPC} has despawned.
@@ -37,7 +37,7 @@ public class NpcDespawned
/** /**
* The despawned NPC. * The despawned NPC.
*/ */
NPC npc; private final NPC npc;
public Actor getActor() public Actor getActor()
{ {
@@ -24,9 +24,9 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import lombok.Value;
import net.runelite.api.Actor; import net.runelite.api.Actor;
import net.runelite.api.NPC; import net.runelite.api.NPC;
import lombok.Value;
/** /**
* An event where an {@link NPC} has spawned. * An event where an {@link NPC} has spawned.
@@ -37,7 +37,7 @@ public class NpcSpawned
/** /**
* The spawned NPC. * The spawned NPC.
*/ */
NPC npc; private final NPC npc;
public Actor getActor() public Actor getActor()
{ {
@@ -1,12 +1,39 @@
/*
* 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.events; package net.runelite.api.events;
import net.runelite.api.Actor;
import lombok.Value; import lombok.Value;
import net.runelite.api.Actor;
/**
* Event fired when an actors overhead text is changed.
*/
@Value @Value
public class OverheadTextChanged public class OverheadTextChanged
{ {
Actor actor; private final Actor actor;
String overheadText; private final String overheadText;
} }
@@ -24,9 +24,9 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import lombok.Value;
import net.runelite.api.Actor; import net.runelite.api.Actor;
import net.runelite.api.Player; import net.runelite.api.Player;
import lombok.Value;
/** /**
* An event where a {@link Player} has despawned. * An event where a {@link Player} has despawned.
@@ -39,7 +39,7 @@ public class PlayerDespawned
/** /**
* The despawned player. * The despawned player.
*/ */
Player player; private final Player player;
public Actor getActor() public Actor getActor()
{ {
@@ -24,9 +24,9 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import lombok.Value;
import net.runelite.api.Actor; import net.runelite.api.Actor;
import net.runelite.api.Player; import net.runelite.api.Player;
import lombok.Value;
/** /**
* An event where a {@link Player} has spawned. * An event where a {@link Player} has spawned.
@@ -37,7 +37,7 @@ public class PlayerSpawned
/** /**
* The spawned player. * The spawned player.
*/ */
Player player; private final Player player;
public Actor getActor() public Actor getActor()
{ {
@@ -24,8 +24,8 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import net.runelite.api.HealthBar;
import lombok.Data; import lombok.Data;
import net.runelite.api.HealthBar;
@Data @Data
public class PostHealthBar public class PostHealthBar
@@ -24,9 +24,9 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import lombok.Data;
import net.runelite.api.Projectile; import net.runelite.api.Projectile;
import net.runelite.api.coords.LocalPoint; import net.runelite.api.coords.LocalPoint;
import lombok.Data;
/** /**
* An event called whenever a {@link Projectile} has moved towards a point. * An event called whenever a {@link Projectile} has moved towards a point.
@@ -24,8 +24,8 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import net.runelite.api.Script;
import lombok.Data; import lombok.Data;
import net.runelite.api.Script;
/** /**
* A callback from a runelite_callback opcode in a cs2 * A callback from a runelite_callback opcode in a cs2
@@ -35,5 +35,5 @@ public class ScriptPostFired
/** /**
* The script id of the invoked script * The script id of the invoked script
*/ */
int scriptId; private final int scriptId;
} }
@@ -24,22 +24,22 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import lombok.Value; import lombok.Data;
import net.runelite.api.ScriptEvent; import net.runelite.api.ScriptEvent;
/** /**
* An event that is fired before the designated script is ran * An event that is fired before the designated script is ran
*/ */
@Value @Data
public class ScriptPreFired public class ScriptPreFired
{ {
/** /**
* The script id of the invoked script * The script id of the invoked script
*/ */
int scriptId; private final int scriptId;
/** /**
* The input of the script invoke, this will be null unless it is the root script * The input of the script invoke, this will be null unless it is the root script
*/ */
ScriptEvent scriptEvent; private ScriptEvent scriptEvent;
} }
@@ -33,10 +33,8 @@ public class SoundEffectPlayed
{ {
@Nullable @Nullable
private final Actor source; private final Actor source;
private int soundId; private int soundId;
private int delay; private int delay;
private int npcid;
private boolean consumed; private boolean consumed;
@@ -33,8 +33,8 @@ import net.runelite.api.Skill;
@Value @Value
public class StatChanged public class StatChanged
{ {
Skill skill; private final Skill skill;
int xp; private final int xp;
int level; private final int level;
int boostedLevel; private final int boostedLevel;
} }
@@ -28,11 +28,10 @@ package net.runelite.api.events;
import lombok.Value; import lombok.Value;
/** /**
* An event where a client int var has changed.
* @see net.runelite.api.VarClientInt * @see net.runelite.api.VarClientInt
*/ */
@Value @Value
public class VarClientIntChanged public class VarClientIntChanged
{ {
int index; private int index;
} }
@@ -28,11 +28,10 @@ package net.runelite.api.events;
import lombok.Value; import lombok.Value;
/** /**
* An event where a client var string has changed.
* @see net.runelite.api.VarClientStr * @see net.runelite.api.VarClientStr
*/ */
@Value @Value
public class VarClientStrChanged public class VarClientStrChanged
{ {
int index; private int index;
} }
@@ -37,5 +37,5 @@ public class VolumeChanged
AREA AREA
} }
Type type; private final Type type;
} }
@@ -24,9 +24,9 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import lombok.Data;
import net.runelite.api.Tile; import net.runelite.api.Tile;
import net.runelite.api.WallObject; import net.runelite.api.WallObject;
import lombok.Data;
/** /**
* An event where the {@link WallObject} of a {@link Tile} has been changed. * An event where the {@link WallObject} of a {@link Tile} has been changed.
@@ -24,9 +24,9 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import lombok.Data;
import net.runelite.api.Tile; import net.runelite.api.Tile;
import net.runelite.api.WallObject; import net.runelite.api.WallObject;
import lombok.Data;
/** /**
* An event where a {@link WallObject} on a {@link Tile} has been removed. * An event where a {@link WallObject} on a {@link Tile} has been removed.
@@ -24,9 +24,9 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import lombok.Data;
import net.runelite.api.Tile; import net.runelite.api.Tile;
import net.runelite.api.WallObject; import net.runelite.api.WallObject;
import lombok.Data;
/** /**
* An event where a {@link WallObject} is added to a {@link Tile}. * An event where a {@link WallObject} is added to a {@link Tile}.
@@ -24,8 +24,8 @@
*/ */
package net.runelite.api.events; package net.runelite.api.events;
import net.runelite.api.World;
import lombok.Value; import lombok.Value;
import net.runelite.api.World;
/** /**
* Event when the world list is loaded for the world switcher * Event when the world list is loaded for the world switcher
@@ -33,5 +33,5 @@ import lombok.Value;
@Value @Value
public class WorldListLoad public class WorldListLoad
{ {
World[] worlds; private final World[] worlds;
} }
@@ -28,7 +28,7 @@ package net.runelite.api.widgets;
/** /**
* Utility class mapping Widget ItemQuantityMode values * Utility class mapping Widget ItemQuantityMode values
*/ */
public class ItemQuantityMode public final class ItemQuantityMode
{ {
/** /**
* Never show item quantity number * Never show item quantity number
@@ -31,7 +31,7 @@ package net.runelite.api.widgets;
* *
* @see Widget#getClickMask() * @see Widget#getClickMask()
*/ */
public class WidgetConfig public final class WidgetConfig
{ {
/** /**
* Enables displaying a ninth option on a menu. * Enables displaying a ninth option on a menu.
@@ -34,7 +34,7 @@ package net.runelite.api.widgets;
* For a more direct group-child widget mapping, use the * For a more direct group-child widget mapping, use the
* {@link WidgetInfo} enum class. * {@link WidgetInfo} enum class.
*/ */
public class WidgetID public final class WidgetID
{ {
public static final int FAIRY_RING_PANEL_GROUP_ID = 381; public static final int FAIRY_RING_PANEL_GROUP_ID = 381;
public static final int FAIRY_RING_GROUP_ID = 398; public static final int FAIRY_RING_GROUP_ID = 398;
@@ -182,6 +182,8 @@ public class WidgetID
public static final int TEMPOROSS_GROUP_ID = 437; public static final int TEMPOROSS_GROUP_ID = 437;
public static final int CLAN_GROUP_ID = 701; public static final int CLAN_GROUP_ID = 701;
public static final int CLAN_GUEST_GROUP_ID = 702; public static final int CLAN_GUEST_GROUP_ID = 702;
public static final int GRAVESTONE_GROUP_ID = 672;
public static final int POH_TREASURE_CHEST_INVENTORY_GROUP_ID = 674;
static class WorldMap static class WorldMap
{ {
@@ -290,20 +292,18 @@ public class WidgetID
static final int ITEM_COUNT_TOP = 5; static final int ITEM_COUNT_TOP = 5;
static final int ITEM_COUNT_BAR = 6; static final int ITEM_COUNT_BAR = 6;
static final int ITEM_COUNT_BOTTOM = 7; static final int ITEM_COUNT_BOTTOM = 7;
static final int CONTENT_CONTAINER = 9; static final int CONTENT_CONTAINER = 10;
static final int TAB_CONTAINER = 10; static final int TAB_CONTAINER = 11;
static final int ITEM_CONTAINER = 12; static final int ITEM_CONTAINER = 13;
static final int SCROLLBAR = 13; static final int SCROLLBAR = 14;
static final int UNNOTED_BUTTON = 21; static final int SEARCH_BUTTON_BACKGROUND = 40;
static final int NOTED_BUTTON = 23; static final int DEPOSIT_INVENTORY = 42;
static final int SEARCH_BUTTON_BACKGROUND = 39; static final int DEPOSIT_EQUIPMENT = 44;
static final int DEPOSIT_INVENTORY = 41; static final int INCINERATOR = 46;
static final int DEPOSIT_EQUIPMENT = 43; static final int INCINERATOR_CONFIRM = 47;
static final int INCINERATOR = 45; static final int EQUIPMENT_CONTENT_CONTAINER = 69;
static final int INCINERATOR_CONFIRM = 46; static final int SETTINGS_BUTTON = 112;
static final int EQUIPMENT_CONTENT_CONTAINER = 68; static final int EQUIPMENT_BUTTON = 113;
static final int SETTINGS_BUTTON = 111;
static final int EQUIPMENT_BUTTON = 112;
} }
static class GrandExchange static class GrandExchange
@@ -578,9 +578,6 @@ public enum WidgetInfo
PEST_CONTROL_EXCHANGE_WINDOW(WidgetID.PEST_CONTROL_EXCHANGE_WINDOW_GROUP_ID, 0), PEST_CONTROL_EXCHANGE_WINDOW(WidgetID.PEST_CONTROL_EXCHANGE_WINDOW_GROUP_ID, 0),
PEST_CONTROL_EXCHANGE_WINDOW_POINTS(WidgetID.PEST_CONTROL_EXCHANGE_WINDOW_GROUP_ID, WidgetID.PestControlExchangeWindow.POINTS), PEST_CONTROL_EXCHANGE_WINDOW_POINTS(WidgetID.PEST_CONTROL_EXCHANGE_WINDOW_GROUP_ID, WidgetID.PestControlExchangeWindow.POINTS),
BANK_UNNOTED_BUTTON(WidgetID.BANK_GROUP_ID, WidgetID.Bank.UNNOTED_BUTTON),
BANK_NOTED_BUTTON(WidgetID.BANK_GROUP_ID, WidgetID.Bank.NOTED_BUTTON),
GRAND_EXCHANGE_HISTORY_BUTTON(WidgetID.GRAND_EXCHANGE_GROUP_ID, WidgetID.GrandExchange.HISTORY_BUTTON), GRAND_EXCHANGE_HISTORY_BUTTON(WidgetID.GRAND_EXCHANGE_GROUP_ID, WidgetID.GrandExchange.HISTORY_BUTTON),
GRAND_EXCHANGE_BACK_BUTTON(WidgetID.GRAND_EXCHANGE_GROUP_ID, WidgetID.GrandExchange.BACK_BUTTON), GRAND_EXCHANGE_BACK_BUTTON(WidgetID.GRAND_EXCHANGE_GROUP_ID, WidgetID.GrandExchange.BACK_BUTTON),
GRAND_EXCHANGE_OFFER1(WidgetID.GRAND_EXCHANGE_GROUP_ID, WidgetID.GrandExchange.OFFER1), GRAND_EXCHANGE_OFFER1(WidgetID.GRAND_EXCHANGE_GROUP_ID, WidgetID.GrandExchange.OFFER1),
@@ -928,6 +925,8 @@ public enum WidgetInfo
GAUNTLET_MAP(WidgetID.GAUNTLET_MAP_GROUP_ID, WidgetID.GauntletMap.CONTAINER), GAUNTLET_MAP(WidgetID.GAUNTLET_MAP_GROUP_ID, WidgetID.GauntletMap.CONTAINER),
SHOP_ITEMS_CONTAINER(WidgetID.SHOP_GROUP_ID, WidgetID.Shop.ITEMS_CONTAINER), SHOP_ITEMS_CONTAINER(WidgetID.SHOP_GROUP_ID, WidgetID.Shop.ITEMS_CONTAINER),
POH_TREASURE_CHEST_INVENTORY_CONTAINER(WidgetID.POH_TREASURE_CHEST_INVENTORY_GROUP_ID, 0),
; ;
private final int groupId; private final int groupId;
@@ -24,7 +24,7 @@
*/ */
package net.runelite.api.widgets; package net.runelite.api.widgets;
public class WidgetModalMode public final class WidgetModalMode
{ {
public static final int MODAL_NOCLICKTHROUGH = 0; public static final int MODAL_NOCLICKTHROUGH = 0;
public static final int NON_MODAL = 1; public static final int NON_MODAL = 1;
@@ -24,7 +24,7 @@
*/ */
package net.runelite.api.widgets; package net.runelite.api.widgets;
public class WidgetModelType public final class WidgetModelType
{ {
public static final int NULL = 0; public static final int NULL = 0;
public static final int MODEL = 1; public static final int MODEL = 1;
@@ -0,0 +1,62 @@
/*
* Copyright (c) 2021 Jordan Atwood <nightfirecat@protonmail.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.coords;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import org.junit.Test;
public class WorldPointTest
{
@Test
public void getGetMirrorPoint()
{
WorldPoint point, converted;
// Zalcano's entrance portal
point = new WorldPoint(3282, 6058, 0);
converted = WorldPoint.getMirrorPoint(point, true);
assertNotEquals(point, converted);
// Elven Crystal Chest, which is upstairs
point = new WorldPoint(3273, 6082, 2);
converted = WorldPoint.getMirrorPoint(point, true);
assertNotEquals(point, converted);
// Around the area of the Elite coordinate clue
point = new WorldPoint(2185, 3280, 0);
// To overworld
converted = WorldPoint.getMirrorPoint(point, true);
assertEquals(point, converted);
// To real
converted = WorldPoint.getMirrorPoint(point, false);
assertNotEquals(point, converted);
// Brugsen Bursen, Grand Exchange
point = new WorldPoint(3165, 3477, 0);
converted = WorldPoint.getMirrorPoint(point, false);
assertEquals(point, converted);
}
}
+15 -14
View File
@@ -44,7 +44,7 @@ description = "RuneLite Client"
dependencies { dependencies {
annotationProcessor(group = "org.projectlombok", name = "lombok", version = ProjectVersions.lombokVersion) annotationProcessor(group = "org.projectlombok", name = "lombok", version = ProjectVersions.lombokVersion)
annotationProcessor(group = "org.pf4j", name = "pf4j", version = "3.5.0") annotationProcessor(group = "org.pf4j", name = "pf4j", version = "3.6.0")
api(project(":runelite-api")) api(project(":runelite-api"))
@@ -56,23 +56,24 @@ dependencies {
implementation(project(":runelite-jshell")) implementation(project(":runelite-jshell"))
implementation(group = "ch.qos.logback", name = "logback-classic", version = "1.2.3") implementation(group = "ch.qos.logback", name = "logback-classic", version = "1.2.3")
implementation(group = "com.google.code.gson", name = "gson", version = "2.8.5") implementation(group = "com.google.code.gson", name = "gson", version = "2.8.5")
implementation(group = "com.google.guava", name = "guava", version = "23.2-jre") implementation(group = "com.google.guava", name = "guava", version = "30.1.1-jre")
implementation(group = "com.google.inject", name = "guice", version = "4.1.0", classifier = "no_aop") implementation(group = "com.google.inject", name = "guice", version = "5.0.1")
implementation(group = "com.h2database", name = "h2", version = "1.4.200") implementation(group = "com.h2database", name = "h2", version = "1.4.200")
implementation(group = "com.jakewharton.rxrelay3", name = "rxrelay", version = "3.0.0") implementation(group = "com.jakewharton.rxrelay3", name = "rxrelay", version = "3.0.1")
implementation(group = "com.squareup.okhttp3", name = "okhttp", version = "3.7.0") implementation(group = "com.squareup.okhttp3", name = "okhttp", version = "4.9.1")
implementation(group = "io.reactivex.rxjava3", name = "rxjava", version = "3.0.10") implementation(group = "io.reactivex.rxjava3", name = "rxjava", version = "3.1.1")
implementation(group = "org.jgroups", name = "jgroups", version = "5.1.9.Final")
implementation(group = "net.java.dev.jna", name = "jna", version = "5.9.0") implementation(group = "net.java.dev.jna", name = "jna", version = "5.9.0")
implementation(group = "org.jgroups", name = "jgroups", version = "5.0.4.Final")
implementation(group = "net.java.dev.jna", name = "jna-platform", version = "5.9.0") implementation(group = "net.java.dev.jna", name = "jna-platform", version = "5.9.0")
implementation(group = "net.runelite", name = "discord", version = "1.4") implementation(group = "net.runelite", name = "discord", version = "1.4")
implementation(group = "net.runelite.pushingpixels", name = "substance", version = "8.0.02") implementation(group = "org.pushing-pixels", name = "radiance-substance", version = "4.0.0")
implementation(group = "net.sf.jopt-simple", name = "jopt-simple", version = "5.0.1") implementation(group = "net.sf.jopt-simple", name = "jopt-simple", version = "5.0.4")
implementation(group = "org.apache.commons", name = "commons-text", version = "1.2") implementation(group = "org.madlonkay", name = "desktopsupport", version = "0.6.0")
implementation(group = "org.apache.commons", name = "commons-text", version = "1.9")
implementation(group = "commons-io", name = "commons-io", version = "2.8.0") implementation(group = "commons-io", name = "commons-io", version = "2.8.0")
implementation(group = "org.jetbrains", name = "annotations", version = "20.1.0") implementation(group = "org.jetbrains", name = "annotations", version = "22.0.0")
implementation(group = "com.github.zafarkhaja", name = "java-semver", version = "0.9.0") implementation(group = "com.github.zafarkhaja", name = "java-semver", version = "0.9.0")
implementation(group = "org.slf4j", name = "slf4j-api", version = "1.7.12") implementation(group = "org.slf4j", name = "slf4j-api", version = "1.7.32")
implementation(group = "org.pf4j", name = "pf4j", version = "3.6.0") { implementation(group = "org.pf4j", name = "pf4j", version = "3.6.0") {
exclude(group = "org.slf4j") exclude(group = "org.slf4j")
} }
@@ -105,8 +106,8 @@ dependencies {
testImplementation(group = "junit", name = "junit", version = "4.12") testImplementation(group = "junit", name = "junit", version = "4.12")
testImplementation(group = "org.mockito", name = "mockito-core", version = "3.1.0") testImplementation(group = "org.mockito", name = "mockito-core", version = "3.1.0")
testImplementation(group = "org.mockito", name = "mockito-inline", version = "3.1.0") testImplementation(group = "org.mockito", name = "mockito-inline", version = "3.1.0")
testImplementation(group = "com.squareup.okhttp3", name = "mockwebserver", version = "3.7.0") testImplementation(group = "com.squareup.okhttp3", name = "mockwebserver", version = "4.9.1")
testImplementation(group = "org.slf4j", name = "slf4j-api", version = "1.7.12") testImplementation(group = "org.slf4j", name = "slf4j-api", version = "1.7.32")
} }
fun formatDate(date: Date?) = with(date ?: Date()) { fun formatDate(date: Date?) = with(date ?: Date()) {
@@ -354,7 +354,7 @@ public class RuneLite
oprsExternalPluginManager.setOutdated(isOutdated); oprsExternalPluginManager.setOutdated(isOutdated);
// Update external plugins // Update external plugins
oprsExternalPluginManager.update(); //TODO: Re-enable after fixing actions for new repo oprsExternalPluginManager.update();
// Load the plugins, but does not start them yet. // Load the plugins, but does not start them yet.
// This will initialize configuration // This will initialize configuration
@@ -435,11 +435,15 @@ public class ChatMessageManager
{ {
cacheColor(new ChatColor(ChatColorType.NORMAL, chatColorConfig.opaqueServerMessage(), false), cacheColor(new ChatColor(ChatColorType.NORMAL, chatColorConfig.opaqueServerMessage(), false),
ChatMessageType.GAMEMESSAGE); ChatMessageType.GAMEMESSAGE);
cacheColor(new ChatColor(ChatColorType.NORMAL, chatColorConfig.opaqueServerMessage(), false),
ChatMessageType.ENGINE);
} }
if (chatColorConfig.opaqueServerMessageHighlight() != null) if (chatColorConfig.opaqueServerMessageHighlight() != null)
{ {
cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, chatColorConfig.opaqueServerMessageHighlight(), false), cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, chatColorConfig.opaqueServerMessageHighlight(), false),
ChatMessageType.GAMEMESSAGE); ChatMessageType.GAMEMESSAGE);
cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, chatColorConfig.opaqueServerMessageHighlight(), false),
ChatMessageType.ENGINE);
} }
if (chatColorConfig.opaqueGameMessage() != null) if (chatColorConfig.opaqueGameMessage() != null)
{ {
@@ -613,11 +617,15 @@ public class ChatMessageManager
{ {
cacheColor(new ChatColor(ChatColorType.NORMAL, chatColorConfig.transparentServerMessage(), true), cacheColor(new ChatColor(ChatColorType.NORMAL, chatColorConfig.transparentServerMessage(), true),
ChatMessageType.GAMEMESSAGE); ChatMessageType.GAMEMESSAGE);
cacheColor(new ChatColor(ChatColorType.NORMAL, chatColorConfig.transparentServerMessage(), true),
ChatMessageType.ENGINE);
} }
if (chatColorConfig.transparentServerMessageHighlight() != null) if (chatColorConfig.transparentServerMessageHighlight() != null)
{ {
cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, chatColorConfig.transparentServerMessageHighlight(), true), cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, chatColorConfig.transparentServerMessageHighlight(), true),
ChatMessageType.GAMEMESSAGE); ChatMessageType.GAMEMESSAGE);
cacheColor(new ChatColor(ChatColorType.HIGHLIGHT, chatColorConfig.transparentServerMessageHighlight(), true),
ChatMessageType.ENGINE);
} }
if (chatColorConfig.transparentGameMessage() != null) if (chatColorConfig.transparentGameMessage() != null)
{ {
@@ -38,7 +38,8 @@ public enum RuneScapeProfileType
BETA(client -> client.getWorldType().contains(WorldType.NOSAVE_MODE)), BETA(client -> client.getWorldType().contains(WorldType.NOSAVE_MODE)),
DEADMAN(client -> client.getWorldType().contains(WorldType.DEADMAN)), DEADMAN(client -> client.getWorldType().contains(WorldType.DEADMAN)),
TRAILBLAZER_LEAGUE, TRAILBLAZER_LEAGUE,
DEADMAN_REBORN(client -> client.getWorldType().contains(WorldType.SEASONAL)) DEADMAN_REBORN,
SHATTERED_RELICS_LEAGUE(client -> client.getWorldType().contains(WorldType.SEASONAL)),
; ;
private final Predicate<Client> test; private final Predicate<Client> test;
@@ -100,7 +100,7 @@ public enum AgilityShortcut
COAL_TRUCKS_LOG_BALANCE(20, "Log Balance", new WorldPoint(2598, 3475, 0), LOG_BALANCE_23274), COAL_TRUCKS_LOG_BALANCE(20, "Log Balance", new WorldPoint(2598, 3475, 0), LOG_BALANCE_23274),
GRAND_EXCHANGE_UNDERWALL_TUNNEL(21, "Underwall Tunnel", new WorldPoint(3139, 3515, 0), UNDERWALL_TUNNEL_16529, UNDERWALL_TUNNEL_16530), GRAND_EXCHANGE_UNDERWALL_TUNNEL(21, "Underwall Tunnel", new WorldPoint(3139, 3515, 0), UNDERWALL_TUNNEL_16529, UNDERWALL_TUNNEL_16530),
BRIMHAVEN_DUNGEON_PIPE(22, "Pipe Squeeze", new WorldPoint(2654, 9569, 0), PIPE_21728), BRIMHAVEN_DUNGEON_PIPE(22, "Pipe Squeeze", new WorldPoint(2654, 9569, 0), PIPE_21728),
OBSERVATORY_SCALE_CLIFF(23, "Grapple Rocks", new WorldPoint(2447, 3155, 0), NULL_31849), OBSERVATORY_SCALE_CLIFF(23, "Grapple Rocks", new WorldPoint(2447, 3155, 0), NULL_31849, NULL_31852),
EAGLES_PEAK_ROCK_CLIMB(25, "Rock Climb", new WorldPoint(2320, 3499, 0), ROCKS_19849), EAGLES_PEAK_ROCK_CLIMB(25, "Rock Climb", new WorldPoint(2320, 3499, 0), ROCKS_19849),
FALADOR_UNDERWALL_TUNNEL(26, "Underwall Tunnel", new WorldPoint(2947, 3313, 0), UNDERWALL_TUNNEL, UNDERWALL_TUNNEL_16528), FALADOR_UNDERWALL_TUNNEL(26, "Underwall Tunnel", new WorldPoint(2947, 3313, 0), UNDERWALL_TUNNEL, UNDERWALL_TUNNEL_16528),
KOUREND_CATACOMBS_PILLAR_JUMP_NORTH(28, "Pillar Jump", new WorldPoint(1613, 10071, 0)), KOUREND_CATACOMBS_PILLAR_JUMP_NORTH(28, "Pillar Jump", new WorldPoint(1613, 10071, 0)),
@@ -53,12 +53,8 @@ import net.runelite.api.GameState;
import net.runelite.api.ItemComposition; import net.runelite.api.ItemComposition;
import static net.runelite.api.ItemID.*; import static net.runelite.api.ItemID.*;
import net.runelite.api.SpritePixels; import net.runelite.api.SpritePixels;
import net.runelite.api.events.GameStateChanged;
import net.runelite.api.events.PostItemComposition;
import net.runelite.client.callback.ClientThread; import net.runelite.client.callback.ClientThread;
import net.runelite.client.config.RuneLiteConfig; import net.runelite.client.config.RuneLiteConfig;
import net.runelite.client.eventbus.EventBus;
import net.runelite.client.eventbus.Subscribe;
import net.runelite.client.util.AsyncBufferedImage; import net.runelite.client.util.AsyncBufferedImage;
import net.runelite.http.api.item.ItemClient; import net.runelite.http.api.item.ItemClient;
import net.runelite.http.api.item.ItemPrice; import net.runelite.http.api.item.ItemPrice;
@@ -93,7 +89,6 @@ public class ItemManager
private Map<Integer, ItemPrice> itemPrices = Collections.emptyMap(); private Map<Integer, ItemPrice> itemPrices = Collections.emptyMap();
private Map<Integer, ItemStats> itemStats = Collections.emptyMap(); private Map<Integer, ItemStats> itemStats = Collections.emptyMap();
private final LoadingCache<ImageKey, AsyncBufferedImage> itemImages; private final LoadingCache<ImageKey, AsyncBufferedImage> itemImages;
private final LoadingCache<Integer, ItemComposition> itemCompositions;
private final LoadingCache<OutlineKey, BufferedImage> itemOutlines; private final LoadingCache<OutlineKey, BufferedImage> itemOutlines;
// Worn items with weight reducing property have a different worn and inventory ItemID // Worn items with weight reducing property have a different worn and inventory ItemID
@@ -173,7 +168,7 @@ public class ItemManager
@Inject @Inject
public ItemManager(Client client, ScheduledExecutorService scheduledExecutorService, ClientThread clientThread, public ItemManager(Client client, ScheduledExecutorService scheduledExecutorService, ClientThread clientThread,
OkHttpClient okHttpClient, EventBus eventBus, RuneLiteConfig runeLiteConfig) OkHttpClient okHttpClient, RuneLiteConfig runeLiteConfig)
{ {
this.client = client; this.client = client;
this.clientThread = clientThread; this.clientThread = clientThread;
@@ -195,18 +190,6 @@ public class ItemManager
} }
}); });
itemCompositions = CacheBuilder.newBuilder()
.maximumSize(1024L)
.expireAfterAccess(1, TimeUnit.HOURS)
.build(new CacheLoader<Integer, ItemComposition>()
{
@Override
public ItemComposition load(Integer key) throws Exception
{
return client.getItemComposition(key);
}
});
itemOutlines = CacheBuilder.newBuilder() itemOutlines = CacheBuilder.newBuilder()
.maximumSize(128L) .maximumSize(128L)
.expireAfterAccess(1, TimeUnit.HOURS) .expireAfterAccess(1, TimeUnit.HOURS)
@@ -218,8 +201,6 @@ public class ItemManager
return loadItemOutline(key.itemId, key.itemQuantity, key.outlineColor); return loadItemOutline(key.itemId, key.itemQuantity, key.outlineColor);
} }
}); });
eventBus.register(this);
} }
private void loadPrices() private void loadPrices()
@@ -263,31 +244,6 @@ public class ItemManager
} }
} }
@Subscribe
public void onGameStateChanged(final GameStateChanged event)
{
if (event.getGameState() == GameState.HOPPING || event.getGameState() == GameState.LOGIN_SCREEN)
{
itemCompositions.invalidateAll();
}
}
@Subscribe
public void onPostItemComposition(PostItemComposition event)
{
itemCompositions.put(event.getItemComposition().getId(), event.getItemComposition());
}
/**
* Invalidates internal item manager item composition cache (but not client item composition cache)
* @see Client#getItemCompositionCache()
*/
public void invalidateItemCompositionCache()
{
itemCompositions.invalidateAll();
}
/** /**
* Look up an item's price * Look up an item's price
* *
@@ -432,8 +388,7 @@ public class ItemManager
@Nonnull @Nonnull
public ItemComposition getItemComposition(int itemId) public ItemComposition getItemComposition(int itemId)
{ {
assert client.isClientThread() : "getItemComposition must be called on client thread"; return client.getItemDefinition(itemId);
return itemCompositions.getUnchecked(itemId);
} }
/** /**
@@ -0,0 +1,24 @@
package net.runelite.client.plugins;
import java.nio.file.Path;
import lombok.extern.slf4j.Slf4j;
import org.pf4j.BasePluginLoader;
import org.pf4j.PluginClassLoader;
import org.pf4j.PluginClasspath;
import org.pf4j.PluginDescriptor;
import org.pf4j.PluginManager;
@Slf4j
class OPRSExternalBasePluginLoader extends BasePluginLoader
{
OPRSExternalBasePluginLoader(PluginManager pluginManager, PluginClasspath pluginClasspath)
{
super(pluginManager, pluginClasspath);
}
@Override
protected PluginClassLoader createPluginClassLoader(Path pluginPath, PluginDescriptor pluginDescriptor)
{
return new OPRSExternalClassLoader(pluginManager, pluginDescriptor, getClass().getClassLoader());
}
}
@@ -0,0 +1,142 @@
package net.runelite.client.plugins;
import java.lang.invoke.MethodHandles;
import java.util.List;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import net.runelite.client.util.ReflectUtil;
import org.pf4j.ClassLoadingStrategy;
import org.pf4j.PluginClassLoader;
import org.pf4j.PluginDependency;
import org.pf4j.PluginDescriptor;
import org.pf4j.PluginManager;
@Slf4j
class OPRSExternalClassLoader extends PluginClassLoader implements ReflectUtil.PrivateLookupableClassLoader
{
private static final String JAVA_PACKAGE_PREFIX = "java.";
private static final String PLUGIN_PACKAGE_PREFIX = "org.pf4j.";
@Getter
@Setter
private MethodHandles.Lookup lookup;
private final PluginManager pluginManager;
private final PluginDescriptor pluginDescriptor;
private final ClassLoadingStrategy classLoadingStrategy;
OPRSExternalClassLoader(PluginManager pluginManager, PluginDescriptor pluginDescriptor, ClassLoader parent)
{
super(pluginManager, pluginDescriptor, parent);
this.pluginManager = pluginManager;
this.pluginDescriptor = pluginDescriptor;
this.classLoadingStrategy = ClassLoadingStrategy.PDA;
ReflectUtil.installLookupHelper(this);
}
@Override
public Class<?> defineClass0(String name, byte[] b, int off, int len) throws ClassFormatError
{
return super.defineClass(name, b, off, len);
}
@Override
protected Class<?> loadClassFromDependencies(String className)
{
log.trace("Search in dependencies for class '{}'", className);
List<org.pf4j.PluginDependency> dependencies = pluginDescriptor.getDependencies();
for (PluginDependency dependency : dependencies)
{
ClassLoader classLoader = pluginManager.getPluginClassLoader(dependency.getPluginId());
// If the dependency is marked as optional, its class loader might not be available.
if (classLoader == null && dependency.isOptional())
{
continue;
}
try
{
if (classLoader != null)
{
return classLoader.loadClass(className);
}
}
catch (ClassNotFoundException e)
{
// try next dependency
}
}
return null;
}
@Override
public Class<?> loadClass(String className) throws ClassNotFoundException
{
synchronized (getClassLoadingLock(className))
{
// first check whether it's a system class, delegate to the system loader
if (className.startsWith(JAVA_PACKAGE_PREFIX))
{
return findSystemClass(className);
}
// if the class is part of the plugin engine use parent class loader
if (className.startsWith(PLUGIN_PACKAGE_PREFIX) && !className.startsWith("org.pf4j.demo"))
{
// log.trace("Delegate the loading of PF4J class '{}' to parent", className);
return getParent().loadClass(className);
}
log.trace("Received request to load class '{}'", className);
// second check whether it's already been loaded
Class<?> loadedClass = findLoadedClass(className);
if (loadedClass != null)
{
log.trace("Found loaded class '{}'", className);
return loadedClass;
}
for (ClassLoadingStrategy.Source classLoadingSource : this.classLoadingStrategy.getSources())
{
Class<?> c = null;
try
{
switch (classLoadingSource)
{
case APPLICATION:
c = super.loadClass(className);
break;
case PLUGIN:
c = findClass(className);
break;
case DEPENDENCIES:
c = loadClassFromDependencies(className);
break;
}
}
catch (ClassNotFoundException ignored)
{
}
if (c != null)
{
log.trace("Found class '{}' in {} classpath", className, classLoadingSource);
return c;
}
else
{
log.trace("Couldn't find class '{}' in {} classpath", className, classLoadingSource);
}
}
throw new ClassNotFoundException(className);
}
}
}

Some files were not shown because too many files have changed in this diff Show More