diff --git a/.gitattributes b/.gitattributes
deleted file mode 100644
index dfe0770424..0000000000
--- a/.gitattributes
+++ /dev/null
@@ -1,2 +0,0 @@
-# Auto detect text files and perform LF normalization
-* text=auto
diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
new file mode 100644
index 0000000000..fe0d820eca
--- /dev/null
+++ b/.github/CONTRIBUTING.md
@@ -0,0 +1,134 @@
+# Contributing to runelite
+
+We'd love for you to contribute to our source code and to make runelite even better than it is
+today!
+
+Check out the Developer's Guide on the [wiki](https://github.com/runelite/runelite/wiki) for setup instructions, and general tips and tricks.
+
+Here are the guidelines we'd like you to follow:
+
+ - [Question or Problem?](#question)
+ - [Issues and Bugs](#issue)
+ - [Submission Guidelines](#submit)
+ - [Coding Format](#format)
+
+## Got a Question or Problem?
+
+If you have questions about how to contribute to runelite, please join our [Discord](https://discord.gg/HN5gf3m) server.
+
+## Found an Issue?
+
+If you find a bug in the source code or a mistake in the documentation, you can help us by
+submitting an issue to our [GitHub Repository][github]. Even better you can submit a Pull Request
+with a fix.
+
+**Please see the [Submission Guidelines](#submit) below.**
+
+## Submission Guidelines
+
+### Submitting an Issue
+Before you submit your issue search the archive, maybe your question was already answered.
+
+If your issue appears to be a bug and hasn't been reported, open a new issue. Help us to maximize
+the effort we can spend fixing issues and adding new features, by not reporting duplicate issues.
+Providing the following information will increase the chances of your issue being dealt with
+quickly:
+
+* **Overview of the Issue** - if an error is being thrown a non-minified stack trace helps
+* **Java Version and Operating System** - is this a problem with a specific setup?
+* **Reproduce the Error** - provide details, if possible, on how to reproduce the error
+* **Related Issues** - has a similar issue been reported before?
+* **Suggest a Fix** - if you can't fix the bug yourself, perhaps you can point to what might be causing the problem (line of code or commit)
+
+### Submitting a Pull Request
+Before you submit your pull request consider the following guidelines:
+
+* Search [GitHub](https://github.com/runelite-extended/runelite/pulls) for an open or closed Pull Request
+ that relates to your submission. You don't want to duplicate effort.
+* [Fork](https://help.github.com/articles/fork-a-repo/) this repo.
+* [Clone](https://help.github.com/articles/cloning-a-repository/) your copy.
+ ```shell
+ git clone https://github.com/YOUR_USERNAME/runelite.git
+ cd runelite/
+ ```
+* After cloning, set a new remote [upstream](https://help.github.com/articles/configuring-a-remote-for-a-fork/) (this helps to keep your fork up to date)
+
+ ```shell
+ git remote add upstream https://github.com/runelite-extended/runelite.git
+ ```
+
+* Make your changes in a new git branch:
+
+ ```shell
+ git checkout -b my-fix-branch master
+ ```
+
+* Create your patch and run appropriate tests.
+* Follow our [Coding Format](#format).
+* Commit your changes using a descriptive commit message that uses the imperative, present tense: "change" not "changed" nor "changes".
+
+ ```shell
+ git commit -a
+ ```
+ Note: the optional commit `-a` command line option will automatically "add" and "rm" edited files.
+
+* Push your branch to GitHub:
+
+ ```shell
+ git push origin my-fix-branch
+ ```
+
+In GitHub, send a pull request to `runelite:master`.
+If we suggest changes, then:
+
+* Make the required updates.
+* Re-run runelite and make sure any and all tests are still passing.
+* Commit your changes to your branch (e.g. `my-fix-branch`).
+* Push the changes to your GitHub repository (this will update your Pull Request).
+
+If the PR gets too outdated we may ask you to rebase and force push to update the PR:
+
+```shell
+git fetch upstream
+git rebase upstream/master
+git push origin my-fix-branch -f
+```
+
+That's it! Thank you for your contribution!
+
+#### After your pull request is merged
+
+After your pull request is merged, you can safely delete your branch and pull the changes
+from the main (upstream) repository:
+
+* Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:
+
+ ```shell
+ git push origin --delete my-fix-branch
+ ```
+
+* Check out the master branch:
+
+ ```shell
+ git checkout master -f
+ ```
+
+* Delete the local branch:
+
+ ```shell
+ git branch -D my-fix-branch
+ ```
+
+* Update your master with the latest upstream version:
+
+ ```shell
+ git pull --ff upstream master
+ ```
+
+## Coding Format
+
+To ensure consistency throughout the source code, review our [code conventions](https://github.com/runelite/runelite/wiki/Code-Conventions).
+
+
+[github]: https://github.com/runelite-extended/runelite
+[discord]: https://discord.gg/HN5gf3m
diff --git a/.github/ISSUE_TEMPLATE/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md
new file mode 100644
index 0000000000..219706327f
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/Bug_report.md
@@ -0,0 +1,32 @@
+---
+name: "\U0001F41B Bug report"
+about: Create a report to help us improve
+
+---
+
+Please check if your issue is not a duplicate by [searching existing issues](https://github.com/runelite/runelite/search?type=Issues)
+
+**Describe the bug**
+A clear and concise description of what the bug is.
+
+**To Reproduce**
+Steps to reproduce the behavior:
+1. Go to '...'
+2. Click on '....'
+3. Scroll down to '....'
+4. See error
+
+**Expected behavior**
+A clear and concise description of what you expected to happen.
+
+**Screenshots**
+If applicable, add screenshots to help explain your problem.
+
+**Environment (please complete the following information):**
+ - OS: [e.g. Windows, Ubuntu, macOS]
+ - RuneLite version: [e.g 1.4.6]
+ - Launcher version: [e.g 1.5.2]
+
+**Additional context**
+Add any other context about the problem here, e.g. logs. Your client logs can usually be found in
+`C:\Users\\.runelite\logs` on Windows and `~/.runelite/logs` on Linux and macOS.
diff --git a/.github/ISSUE_TEMPLATE/Feature_request.md b/.github/ISSUE_TEMPLATE/Feature_request.md
new file mode 100644
index 0000000000..57cf66a8dd
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/Feature_request.md
@@ -0,0 +1,19 @@
+---
+name: "\U0001F680 Feature Request"
+about: Suggest an idea for this project
+
+---
+
+**Is your feature request related to a problem? Please describe.**
+A clear and concise description of what the problem is. Ex. I'm always
+frustrated when [...]
+
+**Describe the solution you'd like**
+A clear and concise description of what you want to happen.
+
+**Describe alternatives you've considered**
+A clear and concise description of any alternative solutions or features you've
+considered.
+
+**Additional context**
+Add any other context or screenshots about the feature request here.
diff --git a/.gitignore b/.gitignore
index 9b27729015..51854a9d2e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,15 @@
-*.jar
+target
+nbactions.xml
+nb-configuration.xml
+/nbproject/
+project.properties
*.iml
-
.idea/
-dependency-reduced-pom.xml
-**/target/*
\ No newline at end of file
+.project
+.settings/
+.classpath
+runelite-client/src/main/resources/META-INF/MANIFEST.MF
+git
+classes/artifacts/client_jar/run.bat
+classes/artifacts/client_jar/client.jar
+*.jar
diff --git a/.mvn/jvm.config b/.mvn/jvm.config
new file mode 100644
index 0000000000..67bd169f31
--- /dev/null
+++ b/.mvn/jvm.config
@@ -0,0 +1 @@
+-Xmx512m
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000000..ada8108a37
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,11 @@
+language: java
+sudo: false
+dist: xenial
+cache:
+ directories:
+ - $HOME/.m2
+jdk:
+- openjdk8
+- openjdk11
+install: true
+script: ./travis/build.sh
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
index 8410c20079..9426de9b87 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,661 +1,25 @@
-GNU AFFERO GENERAL PUBLIC LICENSE
- Version 3, 19 November 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc.
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The GNU Affero General Public License is a free, copyleft license for
-software and other kinds of works, specifically designed to ensure
-cooperation with the community in the case of network server software.
-
- The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works. By contrast,
-our General Public Licenses are intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
- Developers that use our General Public Licenses protect your rights
-with two steps: (1) assert copyright on the software, and (2) offer
-you this License which gives you legal permission to copy, distribute
-and/or modify the software.
-
- A secondary benefit of defending all users' freedom is that
-improvements made in alternate versions of the program, if they
-receive widespread use, become available for other developers to
-incorporate. Many developers of free software are heartened and
-encouraged by the resulting cooperation. However, in the case of
-software used on network servers, this result may fail to come about.
-The GNU General Public License permits making a modified version and
-letting the public access it on a server without ever releasing its
-source code to the public.
-
- The GNU Affero General Public License is designed specifically to
-ensure that, in such cases, the modified source code becomes available
-to the community. It requires the operator of a network server to
-provide the source code of the modified version running there to the
-users of that server. Therefore, public use of a modified version, on
-a publicly accessible server, gives the public access to the source
-code of the modified version.
-
- An older license, called the Affero General Public License and
-published by Affero, was designed to accomplish similar goals. This is
-a different license, not a version of the Affero GPL, but Affero has
-released a new version of the Affero GPL which permits relicensing under
-this license.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- TERMS AND CONDITIONS
-
- 0. Definitions.
-
- "This License" refers to version 3 of the GNU Affero General Public License.
-
- "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
- "The Program" refers to any copyrightable work licensed under this
-License. Each licensee is addressed as "you". "Licensees" and
-"recipients" may be individuals or organizations.
-
- To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy. The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
- A "covered work" means either the unmodified Program or a work based
-on the Program.
-
- To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy. Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
- To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies. Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
- An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License. If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
- 1. Source Code.
-
- The "source code" for a work means the preferred form of the work
-for making modifications to it. "Object code" means any non-source
-form of a work.
-
- A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
- The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
- The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities. However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work. For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
- The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
- The Corresponding Source for a work in source code form is that
-same work.
-
- 2. Basic Permissions.
-
- All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
- You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force. You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright. Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
- Conveying under any other circumstances is permitted solely under
-the conditions stated below. Sublicensing is not allowed; section 10
-makes it unnecessary.
-
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
- No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
- When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
- 4. Conveying Verbatim Copies.
-
- You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
- You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
- 5. Conveying Modified Source Versions.
-
- You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
- a) The work must carry prominent notices stating that you modified
- it, and giving a relevant date.
-
- b) The work must carry prominent notices stating that it is
- released under this License and any conditions added under section
- 7. This requirement modifies the requirement in section 4 to
- "keep intact all notices".
-
- c) You must license the entire work, as a whole, under this
- License to anyone who comes into possession of a copy. This
- License will therefore apply, along with any applicable section 7
- additional terms, to the whole of the work, and all its parts,
- regardless of how they are packaged. This License gives no
- permission to license the work in any other way, but it does not
- invalidate such permission if you have separately received it.
-
- d) If the work has interactive user interfaces, each must display
- Appropriate Legal Notices; however, if the Program has interactive
- interfaces that do not display Appropriate Legal Notices, your
- work need not make them do so.
-
- A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit. Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
- 6. Conveying Non-Source Forms.
-
- You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
- a) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by the
- Corresponding Source fixed on a durable physical medium
- customarily used for software interchange.
-
- b) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by a
- written offer, valid for at least three years and valid for as
- long as you offer spare parts or customer support for that product
- model, to give anyone who possesses the object code either (1) a
- copy of the Corresponding Source for all the software in the
- product that is covered by this License, on a durable physical
- medium customarily used for software interchange, for a price no
- more than your reasonable cost of physically performing this
- conveying of source, or (2) access to copy the
- Corresponding Source from a network server at no charge.
-
- c) Convey individual copies of the object code with a copy of the
- written offer to provide the Corresponding Source. This
- alternative is allowed only occasionally and noncommercially, and
- only if you received the object code with such an offer, in accord
- with subsection 6b.
-
- d) Convey the object code by offering access from a designated
- place (gratis or for a charge), and offer equivalent access to the
- Corresponding Source in the same way through the same place at no
- further charge. You need not require recipients to copy the
- Corresponding Source along with the object code. If the place to
- copy the object code is a network server, the Corresponding Source
- may be on a different server (operated by you or a third party)
- that supports equivalent copying facilities, provided you maintain
- clear directions next to the object code saying where to find the
- Corresponding Source. Regardless of what server hosts the
- Corresponding Source, you remain obligated to ensure that it is
- available for as long as needed to satisfy these requirements.
-
- e) Convey the object code using peer-to-peer transmission, provided
- you inform other peers where the object code and Corresponding
- Source of the work are being offered to the general public at no
- charge under subsection 6d.
-
- A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
- A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling. In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage. For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product. A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
- "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source. The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
- If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information. But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
- The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed. Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
- Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
- 7. Additional Terms.
-
- "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law. If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
- When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it. (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.) You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
- Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
- a) Disclaiming warranty or limiting liability differently from the
- terms of sections 15 and 16 of this License; or
-
- b) Requiring preservation of specified reasonable legal notices or
- author attributions in that material or in the Appropriate Legal
- Notices displayed by works containing it; or
-
- c) Prohibiting misrepresentation of the origin of that material, or
- requiring that modified versions of such material be marked in
- reasonable ways as different from the original version; or
-
- d) Limiting the use for publicity purposes of names of licensors or
- authors of the material; or
-
- e) Declining to grant rights under trademark law for use of some
- trade names, trademarks, or service marks; or
-
- f) Requiring indemnification of licensors and authors of that
- material by anyone who conveys the material (or modified versions of
- it) with contractual assumptions of liability to the recipient, for
- any liability that these contractual assumptions directly impose on
- those licensors and authors.
-
- All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10. If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term. If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
- If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
- Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
- 8. Termination.
-
- You may not propagate or modify a covered work except as expressly
-provided under this License. Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
- However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
- Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
- Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
- 9. Acceptance Not Required for Having Copies.
-
- You are not required to accept this License in order to receive or
-run a copy of the Program. Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance. However,
-nothing other than this License grants you permission to propagate or
-modify any covered work. These actions infringe copyright if you do
-not accept this License. Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
- 10. Automatic Licensing of Downstream Recipients.
-
- Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License. You are not responsible
-for enforcing compliance by third parties with this License.
-
- An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations. If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
- You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License. For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
- 11. Patents.
-
- A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based. The
-work thus licensed is called the contributor's "contributor version".
-
- A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version. For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
- Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
- In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement). To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
- If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients. "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
- If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
- A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License. You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
- Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
- 12. No Surrender of Others' Freedom.
-
- If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all. For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
- 13. Remote Network Interaction; Use with the GNU General Public License.
-
- Notwithstanding any other provision of this License, if you modify the
-Program, your modified version must prominently offer all users
-interacting with it remotely through a computer network (if your version
-supports such interaction) an opportunity to receive the Corresponding
-Source of your version by providing access to the Corresponding Source
-from a network server at no charge, through some standard or customary
-means of facilitating copying of software. This Corresponding Source
-shall include the Corresponding Source for any work covered by version 3
-of the GNU General Public License that is incorporated pursuant to the
-following paragraph.
-
- Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU General Public License into a single
-combined work, and to convey the resulting work. The terms of this
-License will continue to apply to the part which is the covered work,
-but the work with which it is combined will remain governed by version
-3 of the GNU General Public License.
-
- 14. Revised Versions of this License.
-
- The Free Software Foundation may publish revised and/or new versions of
-the GNU Affero General Public License from time to time. Such new versions
-will be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Program specifies that a certain numbered version of the GNU Affero General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation. If the Program does not specify a version number of the
-GNU Affero General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
- If the Program specifies that a proxy can decide which future
-versions of the GNU Affero General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
- Later license versions may give you additional or different
-permissions. However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
- 15. Disclaimer of Warranty.
-
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. Limitation of Liability.
-
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
- 17. Interpretation of Sections 15 and 16.
-
- If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published
- by the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see .
-
-Also add information on how to contact you by electronic and paper mail.
-
- If your software can interact with users remotely through a computer
-network, you should also make sure that it provides a way for users to
-get its source. For example, if your program is a web application, its
-interface could display a "Source" link that leads users to an archive
-of the code. There are many ways you could offer source, and different
-solutions will be better for different programs; see section 13 for the
-specific requirements.
-
- You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU AGPL, see
-.
\ No newline at end of file
+BSD 2-Clause License
+
+Copyright (c) 2016-2017, Adam
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+* 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 HOLDER 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.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000000..7ff563d196
--- /dev/null
+++ b/README.md
@@ -0,0 +1,25 @@
+
+
+
+
+# RuneLitePlus [](https://travis-ci.org/runelite-extended/runelite) [](https://discord.gg/HN5gf3m)
+
+[RuneLitePlus](https://runelitepl.us) is a fork of [RuneLite](https://github.com/runelite/runelite) that provides more functionality and less restrictions while staying open source. This is meant to directly compete with 3rd party RL clients that are trying to sell their code.
+
+## Project Layout
+
+- [cache](cache/src/main/java/net/runelite/cache) - Libraries used for reading/writing cache files, as well as the data in it
+- [http-api](http-api/src/main/java/net/runelite/http/api) - API for api.runelite.net
+- [http-service](http-service/src/main/java/net/runelite/http/service) - Service for api.runelite.net
+- [runelite-api](runelite-api/src/main/java/net/runelite/api) - RuneLite API, interfaces for accessing the client
+- [runelite-mixins](runelite-mixins/src/main/java/net/runelite) - Mixins which are injected into the injected client's classes
+- [runescape-api](runescape-api/src/main/java/net/runelite) - Mappings correspond to these interfaces, runelite-api is a subset of this
+- [runelite-client](runelite-client/src/main/java/net/runelite/client) - Game client with plugins
+
+## License
+
+RuneLitePlus is licensed under the BSD 2-clause license. See the license header in the respective file to be sure.
+
+## Contribute and Develop
+
+We've set up a separate document for our [contribution guidelines](https://github.com/runelite-extended/runelite/blob/master/.github/CONTRIBUTING.md).
diff --git a/RuneLitePlus/Test.java b/RuneLitePlus/Test.java
deleted file mode 100644
index bffdcb6707..0000000000
--- a/RuneLitePlus/Test.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 2018, https://runelitepl.us
- * 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 com.runeswag.client.plugins;
-
-import api.Client;
-import api.events.ChatMessage;
-import api.events.ClientTick;
-import api.events.GameTick;
-import api.events.MenuOpened;
-import api.events.VarbitChanged;
-import com.google.common.eventbus.Subscribe;
-import com.google.inject.Binder;
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import com.google.inject.Provides;
-import com.runeswag.client.config.ConfigManager;
-import com.runeswag.client.misc.Plugin;
-import com.runeswag.client.misc.PluginDescriptor;
-import com.runeswag.client.ui.OverlayManager;
-import lombok.extern.slf4j.Slf4j;
-
-/**
- * Authors gazivodag longstreet
- */
-@PluginDescriptor(
- name = "Test",
- description = "Testing plugin for building functionality",
- tags = {}
-)
-@Singleton
-@Slf4j
-public class Test extends Plugin
-{
-
- @Provides
- TestConfig getConfig(ConfigManager configManager)
- {
- return configManager.getConfig(TestConfig.class);
- }
-
- @Inject
- private TestOverlay testOverlay;
-
- @Inject
- private TestConfig config;
-
- @Inject
- private Client client;
-
- @Inject
- private OverlayManager overlayManager;
-
- @Override
- public void configure(Binder binder)
- {
- }
-
- @Override
- protected void startUp() throws Exception
- {
- overlayManager.add(testOverlay);
- System.out.println("Test Plugin started");
- }
-
- @Override
- protected void shutDown() throws Exception
- {
-
- }
-
- @Subscribe
- public void onMenuOpened(MenuOpened event)
- {
- System.out.println("[Test Plugin] Menu Opened");
- }
-
- @Subscribe
- public void onChatMessage(ChatMessage chatMessage)
- {
- System.out.println("[Test Plugin] Chat Message");
- }
-
- @Subscribe
- public void onVarbitChanged(VarbitChanged event)
- {
- System.out.println("[Test Plugin] Varbit Changed");
- }
-}
\ No newline at end of file
diff --git a/RuneLitePlus/src/main/java/net/runelite/client/plugins/aoewarnings/AoeWarningConfig.java b/RuneLitePlus/src/main/java/net/runelite/client/plugins/aoewarnings/AoeWarningConfig.java
deleted file mode 100644
index 539c6ca132..0000000000
--- a/RuneLitePlus/src/main/java/net/runelite/client/plugins/aoewarnings/AoeWarningConfig.java
+++ /dev/null
@@ -1,333 +0,0 @@
-/*
- * Copyright (c) 2018, Adam
- * All rights reserved.
- *
- * Modified by farhan1666
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 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.client.plugins.aoewarnings;
-
-import java.awt.Color;
-import net.runelite.client.config.Config;
-import net.runelite.client.config.ConfigGroup;
-import net.runelite.client.config.ConfigItem;
-import net.runelite.client.config.Stub;
-
-@ConfigGroup("aoe")
-public interface AoeWarningConfig extends Config
-{
- @ConfigItem(
- keyName = "overlayStub",
- name = "Overlay",
- description = "",
- position = 1
- )
- default Stub overlayStub()
- {
- return new Stub();
- }
-
- @ConfigItem(
- position = 2,
- keyName = "overlayColor",
- name = "Overlay Color",
- description = "Configures the color of the AoE Projectile Warnings overlay"
- )
- default Color overlayColor()
- {
- return new Color(0, 150, 200);
- }
-
- @ConfigItem(
- keyName = "outline",
- name = "Display Outline",
- description = "Configures whether or not AoE Projectile Warnings have an outline",
- parent = "overlayStub",
- position = 3
- )
- default boolean isOutlineEnabled()
- {
- return true;
- }
-
- @ConfigItem(
- keyName = "delay",
- name = "Fade Delay",
- description = "Configures the amount of time in milliseconds that the warning lingers for after the projectile has touched the ground",
- parent = "overlayStub",
- position = 4
- )
- default int delay()
- {
- return 300;
- }
-
- @ConfigItem(
- keyName = "fade",
- name = "Fade Warnings",
- description = "Configures whether or not AoE Projectile Warnings fade over time",
- parent = "overlayStub",
- position = 5
- )
- default boolean isFadeEnabled()
- {
- return true;
- }
-
- @ConfigItem(
- keyName = "npcStub",
- name = "NPC's",
- description = "",
- position = 6
- )
- default Stub npcStub()
- {
- return new Stub();
- }
-
- @ConfigItem(
- keyName = "lizardmanaoe",
- name = "Lizardman Shamans",
- description = "Configures whether or not AoE Projectile Warnings for Lizardman Shamans is displayed",
- parent = "npcStub",
- position = 7
- )
- default boolean isShamansEnabled()
- {
- return true;
- }
-
- @ConfigItem(
- keyName = "archaeologistaoe",
- name = "Crazy Archaeologist",
- description = "Configures whether or not AoE Projectile Warnings for Archaeologist is displayed",
- parent = "npcStub",
- position = 8
- )
- default boolean isArchaeologistEnabled()
- {
- return true;
- }
-
- @ConfigItem(
- keyName = "icedemon",
- name = "Ice Demon",
- description = "Configures whether or not AoE Projectile Warnings for Ice Demon is displayed",
- parent = "npcStub",
- position = 9
- )
- default boolean isIceDemonEnabled()
- {
- return true;
- }
-
- @ConfigItem(
- keyName = "vasa",
- name = "Vasa",
- description = "Configures whether or not AoE Projectile Warnings for Vasa is displayed",
- parent = "npcStub",
- position = 10
- )
- default boolean isVasaEnabled()
- {
- return true;
- }
-
- @ConfigItem(
- keyName = "tekton",
- name = "Tekton",
- description = "Configures whether or not AoE Projectile Warnings for Tekton is displayed",
- parent = "npcStub",
- position = 11
- )
- default boolean isTektonEnabled()
- {
- return true;
- }
-
- @ConfigItem(
- keyName = "vorkath",
- name = "Vorkath",
- description = "Configures whether or not AoE Projectile Warnings for Vorkath are displayed",
- parent = "npcStub",
- position = 12
- )
- default boolean isVorkathEnabled()
- {
- return true;
- }
-
- @ConfigItem(
- keyName = "galvek",
- name = "Galvek",
- description = "Configures whether or not AoE Projectile Warnings for Galvek are displayed",
- parent = "npcStub",
- position = 13
- )
- default boolean isGalvekEnabled()
- {
- return true;
- }
-
- @ConfigItem(
- keyName = "gargboss",
- name = "Gargoyle Boss",
- description = "Configs whether or not AoE Projectile Warnings for Dawn/Dusk are displayed",
- parent = "npcStub",
- position = 14
- )
- default boolean isGargBossEnabled()
- {
- return true;
- }
-
- @ConfigItem(
- keyName = "vetion",
- name = "Vet'ion",
- description = "Configures whether or not AoE Projectile Warnings for Vet'ion are displayed",
- parent = "npcStub",
- position = 15
- )
- default boolean isVetionEnabled()
- {
- return true;
- }
-
- @ConfigItem(
- keyName = "chaosfanatic",
- name = "Chaos Fanatic",
- description = "Configures whether or not AoE Projectile Warnings for Chaos Fanatic are displayed",
- parent = "npcStub",
- position = 16
- )
- default boolean isChaosFanaticEnabled()
- {
- return true;
- }
-
- @ConfigItem(
- keyName = "olm",
- name = "Olm",
- description = "Configures whether or not AoE Projectile Warnings for The Great Olm are displayed",
- parent = "npcStub",
- position = 17
- )
- default boolean isOlmEnabled()
- {
- return true;
- }
-
- @ConfigItem(
- keyName = "bombDisplay",
- name = "Olm Bombs",
- description = "Display a timer and colour-coded AoE for Olm's crystal-phase bombs.",
- parent = "npcStub",
- position = 18
- )
- default boolean bombDisplay()
- {
- return true;
- }
-
- @ConfigItem(
- keyName = "corp",
- name = "Corporeal Beast",
- description = "Configures whether or not AoE Projectile Warnings for the Corporeal Beast are displayed",
- parent = "npcStub",
- position = 19
- )
- default boolean isCorpEnabled()
- {
- return true;
- }
-
- @ConfigItem(
- keyName = "wintertodt",
- name = "Wintertodt Snow Fall",
- description = "Configures whether or not AOE Projectile Warnings for the Wintertodt snow fall are displayed",
- parent = "npcStub",
- position = 20
- )
- default boolean isWintertodtEnabled()
- {
- return true;
- }
-
- @ConfigItem(
- keyName = "isXarpusEnabled",
- name = "Xarpus",
- description = "Configures whether or not AOE Projectile Warnings for Xarpus are displayed",
- parent = "npcStub",
- position = 21
- )
- default boolean isXarpusEnabled()
- {
- return true;
- }
-
- @ConfigItem(
- keyName = "lightning",
- name = "Olm Lightning Trails",
- description = "Show Lightning Trails",
- parent = "npcStub",
- position = 22
- )
- default boolean LightningTrail()
- {
- return true;
- }
-
- @ConfigItem(
- keyName = "addyDrags",
- name = "Addy Drags",
- description = "Show Bad Areas",
- parent = "npcStub",
- position = 23
- )
- default boolean addyDrags()
- {
- return true;
- }
-
- @ConfigItem(
- keyName = "drake", name = "Drakes Breath",
- description = "Configures if Drakes Breath tile markers are displayed",
- parent = "npcStub",
- position = 24
- )
- default boolean isDrakeEnabled()
- {
- return true;
- }
-
- @ConfigItem(
- keyName = "cerbFire",
- name = "Cerberus Fire",
- description = "Configures if Cerberus fire tile markers are displayed",
- parent = "npcStub",
- position = 25
- )
- default boolean isCerbFireEnabled()
- {
- return true;
- }
-}
diff --git a/RuneLitePlus/src/main/java/net/runelite/client/plugins/blackjack/BlackjackPlugin.java b/RuneLitePlus/src/main/java/net/runelite/client/plugins/blackjack/BlackjackPlugin.java
deleted file mode 100644
index acc543bae7..0000000000
--- a/RuneLitePlus/src/main/java/net/runelite/client/plugins/blackjack/BlackjackPlugin.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Copyright (c) 2018, https://runelitepl.us
- * 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.client.plugins.blackjack;
-
-import com.google.inject.Binder;
-import javax.inject.Inject;
-import javax.inject.Singleton;
-import lombok.extern.slf4j.Slf4j;
-import api.ChatMessageType;
-import api.Client;
-import static api.Varbits.QUEST_THE_FEUD;
-import api.events.ChatMessage;
-import api.events.GameTick;
-import api.events.MenuEntryAdded;
-import api.events.VarbitChanged;
-import net.runelite.client.eventbus.Subscribe;
-import net.runelite.client.menus.MenuManager;
-import net.runelite.client.plugins.Plugin;
-import net.runelite.client.plugins.PluginDescriptor;
-import net.runelite.client.plugins.PluginType;
-import static net.runelite.client.util.MenuUtil.swap;
-
-/**
- * Authors gazivodag longstreet
- */
-@PluginDescriptor(
- name = "Blackjack",
- description = "Uses chat messages and tick timers instead of animations to read",
- tags = {"blackjack", "thieving"},
- type = PluginType.SKILLING
-)
-@Singleton
-@Slf4j
-public class BlackjackPlugin extends Plugin
-{
- private static final String PICKPOCKET = "Pickpocket";
- private static final String KNOCK_OUT = "Knock-out";
- private static final String LURE = "Lure";
- private static final String BANDIT = "Bandit";
- private static final String MENAPHITE = "Menaphite Thug";
-
- @Inject
- private Client client;
-
- @Inject
- private MenuManager menuManager;
-
- private int lastKnockout;
- private boolean pickpocketing;
- private boolean ableToBlackJack;
-
- @Override
- public void configure(Binder binder)
- {
- }
-
- @Override
- protected void startUp() throws Exception
- {
- menuManager.addPriorityEntry(LURE, BANDIT);
- menuManager.addPriorityEntry(LURE, MENAPHITE);
-
- menuManager.addPriorityEntry(KNOCK_OUT, BANDIT);
- menuManager.addPriorityEntry(KNOCK_OUT, MENAPHITE);
- }
-
- @Override
- protected void shutDown() throws Exception
- {
- menuManager.removePriorityEntry(LURE, BANDIT);
- menuManager.removePriorityEntry(LURE, MENAPHITE);
-
- menuManager.removePriorityEntry(PICKPOCKET, BANDIT);
- menuManager.removePriorityEntry(PICKPOCKET, MENAPHITE);
-
- menuManager.removePriorityEntry(KNOCK_OUT, BANDIT);
- menuManager.removePriorityEntry(KNOCK_OUT, MENAPHITE);
- }
-
- @Subscribe
- public void onGameTick(GameTick gameTick)
- {
- if (ableToBlackJack && pickpocketing && client.getTickCount() >= lastKnockout + 4)
- {
- pickpocketing = false;
-
- menuManager.removePriorityEntry(PICKPOCKET, BANDIT);
- menuManager.removePriorityEntry(PICKPOCKET, MENAPHITE);
-
- menuManager.addPriorityEntry(KNOCK_OUT, BANDIT);
- menuManager.addPriorityEntry(KNOCK_OUT, MENAPHITE);
- }
- }
-
- @Subscribe
- public void onMenuEntryAdded(MenuEntryAdded event)
- {
- // Lure has higher priority than knock-out
- if (event.getTarget().contains(MENAPHITE) || event.getTarget().contains(BANDIT)
- && event.getOption().equals(LURE))
- {
- swap(client, KNOCK_OUT, LURE, event.getTarget(), false);
- }
- }
-
- @Subscribe
- public void onChatMessage(ChatMessage chatMessage)
- {
- if (chatMessage.getType() == ChatMessageType.SPAM)
- {
- if (chatMessage.getMessage().equals("You smack the bandit over the head and render them unconscious.")
- || chatMessage.getMessage().equals("Your blow only glances off the bandit's head."))
- {
- menuManager.removePriorityEntry(KNOCK_OUT, BANDIT);
- menuManager.removePriorityEntry(KNOCK_OUT, MENAPHITE);
-
- menuManager.addPriorityEntry(PICKPOCKET, BANDIT);
- menuManager.addPriorityEntry(PICKPOCKET, MENAPHITE);
-
- lastKnockout = client.getTickCount();
- pickpocketing = true;
- }
- }
- }
-
- @Subscribe
- public void onVarbitChanged(VarbitChanged event)
- {
- ableToBlackJack = client.getVar(QUEST_THE_FEUD) >= 13;
-
- if (!ableToBlackJack)
- {
- menuManager.removePriorityEntry(LURE, BANDIT);
- menuManager.removePriorityEntry(LURE, MENAPHITE);
-
- menuManager.removePriorityEntry(KNOCK_OUT, BANDIT);
- menuManager.removePriorityEntry(KNOCK_OUT, MENAPHITE);
-
- menuManager.removePriorityEntry(PICKPOCKET, BANDIT);
- menuManager.removePriorityEntry(PICKPOCKET, MENAPHITE);
- }
- }
-}
\ No newline at end of file
diff --git a/RuneLitePlus/src/main/java/net/runelite/client/plugins/cooking/FermentTimerOverlay.java b/RuneLitePlus/src/main/java/net/runelite/client/plugins/cooking/FermentTimerOverlay.java
deleted file mode 100644
index 99288092ae..0000000000
--- a/RuneLitePlus/src/main/java/net/runelite/client/plugins/cooking/FermentTimerOverlay.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (c) 2019, Lucas C
- * 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.client.plugins.cooking;
-
-import com.google.inject.Inject;
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Graphics2D;
-import java.time.Duration;
-import java.time.Instant;
-import lombok.extern.slf4j.Slf4j;
-import static api.AnimationID.COOKING_WINE;
-import api.Client;
-import static api.MenuAction.RUNELITE_OVERLAY_CONFIG;
-import net.runelite.client.ui.overlay.Overlay;
-import static net.runelite.client.ui.overlay.OverlayManager.OPTION_CONFIGURE;
-import net.runelite.client.ui.overlay.OverlayMenuEntry;
-import net.runelite.client.ui.overlay.OverlayPosition;
-import net.runelite.client.ui.overlay.components.LineComponent;
-import net.runelite.client.ui.overlay.components.PanelComponent;
-import net.runelite.client.ui.overlay.components.TitleComponent;
-
-@Slf4j
-class FermentTimerOverlay extends Overlay
-{
- private static final int INITIAL_TIME = 12;
-
- private final Client client;
- private final CookingPlugin plugin;
- private final PanelComponent panelComponent = new PanelComponent();
-
- @Inject
- private FermentTimerOverlay(final Client client, final CookingPlugin plugin)
- {
- super(plugin);
- setPosition(OverlayPosition.TOP_LEFT);
- this.client = client;
- this.plugin = plugin;
- getMenuEntries().add(new OverlayMenuEntry(RUNELITE_OVERLAY_CONFIG, OPTION_CONFIGURE, "Fermenting Timer overlay"));
- }
-
- @Override
- public Dimension render(Graphics2D graphics)
- {
- FermentTimerSession session = plugin.getFermentTimerSession();
- if (session == null)
- {
- return null;
- }
-
- panelComponent.getChildren().clear();
-
- if (isMakingWine() || Duration.between(session.getLastWineMakingAction(), Instant.now()).getSeconds() < INITIAL_TIME)
- {
- panelComponent.getChildren().add(TitleComponent.builder()
- .text("Making Wine")
- .color(Color.GREEN)
- .build());
- panelComponent.getChildren().add(LineComponent.builder()
- .left("Ferments in: ")
- .right(String.valueOf(INITIAL_TIME - Duration.between(session.getLastWineMakingAction(), Instant.now()).getSeconds()))
- .build());
- }
- else
- {
- panelComponent.getChildren().add(TitleComponent.builder()
- .text("Wine Fermented")
- .color(Color.ORANGE)
- .build());
- }
-
- return panelComponent.render(graphics);
- }
-
- private boolean isMakingWine()
- {
- return (client.getLocalPlayer().getAnimation() == COOKING_WINE);
- }
-}
diff --git a/RuneLitePlus/src/main/java/net/runelite/client/plugins/inventoryhighlight/InventoryHighlightConfig.java b/RuneLitePlus/src/main/java/net/runelite/client/plugins/inventoryhighlight/InventoryHighlightConfig.java
deleted file mode 100644
index 1cf5a673a1..0000000000
--- a/RuneLitePlus/src/main/java/net/runelite/client/plugins/inventoryhighlight/InventoryHighlightConfig.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package net.runelite.client.plugins.inventoryhighlight;
-
-import net.runelite.client.config.Config;
-import net.runelite.client.config.ConfigGroup;
-import net.runelite.client.config.ConfigItem;
-import net.runelite.client.config.Stub;
-
-@ConfigGroup("inventoryHighlight")
-public interface InventoryHighlightConfig extends Config
-{
- @ConfigItem(
- keyName = "showItem",
- name = "Show the item",
- description = "Show a preview of the item in the new slot"
- )
- default boolean showItem()
- {
- return true;
- }
-
- @ConfigItem(
- keyName = "gridStub",
- name = "Grid",
- description = "",
- position = 1
- )
- default Stub gridStub()
- {
- return new Stub();
- }
-
- @ConfigItem(
- keyName = "showGrid",
- name = "Show a grid",
- description = "Show a grid on the inventory while dragging",
- parent = "gridStub"
- )
- default boolean showGrid()
- {
- return false;
- }
-
- @ConfigItem(
- keyName = "showHighlight",
- name = "Show background highlight",
- description = "Show a green background highlight in the new slot",
- parent = "gridStub"
- )
- default boolean showHighlight()
- {
- return false;
- }
-}
diff --git a/RuneLitePlus/src/main/java/net/runelite/client/plugins/inventoryhighlight/InventoryHighlightInputListener.java b/RuneLitePlus/src/main/java/net/runelite/client/plugins/inventoryhighlight/InventoryHighlightInputListener.java
deleted file mode 100644
index 6aa50f8515..0000000000
--- a/RuneLitePlus/src/main/java/net/runelite/client/plugins/inventoryhighlight/InventoryHighlightInputListener.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright (c) 2018, Jeremy Plsek
- * 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.client.plugins.inventoryhighlight;
-
-import com.google.inject.Inject;
-import java.awt.event.MouseEvent;
-import api.Client;
-import api.GameState;
-import api.Point;
-import api.widgets.Widget;
-import api.widgets.WidgetInfo;
-import api.widgets.WidgetItem;
-import net.runelite.client.input.MouseListener;
-
-public class InventoryHighlightInputListener implements MouseListener
-{
- private final InventoryHighlightPlugin plugin;
- private final Client client;
-
- @Inject
- public InventoryHighlightInputListener(InventoryHighlightPlugin plugin, Client client)
- {
- this.plugin = plugin;
- this.client = client;
- }
-
- @Override
- public MouseEvent mouseDragged(MouseEvent mouseEvent)
- {
- plugin.setDragging(true);
- return mouseEvent;
- }
-
- @Override
- public MouseEvent mouseMoved(MouseEvent mouseEvent)
- {
- return mouseEvent;
- }
-
- @Override
- public MouseEvent mouseClicked(MouseEvent mouseEvent)
- {
- return mouseEvent;
- }
-
- @Override
- public MouseEvent mousePressed(MouseEvent mouseEvent)
- {
- if (client.getGameState() != GameState.LOGGED_IN)
- {
- return mouseEvent;
- }
-
- final Widget inventoryWidget = client.getWidget(WidgetInfo.INVENTORY);
- final Widget bankInventoryWidget = client.getWidget(WidgetInfo.BANK_INVENTORY_ITEMS_CONTAINER);
-
- if ((inventoryWidget == null || inventoryWidget.isSelfHidden()) &&
- (inventoryWidget == null || bankInventoryWidget == null || bankInventoryWidget.isSelfHidden()))
- {
- return mouseEvent;
- }
-
- final Point mouse = client.getMouseCanvasPosition();
-
- for (WidgetItem item : inventoryWidget.getWidgetItems())
- {
- if (item.getCanvasBounds().contains(mouse.getX(), mouse.getY()))
- {
- plugin.setDraggingItem(item.getId());
- break;
- }
- }
-
- return mouseEvent;
- }
-
- @Override
- public MouseEvent mouseReleased(MouseEvent mouseEvent)
- {
- plugin.setDragging(false);
- plugin.setDraggingItem(-1);
-
- return mouseEvent;
- }
-
- @Override
- public MouseEvent mouseEntered(MouseEvent mouseEvent)
- {
- return mouseEvent;
- }
-
- @Override
- public MouseEvent mouseExited(MouseEvent mouseEvent)
- {
- return mouseEvent;
- }
-}
diff --git a/RuneLitePlus/src/main/java/net/runelite/client/plugins/inventoryhighlight/InventoryHighlightOverlay.java b/RuneLitePlus/src/main/java/net/runelite/client/plugins/inventoryhighlight/InventoryHighlightOverlay.java
deleted file mode 100644
index 83e4393b7e..0000000000
--- a/RuneLitePlus/src/main/java/net/runelite/client/plugins/inventoryhighlight/InventoryHighlightOverlay.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (c) 2018, Jeremy Plsek
- * 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.client.plugins.inventoryhighlight;
-
-import com.google.inject.Inject;
-import java.awt.AlphaComposite;
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Graphics2D;
-import java.awt.Point;
-import java.awt.Rectangle;
-import java.awt.image.BufferedImage;
-import api.Client;
-import api.widgets.Widget;
-import api.widgets.WidgetInfo;
-import net.runelite.client.game.ItemManager;
-import net.runelite.client.ui.overlay.Overlay;
-import net.runelite.client.ui.overlay.OverlayLayer;
-
-public class InventoryHighlightOverlay extends Overlay
-{
- private final InventoryHighlightPlugin plugin;
- private final InventoryHighlightConfig config;
- private final Client client;
- private final ItemManager itemManager;
-
- // the inventory widget location is slightly off
- private static final int FIXED_MARGIN_X = -10;
- private static final int FIXED_MARGIN_Y = -25;
- private static final int RESIZEABLE_MARGIN_X = -6;
- private static final int RESIZEABLE_MARGIN_Y = -21;
-
- private static final int ITEM_WIDTH = 32;
- private static final int ITEM_HEIGHT = 32;
- private static final int ITEM_MARGIN_X = 10;
- private static final int ITEM_MARGIN_Y = 4;
-
- private static final Color HIGHLIGHT = new Color(0, 255, 0, 45);
- private static final Color GRID = new Color(255, 255, 255, 45);
-
- @Inject
- public InventoryHighlightOverlay(InventoryHighlightPlugin plugin, InventoryHighlightConfig config, Client client, ItemManager itemManager)
- {
- this.plugin = plugin;
- this.itemManager = itemManager;
- this.client = client;
- this.config = config;
-
- setLayer(OverlayLayer.ABOVE_WIDGETS);
- }
-
- @Override
- public Dimension render(Graphics2D graphics)
- {
- if (plugin.getDraggingItem() == -1 || !plugin.isDragging())
- {
- return null;
- }
-
- int marginX, marginY;
- if (client.isResized())
- {
- marginX = RESIZEABLE_MARGIN_X;
- marginY = RESIZEABLE_MARGIN_Y;
- }
- else
- {
- marginX = FIXED_MARGIN_X;
- marginY = FIXED_MARGIN_Y;
- }
-
- final api.Point mouse = client.getMouseCanvasPosition();
- final Point updatedMouse = new Point(mouse.getX() + marginX, mouse.getY() + marginY);
-
- // null checks for inventory are checked during dragging events
- final Widget inventoryWidget = client.getWidget(WidgetInfo.INVENTORY);
-
- final int inventoryX = inventoryWidget.getCanvasLocation().getX() + marginX;
- final int inventoryY = inventoryWidget.getCanvasLocation().getY() + marginY;
-
- final BufferedImage draggedItemImage = itemManager.getImage(plugin.getDraggingItem());
-
- for (int i = 0; i < 4; i++)
- {
- for (int j = 0; j < 7; j++)
- {
- final int x = (ITEM_WIDTH + ITEM_MARGIN_X) * i + inventoryX;
- final int y = (ITEM_HEIGHT + ITEM_MARGIN_Y) * j + inventoryY;
- final Rectangle bounds = new Rectangle(x, y, ITEM_WIDTH, ITEM_HEIGHT);
-
- if (config.showItem() && bounds.contains(updatedMouse))
- {
- graphics.setComposite(AlphaComposite.SrcOver.derive(0.3f));
- graphics.drawImage(draggedItemImage, x, y, null);
- graphics.setComposite(AlphaComposite.SrcOver);
- }
-
- if (config.showHighlight() && bounds.contains(updatedMouse))
- {
- graphics.setColor(HIGHLIGHT);
- graphics.fill(bounds);
- }
-
- if (config.showGrid())
- {
- // don't set color on highlighted slot
- if (!config.showHighlight() || !(config.showHighlight() && bounds.contains(updatedMouse)))
- {
- graphics.setColor(GRID);
- graphics.fill(bounds);
- }
- }
- }
- }
-
- return null;
- }
-}
diff --git a/RuneLitePlus/src/main/java/net/runelite/client/plugins/itemstats/ItemStatChanges.java b/RuneLitePlus/src/main/java/net/runelite/client/plugins/itemstats/ItemStatChanges.java
deleted file mode 100644
index b471a69dd8..0000000000
--- a/RuneLitePlus/src/main/java/net/runelite/client/plugins/itemstats/ItemStatChanges.java
+++ /dev/null
@@ -1,628 +0,0 @@
-/*
- * Copyright (c) 2016-2018, Adam
- * Copyright (c) 2018, Jordan Atwood
- * 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.client.plugins.itemstats;
-
-import com.google.inject.Singleton;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import lombok.extern.slf4j.Slf4j;
-import static api.ItemID.ADMIRAL_PIE;
-import static api.ItemID.AGILITY_POTION1;
-import static api.ItemID.AGILITY_POTION2;
-import static api.ItemID.AGILITY_POTION3;
-import static api.ItemID.AGILITY_POTION4;
-import static api.ItemID.ANCHOVIES;
-import static api.ItemID.ANCHOVY_PIZZA;
-import static api.ItemID.ANGLERFISH;
-import static api.ItemID.APPLE_PIE;
-import static api.ItemID.ATTACK_POTION1;
-import static api.ItemID.ATTACK_POTION2;
-import static api.ItemID.ATTACK_POTION3;
-import static api.ItemID.ATTACK_POTION4;
-import static api.ItemID.AUTUMN_SQIRKJUICE;
-import static api.ItemID.BAGUETTE;
-import static api.ItemID.BAKED_POTATO;
-import static api.ItemID.BANANA;
-import static api.ItemID.BANDAGES;
-import static api.ItemID.BASS;
-import static api.ItemID.BASTION_POTION1;
-import static api.ItemID.BASTION_POTION2;
-import static api.ItemID.BASTION_POTION3;
-import static api.ItemID.BASTION_POTION4;
-import static api.ItemID.BATTLEMAGE_POTION1;
-import static api.ItemID.BATTLEMAGE_POTION2;
-import static api.ItemID.BATTLEMAGE_POTION3;
-import static api.ItemID.BATTLEMAGE_POTION4;
-import static api.ItemID.BAT_SHISH;
-import static api.ItemID.BOTANICAL_PIE;
-import static api.ItemID.BOTTLE_OF_WINE;
-import static api.ItemID.BRAWK_FISH_3;
-import static api.ItemID.BREAD;
-import static api.ItemID.CABBAGE;
-import static api.ItemID.CABBAGE_1967;
-import static api.ItemID.CAKE;
-import static api.ItemID.CAVE_EEL;
-import static api.ItemID.CAVIAR;
-import static api.ItemID.CHEESE;
-import static api.ItemID.CHEESETOM_BATTA;
-import static api.ItemID.CHILLI_CON_CARNE;
-import static api.ItemID.CHILLI_POTATO;
-import static api.ItemID.CHOCCHIP_CRUNCHIES;
-import static api.ItemID.CHOCICE;
-import static api.ItemID.CHOCOLATEY_MILK;
-import static api.ItemID.CHOCOLATE_BAR;
-import static api.ItemID.CHOCOLATE_BOMB;
-import static api.ItemID.CHOCOLATE_CAKE;
-import static api.ItemID.CHOCOLATE_SLICE;
-import static api.ItemID.CHOC_SATURDAY;
-import static api.ItemID.CHOPPED_ONION;
-import static api.ItemID.CHOPPED_TOMATO;
-import static api.ItemID.CHOPPED_TUNA;
-import static api.ItemID.COATED_FROGS_LEGS;
-import static api.ItemID.COD;
-import static api.ItemID.COMBAT_POTION1;
-import static api.ItemID.COMBAT_POTION2;
-import static api.ItemID.COMBAT_POTION3;
-import static api.ItemID.COMBAT_POTION4;
-import static api.ItemID.COOKED_CHICKEN;
-import static api.ItemID.COOKED_CHOMPY;
-import static api.ItemID.COOKED_CRAB_MEAT;
-import static api.ItemID.COOKED_FISHCAKE;
-import static api.ItemID.COOKED_JUBBLY;
-import static api.ItemID.COOKED_KARAMBWAN;
-import static api.ItemID.COOKED_MEAT;
-import static api.ItemID.COOKED_RABBIT;
-import static api.ItemID.COOKED_SLIMY_EEL;
-import static api.ItemID.COOKED_SWEETCORN;
-import static api.ItemID.CURRY;
-import static api.ItemID.DARK_CRAB;
-import static api.ItemID.DEFENCE_POTION1;
-import static api.ItemID.DEFENCE_POTION2;
-import static api.ItemID.DEFENCE_POTION3;
-import static api.ItemID.DEFENCE_POTION4;
-import static api.ItemID.DRUNK_DRAGON;
-import static api.ItemID.DWELLBERRIES;
-import static api.ItemID.EASTER_EGG;
-import static api.ItemID.EDIBLE_SEAWEED;
-import static api.ItemID.EEL_SUSHI;
-import static api.ItemID.EGG_AND_TOMATO;
-import static api.ItemID.EGG_POTATO;
-import static api.ItemID.ELDER_1;
-import static api.ItemID.ELDER_1_20921;
-import static api.ItemID.ELDER_2;
-import static api.ItemID.ELDER_2_20922;
-import static api.ItemID.ELDER_3;
-import static api.ItemID.ELDER_3_20923;
-import static api.ItemID.ELDER_4;
-import static api.ItemID.ELDER_4_20924;
-import static api.ItemID.ELDER_POTION_1;
-import static api.ItemID.ELDER_POTION_2;
-import static api.ItemID.ELDER_POTION_3;
-import static api.ItemID.ELDER_POTION_4;
-import static api.ItemID.ENERGY_POTION1;
-import static api.ItemID.ENERGY_POTION2;
-import static api.ItemID.ENERGY_POTION3;
-import static api.ItemID.ENERGY_POTION4;
-import static api.ItemID.FAT_SNAIL_MEAT;
-import static api.ItemID.FIELD_RATION;
-import static api.ItemID.FILLETS;
-import static api.ItemID.FINGERS;
-import static api.ItemID.FISHING_POTION1;
-import static api.ItemID.FISHING_POTION2;
-import static api.ItemID.FISHING_POTION3;
-import static api.ItemID.FISHING_POTION4;
-import static api.ItemID.FISH_PIE;
-import static api.ItemID.FRIED_MUSHROOMS;
-import static api.ItemID.FRIED_ONIONS;
-import static api.ItemID.FROGBURGER;
-import static api.ItemID.FROGSPAWN_GUMBO;
-import static api.ItemID.FROG_SPAWN;
-import static api.ItemID.FRUIT_BATTA;
-import static api.ItemID.FRUIT_BLAST;
-import static api.ItemID.GARDEN_PIE;
-import static api.ItemID.GIANT_CARP;
-import static api.ItemID.GIRAL_BAT_2;
-import static api.ItemID.GOUT_TUBER;
-import static api.ItemID.GREEN_GLOOP_SOUP;
-import static api.ItemID.GRUBS__LA_MODE;
-import static api.ItemID.GUANIC_BAT_0;
-import static api.ItemID.GUTHIX_REST1;
-import static api.ItemID.GUTHIX_REST2;
-import static api.ItemID.GUTHIX_REST3;
-import static api.ItemID.GUTHIX_REST4;
-import static api.ItemID.HALF_AN_ADMIRAL_PIE;
-import static api.ItemID.HALF_AN_APPLE_PIE;
-import static api.ItemID.HALF_A_BOTANICAL_PIE;
-import static api.ItemID.HALF_A_FISH_PIE;
-import static api.ItemID.HALF_A_GARDEN_PIE;
-import static api.ItemID.HALF_A_MEAT_PIE;
-import static api.ItemID.HALF_A_MUSHROOM_PIE;
-import static api.ItemID.HALF_A_REDBERRY_PIE;
-import static api.ItemID.HALF_A_SUMMER_PIE;
-import static api.ItemID.HALF_A_WILD_PIE;
-import static api.ItemID.HERRING;
-import static api.ItemID.HUNTER_POTION1;
-import static api.ItemID.HUNTER_POTION2;
-import static api.ItemID.HUNTER_POTION3;
-import static api.ItemID.HUNTER_POTION4;
-import static api.ItemID.IMBUED_HEART;
-import static api.ItemID.JANGERBERRIES;
-import static api.ItemID.JUG_OF_WINE;
-import static api.ItemID.KODAI_1;
-import static api.ItemID.KODAI_1_20945;
-import static api.ItemID.KODAI_2;
-import static api.ItemID.KODAI_2_20946;
-import static api.ItemID.KODAI_3;
-import static api.ItemID.KODAI_3_20947;
-import static api.ItemID.KODAI_4;
-import static api.ItemID.KODAI_4_20948;
-import static api.ItemID.KODAI_POTION_1;
-import static api.ItemID.KODAI_POTION_2;
-import static api.ItemID.KODAI_POTION_3;
-import static api.ItemID.KODAI_POTION_4;
-import static api.ItemID.KRYKET_BAT_4;
-import static api.ItemID.KYREN_FISH_6;
-import static api.ItemID.LAVA_EEL;
-import static api.ItemID.LECKISH_FISH_2;
-import static api.ItemID.LEMON;
-import static api.ItemID.LEMON_CHUNKS;
-import static api.ItemID.LEMON_SLICES;
-import static api.ItemID.LIME;
-import static api.ItemID.LIME_CHUNKS;
-import static api.ItemID.LIME_SLICES;
-import static api.ItemID.LOACH;
-import static api.ItemID.LOBSTER;
-import static api.ItemID.MACKEREL;
-import static api.ItemID.MAGIC_ESSENCE1;
-import static api.ItemID.MAGIC_ESSENCE2;
-import static api.ItemID.MAGIC_ESSENCE3;
-import static api.ItemID.MAGIC_ESSENCE4;
-import static api.ItemID.MAGIC_POTION1;
-import static api.ItemID.MAGIC_POTION2;
-import static api.ItemID.MAGIC_POTION3;
-import static api.ItemID.MAGIC_POTION4;
-import static api.ItemID.MANTA_RAY;
-import static api.ItemID.MEAT_PIE;
-import static api.ItemID.MEAT_PIZZA;
-import static api.ItemID.MINT_CAKE;
-import static api.ItemID.MONKFISH;
-import static api.ItemID.MOONLIGHT_MEAD;
-import static api.ItemID.MURNG_BAT_5;
-import static api.ItemID.MUSHROOMS;
-import static api.ItemID.MUSHROOM_PIE;
-import static api.ItemID.MUSHROOM_POTATO;
-import static api.ItemID.MUSHROOM__ONION;
-import static api.ItemID.MYCIL_FISH_4;
-import static api.ItemID.ONION;
-import static api.ItemID.ORANGE;
-import static api.ItemID.ORANGE_CHUNKS;
-import static api.ItemID.ORANGE_SLICES;
-import static api.ItemID.OVERLOAD_1;
-import static api.ItemID.OVERLOAD_1_20985;
-import static api.ItemID.OVERLOAD_1_20989;
-import static api.ItemID.OVERLOAD_1_20993;
-import static api.ItemID.OVERLOAD_2;
-import static api.ItemID.OVERLOAD_2_20986;
-import static api.ItemID.OVERLOAD_2_20990;
-import static api.ItemID.OVERLOAD_2_20994;
-import static api.ItemID.OVERLOAD_3;
-import static api.ItemID.OVERLOAD_3_20987;
-import static api.ItemID.OVERLOAD_3_20991;
-import static api.ItemID.OVERLOAD_3_20995;
-import static api.ItemID.OVERLOAD_4;
-import static api.ItemID.OVERLOAD_4_20988;
-import static api.ItemID.OVERLOAD_4_20992;
-import static api.ItemID.OVERLOAD_4_20996;
-import static api.ItemID.PAPAYA_FRUIT;
-import static api.ItemID.PEACH;
-import static api.ItemID.PHLUXIA_BAT_3;
-import static api.ItemID.PIKE;
-import static api.ItemID.PINEAPPLE_CHUNKS;
-import static api.ItemID.PINEAPPLE_PIZZA;
-import static api.ItemID.PINEAPPLE_PUNCH;
-import static api.ItemID.PINEAPPLE_RING;
-import static api.ItemID.PLAIN_PIZZA;
-import static api.ItemID.POISON_KARAMBWAN;
-import static api.ItemID.POTATO;
-import static api.ItemID.POTATO_WITH_BUTTER;
-import static api.ItemID.POTATO_WITH_CHEESE;
-import static api.ItemID.POT_OF_CREAM;
-import static api.ItemID.PRAEL_BAT_1;
-import static api.ItemID.PRAYER_POTION1;
-import static api.ItemID.PRAYER_POTION2;
-import static api.ItemID.PRAYER_POTION3;
-import static api.ItemID.PRAYER_POTION4;
-import static api.ItemID.PREMADE_CHOC_BOMB;
-import static api.ItemID.PREMADE_CHOC_SDY;
-import static api.ItemID.PREMADE_CH_CRUNCH;
-import static api.ItemID.PREMADE_CT_BATTA;
-import static api.ItemID.PREMADE_DR_DRAGON;
-import static api.ItemID.PREMADE_FRT_BATTA;
-import static api.ItemID.PREMADE_FR_BLAST;
-import static api.ItemID.PREMADE_P_PUNCH;
-import static api.ItemID.PREMADE_SGG;
-import static api.ItemID.PREMADE_SY_CRUNCH;
-import static api.ItemID.PREMADE_TD_BATTA;
-import static api.ItemID.PREMADE_TD_CRUNCH;
-import static api.ItemID.PREMADE_TTL;
-import static api.ItemID.PREMADE_VEG_BALL;
-import static api.ItemID.PREMADE_VEG_BATTA;
-import static api.ItemID.PREMADE_WIZ_BLZD;
-import static api.ItemID.PREMADE_WM_BATTA;
-import static api.ItemID.PREMADE_WM_CRUN;
-import static api.ItemID.PREMADE_WORM_HOLE;
-import static api.ItemID.PSYKK_BAT_6;
-import static api.ItemID.PUMPKIN;
-import static api.ItemID.PURPLE_SWEETS_10476;
-import static api.ItemID.PYSK_FISH_0;
-import static api.ItemID.RAINBOW_FISH;
-import static api.ItemID.RANGING_POTION1;
-import static api.ItemID.RANGING_POTION2;
-import static api.ItemID.RANGING_POTION3;
-import static api.ItemID.RANGING_POTION4;
-import static api.ItemID.REDBERRY_PIE;
-import static api.ItemID.RESTORE_POTION1;
-import static api.ItemID.RESTORE_POTION2;
-import static api.ItemID.RESTORE_POTION3;
-import static api.ItemID.RESTORE_POTION4;
-import static api.ItemID.REVITALISATION_1_20957;
-import static api.ItemID.REVITALISATION_2_20958;
-import static api.ItemID.REVITALISATION_3_20959;
-import static api.ItemID.REVITALISATION_4_20960;
-import static api.ItemID.ROAST_BEAST_MEAT;
-import static api.ItemID.ROAST_BIRD_MEAT;
-import static api.ItemID.ROAST_FROG;
-import static api.ItemID.ROAST_RABBIT;
-import static api.ItemID.ROE;
-import static api.ItemID.ROLL;
-import static api.ItemID.ROQED_FISH_5;
-import static api.ItemID.SALMON;
-import static api.ItemID.SANFEW_SERUM1;
-import static api.ItemID.SANFEW_SERUM2;
-import static api.ItemID.SANFEW_SERUM3;
-import static api.ItemID.SANFEW_SERUM4;
-import static api.ItemID.SARADOMIN_BREW1;
-import static api.ItemID.SARADOMIN_BREW2;
-import static api.ItemID.SARADOMIN_BREW3;
-import static api.ItemID.SARADOMIN_BREW4;
-import static api.ItemID.SARDINE;
-import static api.ItemID.SEA_TURTLE;
-import static api.ItemID.SHARK;
-import static api.ItemID.SHORT_GREEN_GUY;
-import static api.ItemID.SHRIMPS;
-import static api.ItemID.SLICED_BANANA;
-import static api.ItemID.SLICE_OF_CAKE;
-import static api.ItemID.SPICY_CRUNCHIES;
-import static api.ItemID.SPICY_SAUCE;
-import static api.ItemID.SPICY_STEW;
-import static api.ItemID.SPINACH_ROLL;
-import static api.ItemID.SPRING_SQIRKJUICE;
-import static api.ItemID.SQUARE_SANDWICH;
-import static api.ItemID.STAMINA_POTION1;
-import static api.ItemID.STAMINA_POTION2;
-import static api.ItemID.STAMINA_POTION3;
-import static api.ItemID.STAMINA_POTION4;
-import static api.ItemID.STEW;
-import static api.ItemID.STRANGE_FRUIT;
-import static api.ItemID.STRAWBERRY;
-import static api.ItemID.STRENGTH_POTION1;
-import static api.ItemID.STRENGTH_POTION2;
-import static api.ItemID.STRENGTH_POTION3;
-import static api.ItemID.STRENGTH_POTION4;
-import static api.ItemID.STUFFED_SNAKE;
-import static api.ItemID.SUMMER_PIE;
-import static api.ItemID.SUMMER_SQIRKJUICE;
-import static api.ItemID.SUPER_ATTACK1;
-import static api.ItemID.SUPER_ATTACK2;
-import static api.ItemID.SUPER_ATTACK3;
-import static api.ItemID.SUPER_ATTACK4;
-import static api.ItemID.SUPER_COMBAT_POTION1;
-import static api.ItemID.SUPER_COMBAT_POTION2;
-import static api.ItemID.SUPER_COMBAT_POTION3;
-import static api.ItemID.SUPER_COMBAT_POTION4;
-import static api.ItemID.SUPER_DEFENCE1;
-import static api.ItemID.SUPER_DEFENCE2;
-import static api.ItemID.SUPER_DEFENCE3;
-import static api.ItemID.SUPER_DEFENCE4;
-import static api.ItemID.SUPER_ENERGY1;
-import static api.ItemID.SUPER_ENERGY2;
-import static api.ItemID.SUPER_ENERGY3;
-import static api.ItemID.SUPER_ENERGY4;
-import static api.ItemID.SUPER_MAGIC_POTION_1;
-import static api.ItemID.SUPER_MAGIC_POTION_2;
-import static api.ItemID.SUPER_MAGIC_POTION_3;
-import static api.ItemID.SUPER_MAGIC_POTION_4;
-import static api.ItemID.SUPER_RANGING_1;
-import static api.ItemID.SUPER_RANGING_2;
-import static api.ItemID.SUPER_RANGING_3;
-import static api.ItemID.SUPER_RANGING_4;
-import static api.ItemID.SUPER_RESTORE1;
-import static api.ItemID.SUPER_RESTORE2;
-import static api.ItemID.SUPER_RESTORE3;
-import static api.ItemID.SUPER_RESTORE4;
-import static api.ItemID.SUPER_STRENGTH1;
-import static api.ItemID.SUPER_STRENGTH2;
-import static api.ItemID.SUPER_STRENGTH3;
-import static api.ItemID.SUPER_STRENGTH4;
-import static api.ItemID.SUPHI_FISH_1;
-import static api.ItemID.SWEETCORN_7088;
-import static api.ItemID.SWORDFISH;
-import static api.ItemID.TANGLED_TOADS_LEGS;
-import static api.ItemID.THIN_SNAIL_MEAT;
-import static api.ItemID.TOAD_BATTA;
-import static api.ItemID.TOAD_CRUNCHIES;
-import static api.ItemID.TOMATO;
-import static api.ItemID.TRIANGLE_SANDWICH;
-import static api.ItemID.TROUT;
-import static api.ItemID.TUNA;
-import static api.ItemID.TUNA_AND_CORN;
-import static api.ItemID.TUNA_POTATO;
-import static api.ItemID.TWISTED_1;
-import static api.ItemID.TWISTED_1_20933;
-import static api.ItemID.TWISTED_2;
-import static api.ItemID.TWISTED_2_20934;
-import static api.ItemID.TWISTED_3;
-import static api.ItemID.TWISTED_3_20935;
-import static api.ItemID.TWISTED_4;
-import static api.ItemID.TWISTED_4_20936;
-import static api.ItemID.TWISTED_POTION_1;
-import static api.ItemID.TWISTED_POTION_2;
-import static api.ItemID.TWISTED_POTION_3;
-import static api.ItemID.TWISTED_POTION_4;
-import static api.ItemID.UGTHANKI_KEBAB;
-import static api.ItemID.UGTHANKI_KEBAB_1885;
-import static api.ItemID.VEGETABLE_BATTA;
-import static api.ItemID.VEG_BALL;
-import static api.ItemID.WATERMELON_SLICE;
-import static api.ItemID.WHITE_TREE_FRUIT;
-import static api.ItemID.WILD_PIE;
-import static api.ItemID.WINTER_SQIRKJUICE;
-import static api.ItemID.WIZARD_BLIZZARD;
-import static api.ItemID.WORM_BATTA;
-import static api.ItemID.WORM_CRUNCHIES;
-import static api.ItemID.WORM_HOLE;
-import static api.ItemID.XERICS_AID_1_20981;
-import static api.ItemID.XERICS_AID_2_20982;
-import static api.ItemID.XERICS_AID_3_20983;
-import static api.ItemID.XERICS_AID_4_20984;
-import static api.ItemID.ZAMORAK_BREW1;
-import static api.ItemID.ZAMORAK_BREW2;
-import static api.ItemID.ZAMORAK_BREW3;
-import static api.ItemID.ZAMORAK_BREW4;
-import static api.ItemID._12_ANCHOVY_PIZZA;
-import static api.ItemID._12_MEAT_PIZZA;
-import static api.ItemID._12_PINEAPPLE_PIZZA;
-import static api.ItemID._12_PLAIN_PIZZA;
-import static api.ItemID._23_CAKE;
-import static api.ItemID._23_CHOCOLATE_CAKE;
-import static net.runelite.client.plugins.itemstats.Builders.boost;
-import static net.runelite.client.plugins.itemstats.Builders.combo;
-import static net.runelite.client.plugins.itemstats.Builders.dec;
-import static net.runelite.client.plugins.itemstats.Builders.food;
-import static net.runelite.client.plugins.itemstats.Builders.heal;
-import static net.runelite.client.plugins.itemstats.Builders.perc;
-import static net.runelite.client.plugins.itemstats.Builders.range;
-import net.runelite.client.plugins.itemstats.food.Anglerfish;
-import net.runelite.client.plugins.itemstats.potions.PrayerPotion;
-import net.runelite.client.plugins.itemstats.potions.SaradominBrew;
-import net.runelite.client.plugins.itemstats.potions.SuperRestore;
-import net.runelite.client.plugins.itemstats.special.CastleWarsBandage;
-import net.runelite.client.plugins.itemstats.special.SpicyStew;
-import static net.runelite.client.plugins.itemstats.stats.Stats.AGILITY;
-import static net.runelite.client.plugins.itemstats.stats.Stats.ATTACK;
-import static net.runelite.client.plugins.itemstats.stats.Stats.CRAFTING;
-import static net.runelite.client.plugins.itemstats.stats.Stats.DEFENCE;
-import static net.runelite.client.plugins.itemstats.stats.Stats.FARMING;
-import static net.runelite.client.plugins.itemstats.stats.Stats.FISHING;
-import static net.runelite.client.plugins.itemstats.stats.Stats.HERBLORE;
-import static net.runelite.client.plugins.itemstats.stats.Stats.HITPOINTS;
-import static net.runelite.client.plugins.itemstats.stats.Stats.HUNTER;
-import static net.runelite.client.plugins.itemstats.stats.Stats.MAGIC;
-import static net.runelite.client.plugins.itemstats.stats.Stats.PRAYER;
-import static net.runelite.client.plugins.itemstats.stats.Stats.RANGED;
-import static net.runelite.client.plugins.itemstats.stats.Stats.RUN_ENERGY;
-import static net.runelite.client.plugins.itemstats.stats.Stats.SLAYER;
-import static net.runelite.client.plugins.itemstats.stats.Stats.STRENGTH;
-import static net.runelite.client.plugins.itemstats.stats.Stats.THIEVING;
-
-@Singleton
-@Slf4j
-public class ItemStatChanges
-{
- ItemStatChanges()
- {
- init();
- }
-
- private void init()
- {
- add(food(-5), POISON_KARAMBWAN);
- add(food(1), POTATO, ONION, CABBAGE, POT_OF_CREAM, CHOPPED_ONION, ANCHOVIES);
- add(food(2), TOMATO, CHOPPED_TOMATO, BANANA, SLICED_BANANA, ORANGE, ORANGE_SLICES, ORANGE_CHUNKS,
- PINEAPPLE_RING, PINEAPPLE_CHUNKS, SPICY_SAUCE, CHEESE, SPINACH_ROLL, LEMON, LEMON_CHUNKS, LEMON_SLICES,
- LIME, LIME_CHUNKS, LIME_SLICES, DWELLBERRIES);
- add(food(3), SHRIMPS, COOKED_MEAT, COOKED_CHICKEN, ROE, CHOCOLATE_BAR);
- add(food(4), SARDINE, CAKE, _23_CAKE, SLICE_OF_CAKE, CHOCOLATEY_MILK, BAKED_POTATO, EDIBLE_SEAWEED, MOONLIGHT_MEAD);
- add(food(5), BREAD, HERRING, CHOCOLATE_CAKE, _23_CHOCOLATE_CAKE, CHOCOLATE_SLICE, COOKED_RABBIT, CHILLI_CON_CARNE,
- FRIED_MUSHROOMS, FRIED_ONIONS, REDBERRY_PIE, HALF_A_REDBERRY_PIE, CAVIAR, PYSK_FISH_0);
- add(food(6), CHOCICE, MACKEREL, MEAT_PIE, HALF_A_MEAT_PIE, GUANIC_BAT_0, ROAST_BIRD_MEAT,
- SQUARE_SANDWICH, ROLL, BAGUETTE, TRIANGLE_SANDWICH, GIANT_CARP);
- add(food(7), TROUT, COD, PLAIN_PIZZA, _12_PLAIN_PIZZA, APPLE_PIE, HALF_AN_APPLE_PIE, ROAST_RABBIT,
- PREMADE_CH_CRUNCH, CHOCCHIP_CRUNCHIES, PREMADE_SY_CRUNCH, SPICY_CRUNCHIES);
- add(food(8), PIKE, ROAST_BEAST_MEAT, MEAT_PIZZA, _12_MEAT_PIZZA, PREMADE_WM_CRUN, WORM_CRUNCHIES, PREMADE_TD_CRUNCH,
- TOAD_CRUNCHIES, EGG_AND_TOMATO, PRAEL_BAT_1, PEACH, SUPHI_FISH_1);
- add(food(9), PREMADE_P_PUNCH, PINEAPPLE_PUNCH, PREMADE_FR_BLAST, FRUIT_BLAST, SALMON, ANCHOVY_PIZZA,
- _12_ANCHOVY_PIZZA);
- add(food(10), TUNA, COOKED_CRAB_MEAT, CHOPPED_TUNA, COOKED_CHOMPY, FIELD_RATION);
- add(food(11), RAINBOW_FISH, STEW, PINEAPPLE_PIZZA, _12_PINEAPPLE_PIZZA, COOKED_FISHCAKE,
- PREMADE_VEG_BATTA, VEGETABLE_BATTA, PREMADE_WM_BATTA, WORM_BATTA, PREMADE_TD_BATTA, TOAD_BATTA, PREMADE_CT_BATTA,
- CHEESETOM_BATTA, PREMADE_FRT_BATTA, FRUIT_BATTA, MUSHROOM__ONION, GIRAL_BAT_2, LAVA_EEL, LECKISH_FISH_2);
- add(food(12), LOBSTER, PREMADE_WORM_HOLE, WORM_HOLE, PREMADE_VEG_BALL, VEG_BALL);
- add(food(13), BASS, TUNA_AND_CORN);
- add(food(14), POTATO_WITH_BUTTER, CHILLI_POTATO, SWORDFISH, PHLUXIA_BAT_3, PUMPKIN, EASTER_EGG, BRAWK_FISH_3);
- add(food(15), PREMADE_TTL, TANGLED_TOADS_LEGS, PREMADE_CHOC_BOMB, CHOCOLATE_BOMB, COOKED_JUBBLY);
- add(food(16), MONKFISH, POTATO_WITH_CHEESE, EGG_POTATO);
- add(food(17), MYCIL_FISH_4, KRYKET_BAT_4);
- add(food(18), COOKED_KARAMBWAN);
- add(food(19), CURRY, UGTHANKI_KEBAB, UGTHANKI_KEBAB_1885);
- add(food(20), MUSHROOM_POTATO, SHARK, ROQED_FISH_5, MURNG_BAT_5, STUFFED_SNAKE);
- add(food(21), SEA_TURTLE);
- add(food(22), MANTA_RAY, DARK_CRAB, TUNA_POTATO);
- add(food(23), KYREN_FISH_6, PSYKK_BAT_6);
- add(new Anglerfish(), ANGLERFISH);
- add(food(maxHP -> (int) Math.ceil(maxHP * .06)), STRAWBERRY);
- add(food(maxHP -> (int) Math.ceil(maxHP * .05)), WATERMELON_SLICE);
- add(food(perc(.1, 1)), COOKED_SWEETCORN, SWEETCORN_7088 /* Bowl of cooked sweetcorn */);
- add(combo(food(1), boost(DEFENCE, perc(.02, 1))), CABBAGE_1967 /* Draynor Manor */);
- add(combo(2, food(8), heal(RUN_ENERGY, 5)), PAPAYA_FRUIT);
- add(range(food(5), food(7)), THIN_SNAIL_MEAT);
- add(range(food(7), food(9)), FAT_SNAIL_MEAT);
-
- // Dorgeshuun Cuisine
- add(food(2), BAT_SHISH, COATED_FROGS_LEGS, FILLETS, FINGERS, FROGBURGER, FROGSPAWN_GUMBO, GREEN_GLOOP_SOUP,
- GRUBS__LA_MODE, MUSHROOMS, ROAST_FROG);
- add(food(3), LOACH);
- add(range(food(3), food(6)), FROG_SPAWN);
- add(range(food(6), food(10)), COOKED_SLIMY_EEL);
- add(range(food(8), food(12)), CAVE_EEL);
- add(food(10), EEL_SUSHI);
-
- // Alcoholic Beverages
- add(combo(food(11), dec(ATTACK, 2)), JUG_OF_WINE);
- add(combo(food(14), dec(ATTACK, 3)), BOTTLE_OF_WINE);
- add(combo(2, food(5), boost(STRENGTH, 6), heal(ATTACK, -4)), PREMADE_WIZ_BLZD, WIZARD_BLIZZARD);
- add(combo(2, food(5), boost(STRENGTH, 4), heal(ATTACK, -3)), PREMADE_SGG, SHORT_GREEN_GUY);
- add(combo(2, food(5), boost(STRENGTH, 7), heal(ATTACK, -4)), PREMADE_DR_DRAGON, DRUNK_DRAGON);
- add(combo(2, food(5), boost(STRENGTH, 7), heal(ATTACK, -4)), PREMADE_CHOC_SDY, CHOC_SATURDAY);
-
- // Sq'irk Juice
- add(heal(RUN_ENERGY, 5), WINTER_SQIRKJUICE);
- add(combo(heal(RUN_ENERGY, 10), boost(THIEVING, 1)), SPRING_SQIRKJUICE);
- add(combo(heal(RUN_ENERGY, 15), boost(THIEVING, 2)), AUTUMN_SQIRKJUICE);
- add(combo(heal(RUN_ENERGY, 20), boost(THIEVING, 3)), SUMMER_SQIRKJUICE);
-
- // Combat potions
- add(boost(ATTACK, perc(.10, 3)), ATTACK_POTION1, ATTACK_POTION2, ATTACK_POTION3, ATTACK_POTION4);
- add(boost(STRENGTH, perc(.10, 3)), STRENGTH_POTION1, STRENGTH_POTION2, STRENGTH_POTION3, STRENGTH_POTION4);
- add(boost(DEFENCE, perc(.10, 3)), DEFENCE_POTION1, DEFENCE_POTION2, DEFENCE_POTION3, DEFENCE_POTION4);
- add(boost(MAGIC, 4), MAGIC_POTION1, MAGIC_POTION2, MAGIC_POTION3, MAGIC_POTION4);
- add(boost(RANGED, perc(.10, 4)), RANGING_POTION1, RANGING_POTION2, RANGING_POTION3, RANGING_POTION4);
- add(combo(2, boost(ATTACK, perc(.10, 3)), boost(STRENGTH, perc(.10, 3))), COMBAT_POTION1, COMBAT_POTION2, COMBAT_POTION3, COMBAT_POTION4);
- add(boost(ATTACK, perc(.15, 5)), SUPER_ATTACK1, SUPER_ATTACK2, SUPER_ATTACK3, SUPER_ATTACK4);
- add(boost(STRENGTH, perc(.15, 5)), SUPER_STRENGTH1, SUPER_STRENGTH2, SUPER_STRENGTH3, SUPER_STRENGTH4);
- add(boost(DEFENCE, perc(.15, 5)), SUPER_DEFENCE1, SUPER_DEFENCE2, SUPER_DEFENCE3, SUPER_DEFENCE4);
- add(boost(MAGIC, 3), MAGIC_ESSENCE1, MAGIC_ESSENCE2, MAGIC_ESSENCE3, MAGIC_ESSENCE4);
- add(combo(3, boost(ATTACK, perc(.15, 5)), boost(STRENGTH, perc(.15, 5)), boost(DEFENCE, perc(.15, 5))), SUPER_COMBAT_POTION1, SUPER_COMBAT_POTION2, SUPER_COMBAT_POTION3, SUPER_COMBAT_POTION4);
- add(combo(3, boost(ATTACK, perc(.20, 2)), boost(STRENGTH, perc(.12, 2)), heal(PRAYER, perc(.10, 0)), heal(DEFENCE, perc(.10, -2)), new BoostedStatBoost(HITPOINTS, false, perc(-.12, 0))), ZAMORAK_BREW1, ZAMORAK_BREW2, ZAMORAK_BREW3, ZAMORAK_BREW4);
- add(new SaradominBrew(0.15, 0.2, 0.1, 2, 2), SARADOMIN_BREW1, SARADOMIN_BREW2, SARADOMIN_BREW3, SARADOMIN_BREW4);
- add(boost(RANGED, perc(.15, 5)), SUPER_RANGING_1, SUPER_RANGING_2, SUPER_RANGING_3, SUPER_RANGING_4);
- add(boost(MAGIC, perc(.15, 5)), SUPER_MAGIC_POTION_1, SUPER_MAGIC_POTION_2, SUPER_MAGIC_POTION_3, SUPER_MAGIC_POTION_4);
- add(combo(2, boost(RANGED, perc(0.1, 4)), boost(DEFENCE, perc(0.15, 5))), BASTION_POTION1, BASTION_POTION2, BASTION_POTION3, BASTION_POTION4);
- add(combo(2, boost(MAGIC, 4), boost(DEFENCE, perc(0.15, 5))), BATTLEMAGE_POTION1, BATTLEMAGE_POTION2, BATTLEMAGE_POTION3, BATTLEMAGE_POTION4);
-
- // Regular overload (NMZ)
- add(combo(5, boost(ATTACK, perc(.15, 5)), boost(STRENGTH, perc(.15, 5)), boost(DEFENCE, perc(.15, 5)), boost(RANGED, perc(.15, 5)), boost(MAGIC, perc(.15, 5)), heal(HITPOINTS, -50)), OVERLOAD_1, OVERLOAD_2, OVERLOAD_3, OVERLOAD_4);
-
- // Bandages (Castle Wars)
- add(new CastleWarsBandage(), BANDAGES);
-
- // Recovery potions
- add(combo(5, heal(ATTACK, perc(.30, 10)), heal(STRENGTH, perc(.30, 10)), heal(DEFENCE, perc(.30, 10)), heal(RANGED, perc(.30, 10)), heal(MAGIC, perc(.30, 10))), RESTORE_POTION1, RESTORE_POTION2, RESTORE_POTION3, RESTORE_POTION4);
- add(heal(RUN_ENERGY, 10), ENERGY_POTION1, ENERGY_POTION2, ENERGY_POTION3, ENERGY_POTION4);
- add(new PrayerPotion(7), PRAYER_POTION1, PRAYER_POTION2, PRAYER_POTION3, PRAYER_POTION4);
- add(heal(RUN_ENERGY, 20), SUPER_ENERGY1, SUPER_ENERGY2, SUPER_ENERGY3, SUPER_ENERGY4);
- add(new SuperRestore(.25, 8), SUPER_RESTORE1, SUPER_RESTORE2, SUPER_RESTORE3, SUPER_RESTORE4);
- add(new SuperRestore(.25, 9), SANFEW_SERUM1, SANFEW_SERUM2, SANFEW_SERUM3, SANFEW_SERUM4);
- add(heal(RUN_ENERGY, 20), STAMINA_POTION1, STAMINA_POTION2, STAMINA_POTION3, STAMINA_POTION4);
-
- // Raids potions (+)
- add(combo(5, boost(ATTACK, perc(.16, 6)), boost(STRENGTH, perc(.16, 6)), boost(DEFENCE, perc(.16, 6)), boost(RANGED, perc(.16, 6)), boost(MAGIC, perc(.16, 6)), heal(HITPOINTS, -50)), OVERLOAD_1_20993, OVERLOAD_2_20994, OVERLOAD_3_20995, OVERLOAD_4_20996);
- add(combo(3, boost(ATTACK, perc(.16, 6)), boost(STRENGTH, perc(.16, 6)), boost(DEFENCE, perc(.16, 6))), ELDER_1_20921, ELDER_2_20922, ELDER_3_20923, ELDER_4_20924);
- add(combo(2, boost(RANGED, perc(.16, 6)), boost(DEFENCE, perc(.16, 6))), TWISTED_1_20933, TWISTED_2_20934, TWISTED_3_20935, TWISTED_4_20936);
- add(combo(2, boost(MAGIC, perc(.16, 6)), boost(DEFENCE, perc(.16, 6))), KODAI_1_20945, KODAI_2_20946, KODAI_3_20947, KODAI_4_20948);
- add(new SuperRestore(.30, 11), REVITALISATION_1_20957, REVITALISATION_2_20958, REVITALISATION_3_20959, REVITALISATION_4_20960);
- add(new SaradominBrew(0.15, 0.2, 0.1, 5, 4), XERICS_AID_1_20981, XERICS_AID_2_20982, XERICS_AID_3_20983, XERICS_AID_4_20984);
-
- // Raids potions
- add(combo(5, boost(ATTACK, perc(.13, 5)), boost(STRENGTH, perc(.13, 5)), boost(DEFENCE, perc(.13, 5)), boost(RANGED, perc(.13, 5)), boost(MAGIC, perc(.13, 5)), heal(HITPOINTS, -50)), OVERLOAD_1_20989, OVERLOAD_2_20990, OVERLOAD_3_20991, OVERLOAD_4_20992);
- add(combo(3, boost(ATTACK, perc(.13, 5)), boost(STRENGTH, perc(.13, 5)), boost(DEFENCE, perc(.13, 5))), ELDER_POTION_1, ELDER_POTION_2, ELDER_POTION_3, ELDER_POTION_4);
- add(combo(2, boost(RANGED, perc(.13, 5)), boost(DEFENCE, perc(.13, 5))), TWISTED_POTION_1, TWISTED_POTION_2, TWISTED_POTION_3, TWISTED_POTION_4);
- add(combo(2, boost(MAGIC, perc(.13, 5)), boost(DEFENCE, perc(.13, 5))), KODAI_POTION_1, KODAI_POTION_2, KODAI_POTION_3, KODAI_POTION_4);
-
- // Raids potions (-)
- add(combo(5, boost(ATTACK, perc(.10, 4)), boost(STRENGTH, perc(.10, 4)), boost(DEFENCE, perc(.10, 4)), boost(RANGED, perc(.10, 4)), boost(MAGIC, perc(.10, 4)), heal(HITPOINTS, -50)), OVERLOAD_1_20985, OVERLOAD_2_20986, OVERLOAD_3_20987, OVERLOAD_4_20988);
- add(combo(3, boost(ATTACK, perc(.10, 4)), boost(STRENGTH, perc(.10, 4)), boost(DEFENCE, perc(.10, 4))), ELDER_1, ELDER_2, ELDER_3, ELDER_4);
- add(combo(3, boost(RANGED, perc(.10, 4)), boost(DEFENCE, perc(.10, 4))), TWISTED_1, TWISTED_2, TWISTED_3, TWISTED_4);
- add(combo(3, boost(MAGIC, perc(.10, 4)), boost(DEFENCE, perc(.10, 4))), KODAI_1, KODAI_2, KODAI_3, KODAI_4);
-
- // Skill potions
- add(boost(AGILITY, 3), AGILITY_POTION1, AGILITY_POTION2, AGILITY_POTION3, AGILITY_POTION4);
- add(boost(FISHING, 3), FISHING_POTION1, FISHING_POTION2, FISHING_POTION3, FISHING_POTION4);
- add(boost(HUNTER, 3), HUNTER_POTION1, HUNTER_POTION2, HUNTER_POTION3, HUNTER_POTION4);
- add(combo(2, boost(HITPOINTS, 5), heal(RUN_ENERGY, 5)), GUTHIX_REST1, GUTHIX_REST2, GUTHIX_REST3, GUTHIX_REST4);
-
- // Misc/run energy
- add(heal(RUN_ENERGY, 10), WHITE_TREE_FRUIT);
- add(heal(RUN_ENERGY, 30), STRANGE_FRUIT);
- add(heal(RUN_ENERGY, 50), MINT_CAKE);
- add(combo(food(12), heal(RUN_ENERGY, 50)), GOUT_TUBER);
-
- // Pies
- add(combo(2, heal(HITPOINTS, 6), boost(FARMING, 3)), GARDEN_PIE, HALF_A_GARDEN_PIE);
- add(combo(2, heal(HITPOINTS, 6), boost(FISHING, 3)), FISH_PIE, HALF_A_FISH_PIE);
- add(combo(2, heal(HITPOINTS, 7), boost(HERBLORE, 4)), BOTANICAL_PIE, HALF_A_BOTANICAL_PIE);
- add(combo(2, heal(HITPOINTS, 8), boost(CRAFTING, 4)), MUSHROOM_PIE, HALF_A_MUSHROOM_PIE);
- add(combo(2, heal(HITPOINTS, 8), boost(FISHING, 5)), ADMIRAL_PIE, HALF_AN_ADMIRAL_PIE);
- add(combo(2, heal(HITPOINTS, 11), boost(SLAYER, 5), boost(RANGED, 4)), WILD_PIE, HALF_A_WILD_PIE);
- add(combo(2, heal(HITPOINTS, 11), boost(AGILITY, 5), heal(RUN_ENERGY, 10)), SUMMER_PIE, HALF_A_SUMMER_PIE);
-
- // Other
- add(combo(range(food(1), food(3)), heal(RUN_ENERGY, 10)), PURPLE_SWEETS_10476);
- add(new SpicyStew(), SPICY_STEW);
- add(boost(MAGIC, perc(.10, 1)), IMBUED_HEART);
- add(combo(boost(ATTACK, 2), boost(STRENGTH, 1), heal(DEFENCE, -1)), JANGERBERRIES);
-
- log.debug("{} items; {} behaviours loaded", effects.size(), new HashSet<>(effects.values()).size());
- }
-
- private final Map effects = new HashMap<>();
-
- private void add(Effect effect, int... items)
- {
- assert items.length > 0;
- for (int item : items)
- {
- Effect prev = effects.put(item, effect);
- assert prev == null : "Item already added";
- }
- }
-
- public Effect get(int id)
- {
- return effects.get(id);
- }
-}
diff --git a/RuneLitePlus/src/main/java/net/runelite/client/plugins/keptondeath/ActuallyTradeableItem.java b/RuneLitePlus/src/main/java/net/runelite/client/plugins/keptondeath/ActuallyTradeableItem.java
deleted file mode 100644
index 17e9354f0e..0000000000
--- a/RuneLitePlus/src/main/java/net/runelite/client/plugins/keptondeath/ActuallyTradeableItem.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- * Copyright (c) 2018, TheStonedTurtle
- * 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.client.plugins.keptondeath;
-
-import java.util.HashSet;
-import static api.ItemID.ADAMANT_FIRE_ARROWS;
-import static api.ItemID.ADAMANT_FIRE_ARROWS_2539;
-import static api.ItemID.AIR_RUNE_PACK;
-import static api.ItemID.AMETHYST_FIRE_ARROWS;
-import static api.ItemID.AMETHYST_FIRE_ARROWS_21330;
-import static api.ItemID.AMULET_OF_GLORY1;
-import static api.ItemID.AMULET_OF_GLORY2;
-import static api.ItemID.AMULET_OF_GLORY3;
-import static api.ItemID.AMULET_OF_GLORY5;
-import static api.ItemID.AMULET_OF_GLORY_T1;
-import static api.ItemID.AMULET_OF_GLORY_T2;
-import static api.ItemID.AMULET_OF_GLORY_T3;
-import static api.ItemID.AMULET_OF_GLORY_T5;
-import static api.ItemID.APPLES1;
-import static api.ItemID.APPLES2;
-import static api.ItemID.APPLES3;
-import static api.ItemID.APPLES4;
-import static api.ItemID.BANANAS1;
-import static api.ItemID.BANANAS2;
-import static api.ItemID.BANANAS3;
-import static api.ItemID.BANANAS4;
-import static api.ItemID.BASKET_PACK;
-import static api.ItemID.BLACK_MASK_1;
-import static api.ItemID.BLACK_MASK_2;
-import static api.ItemID.BLACK_MASK_3;
-import static api.ItemID.BLACK_MASK_4;
-import static api.ItemID.BLACK_MASK_5;
-import static api.ItemID.BLACK_MASK_6;
-import static api.ItemID.BLACK_MASK_7;
-import static api.ItemID.BLACK_MASK_8;
-import static api.ItemID.BLACK_MASK_9;
-import static api.ItemID.BLACK_SATCHEL;
-import static api.ItemID.BRONZE_FIRE_ARROWS;
-import static api.ItemID.BRONZE_FIRE_ARROWS_942;
-import static api.ItemID.BURNING_AMULET1;
-import static api.ItemID.BURNING_AMULET2;
-import static api.ItemID.BURNING_AMULET3;
-import static api.ItemID.BURNING_AMULET4;
-import static api.ItemID.CAKE;
-import static api.ItemID.CHAOS_RUNE_PACK;
-import static api.ItemID.CHOCOLATE_CAKE;
-import static api.ItemID.CHOCOLATE_SLICE;
-import static api.ItemID.COMBAT_BRACELET1;
-import static api.ItemID.COMBAT_BRACELET2;
-import static api.ItemID.COMBAT_BRACELET3;
-import static api.ItemID.COMBAT_BRACELET5;
-import static api.ItemID.DRAGON_FIRE_ARROWS;
-import static api.ItemID.DRAGON_FIRE_ARROWS_11222;
-import static api.ItemID.EARTH_RUNE_PACK;
-import static api.ItemID.FEATHER_PACK;
-import static api.ItemID.FIRE_RUNE_PACK;
-import static api.ItemID.GAMES_NECKLACE1;
-import static api.ItemID.GAMES_NECKLACE2;
-import static api.ItemID.GAMES_NECKLACE3;
-import static api.ItemID.GAMES_NECKLACE4;
-import static api.ItemID.GAMES_NECKLACE5;
-import static api.ItemID.GAMES_NECKLACE6;
-import static api.ItemID.GAMES_NECKLACE7;
-import static api.ItemID.GOLD_SATCHEL;
-import static api.ItemID.GREEN_SATCHEL;
-import static api.ItemID.HALF_AN_ADMIRAL_PIE;
-import static api.ItemID.HALF_AN_APPLE_PIE;
-import static api.ItemID.HALF_A_BOTANICAL_PIE;
-import static api.ItemID.HALF_A_FISH_PIE;
-import static api.ItemID.HALF_A_GARDEN_PIE;
-import static api.ItemID.HALF_A_MEAT_PIE;
-import static api.ItemID.HALF_A_MUSHROOM_PIE;
-import static api.ItemID.HALF_A_REDBERRY_PIE;
-import static api.ItemID.HALF_A_SUMMER_PIE;
-import static api.ItemID.HALF_A_WILD_PIE;
-import static api.ItemID.IRON_FIRE_ARROWS;
-import static api.ItemID.IRON_FIRE_ARROWS_2533;
-import static api.ItemID.MIND_RUNE_PACK;
-import static api.ItemID.MITHRIL_FIRE_ARROWS;
-import static api.ItemID.MITHRIL_FIRE_ARROWS_2537;
-import static api.ItemID.NECKLACE_OF_PASSAGE1;
-import static api.ItemID.NECKLACE_OF_PASSAGE2;
-import static api.ItemID.NECKLACE_OF_PASSAGE3;
-import static api.ItemID.NECKLACE_OF_PASSAGE4;
-import static api.ItemID.ORANGES1;
-import static api.ItemID.ORANGES2;
-import static api.ItemID.ORANGES3;
-import static api.ItemID.ORANGES4;
-import static api.ItemID.PLAIN_SATCHEL;
-import static api.ItemID.PLANT_POT_PACK;
-import static api.ItemID.RED_SATCHEL;
-import static api.ItemID.RING_OF_DUELING1;
-import static api.ItemID.RING_OF_DUELING2;
-import static api.ItemID.RING_OF_DUELING3;
-import static api.ItemID.RING_OF_DUELING4;
-import static api.ItemID.RING_OF_DUELING5;
-import static api.ItemID.RING_OF_DUELING6;
-import static api.ItemID.RING_OF_DUELING7;
-import static api.ItemID.RING_OF_WEALTH_1;
-import static api.ItemID.RING_OF_WEALTH_2;
-import static api.ItemID.RING_OF_WEALTH_3;
-import static api.ItemID.RING_OF_WEALTH_4;
-import static api.ItemID.RING_OF_WEALTH_I;
-import static api.ItemID.RING_OF_WEALTH_I1;
-import static api.ItemID.RING_OF_WEALTH_I2;
-import static api.ItemID.RING_OF_WEALTH_I3;
-import static api.ItemID.RING_OF_WEALTH_I4;
-import static api.ItemID.RING_OF_WEALTH_I5;
-import static api.ItemID.RUNE_FIRE_ARROWS;
-import static api.ItemID.RUNE_FIRE_ARROWS_2541;
-import static api.ItemID.RUNE_SATCHEL;
-import static api.ItemID.SACK_PACK;
-import static api.ItemID.SKILLS_NECKLACE1;
-import static api.ItemID.SKILLS_NECKLACE2;
-import static api.ItemID.SKILLS_NECKLACE3;
-import static api.ItemID.SKILLS_NECKLACE5;
-import static api.ItemID.SLICE_OF_CAKE;
-import static api.ItemID.STEEL_FIRE_ARROWS;
-import static api.ItemID.STEEL_FIRE_ARROWS_2535;
-import static api.ItemID.STRAWBERRIES1;
-import static api.ItemID.STRAWBERRIES2;
-import static api.ItemID.STRAWBERRIES3;
-import static api.ItemID.STRAWBERRIES4;
-import static api.ItemID.TOMATOES1;
-import static api.ItemID.TOMATOES2;
-import static api.ItemID.TOMATOES3;
-import static api.ItemID.TOMATOES4;
-import static api.ItemID.TZHAAR_AIR_RUNE_PACK;
-import static api.ItemID.TZHAAR_EARTH_RUNE_PACK;
-import static api.ItemID.TZHAAR_FIRE_RUNE_PACK;
-import static api.ItemID.TZHAAR_WATER_RUNE_PACK;
-import static api.ItemID.UNFINISHED_BROAD_BOLT_PACK;
-import static api.ItemID.WATER_RUNE_PACK;
-import static api.ItemID._12_ANCHOVY_PIZZA;
-import static api.ItemID._12_MEAT_PIZZA;
-import static api.ItemID._12_PINEAPPLE_PIZZA;
-import static api.ItemID._12_PLAIN_PIZZA;
-import static api.ItemID._23_CAKE;
-import static api.ItemID._23_CHOCOLATE_CAKE;
-
-/**
- * Certain items aren't tradeable via the GE but can be traded between players.
- * The {@link api.ItemDefinition}'s `isTradeable` value is based on GE trade-ability so we need
- * to account for these items. These items should only be kept if protected based on item value.
- */
-public enum ActuallyTradeableItem
-{
- // Item Packs
- RUNE_PACKS(AIR_RUNE_PACK, WATER_RUNE_PACK, EARTH_RUNE_PACK, FIRE_RUNE_PACK, CHAOS_RUNE_PACK, MIND_RUNE_PACK),
- TZHAAR_PACKS(TZHAAR_AIR_RUNE_PACK, TZHAAR_WATER_RUNE_PACK, TZHAAR_EARTH_RUNE_PACK, TZHAAR_FIRE_RUNE_PACK),
- OTHER_PACKS(BASKET_PACK, FEATHER_PACK, PLANT_POT_PACK, SACK_PACK, UNFINISHED_BROAD_BOLT_PACK),
- // Equipment
- BLACK_MASK(BLACK_MASK_1, BLACK_MASK_2, BLACK_MASK_3, BLACK_MASK_4, BLACK_MASK_5, BLACK_MASK_6, BLACK_MASK_7, BLACK_MASK_8, BLACK_MASK_9),
- SATCHELS(BLACK_SATCHEL, GOLD_SATCHEL, GREEN_SATCHEL, PLAIN_SATCHEL, RED_SATCHEL, RUNE_SATCHEL),
- FIRE_ARROWS(BRONZE_FIRE_ARROWS, IRON_FIRE_ARROWS, STEEL_FIRE_ARROWS, MITHRIL_FIRE_ARROWS, ADAMANT_FIRE_ARROWS, RUNE_FIRE_ARROWS, AMETHYST_FIRE_ARROWS, DRAGON_FIRE_ARROWS),
- FIRE_ARROWS_2(BRONZE_FIRE_ARROWS_942, IRON_FIRE_ARROWS_2533, STEEL_FIRE_ARROWS_2535, MITHRIL_FIRE_ARROWS_2537, ADAMANT_FIRE_ARROWS_2539, RUNE_FIRE_ARROWS_2541, AMETHYST_FIRE_ARROWS_21330, DRAGON_FIRE_ARROWS_11222),
- // Food Items
- HALF_A(HALF_A_GARDEN_PIE, HALF_A_MEAT_PIE, HALF_A_MUSHROOM_PIE, HALF_A_REDBERRY_PIE, HALF_A_BOTANICAL_PIE, HALF_A_FISH_PIE, HALF_A_SUMMER_PIE, HALF_A_WILD_PIE, HALF_AN_ADMIRAL_PIE, HALF_AN_APPLE_PIE),
- PIZZA(_12_ANCHOVY_PIZZA, _12_MEAT_PIZZA, _12_PINEAPPLE_PIZZA, _12_PLAIN_PIZZA),
- CAKES(CAKE, _23_CAKE, SLICE_OF_CAKE, CHOCOLATE_CAKE, _23_CHOCOLATE_CAKE, CHOCOLATE_SLICE),
- BASKETS(APPLES1, APPLES2, APPLES3, APPLES4, BANANAS1, BANANAS2, BANANAS3, BANANAS4, ORANGES1, ORANGES2, ORANGES3, ORANGES4, STRAWBERRIES1, STRAWBERRIES2, STRAWBERRIES3, STRAWBERRIES4, TOMATOES1, TOMATOES2, TOMATOES3, TOMATOES4),
- // Charged Jewelery
- BURNING_AMULET(BURNING_AMULET1, BURNING_AMULET2, BURNING_AMULET3, BURNING_AMULET4),
- NECKLACE_OF_PASSAGE(NECKLACE_OF_PASSAGE1, NECKLACE_OF_PASSAGE2, NECKLACE_OF_PASSAGE3, NECKLACE_OF_PASSAGE4),
- RING_OF_DUELING(RING_OF_DUELING1, RING_OF_DUELING2, RING_OF_DUELING3, RING_OF_DUELING4, RING_OF_DUELING5, RING_OF_DUELING6, RING_OF_DUELING7),
- GAMES_NECKLACE(GAMES_NECKLACE1, GAMES_NECKLACE2, GAMES_NECKLACE3, GAMES_NECKLACE4, GAMES_NECKLACE5, GAMES_NECKLACE6, GAMES_NECKLACE7),
- COMBAT_BRACELET(COMBAT_BRACELET1, COMBAT_BRACELET2, COMBAT_BRACELET3, COMBAT_BRACELET5),
- RING_OF_WEALTH(RING_OF_WEALTH_I, RING_OF_WEALTH_1, RING_OF_WEALTH_I1, RING_OF_WEALTH_2, RING_OF_WEALTH_I2, RING_OF_WEALTH_3, RING_OF_WEALTH_I3, RING_OF_WEALTH_4, RING_OF_WEALTH_I4, RING_OF_WEALTH_I5),
- AMULET_OF_GLORY(AMULET_OF_GLORY1, AMULET_OF_GLORY2, AMULET_OF_GLORY3, AMULET_OF_GLORY5),
- AMULET_OF_GLORY_T(AMULET_OF_GLORY_T1, AMULET_OF_GLORY_T2, AMULET_OF_GLORY_T3, AMULET_OF_GLORY_T5),
- SKILLS_NECKLACE(SKILLS_NECKLACE1, SKILLS_NECKLACE2, SKILLS_NECKLACE3, SKILLS_NECKLACE5),
- ;
-
- private final int[] ids;
-
- private static final HashSet ID_SET;
-
- static
- {
- ID_SET = new HashSet<>();
- for (ActuallyTradeableItem p : values())
- {
- for (int id : p.ids)
- {
- ID_SET.add(id);
- }
- }
- }
-
- ActuallyTradeableItem(int... ids)
- {
- this.ids = ids;
- }
-
- public static Boolean check(int id)
- {
- return ID_SET.contains(id);
- }
-}
diff --git a/RuneLitePlus/src/main/java/net/runelite/client/plugins/menuentryswapper/Parse.java b/RuneLitePlus/src/main/java/net/runelite/client/plugins/menuentryswapper/Parse.java
deleted file mode 100644
index 75a225589c..0000000000
--- a/RuneLitePlus/src/main/java/net/runelite/client/plugins/menuentryswapper/Parse.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package net.runelite.client.plugins.menuentryswapper;
-
-import com.google.common.base.Splitter;
-
-public class Parse
-{
- public static boolean parse(String value)
- {
- try
- {
- Splitter NEWLINE_SPLITTER = Splitter
- .on("\n")
- .omitEmptyStrings()
- .trimResults();
-
- NEWLINE_SPLITTER.withKeyValueSeparator(':').split(value);
- return true;
- }
- catch (IllegalArgumentException ex)
- {
- return false;
- }
- }
-}
diff --git a/RuneLitePlus/src/main/java/net/runelite/client/plugins/mining/MiningOverlay.java b/RuneLitePlus/src/main/java/net/runelite/client/plugins/mining/MiningOverlay.java
deleted file mode 100644
index 1e4dda5bd4..0000000000
--- a/RuneLitePlus/src/main/java/net/runelite/client/plugins/mining/MiningOverlay.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Copyright (c) 2018, Seth
- * 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.client.plugins.mining;
-
-import com.google.common.collect.ImmutableSet;
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Graphics2D;
-import java.time.Duration;
-import java.time.Instant;
-import java.util.Set;
-import javax.inject.Inject;
-import static api.AnimationID.MINING_MOTHERLODE_ADAMANT;
-import static api.AnimationID.MINING_MOTHERLODE_BLACK;
-import static api.AnimationID.MINING_MOTHERLODE_BRONZE;
-import static api.AnimationID.MINING_MOTHERLODE_DRAGON;
-import static api.AnimationID.MINING_MOTHERLODE_DRAGON_ORN;
-import static api.AnimationID.MINING_MOTHERLODE_INFERNAL;
-import static api.AnimationID.MINING_MOTHERLODE_IRON;
-import static api.AnimationID.MINING_MOTHERLODE_MITHRIL;
-import static api.AnimationID.MINING_MOTHERLODE_RUNE;
-import static api.AnimationID.MINING_MOTHERLODE_STEEL;
-import api.Client;
-import net.runelite.client.ui.overlay.Overlay;
-import net.runelite.client.ui.overlay.OverlayPosition;
-import net.runelite.client.ui.overlay.components.LineComponent;
-import net.runelite.client.ui.overlay.components.PanelComponent;
-import net.runelite.client.ui.overlay.components.TitleComponent;
-
-class MiningOverlay extends Overlay
-{
- private static final Set MINING_ANIMATION_IDS = ImmutableSet.of(
- MINING_MOTHERLODE_BRONZE, MINING_MOTHERLODE_IRON, MINING_MOTHERLODE_STEEL,
- MINING_MOTHERLODE_BLACK, MINING_MOTHERLODE_MITHRIL, MINING_MOTHERLODE_ADAMANT,
- MINING_MOTHERLODE_RUNE, MINING_MOTHERLODE_DRAGON, MINING_MOTHERLODE_DRAGON_ORN,
- MINING_MOTHERLODE_INFERNAL
- );
-
- private final Client client;
- private final MiningPlugin plugin;
- private final MiningConfig config;
- private final PanelComponent panelComponent = new PanelComponent();
-
- @Inject
- MiningOverlay(Client client, MiningPlugin plugin, MiningConfig config)
- {
- setPosition(OverlayPosition.TOP_LEFT);
- this.client = client;
- this.plugin = plugin;
- this.config = config;
- }
-
- @Override
- public Dimension render(Graphics2D graphics)
- {
- if (!plugin.isInMlm() || !config.showMiningStats())
- {
- return null;
- }
-
- MiningSession session = plugin.getSession();
-
- if (session.getLastPayDirtMined() == null)
- {
- return null;
- }
-
- Duration statTimeout = Duration.ofMinutes(config.statTimeout());
- Duration sinceCut = Duration.between(session.getLastPayDirtMined(), Instant.now());
-
- if (sinceCut.compareTo(statTimeout) >= 0)
- {
- return null;
- }
-
- panelComponent.getChildren().clear();
-
- if (config.showMiningState())
- {
- if (MINING_ANIMATION_IDS.contains(client.getLocalPlayer().getAnimation()))
- {
- panelComponent.getChildren().add(TitleComponent.builder()
- .text("Mining")
- .color(Color.GREEN)
- .build());
- }
- else
- {
- panelComponent.getChildren().add(TitleComponent.builder()
- .text("NOT mining")
- .color(Color.RED)
- .build());
- }
- }
-
- panelComponent.getChildren().add(LineComponent.builder()
- .left("Pay-dirt mined:")
- .right(Integer.toString(session.getTotalMined()))
- .build());
-
- panelComponent.getChildren().add(LineComponent.builder()
- .left("Pay-dirt/hr:")
- .right(session.getRecentMined() > 2 ? Integer.toString(session.getPerHour()) : "")
- .build());
-
- return panelComponent.render(graphics);
- }
-}
diff --git a/RuneLitePlus/src/main/java/net/runelite/client/plugins/mining/MiningPlugin.java b/RuneLitePlus/src/main/java/net/runelite/client/plugins/mining/MiningPlugin.java
deleted file mode 100644
index c5256691b2..0000000000
--- a/RuneLitePlus/src/main/java/net/runelite/client/plugins/mining/MiningPlugin.java
+++ /dev/null
@@ -1,366 +0,0 @@
-/*
- * Copyright (c) 2018, Seth
- * Copyright (c) 2018, Adam
- * Copyright (c) 2018, Lars
- * 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.client.plugins.mining;
-
-import com.google.common.collect.ImmutableSet;
-import com.google.inject.Provides;
-import java.time.temporal.ChronoUnit;
-import java.util.HashSet;
-import java.util.Set;
-import javax.inject.Inject;
-import lombok.AccessLevel;
-import lombok.Getter;
-import api.Client;
-import api.GameObject;
-import api.GameState;
-import api.ItemID;
-import static api.ObjectID.ORE_VEIN_26661;
-import static api.ObjectID.ORE_VEIN_26662;
-import static api.ObjectID.ORE_VEIN_26663;
-import static api.ObjectID.ORE_VEIN_26664;
-import api.WallObject;
-import api.events.GameObjectChanged;
-import api.events.GameObjectDespawned;
-import api.events.GameObjectSpawned;
-import api.events.GameStateChanged;
-import net.runelite.client.callback.ClientThread;
-import net.runelite.client.config.ConfigManager;
-import net.runelite.client.eventbus.Subscribe;
-import net.runelite.client.plugins.Plugin;
-import net.runelite.client.plugins.PluginDescriptor;
-import net.runelite.client.plugins.PluginType;
-import net.runelite.client.task.Schedule;
-import net.runelite.client.ui.overlay.OverlayManager;
-
-@PluginDescriptor(
- name = "Mining",
- description = "Show helpful information about Mining",
- tags = {"mining", "skilling", "overlay"},
- type = PluginType.SKILLING,
- enabledByDefault = false
-)
-public class MiningPlugin extends Plugin
-{
- private static final Set MOTHERLODE_MAP_REGIONS = ImmutableSet.of(14679, 14680, 14681, 14935, 14936, 14937, 15191, 15192, 15193);
- private static final Set MINE_SPOTS = ImmutableSet.of(ORE_VEIN_26661, ORE_VEIN_26662, ORE_VEIN_26663, ORE_VEIN_26664);
- private static final Set MLM_ORE_TYPES = ImmutableSet.of(ItemID.RUNITE_ORE, ItemID.ADAMANTITE_ORE,
- ItemID.MITHRIL_ORE, ItemID.GOLD_ORE, ItemID.COAL, ItemID.GOLDEN_NUGGET);
- private static final Set MINING_ROCKS = ImmutableSet.of(
- // another website says depleted rocks are 7468, 7469
- // website says stoney 2902, 2962, 2963, 2964,
- 2231, 2257, 2584, 2704, 3722, 3723, 3748, 3790, 3791, 3803, 3804, 3805, 3806, 3807, 3808, 4437, 4438, 4676, 6669, 6670, 6671, 6672, 6673, 7453, 7454, 7455, 7456, 7457, 7458, 7459, 7460, 7461, 7462, 7463, 7464, 7467, 7470, 7484, 7485, 7486, 7487, 7488, 7489, 7490, 7491, 7492, 7493, 7494, 7495, 8727, 8828, 8829, 8830, 10079, 10080, 10081, 11441, 11924, 12590, 15127, 15128, 15213, 16464, 16514, 16515, 16521, 16522, 16523, 16524, 16534, 16535, 16545, 16549, 16550, 16998, 16999, 17042, 17043, 17064, 17065, 18817, 18840, 18952, 18953, 18954, 18961, 19849, 19969, 19970, 19971, 19972, 19973, 22665, 22667, 23280, 23281, 23640, 24146, 24147, 24148, 24557, 26873, 26874, 27984, 27985, 27987, 27988, 28596, 28597, 28752, 28753, 28890
- //2090, 2091, 2092, 2093, 2094, 2095, 2096, 2097, 2098, 2099, 2100, 2101, 2102, 2103, 2104, 2105, 2106, 2107, 2108, 2109, 2110, 2111, 2119, 2120, 2121, 2122, 2123, 2124, 2125, 2126, 2127, 2128, 2129, 2130, 2131, 2132, 2133, 2134, 2135, 2136, 2137, 2138, 2139, 2140, 2231, 2257, 2328, 3042, 3043, 3722, 3723, 3748, 3790, 3791, 3803, 3804, 4676, 6943, 6944, 6945, 6946, 6947, 6948, 9296, 9297, 9303, 9304, 9305, 9306, 9316, 9317, 9331, 9332, 9335, 9336, 9708, 9709, 9710, 9711, 9712, 9713, 9714, 9715, 9716, 9717, 9718, 9719, 9720, 9721, 9722, 9723, 9724, 9725, 9726, 9727, 9728, 9729, 9730, 9731, 9732, 9733, 9734, 9735, 9736, 9737, 10583, 10584, 10585, 10586, 10587, 10944, 10945, 10946, 10947, 10948, 10949, 11165, 11166, 11167, 11168, 11169, 11170, 11171, 11172, 11173, 11174, 11175, 11176, 11177, 11178, 11179, 11180, 11181, 11182, 11183, 11184, 11185, 11186, 11187, 11188, 11189, 11190, 11191, 11192, 11193, 11194, 11195, 11424, 11425, 11426, 11427, 11428, 11429, 11430, 11431, 11432, 11433, 11434, 11435, 11436, 11437, 11438, 11439, 11440, 11441, 11442, 11443, 11444, 11552, 11553, 11554, 11555, 11556, 11557, 11915, 11916, 11917, 11918, 11919, 11920, 11921, 11922, 11923, 11924, 11925, 11926, 11927, 11928, 11929, 11930, 11931, 11932, 11933, 11934, 11935, 11936, 11937, 11938, 11939, 11940, 11941, 11942, 11943, 11944, 11945, 11946, 11947, 11948, 11949, 11950, 11951, 11952, 11953, 11954, 11955, 11956, 11957, 11958, 11959, 11960, 11961, 11962, 11963, 11964, 11965
- //968, 1480, 1855, 4043, 4487, 7533, 9716, 21250, 1997, 2581, 2582, 2694, 2695, 2696, 2697, 2835, 2836, 2837, 2901, 2965, 3339, 3364, 4526, 4552, 4553, 4554, 4555, 4556, 4557, 4558, 4887, 5604, 5605, 5606, 5844, 5845, 5896, 5985, 5987, 6622, 6623, 6707, 6708, 6709, 7466, 8725, 8726, 8950, 8951, 8952, 9031, 9032, 10036, 10782, 10783, 10784, 10785, 10786, 10787, 10788, 11097, 11098, 11182, 11183, 11424, 11425, 12564, 12565, 12566, 12567, 12588, 12589, 12774, 14814, 14815, 14816, 14817, 15198, 15199, 15217, 15218, 15219, 15410, 15536, 15537, 16077, 16078, 16079, 16080, 16115, 16136, 16284, 16303, 17350, 17351, 17352, 17353, 17354, 17355, 17356, 17357, 17358, 17364, 17365, 17366, 17679, 17958, 17959, 17960, 17970, 17971, 17972, 18871, 18872, 18873, 19131, 21571, 21572, 21573, 22549, 22550, 22551, 23124, 23125, 23126, 23127, 23165, 23976, 23977, 23978, 23979, 23980, 23981, 24693, 24694, 24695, 24696, 24697, 24698, 24699, 24700, 24701, 24781, 25158, 25159, 25160, 25422, 25423, 26372, 26373, 26376, 26377, 26850, 26856, 28580, 29102, 29883, 29884, 29885, 30344, 30519, 30521, 30522, 30857, 30858, 31045, 31781, 31782, 31783, 31784, 31785, 31786, 31787, 31788, 31789
- );
- private static final int MAX_INVENTORY_SIZE = 28;
-
-// private static final int SACK_LARGE_SIZE = 162;
-// private static final int SACK_SIZE = 81;
-//
-// private static final int UPPER_FLOOR_HEIGHT = -500;
-
- @Inject
- private OverlayManager overlayManager;
-
- @Inject
- private MiningOverlay overlay;
-
- @Inject
- private MiningRocksOverlay rocksOverlay;
-
- @Inject
- private MiningConfig config;
-
- @Inject
- private Client client;
-
- @Inject
- private ClientThread clientThread;
-
- @Getter(AccessLevel.PACKAGE)
- private boolean inMlm;
-
- @Getter(AccessLevel.PACKAGE)
- private int curSackSize;
- @Getter(AccessLevel.PACKAGE)
- private int maxSackSize;
- @Getter(AccessLevel.PACKAGE)
- private Integer depositsLeft;
-
- private MiningSession session;
-
- @Getter(AccessLevel.PACKAGE)
- private final Set veins = new HashSet<>();
- @Getter(AccessLevel.PACKAGE)
- private final Set rocks = new HashSet<>();
-
- @Provides
- MiningConfig getConfig(ConfigManager configManager)
- {
- return configManager.getConfig(MiningConfig.class);
- }
-
- @Override
- protected void startUp()
- {
- overlayManager.add(overlay);
- overlayManager.add(rocksOverlay);
-// overlayManager.add(motherlodeGemOverlay);
-// overlayManager.add(motherlodeSackOverlay);
-
- session = new MiningSession();
- //inMlm = checkInMlm();
-
-// if (inMlm)
-// {
-// clientThread.invokeLater(this::refreshSackValues);
-// }
- }
-
- @Override
- protected void shutDown() throws Exception
- {
- overlayManager.remove(overlay);
- overlayManager.remove(rocksOverlay);
-// overlayManager.remove(motherlodeGemOverlay);
-// overlayManager.remove(motherlodeSackOverlay);
- session = null;
-// veins.clear();
- rocks.clear();
-
-// Widget sack = client.getWidget(WidgetInfo.MOTHERLODE_MINE);
-
-// clientThread.invokeLater(() ->
-// {
-// if (sack != null && sack.isHidden())
-// {
-// sack.setHidden(false);
-// }
-// });
- }
-
- public MiningSession getSession()
- {
- return session;
- }
-
-// @Subscribe
-// public void onVarbitChanged(VarbitChanged event)
-// {
-// if (inMlm)
-// {
-// refreshSackValues();
-// }
-// }
-
-// @Subscribe
-// public void onChatMessage(ChatMessage event)
-// {
-// if (!inMlm || event.getType() != ChatMessageType.FILTERED)
-// {
-// return;
-// }
-//
-// String chatMessage = event.getMessage();
-//
-// switch (chatMessage)
-// {
-// case "You manage to mine some pay-dirt.":
-// session.incrementPayDirtMined();
-// break;
-//
-// case "You just found a Diamond!":
-// session.incrementGemFound(ItemID.UNCUT_DIAMOND);
-// break;
-//
-// case "You just found a Ruby!":
-// session.incrementGemFound(ItemID.UNCUT_RUBY);
-// break;
-//
-// case "You just found an Emerald!":
-// session.incrementGemFound(ItemID.UNCUT_EMERALD);
-// break;
-//
-// case "You just found a Sapphire!":
-// session.incrementGemFound(ItemID.UNCUT_SAPPHIRE);
-// break;
-// }
-// }
-
- @Schedule(
- period = 1,
- unit = ChronoUnit.SECONDS
- )
-// public void checkMining()
-// {
-// if (!inMlm)
-// {
-// return;
-// }
-//
-// depositsLeft = calculateDepositsLeft();
-//
-// Instant lastPayDirtMined = session.getLastPayDirtMined();
-// if (lastPayDirtMined == null)
-// {
-// return;
-// }
-//
-// // reset recentPayDirtMined if you haven't mined anything recently
-// Duration statTimeout = Duration.ofMinutes(config.statTimeout());
-// Duration sinceMined = Duration.between(lastPayDirtMined, Instant.now());
-//
-// if (sinceMined.compareTo(statTimeout) >= 0)
-// {
-// session.resetRecent();
-// }
-// }
-
- @Subscribe
- public void onGameObjectSpawned(GameObjectSpawned event)
- {
- GameObject gameObject = event.getGameObject();
- if (MINING_ROCKS.contains(gameObject.getId()))
- {
- rocks.add(gameObject);
- }
- }
-
- @Subscribe
- public void onGameObjectChanged(GameObjectChanged event)
- {
- GameObject previous = event.getPrevious();
- GameObject gameObject = event.getGameObject();
- rocks.remove(previous);
- if (MINING_ROCKS.contains(gameObject.getId()))
- {
- rocks.add(gameObject);
- }
- }
-
- @Subscribe
- public void onGameObjectDespawned(GameObjectDespawned event)
- {
- GameObject gameObject = event.getGameObject();
- rocks.remove(gameObject);
- }
-
- @Subscribe
- public void onGameStateChanged(GameStateChanged event)
- {
- if (event.getGameState() == GameState.LOADING)
- {
- // on region changes the tiles get set to null
- rocks.clear();
- }
- }
-
-// private Integer calculateDepositsLeft()
-// {
-// if (maxSackSize == 0) // check if maxSackSize has been initialized
-// {
-// refreshSackValues();
-// }
-//
-// double depositsLeft = 0;
-// int nonPayDirtItems = 0;
-//
-// ItemContainer inventory = client.getItemContainer(InventoryID.INVENTORY);
-// if (inventory == null)
-// {
-// return null;
-// }
-//
-// Item[] result = inventory.getItems();
-// assert result != null;
-//
-// for (Item item : result)
-// {
-// // Assume that MLM ores are being banked and exclude them from the check,
-// // so the user doesn't see the Overlay switch between deposits left and N/A.
-// //
-// // Count other items at nonPayDirtItems so depositsLeft is calculated accordingly.
-// if (item.getId() != ItemID.PAYDIRT && item.getId() != -1 && !MLM_ORE_TYPES.contains(item.getId()))
-// {
-// nonPayDirtItems += 1;
-// }
-// }
-//
-// double inventorySpace = MAX_INVENTORY_SIZE - nonPayDirtItems;
-// double sackSizeRemaining = maxSackSize - curSackSize;
-//
-// if (inventorySpace > 0 && sackSizeRemaining > 0)
-// {
-// depositsLeft = Math.ceil(sackSizeRemaining / inventorySpace);
-// }
-// else if (inventorySpace == 0)
-// {
-// return null;
-// }
-//
-// return (int) depositsLeft;
-// }
-//
-// private boolean checkInMlm()
-// {
-// if (client.getGameState() != GameState.LOGGED_IN)
-// {
-// return false;
-// }
-//
-// int[] currentMapRegions = client.getMapRegions();
-//
-// // Verify that all regions exist in MOTHERLODE_MAP_REGIONS
-// for (int region : currentMapRegions)
-// {
-// if (!MOTHERLODE_MAP_REGIONS.contains(region))
-// {
-// return false;
-// }
-// }
-//
-// return true;
-// }
-//
-// private void refreshSackValues()
-// {
-// curSackSize = client.getVar(Varbits.SACK_NUMBER);
-// boolean sackUpgraded = client.getVar(Varbits.SACK_UPGRADED) == 1;
-// maxSackSize = sackUpgraded ? SACK_LARGE_SIZE : SACK_SIZE;
-// }
-//
-// /**
-// * Checks if the given point is "upstairs" in the mlm.
-// * The upper floor is actually on z=0.
-// * @param localPoint
-// * @return
-// */
-// boolean isUpstairs(LocalPoint localPoint)
-// {
-// return Perspective.getTileHeight(client, localPoint, 0) < UPPER_FLOOR_HEIGHT;
-// }
-}
diff --git a/RuneLitePlus/src/main/java/net/runelite/client/plugins/mining/MiningSession.java b/RuneLitePlus/src/main/java/net/runelite/client/plugins/mining/MiningSession.java
deleted file mode 100644
index b245268e8c..0000000000
--- a/RuneLitePlus/src/main/java/net/runelite/client/plugins/mining/MiningSession.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Copyright (c) 2018, Seth
- * 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.client.plugins.mining;
-
-import java.time.Duration;
-import java.time.Instant;
-import lombok.AccessLevel;
-import lombok.Getter;
-import lombok.extern.slf4j.Slf4j;
-import api.ItemID;
-
-@Slf4j
-public class MiningSession
-{
- private static final Duration HOUR = Duration.ofHours(1);
-
- private int perHour;
-
- private Instant lastPayDirtMined;
- private int totalMined;
-
- private Instant recentPayDirtMined;
- private int recentMined;
-
- @Getter(AccessLevel.PACKAGE)
- private Instant lastGemFound;
-
- @Getter(AccessLevel.PACKAGE)
- private int diamondsFound;
-
- @Getter(AccessLevel.PACKAGE)
- private int rubiesFound;
-
- @Getter(AccessLevel.PACKAGE)
- private int emeraldsFound;
-
- @Getter(AccessLevel.PACKAGE)
- private int sapphiresFound;
-
- public void incrementGemFound(int gemID)
- {
- lastGemFound = Instant.now();
-
- switch (gemID)
- {
- case ItemID.UNCUT_DIAMOND:
- diamondsFound++;
- break;
-
- case ItemID.UNCUT_RUBY:
- rubiesFound++;
- break;
-
- case ItemID.UNCUT_EMERALD:
- emeraldsFound++;
- break;
-
- case ItemID.UNCUT_SAPPHIRE:
- sapphiresFound++;
- break;
-
- default:
- log.error("Invalid gem type specified. The gem count will not be incremented.");
- }
- }
-
- public void incrementPayDirtMined()
- {
- Instant now = Instant.now();
-
- lastPayDirtMined = now;
- ++totalMined;
-
- if (recentMined == 0)
- {
- recentPayDirtMined = now;
- }
- ++recentMined;
-
- Duration timeSinceStart = Duration.between(recentPayDirtMined, now);
- if (!timeSinceStart.isZero())
- {
- perHour = (int) ((double) recentMined * (double) HOUR.toMillis() / (double) timeSinceStart.toMillis());
- }
- }
-
- public void resetRecent()
- {
- recentPayDirtMined = null;
- recentMined = 0;
- }
-
- public int getPerHour()
- {
- return perHour;
- }
-
- public Instant getLastPayDirtMined()
- {
- return lastPayDirtMined;
- }
-
- public int getTotalMined()
- {
- return totalMined;
- }
-
- public Instant getRecentPayDirtMined()
- {
- return recentPayDirtMined;
- }
-
- public int getRecentMined()
- {
- return recentMined;
- }
-}
diff --git a/RuneLitePlus/src/main/java/net/runelite/client/plugins/poh/PohIcons.java b/RuneLitePlus/src/main/java/net/runelite/client/plugins/poh/PohIcons.java
deleted file mode 100644
index 4985fe5f67..0000000000
--- a/RuneLitePlus/src/main/java/net/runelite/client/plugins/poh/PohIcons.java
+++ /dev/null
@@ -1,299 +0,0 @@
-/*
- * Copyright (c) 2018, Seth
- * 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.client.plugins.poh;
-
-import com.google.common.collect.ImmutableMap;
-import java.awt.image.BufferedImage;
-import java.util.Map;
-import lombok.Getter;
-import static api.NullObjectID.NULL_13615;
-import static api.NullObjectID.NULL_13618;
-import static api.NullObjectID.NULL_13620;
-import static api.NullObjectID.NULL_13622;
-import static api.NullObjectID.NULL_13625;
-import static api.NullObjectID.NULL_13627;
-import static api.NullObjectID.NULL_13629;
-import static api.NullObjectID.NULL_13632;
-import static api.NullObjectID.NULL_13634;
-import static api.NullObjectID.NULL_29228;
-import static api.NullObjectID.NULL_29229;
-import static api.ObjectID.ALTAR_13179;
-import static api.ObjectID.ALTAR_13180;
-import static api.ObjectID.ALTAR_13181;
-import static api.ObjectID.ALTAR_13182;
-import static api.ObjectID.ALTAR_13183;
-import static api.ObjectID.ALTAR_13184;
-import static api.ObjectID.ALTAR_13185;
-import static api.ObjectID.ALTAR_13186;
-import static api.ObjectID.ALTAR_13187;
-import static api.ObjectID.ALTAR_13188;
-import static api.ObjectID.ALTAR_13189;
-import static api.ObjectID.ALTAR_13190;
-import static api.ObjectID.ALTAR_13191;
-import static api.ObjectID.ALTAR_13192;
-import static api.ObjectID.ALTAR_13193;
-import static api.ObjectID.ALTAR_13194;
-import static api.ObjectID.ALTAR_13196;
-import static api.ObjectID.ALTAR_13197;
-import static api.ObjectID.ALTAR_13198;
-import static api.ObjectID.ALTAR_13199;
-import static api.ObjectID.ALTAR_OF_THE_OCCULT;
-import static api.ObjectID.AMULET_OF_GLORY;
-import static api.ObjectID.ANCIENT_ALTAR;
-import static api.ObjectID.ANNAKARL_PORTAL;
-import static api.ObjectID.ANNAKARL_PORTAL_29349;
-import static api.ObjectID.ANNAKARL_PORTAL_29357;
-import static api.ObjectID.ARDOUGNE_PORTAL;
-import static api.ObjectID.ARDOUGNE_PORTAL_13626;
-import static api.ObjectID.ARDOUGNE_PORTAL_13633;
-import static api.ObjectID.ARMOUR_REPAIR_STAND;
-import static api.ObjectID.BASIC_JEWELLERY_BOX;
-import static api.ObjectID.CARRALLANGAR_PORTAL;
-import static api.ObjectID.CARRALLANGAR_PORTAL_33437;
-import static api.ObjectID.CARRALLANGAR_PORTAL_33440;
-import static api.ObjectID.CATHERBY_PORTAL;
-import static api.ObjectID.CATHERBY_PORTAL_33435;
-import static api.ObjectID.CATHERBY_PORTAL_33438;
-import static api.ObjectID.DARK_ALTAR;
-import static api.ObjectID.DIGSITE_PENDANT;
-import static api.ObjectID.DIGSITE_PENDANT_33417;
-import static api.ObjectID.DIGSITE_PENDANT_33418;
-import static api.ObjectID.DIGSITE_PENDANT_33420;
-import static api.ObjectID.FALADOR_PORTAL;
-import static api.ObjectID.FALADOR_PORTAL_13624;
-import static api.ObjectID.FALADOR_PORTAL_13631;
-import static api.ObjectID.FANCY_JEWELLERY_BOX;
-import static api.ObjectID.FANCY_REJUVENATION_POOL;
-import static api.ObjectID.FISHING_GUILD_PORTAL;
-import static api.ObjectID.FISHING_GUILD_PORTAL_29351;
-import static api.ObjectID.FISHING_GUILD_PORTAL_29359;
-import static api.ObjectID.GHORROCK_PORTAL;
-import static api.ObjectID.GHORROCK_PORTAL_33436;
-import static api.ObjectID.GHORROCK_PORTAL_33439;
-import static api.ObjectID.KHARYRLL_PORTAL;
-import static api.ObjectID.KHARYRLL_PORTAL_29346;
-import static api.ObjectID.KHARYRLL_PORTAL_29354;
-import static api.ObjectID.KOUREND_PORTAL;
-import static api.ObjectID.KOUREND_PORTAL_29353;
-import static api.ObjectID.KOUREND_PORTAL_29361;
-import static api.ObjectID.LUMBRIDGE_PORTAL;
-import static api.ObjectID.LUMBRIDGE_PORTAL_13623;
-import static api.ObjectID.LUMBRIDGE_PORTAL_13630;
-import static api.ObjectID.LUNAR_ALTAR;
-import static api.ObjectID.LUNAR_ISLE_PORTAL;
-import static api.ObjectID.LUNAR_ISLE_PORTAL_29347;
-import static api.ObjectID.LUNAR_ISLE_PORTAL_29355;
-import static api.ObjectID.MARIM_PORTAL;
-import static api.ObjectID.MARIM_PORTAL_29352;
-import static api.ObjectID.MARIM_PORTAL_29360;
-import static api.ObjectID.OBELISK_31554;
-import static api.ObjectID.ORNATE_JEWELLERY_BOX;
-import static api.ObjectID.ORNATE_REJUVENATION_POOL;
-import static api.ObjectID.POOL_OF_REJUVENATION;
-import static api.ObjectID.POOL_OF_RESTORATION;
-import static api.ObjectID.POOL_OF_REVITALISATION;
-import static api.ObjectID.PORTAL_4525;
-import static api.ObjectID.PORTAL_NEXUS;
-import static api.ObjectID.PORTAL_NEXUS_33355;
-import static api.ObjectID.PORTAL_NEXUS_33356;
-import static api.ObjectID.PORTAL_NEXUS_33357;
-import static api.ObjectID.PORTAL_NEXUS_33358;
-import static api.ObjectID.PORTAL_NEXUS_33359;
-import static api.ObjectID.PORTAL_NEXUS_33360;
-import static api.ObjectID.PORTAL_NEXUS_33361;
-import static api.ObjectID.PORTAL_NEXUS_33362;
-import static api.ObjectID.PORTAL_NEXUS_33363;
-import static api.ObjectID.PORTAL_NEXUS_33364;
-import static api.ObjectID.PORTAL_NEXUS_33365;
-import static api.ObjectID.PORTAL_NEXUS_33366;
-import static api.ObjectID.PORTAL_NEXUS_33367;
-import static api.ObjectID.PORTAL_NEXUS_33368;
-import static api.ObjectID.PORTAL_NEXUS_33369;
-import static api.ObjectID.PORTAL_NEXUS_33370;
-import static api.ObjectID.PORTAL_NEXUS_33371;
-import static api.ObjectID.PORTAL_NEXUS_33372;
-import static api.ObjectID.PORTAL_NEXUS_33373;
-import static api.ObjectID.PORTAL_NEXUS_33374;
-import static api.ObjectID.PORTAL_NEXUS_33375;
-import static api.ObjectID.PORTAL_NEXUS_33376;
-import static api.ObjectID.PORTAL_NEXUS_33377;
-import static api.ObjectID.PORTAL_NEXUS_33378;
-import static api.ObjectID.PORTAL_NEXUS_33379;
-import static api.ObjectID.PORTAL_NEXUS_33380;
-import static api.ObjectID.PORTAL_NEXUS_33381;
-import static api.ObjectID.PORTAL_NEXUS_33382;
-import static api.ObjectID.PORTAL_NEXUS_33383;
-import static api.ObjectID.PORTAL_NEXUS_33384;
-import static api.ObjectID.PORTAL_NEXUS_33385;
-import static api.ObjectID.PORTAL_NEXUS_33386;
-import static api.ObjectID.PORTAL_NEXUS_33387;
-import static api.ObjectID.PORTAL_NEXUS_33388;
-import static api.ObjectID.PORTAL_NEXUS_33389;
-import static api.ObjectID.PORTAL_NEXUS_33390;
-import static api.ObjectID.PORTAL_NEXUS_33391;
-import static api.ObjectID.PORTAL_NEXUS_33392;
-import static api.ObjectID.PORTAL_NEXUS_33393;
-import static api.ObjectID.PORTAL_NEXUS_33394;
-import static api.ObjectID.PORTAL_NEXUS_33395;
-import static api.ObjectID.PORTAL_NEXUS_33396;
-import static api.ObjectID.PORTAL_NEXUS_33397;
-import static api.ObjectID.PORTAL_NEXUS_33398;
-import static api.ObjectID.PORTAL_NEXUS_33399;
-import static api.ObjectID.PORTAL_NEXUS_33400;
-import static api.ObjectID.PORTAL_NEXUS_33401;
-import static api.ObjectID.PORTAL_NEXUS_33402;
-import static api.ObjectID.PORTAL_NEXUS_33403;
-import static api.ObjectID.PORTAL_NEXUS_33404;
-import static api.ObjectID.PORTAL_NEXUS_33405;
-import static api.ObjectID.PORTAL_NEXUS_33406;
-import static api.ObjectID.PORTAL_NEXUS_33407;
-import static api.ObjectID.PORTAL_NEXUS_33408;
-import static api.ObjectID.PORTAL_NEXUS_33409;
-import static api.ObjectID.PORTAL_NEXUS_33410;
-import static api.ObjectID.PORTAL_NEXUS_33423;
-import static api.ObjectID.PORTAL_NEXUS_33424;
-import static api.ObjectID.PORTAL_NEXUS_33425;
-import static api.ObjectID.PORTAL_NEXUS_33426;
-import static api.ObjectID.PORTAL_NEXUS_33427;
-import static api.ObjectID.PORTAL_NEXUS_33428;
-import static api.ObjectID.PORTAL_NEXUS_33429;
-import static api.ObjectID.PORTAL_NEXUS_33430;
-import static api.ObjectID.PORTAL_NEXUS_33431;
-import static api.ObjectID.SENNTISTEN_PORTAL;
-import static api.ObjectID.SENNTISTEN_PORTAL_29348;
-import static api.ObjectID.SENNTISTEN_PORTAL_29356;
-import static api.ObjectID.SPIRIT_TREE_29227;
-import static api.ObjectID.TROLL_STRONGHOLD_PORTAL;
-import static api.ObjectID.TROLL_STRONGHOLD_PORTAL_33180;
-import static api.ObjectID.TROLL_STRONGHOLD_PORTAL_33181;
-import static api.ObjectID.WATERBIRTH_ISLAND_PORTAL;
-import static api.ObjectID.WATERBIRTH_ISLAND_PORTAL_29350;
-import static api.ObjectID.WATERBIRTH_ISLAND_PORTAL_29358;
-import static api.ObjectID.XERICS_TALISMAN;
-import static api.ObjectID.XERICS_TALISMAN_33412;
-import static api.ObjectID.XERICS_TALISMAN_33413;
-import static api.ObjectID.XERICS_TALISMAN_33414;
-import static api.ObjectID.XERICS_TALISMAN_33415;
-import static api.ObjectID.XERICS_TALISMAN_33419;
-import net.runelite.client.util.ImageUtil;
-
-public enum PohIcons
-{
- EXITPORTAL("exitportal", PORTAL_4525),
- VARROCK("varrock", NULL_13615, NULL_13622, NULL_13629),
- FALADOR("falador", FALADOR_PORTAL, FALADOR_PORTAL_13624, FALADOR_PORTAL_13631),
- LUMBRIDGE("lumbridge", LUMBRIDGE_PORTAL, LUMBRIDGE_PORTAL_13623, LUMBRIDGE_PORTAL_13630),
- ARDOUGNE("ardougne", ARDOUGNE_PORTAL, ARDOUGNE_PORTAL_13626, ARDOUGNE_PORTAL_13633),
- YANILLE("yanille", NULL_13620, NULL_13627, NULL_13634),
- CAMELOT("camelot", NULL_13618, NULL_13625, NULL_13632),
- LUNARISLE("lunarisle", LUNAR_ISLE_PORTAL, LUNAR_ISLE_PORTAL_29347, LUNAR_ISLE_PORTAL_29355),
- WATERBIRTH("waterbirth", WATERBIRTH_ISLAND_PORTAL, WATERBIRTH_ISLAND_PORTAL_29350, WATERBIRTH_ISLAND_PORTAL_29358),
- FISHINGGUILD("fishingguild", FISHING_GUILD_PORTAL, FISHING_GUILD_PORTAL_29351, FISHING_GUILD_PORTAL_29359),
- SENNTISTEN("senntisten", SENNTISTEN_PORTAL, SENNTISTEN_PORTAL_29348, SENNTISTEN_PORTAL_29356),
- KHARYLL("kharyll", KHARYRLL_PORTAL, KHARYRLL_PORTAL_29346, KHARYRLL_PORTAL_29354),
- ANNAKARL("annakarl", ANNAKARL_PORTAL, ANNAKARL_PORTAL_29349, ANNAKARL_PORTAL_29357),
- KOUREND("kourend", KOUREND_PORTAL, KOUREND_PORTAL_29353, KOUREND_PORTAL_29361),
- MARIM("marim", MARIM_PORTAL, MARIM_PORTAL_29352, MARIM_PORTAL_29360),
- TROLLSTRONGHOLD("trollheim", TROLL_STRONGHOLD_PORTAL, TROLL_STRONGHOLD_PORTAL_33180, TROLL_STRONGHOLD_PORTAL_33181),
- GHORROCK("ghorrock", GHORROCK_PORTAL, GHORROCK_PORTAL_33436, GHORROCK_PORTAL_33439),
- CARRALLANGAR("carrallangar", CARRALLANGAR_PORTAL, CARRALLANGAR_PORTAL_33437, CARRALLANGAR_PORTAL_33440),
- CATHERBY("catherby", CATHERBY_PORTAL, CATHERBY_PORTAL_33435, CATHERBY_PORTAL_33438),
- ALTAR("altar",
- ALTAR_13179, ALTAR_13180, ALTAR_13181, ALTAR_13182, ALTAR_13183, ALTAR_13184, ALTAR_13185, ALTAR_13186,
- ALTAR_13187, ALTAR_13188, ALTAR_13189, ALTAR_13190, ALTAR_13191, ALTAR_13192, ALTAR_13193, ALTAR_13194,
- ALTAR_13196, ALTAR_13197, ALTAR_13198, ALTAR_13199
- ),
- POOLS("pool", POOL_OF_RESTORATION, POOL_OF_REVITALISATION, POOL_OF_REJUVENATION, FANCY_REJUVENATION_POOL, ORNATE_REJUVENATION_POOL),
- GLORY("glory", AMULET_OF_GLORY),
- REPAIR("repair", ARMOUR_REPAIR_STAND),
- SPELLBOOKALTAR("spellbook", ANCIENT_ALTAR, LUNAR_ALTAR, DARK_ALTAR, ALTAR_OF_THE_OCCULT),
- JEWELLERYBOX("jewellery", BASIC_JEWELLERY_BOX, FANCY_JEWELLERY_BOX, ORNATE_JEWELLERY_BOX),
- MAGICTRAVEL("transportation", SPIRIT_TREE_29227, NULL_29228, NULL_29229, OBELISK_31554),
- PORTALNEXUS("portalnexus",
- PORTAL_NEXUS, PORTAL_NEXUS_33355, PORTAL_NEXUS_33356, PORTAL_NEXUS_33357, PORTAL_NEXUS_33358, PORTAL_NEXUS_33359, PORTAL_NEXUS_33360,
- PORTAL_NEXUS_33361, PORTAL_NEXUS_33362, PORTAL_NEXUS_33363, PORTAL_NEXUS_33364, PORTAL_NEXUS_33365, PORTAL_NEXUS_33366, PORTAL_NEXUS_33367,
- PORTAL_NEXUS_33368, PORTAL_NEXUS_33369, PORTAL_NEXUS_33370, PORTAL_NEXUS_33371, PORTAL_NEXUS_33372, PORTAL_NEXUS_33373, PORTAL_NEXUS_33374,
- PORTAL_NEXUS_33375, PORTAL_NEXUS_33376, PORTAL_NEXUS_33377, PORTAL_NEXUS_33378, PORTAL_NEXUS_33379, PORTAL_NEXUS_33380, PORTAL_NEXUS_33381,
- PORTAL_NEXUS_33382, PORTAL_NEXUS_33383, PORTAL_NEXUS_33384, PORTAL_NEXUS_33385, PORTAL_NEXUS_33386, PORTAL_NEXUS_33387, PORTAL_NEXUS_33388,
- PORTAL_NEXUS_33389, PORTAL_NEXUS_33390, PORTAL_NEXUS_33391, PORTAL_NEXUS_33392, PORTAL_NEXUS_33393, PORTAL_NEXUS_33394, PORTAL_NEXUS_33395,
- PORTAL_NEXUS_33396, PORTAL_NEXUS_33397, PORTAL_NEXUS_33398, PORTAL_NEXUS_33399, PORTAL_NEXUS_33400, PORTAL_NEXUS_33401, PORTAL_NEXUS_33402,
- PORTAL_NEXUS_33403, PORTAL_NEXUS_33404, PORTAL_NEXUS_33405, PORTAL_NEXUS_33406, PORTAL_NEXUS_33407, PORTAL_NEXUS_33408, PORTAL_NEXUS_33409,
- PORTAL_NEXUS_33410, PORTAL_NEXUS_33423, PORTAL_NEXUS_33424, PORTAL_NEXUS_33425, PORTAL_NEXUS_33426, PORTAL_NEXUS_33427, PORTAL_NEXUS_33428,
- PORTAL_NEXUS_33429, PORTAL_NEXUS_33430, PORTAL_NEXUS_33431
- ),
- XERICSTALISMAN("xericstalisman",
- XERICS_TALISMAN, XERICS_TALISMAN_33412, XERICS_TALISMAN_33413, XERICS_TALISMAN_33414, XERICS_TALISMAN_33415, XERICS_TALISMAN_33419
- ),
- DIGSITEPENDANT("digsitependant",
- DIGSITE_PENDANT, DIGSITE_PENDANT_33417, DIGSITE_PENDANT_33418, DIGSITE_PENDANT_33420
- );
-
- private static final Map minimapIcons;
-
- @Getter
- private final String imageResource;
- @Getter
- private final int[] Ids;
-
- private BufferedImage image;
-
- static
- {
- ImmutableMap.Builder builder = new ImmutableMap.Builder<>();
-
- for (PohIcons icon : values())
- {
- for (Integer spotId : icon.getIds())
- {
- builder.put(spotId, icon);
- }
- }
-
- minimapIcons = builder.build();
- }
-
- PohIcons(String imageResource, int... ids)
- {
- this.imageResource = imageResource;
- this.Ids = ids;
- }
-
- public static PohIcons getIcon(int id)
- {
- return minimapIcons.get(id);
- }
-
- public BufferedImage getImage()
- {
- if (image != null)
- {
- return image;
- }
-
- image = ImageUtil.getResourceStreamFromClass(getClass(), getImageResource() + ".png");
-
- return image;
- }
-}
diff --git a/RuneLitePlus/src/main/java/net/runelite/client/plugins/tickcounter/TickCounterConfig.java b/RuneLitePlus/src/main/java/net/runelite/client/plugins/tickcounter/TickCounterConfig.java
deleted file mode 100644
index ef349f58d1..0000000000
--- a/RuneLitePlus/src/main/java/net/runelite/client/plugins/tickcounter/TickCounterConfig.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (c) 2018, James Munson
- * 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 HOLDER 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.client.plugins.tickcounter;
-
-import java.awt.Color;
-import net.runelite.client.config.Alpha;
-import net.runelite.client.config.Config;
-import net.runelite.client.config.ConfigGroup;
-import net.runelite.client.config.ConfigItem;
-
-@ConfigGroup("tickcounter")
-public interface TickCounterConfig extends Config
-{
- @ConfigItem(
- keyName = "resetInstance",
- name = "Reset on new instances",
- description = "",
- position = 1
- )
- default boolean instance()
- {
- return true;
- }
-
- @Alpha
- @ConfigItem(
- keyName = "selfColor",
- name = "Your color",
- description = "",
- position = 4
- )
- default Color selfColor()
- {
- return Color.green;
- }
-
- @Alpha
- @ConfigItem(
- keyName = "totalColor",
- name = "Total color",
- description = "",
- position = 6
- )
- default Color totalColor()
- {
- return Color.RED;
- }
-
- @Alpha
- @ConfigItem(
- keyName = "otherColor",
- name = "Other players color",
- description = "",
- position = 5
- )
- default Color otherColor()
- {
- return Color.white;
- }
-
- @Alpha
- @ConfigItem(
- keyName = "bgColor",
- name = "Background color",
- description = "",
- position = 3
- )
- default Color bgColor()
- {
- return new Color(70, 61, 50, 156);
- }
-
- @Alpha
- @ConfigItem(
- keyName = "titleColor",
- name = "Title color",
- description = "",
- position = 2
- )
- default Color titleColor()
- {
- return Color.white;
- }
-}
diff --git a/RuneLitePlus/src/main/java/net/runelite/client/plugins/tickcounter/TickCounterOverlay.java b/RuneLitePlus/src/main/java/net/runelite/client/plugins/tickcounter/TickCounterOverlay.java
deleted file mode 100644
index cb6821ec72..0000000000
--- a/RuneLitePlus/src/main/java/net/runelite/client/plugins/tickcounter/TickCounterOverlay.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 2018, James Munson
- * 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 HOLDER 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.client.plugins.tickcounter;
-
-/*public class TickCounterOverlay extends Overlay
-{
-
- private TickCounterPlugin plugin;
- private TickCounterConfig config;
- private Client client;
- private PanelComponent panelComponent = new PanelComponent();
-
- @Inject
- public TickCounterOverlay(TickCounterPlugin plugin, Client client, TickCounterConfig config)
- {
- super(plugin);
- setPosition(OverlayPosition.DYNAMIC);
- setPosition(OverlayPosition.DETACHED);
- setPosition(OverlayPosition.BOTTOM_RIGHT);
- this.plugin = plugin;
- this.client = client;
- this.config = config;
- }
-
- @Override
- public Dimension render(Graphics2D g)
- {
- List elems = panelComponent.getChildren();
- elems.clear();
- panelComponent.setBackgroundColor(config.bgColor());
- elems.add(TitleComponent.builder().text("Combat counter").color(config.titleColor()).build());
- List> list = new ArrayList<>(plugin.activity.entrySet());
- list.sort((o1, o2) ->
- {
- int value = -Integer.compare(o1.getValue(), o2.getValue());
- if (value == 0)
- {
- value = o1.getKey().compareTo(o2.getKey());
- }
- return value;
- });
- int total = 0;
- for (Entry e : list)
- {
- total += e.getValue();
- if (e.getKey().equals(client.getLocalPlayer().getName()))
- {
- elems.add(LineComponent.builder().leftColor(config.selfColor()).rightColor(config.selfColor()).left(e.getKey()).right(e.getValue().toString()).build());
- }
- else
- {
- elems.add(LineComponent.builder().left(e.getKey()).right(e.getValue().toString()).leftColor(config.otherColor()).rightColor(config.otherColor()).build());
-
- }
- }
- elems.add(LineComponent.builder().left("Total").leftColor(config.totalColor()).rightColor(config.totalColor()).right(String.valueOf(total)).build());
- return this.panelComponent.render(g);
- }
-
-}*/
diff --git a/RuneLitePlus/src/main/java/net/runelite/client/plugins/tickcounter/TickCounterPlugin.java b/RuneLitePlus/src/main/java/net/runelite/client/plugins/tickcounter/TickCounterPlugin.java
deleted file mode 100644
index 74c7c3a612..0000000000
--- a/RuneLitePlus/src/main/java/net/runelite/client/plugins/tickcounter/TickCounterPlugin.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- * Copyright (c) 2018, James Munson
- * 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 HOLDER 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.client.plugins.tickcounter;
-
-import net.runelite.client.plugins.Plugin;
-import net.runelite.client.plugins.PluginDescriptor;
-import net.runelite.client.plugins.PluginType;
-
-@PluginDescriptor(name = "Tick Counter",
- description = "Counts combat activity for nearby players",
- enabledByDefault = false,
- type = PluginType.PVP
-)
-public class TickCounterPlugin extends Plugin
-{
- //todo once bytecodes work again, re-enable
-/*
- @Inject
- private OverlayManager overlayManager;
-
- @Inject
- private TickCounterConfig config;
-
- @Inject
- private Client client;
-
- @Provides
- TickCounterConfig provideConfig(ConfigManager configManager)
- {
- return configManager.getConfig(TickCounterConfig.class);
- }
-
- @Inject
- private TickCounterOverlay overlay;
-
- Map activity = new HashMap<>();
-
- private List blowpiping = new ArrayList<>();
- private boolean instanced = false;
-
- @Override
- protected void startUp() throws Exception
- {
- overlayManager.add(overlay);
- }
-
- @Override
- protected void shutDown() throws Exception
- {
- overlayManager.remove(overlay);
- activity.clear();
- }
-
- @Subscribe
- public void onAnimationChanged(AnimationChanged e)
- {
- if (!(e.getActor() instanceof Player))
- {
- return;
- }
- Player p = (Player) e.getActor();
- int weapon = -1;
- if (p.getPlayerAppearance() != null)
- {
- weapon = p.getPlayerAppearance().getEquipmentId(KitType.WEAPON);
- }
- int delta = 0;
- switch (p.getAnimation())
- {
- case 7617: // rune knife
- case 8194: // dragon knife
- case 8291: // dragon knife spec
- case 5061: // blowpipe
- if (weapon == 12926)
- {
- blowpiping.add(p);
- }
- else
- {
- delta = 2;
- }
- break;
- case 2323: // rpg
- case 7618: // chin
- delta = 3;
- break;
- case 426: // bow shoot
- if (weapon == 20997) // twisted bow
- {
- delta = 5;
- }
- else // shortbow
- {
- delta = 3;
- }
- break;
- case 376: // dds poke
- case 377: // dds slash
- case 422: // punch
- case 423: // kick
- case 386: // lunge
- case 390: // generic slash
- case 1062: // dds spec
- case 1067: // claw stab
- case 1074: // msb spec
- case 1167: // trident cast
- case 1658: // whip
- case 2890: // arclight spec
- case 3294: // abby dagger slash
- case 3297: // abby dagger poke
- case 3298: // bludgeon attack
- case 3299: // bludgeon spec
- case 3300: // abby dagger spec
- case 7514: // claw spec
- case 7515: // d sword spec
- case 8145: // rapier stab
- case 8288: // dhl stab
- case 8289: // dhl slash
- case 8290: // dhl crush
- delta = 4;
- break;
- case 393: // staff bash
- if (weapon == 13652)
- { // claw scratch
- delta = 4;
- break;
- }
- case 395: // axe autos
- case 400: // pick smash
- case 1379: //burst or blitz
- case 1979: // barrage spell cast
- case 1162: // strike/bolt spells
- case 7552: // generic crossbow
- case 7855: // surge spells
- case 8056: // scythe swing
- delta = 5;
- break;
- case 401:
- if (weapon == 13576) // dwh bop
- {
- delta = 6;
- }
- else // used by pickaxe and axe
- {
- delta = 5;
- }
- break;
- case 1378:
- case 7045:
- case 7054:
- case 7055: // godsword autos
- case 7511: // dinh's attack
- case 7516: // maul attack
- case 7555: // ballista attack
- case 7638: // zgs spec
- case 7640: // sgs spec
- case 7642: // bgs spec
- case 7643: // bgs spec
- case 7644: // ags spec
- delta = 6;
- break;
- case 428: // chally swipe
- case 440: // chally jab
- case 1203: // chally spec
- delta = 7;
- break;
- case -1:
- blowpiping.remove(p);
- break;
- }
- if (delta > 0)
- {
- String name = p.getName();
- this.activity.put(name, this.activity.getOrDefault(name, 0) + delta);
- }
- }
-
- @Subscribe
- public void onClientTick(ClientTick e)
- {
- *//*
- * Hack for blowpipe since the AnimationChanged event doesn't fire when using a
- * blowpipe because of its speed. If blowpipe animation restarts, then add 2
- *//*
- for (Player p : blowpiping)
- {
- if (p.getActionFrame() == 0 && p.getActionFrameCycle() == 1)
- {
- String name = p.getName();
- int activity = this.activity.getOrDefault(name, 0);
- this.activity.put(name, activity + 2);
- }
- }
- }
-
- @Subscribe
- public void onGameTick(GameTick tick)
- {
- if (!config.instance())
- {
- return;
- }
- boolean prevInstance = instanced;
- instanced = client.isInInstancedRegion();
- if (!prevInstance && instanced)
- {
- activity.clear();
- }
- }*/
-}
diff --git a/RuneLitePlus/src/main/java/net/runelite/client/plugins/wasdcamera/WASDCameraListener.java b/RuneLitePlus/src/main/java/net/runelite/client/plugins/wasdcamera/WASDCameraListener.java
deleted file mode 100644
index ee6181b55d..0000000000
--- a/RuneLitePlus/src/main/java/net/runelite/client/plugins/wasdcamera/WASDCameraListener.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Copyright (c) 2018, Adam
- * Copyright (c) 2018, Abexlry
- * 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.client.plugins.wasdcamera;
-
-import com.google.common.base.Strings;
-import java.awt.event.KeyEvent;
-import java.util.HashMap;
-import java.util.Map;
-import javax.inject.Inject;
-import api.Client;
-import api.GameState;
-import api.VarClientStr;
-import net.runelite.client.callback.ClientThread;
-import net.runelite.client.input.KeyListener;
-import net.runelite.client.input.MouseAdapter;
-
-class WASDCameraListener extends MouseAdapter implements KeyListener
-{
- @Inject
- private WASDCameraPlugin plugin;
-
- @Inject
- private WASDCameraConfig config;
-
- @Inject
- private Client client;
-
- @Inject
- private ClientThread clientThread;
-
- private final Map modified = new HashMap<>();
-
- @Override
- public void keyTyped(KeyEvent e)
- {
- }
-
- @Override
- public void keyPressed(KeyEvent e)
- {
- if (client.getGameState() != GameState.LOGGED_IN || !plugin.chatboxFocused())
- {
- return;
- }
-
- if (!plugin.isTyping())
- {
- if (config.up().matches(e))
- {
- modified.put(e.getKeyCode(), KeyEvent.VK_UP);
- e.setKeyCode(KeyEvent.VK_UP);
- }
- else if (config.down().matches(e))
- {
- modified.put(e.getKeyCode(), KeyEvent.VK_DOWN);
- e.setKeyCode(KeyEvent.VK_DOWN);
- }
- else if (config.left().matches(e))
- {
- modified.put(e.getKeyCode(), KeyEvent.VK_LEFT);
- e.setKeyCode(KeyEvent.VK_LEFT);
- }
- else if (config.right().matches(e))
- {
- modified.put(e.getKeyCode(), KeyEvent.VK_RIGHT);
- e.setKeyCode(KeyEvent.VK_RIGHT);
- }
- else
- {
- switch (e.getKeyCode())
- {
- case KeyEvent.VK_ENTER:
- case KeyEvent.VK_SLASH:
- case KeyEvent.VK_COLON:
- // refocus chatbox
- plugin.setTyping(true);
- clientThread.invoke(() ->
- {
- plugin.unlockChat();
- });
- break;
- }
- }
- }
- else
- {
- switch (e.getKeyCode())
- {
- case KeyEvent.VK_ENTER:
- plugin.setTyping(false);
- clientThread.invoke(() ->
- {
- plugin.lockChat();
- });
- break;
- case KeyEvent.VK_ESCAPE:
- plugin.setTyping(false);
- clientThread.invoke(() ->
- {
- client.setVar(VarClientStr.CHATBOX_TYPED_TEXT, "");
- plugin.lockChat();
- });
- break;
- case KeyEvent.VK_BACK_SPACE:
- if (Strings.isNullOrEmpty(client.getVar(VarClientStr.CHATBOX_TYPED_TEXT)))
- {
- plugin.setTyping(false);
- clientThread.invoke(() -> plugin.lockChat());
- }
- }
- }
- }
-
- @Override
- public void keyReleased(KeyEvent e)
- {
- if (client.getGameState() != GameState.LOGGED_IN)
- {
- return;
- }
-
- if (plugin.chatboxFocused() && !plugin.isTyping())
- {
- modified.remove(e.getKeyCode());
-
- if (config.up().matches(e))
- {
- e.setKeyCode(KeyEvent.VK_UP);
- }
- else if (config.down().matches(e))
- {
- e.setKeyCode(KeyEvent.VK_DOWN);
- }
- else if (config.left().matches(e))
- {
- e.setKeyCode(KeyEvent.VK_LEFT);
- }
- else if (config.right().matches(e))
- {
- e.setKeyCode(KeyEvent.VK_RIGHT);
- }
- }
- else
- {
- // press d + enter + release d - causes the right arrow to never be released
- Integer m = modified.get(e.getKeyCode());
- if (m != null)
- {
- modified.remove(e.getKeyCode());
- e.setKeyCode(m);
- }
- }
- }
-}
diff --git a/RuneLitePlus/src/main/resources/com/runeswag/client/rlp.properties b/RuneLitePlus/src/main/resources/com/runeswag/client/rlp.properties
deleted file mode 100644
index b89682ed8a..0000000000
--- a/RuneLitePlus/src/main/resources/com/runeswag/client/rlp.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-runeliteplus.title=RuneLitePlus
-runeliteplus.version=1.0
-runeliteplus.version=1.0
-runeliteplus.discord.appid=409416265891971072
-runeliteplus.discord.invite=https://discord.gg/HN5gf3m
-runeliteplus.github.link=https://github.com/runelite-extended/runelite
-runeliteplus.wiki.link=https://github.com/runelite-extended/runelite/wiki
-runeliteplus.patreon.link=https://www.patreon.com/RuneLitePlus
\ No newline at end of file
diff --git a/RuneLitePlus/src/main/resources/com/runeswag/client/ui/runeliteplus.png b/RuneLitePlus/src/main/resources/com/runeswag/client/ui/runeliteplus.png
deleted file mode 100644
index 2b5357ab17..0000000000
Binary files a/RuneLitePlus/src/main/resources/com/runeswag/client/ui/runeliteplus.png and /dev/null differ
diff --git a/RuneLitePlus/src/main/resources/net/runelite/client/ui/open.png b/RuneLitePlus/src/main/resources/net/runelite/client/ui/open.png
deleted file mode 100644
index 6d5ca35ad4..0000000000
Binary files a/RuneLitePlus/src/main/resources/net/runelite/client/ui/open.png and /dev/null differ
diff --git a/RuneLitePlus/src/main/resources/net/runelite/client/ui/open_rs.png b/RuneLitePlus/src/main/resources/net/runelite/client/ui/open_rs.png
deleted file mode 100644
index e0cb3df043..0000000000
Binary files a/RuneLitePlus/src/main/resources/net/runelite/client/ui/open_rs.png and /dev/null differ
diff --git a/RuneLitePlus/src/main/resources/net/runelite/client/ui/runescape.ttf b/RuneLitePlus/src/main/resources/net/runelite/client/ui/runescape.ttf
deleted file mode 100644
index 9d15fc64ff..0000000000
Binary files a/RuneLitePlus/src/main/resources/net/runelite/client/ui/runescape.ttf and /dev/null differ
diff --git a/RuneLitePlus/src/main/resources/net/runelite/client/ui/runescape_bold.ttf b/RuneLitePlus/src/main/resources/net/runelite/client/ui/runescape_bold.ttf
deleted file mode 100644
index 1eaf0e7b82..0000000000
Binary files a/RuneLitePlus/src/main/resources/net/runelite/client/ui/runescape_bold.ttf and /dev/null differ
diff --git a/RuneLitePlus/src/main/resources/net/runelite/client/ui/runescape_small.ttf b/RuneLitePlus/src/main/resources/net/runelite/client/ui/runescape_small.ttf
deleted file mode 100644
index 7998560026..0000000000
Binary files a/RuneLitePlus/src/main/resources/net/runelite/client/ui/runescape_small.ttf and /dev/null differ
diff --git a/RuneLitePlus/src/main/resources/net/runelite/client/ui/skin/RuneLite.colorschemes b/RuneLitePlus/src/main/resources/net/runelite/client/ui/skin/RuneLite.colorschemes
deleted file mode 100644
index 1d9ffee41b..0000000000
--- a/RuneLitePlus/src/main/resources/net/runelite/client/ui/skin/RuneLite.colorschemes
+++ /dev/null
@@ -1,166 +0,0 @@
-# Copyright (c) 2018, Tomas Slusny
-# Copyright (c) 2018, Psikoi
-# 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.
-
-RuneLite Enabled {
- kind=Dark
- colorUltraLight=#232323
- colorExtraLight=#232323
- colorLight=#232323
- colorMid=#232323
- colorDark=#232323
- colorUltraDark=#232323
- colorForeground=#C6C6C6
-}
-
-RuneLite Active {
- kind=Light
- colorUltraLight=#4e4e4e
- colorExtraLight=#4e4e4e
- colorLight=#4e4e4e
- colorMid=#232323
- colorDark=#232323
- colorUltraDark=#232323
- colorForeground=#000000
-}
-
-RuneLite Selected Disabled Border {
- kind=Dark
- colorUltraLight=#191919
- colorExtraLight=#191919
- colorLight=#191919
- colorMid=#191919
- colorDark=#191919
- colorUltraDark=#191919
- colorForeground=#C6C6C6
-}
-
-RuneLite Border {
- kind=Dark
- colorUltraLight=#191919
- colorExtraLight=#191919
- colorLight=#191919
- colorMid=#191919
- colorDark=#191919
- colorUltraDark=#191919
- colorForeground=#C6C6C6
-}
-
-RuneLite Tab Border {
- kind=Light
- colorUltraLight=#232323
- colorExtraLight=#232323
- colorLight=#232323
- colorMid=#232323
- colorDark=#232323
- colorUltraDark=#232323
- colorForeground=#232323
-}
-
-RuneLite Mark Active {
- kind=Dark
- colorUltraLight=#191919
- colorExtraLight=#191919
- colorLight=#191919
- colorMid=#191919
- colorDark=#191919
- colorUltraDark=#191919
- colorForeground=#191919
-}
-
-RuneLite Highlight {
- kind=Light
- colorUltraLight=#C6C6C6
- colorExtraLight=#C6C6C6
- colorLight=#C6C6C6
- colorMid=#C6C6C6
- colorDark=#C6C6C6
- colorUltraDark=#C6C6C6
- colorForeground=#191919
-}
-
-RuneLite Watermark {
- kind=Light
- colorUltraLight=#313131
- colorExtraLight=#313131
- colorLight=#313131
- colorMid=#313131
- colorDark=#313131
- colorUltraDark=#313131
- colorForeground=#C6C6C6
-}
-
-RuneLite Decorations Watermark {
- kind=Light
- colorUltraLight=#1e1e1e
- colorExtraLight=#1e1e1e
- colorLight=#1e1e1e
- colorMid=#1e1e1e
- colorDark=#1e1e1e
- colorUltraDark=#1e1e1e
- colorForeground=#1e1e1e
-}
-
-RuneLite Separator {
- kind=Dark
- colorUltraLight=#232323
- colorExtraLight=#232323
- colorLight=#232323
- colorMid=#232323
- colorDark=#232323
- colorUltraDark=#232323
- colorForeground=#232323
-}
-
-RuneLite Decorations Separator {
- kind=Dark
- colorUltraLight=#232323
- colorExtraLight=#232323
- colorLight=#232323
- colorMid=#232323
- colorDark=#232323
- colorUltraDark=#232323
- colorForeground=#232323
-}
-
-RuneLite Header Watermark {
- kind=Dark
- colorUltraLight=#1e1e1e
- colorExtraLight=#1e1e1e
- colorLight=#1e1e1e
- colorMid=#1e1e1e
- colorDark=#1e1e1e
- colorUltraDark=#1e1e1e
- colorForeground=#C6C6C6
-}
-
-RuneLite Header Border {
- kind=Dark
- colorUltraLight=#1e1e1e
- colorExtraLight=#1e1e1e
- colorLight=#1e1e1e
- colorMid=#1e1e1e
- colorDark=#1e1e1e
- colorUltraDark=#1e1e1e
- colorForeground=#C6C6C6
-}
\ No newline at end of file
diff --git a/api/src/main/java/api/Constants.java b/api/src/main/java/api/Constants.java
deleted file mode 100644
index 8fff5d1c52..0000000000
--- a/api/src/main/java/api/Constants.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 2018, Lotto
- * 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 HOLDER 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 api;
-
-import java.awt.Dimension;
-
-/**
- * A utility class containing constant values.
- */
-public class Constants
-{
- /**
- * The original width of the game when running in fixed mode.
- */
- public static final int GAME_FIXED_WIDTH = 765;
-
- /**
- * The original height of the game when running in fixed mode.
- */
- public static final int GAME_FIXED_HEIGHT = 503;
-
- /**
- * Dimension representation of the width and height of the game in fixed mode.
- */
- public static final Dimension GAME_FIXED_SIZE = new Dimension(GAME_FIXED_WIDTH, GAME_FIXED_HEIGHT);
-
- /**
- * The aspect ratio of the game when running in fixed mode.
- */
- public static final double GAME_FIXED_ASPECT_RATIO = (double) GAME_FIXED_WIDTH / (double) GAME_FIXED_HEIGHT;
-
- /**
- * The default camera zoom value.
- */
- public static final int CLIENT_DEFAULT_ZOOM = 512;
-
- /**
- * The width and length of a chunk (8x8 tiles).
- */
- public static final int CHUNK_SIZE = 8;
-
- /**
- * The width and length of a map region (64x64 tiles).
- */
- public static final int REGION_SIZE = 64;
-
- /**
- * The width and length of the scene (13 chunks x 8 tiles).
- */
- public static final int SCENE_SIZE = 104;
-
- /**
- * The max allowed plane by the game.
- *
- * This value is exclusive. The plane is set by 2 bits which restricts
- * the plane value to 0-3.
- */
- public static final int MAX_Z = 4;
-
- public static final int TILE_FLAG_BRIDGE = 2;
-
- /**
- * The number of milliseconds in a client tick.
- *
- * This is the length of a single frame when the client is running at
- * the maximum framerate of 50 fps.
- */
- public static final int CLIENT_TICK_LENGTH = 20;
-
- /**
- * The number of milliseconds in a server game tick.
- *
- * This is the length of a single game cycle under ideal conditions.
- * All game-play actions operate within multiples of this duration.
- */
- public static final int GAME_TICK_LENGTH = 600;
-
- /**
- * Used when getting High Alchemy value - multiplied by general store price.
- */
- public static final float HIGH_ALCHEMY_CONSTANT = 0.6f;
-}
diff --git a/api/src/main/java/api/GrandExchangeOffer.java b/api/src/main/java/api/GrandExchangeOffer.java
deleted file mode 100644
index c0a41dd515..0000000000
--- a/api/src/main/java/api/GrandExchangeOffer.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package api;
-
-/**
- * Represents an offer in a grand exchange slot.
- */
-public interface GrandExchangeOffer
-{
- /**
- * Gets the quantity of bought or sold items.
- *
- * @return the quantity bought or sold
- */
- int getQuantitySold();
-
- /**
- * Gets the ID of the item being bought or sold.
- *
- * @return item ID
- * @see ItemID
- */
- int getItemId();
-
- /**
- * Gets the total quantity being bought or sold.
- *
- * @return the total quantity
- */
- int getTotalQuantity();
-
- /**
- * Gets the offer or sell price per item.
- *
- * @return the offer price
- */
- int getPrice();
-
- /**
- * Gets the total amount of money spent so far.
- *
- * @return the amount spent
- */
- int getSpent();
-
- /**
- * Gets the current state of the offer.
- *
- * @return the offers state
- */
- GrandExchangeOfferState getState();
-}
diff --git a/api/src/main/java/api/GrandExchangeOfferState.java b/api/src/main/java/api/GrandExchangeOfferState.java
deleted file mode 100644
index 6d374dd7e6..0000000000
--- a/api/src/main/java/api/GrandExchangeOfferState.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package api;
-
-/**
- * Describes the state of a Grand Exchange offer.
- */
-public enum GrandExchangeOfferState
-{
- /**
- * An empty slot.
- */
- EMPTY,
- /**
- * A cancelled buy offer.
- */
- CANCELLED_BUY,
- /**
- * A cancelled sell offer.
- */
- CANCELLED_SELL,
- /**
- * A buy offer that is currently in progress.
- */
- BUYING,
- /**
- * A buy offer that has completed.
- */
- BOUGHT,
- /**
- * A sell offer that is currently in progress.
- */
- SELLING,
- /**
- * A sell offer that has completed.
- */
- SOLD;
-}
diff --git a/api/src/main/java/api/HashTable.java b/api/src/main/java/api/HashTable.java
deleted file mode 100644
index fe2dd3f1a6..0000000000
--- a/api/src/main/java/api/HashTable.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package api;
-
-import java.util.Collection;
-
-/**
- * A data structure that uses a hash function to compute an index into an
- * array of buckets from which node objects can be quickly obtained.
- */
-public interface HashTable
-{
- /**
- * Gets a node by its hash value.
- *
- * @param value the node value
- * @return the associated node
- */
- T get(long value);
-
- /**
- * Gets a collection of all nodes stored in this table.
- *
- * @return the nodes stored
- */
- Collection getNodes();
-}
diff --git a/api/src/main/java/api/IndexDataBase.java b/api/src/main/java/api/IndexDataBase.java
deleted file mode 100644
index 731eeffed7..0000000000
--- a/api/src/main/java/api/IndexDataBase.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package api;
-
-/**
- * Represents an index in the cache
- */
-public interface IndexDataBase
-{
- /**
- * Returns true if any cache overlay in this index is outdated due to hash mismatch
- */
- boolean isOverlayOutdated();
-}
diff --git a/api/src/main/java/api/NPCDefinition.java b/api/src/main/java/api/NPCDefinition.java
deleted file mode 100644
index 15d0b19ca2..0000000000
--- a/api/src/main/java/api/NPCDefinition.java
+++ /dev/null
@@ -1,90 +0,0 @@
-package api;
-
-public interface NPCDefinition
-{
- /**
- * Gets the name of the NPC.
- *
- * @return the name
- */
- String getName();
-
- /**
- * Gets the model IDs that compose this NPC.
- *
- * @return the NPCs model IDs
- */
- int[] getModels();
-
- /**
- * Gets an array of possible right-click menu actions that can be
- * performed on the NPC.
- *
- * @return the menu actions
- */
- String[] getActions();
-
- /**
- * Gets whether the NPC can be clicked.
- *
- * @return true if the NPC can be clicked, false otherwise
- */
- boolean isClickable();
-
- /**
- * Gets whether the NPC is visible on the mini-map.
- *
- * @return the mini-map visible state
- */
- boolean isMinimapVisible();
-
- /**
- * Gets whether the NPC is visible.
- *
- * @return the visible state
- */
- boolean isVisible();
-
- /**
- * Gets the ID of the NPC.
- *
- * @return the ID of the NPC
- * @see NpcID
- */
- int getId();
-
- /**
- * Gets the combat level of the NPC.
- *
- * @return the combat level, -1 if none
- */
- int getCombatLevel();
-
- /**
- * Gets the configuration data for the NPC.
- *
- * @return the configuration data
- */
- int[] getConfigs();
-
- /**
- * Transforms this NPC into a new state, which may have a different ID.
- *
- * @return the transformed composition
- */
- NPCDefinition transform();
-
- /**
- * Gets the size of the NPC.
- *
- * @return the NPCs size
- */
- int getSize();
-
- /**
- * Gets the displayed overhead icon of the NPC.
- *
- * @return the overhead icon
- */
- HeadIcon getOverheadIcon();
-}
diff --git a/api/src/main/java/api/Skill.java b/api/src/main/java/api/Skill.java
deleted file mode 100644
index 484a0b2994..0000000000
--- a/api/src/main/java/api/Skill.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package api;
-
-/**
- * An enumeration of skills that a player can level.
- */
-public enum Skill
-{
- ATTACK("Attack"),
- DEFENCE("Defence"),
- STRENGTH("Strength"),
- HITPOINTS("Hitpoints"),
- RANGED("Ranged"),
- PRAYER("Prayer"),
- MAGIC("Magic"),
- COOKING("Cooking"),
- WOODCUTTING("Woodcutting"),
- FLETCHING("Fletching"),
- FISHING("Fishing"),
- FIREMAKING("Firemaking"),
- CRAFTING("Crafting"),
- SMITHING("Smithing"),
- MINING("Mining"),
- HERBLORE("Herblore"),
- AGILITY("Agility"),
- THIEVING("Thieving"),
- SLAYER("Slayer"),
- FARMING("Farming"),
- RUNECRAFT("Runecraft"),
- HUNTER("Hunter"),
- CONSTRUCTION("Construction"),
- /**
- * The level of all skills added together.
- */
- OVERALL("Overall");
-
- private final String name;
-
- Skill(String name)
- {
- this.name = name;
- }
-
- /**
- * Gets the name of the skill.
- *
- * @return the skill name
- */
- public String getName()
- {
- return name;
- }
-}
diff --git a/api/src/main/java/api/WidgetNode.java b/api/src/main/java/api/WidgetNode.java
deleted file mode 100644
index 03ab3885a4..0000000000
--- a/api/src/main/java/api/WidgetNode.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package api;
-
-/**
- * Represents a widget as an iterable node.
- */
-public interface WidgetNode extends Node
-{
- /**
- * The ID of the widget.
- *
- * @return the ID of the widget
- * @see api.widgets.Widget
- */
- int getId();
-}
diff --git a/api/src/main/java/api/events/AnimationChanged.java b/api/src/main/java/api/events/AnimationChanged.java
deleted file mode 100644
index ccfed921fe..0000000000
--- a/api/src/main/java/api/events/AnimationChanged.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package api.events;
-
-import api.Actor;
-import lombok.Data;
-
-/**
- * An event where the {@link Actor} has changed animations.
- *
- * In order to get the new animation ID, use {@link Actor#getAnimation()}.
- *
- * Examples of when this event may trigger include:
- *
- *
A player starts or stops gathering a resource (ie. woodcut, fishing)
- *
A player starts or stops dancing
- *
- *
- * @see api.AnimationID
- */
-@Data
-public class AnimationChanged
-{
- /**
- * The actor that has entered a new animation.
- */
- private Actor actor;
-}
diff --git a/api/src/main/java/api/events/InteractingChanged.java b/api/src/main/java/api/events/InteractingChanged.java
deleted file mode 100644
index 3b2855e591..0000000000
--- a/api/src/main/java/api/events/InteractingChanged.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package api.events;
-
-import api.Actor;
-import lombok.Value;
-
-/**
- * An event called when the actor an actor is interacting with changes
- */
-@Value
-public class InteractingChanged
-{
- private final Actor source;
-
- /**
- * Target actor, may be null
- */
- private final Actor target;
-}
diff --git a/api/src/main/java/api/events/OverheadTextChanged.java b/api/src/main/java/api/events/OverheadTextChanged.java
deleted file mode 100644
index 298ba82aee..0000000000
--- a/api/src/main/java/api/events/OverheadTextChanged.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package api.events;
-
-import api.Actor;
-import lombok.Value;
-
-@Value
-public class OverheadTextChanged
-{
- private final Actor actor;
-
- private final String overheadText;
-}
\ No newline at end of file
diff --git a/api/src/main/java/api/events/SpotAnimationChanged.java b/api/src/main/java/api/events/SpotAnimationChanged.java
deleted file mode 100644
index 938ebc761b..0000000000
--- a/api/src/main/java/api/events/SpotAnimationChanged.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package api.events;
-
-import api.Actor;
-import lombok.Data;
-
-/**
- * An event where the graphic of an {@link Actor} has changed.
- *
- * The graphic the player has changed to can be obtained using
- * {@link Actor#getSpotAnimation()}.
- *
- * Examples of when this event may trigger include:
- *
- *
Casting a magic spell
- *
Using a fairy ring
- *
Breaking a teleport tab
- *
- *
- * @see api.GraphicID
- */
-@Data
-public class SpotAnimationChanged
-{
- /**
- * The actor that has had their graphic changed.
- */
- private Actor actor;
-}
\ No newline at end of file
diff --git a/api/src/main/java/api/vars/AccountType.java b/api/src/main/java/api/vars/AccountType.java
deleted file mode 100644
index 6e8c2de5b6..0000000000
--- a/api/src/main/java/api/vars/AccountType.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package api.vars;
-
-/**
- * An enumeration of possible account types.
- */
-public enum AccountType
-{
- /**
- * Normal account type.
- */
- NORMAL,
- /**
- * Ironman account type.
- */
- IRONMAN,
- /**
- * Ultimate ironman account type.
- */
- ULTIMATE_IRONMAN,
- /**
- * Hardcore ironman account type.
- */
- HARDCORE_IRONMAN;
-
- /**
- * Checks whether this type is an ironman.
- *
- * @return {@code true} if the type is any of the ironman types.
- */
- public boolean isIronman()
- {
- return this.ordinal() >= IRONMAN.ordinal() && this.ordinal() <= HARDCORE_IRONMAN.ordinal();
- }
-
-}
\ No newline at end of file
diff --git a/api/src/main/java/mapping/ObfuscatedSignature.java b/api/src/main/java/mapping/ObfuscatedSignature.java
deleted file mode 100644
index 1c0bf31b35..0000000000
--- a/api/src/main/java/mapping/ObfuscatedSignature.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2016-2017, Adam
- * 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.mapping;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(
- {
- ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.FIELD
- })
-public @interface ObfuscatedSignature
-{
- String signature();
-
- String garbageValue() default ""; // valid garbage value for last parameter. can't be an Object because Java.
-}
diff --git a/api/src/main/java/rs/api/RSAbstractFont.java b/api/src/main/java/rs/api/RSAbstractFont.java
deleted file mode 100644
index 337dbdc604..0000000000
--- a/api/src/main/java/rs/api/RSAbstractFont.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package rs.api;
-
-import api.FontTypeFace;
-import net.runelite.mapping.Import;
-
-public interface RSAbstractFont extends FontTypeFace
-{
- @Import("stringWidth")
- @Override
- int getTextWidth(String text);
-
- @Import("ascent")
- @Override
- int getBaseline();
-
- @Import("draw")
- void drawTextLeftAligned(String text, int x, int y, int fontColor, int shadowColor);
-}
diff --git a/api/src/main/java/rs/api/RSAbstractIndexCache.java b/api/src/main/java/rs/api/RSAbstractIndexCache.java
deleted file mode 100644
index 793c87f69e..0000000000
--- a/api/src/main/java/rs/api/RSAbstractIndexCache.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package rs.api;
-
-import api.IndexDataBase;
-import net.runelite.mapping.Import;
-
-public interface RSAbstractIndexCache extends IndexDataBase
-{
- @Import("takeRecord")
- byte[] getConfigData(int archiveId, int fileId);
-}
diff --git a/api/src/main/java/rs/api/RSBoundaryObject.java b/api/src/main/java/rs/api/RSBoundaryObject.java
deleted file mode 100644
index fd93d3183c..0000000000
--- a/api/src/main/java/rs/api/RSBoundaryObject.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package rs.api;
-
-import api.WallObject;
-import net.runelite.mapping.Import;
-
-public interface RSBoundaryObject extends WallObject
-{
- @Import("tag")
- @Override
- long getHash();
-
- @Import("x")
- @Override
- int getX();
-
- @Import("y")
- @Override
- int getY();
-
- @Import("orientationA")
- @Override
- int getOrientationA();
-
- @Import("orientationB")
- @Override
- int getOrientationB();
-
- @Import("entity1")
- @Override
- RSEntity getRenderable1();
-
- @Import("entity2")
- @Override
- RSEntity getRenderable2();
-
- @Import("flags")
- @Override
- int getConfig();
-
- void setPlane(int plane);
-}
diff --git a/api/src/main/java/rs/api/RSBuddy.java b/api/src/main/java/rs/api/RSBuddy.java
deleted file mode 100644
index 45cb0b3b0f..0000000000
--- a/api/src/main/java/rs/api/RSBuddy.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package rs.api;
-
-import api.ChatPlayer;
-import net.runelite.mapping.Import;
-
-public interface RSBuddy extends ChatPlayer, RSUser
-{
- @Import("world")
- @Override
- int getWorld();
-
- @Import("rank")
- int getRSRank();
-}
diff --git a/api/src/main/java/rs/api/RSBuffer.java b/api/src/main/java/rs/api/RSBuffer.java
deleted file mode 100644
index 365272e06d..0000000000
--- a/api/src/main/java/rs/api/RSBuffer.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package rs.api;
-
-import net.runelite.mapping.Import;
-
-public interface RSBuffer extends RSNode
-{
- @Import("array")
- byte[] getPayload();
-
- @Import("index")
- int getOffset();
-}
\ No newline at end of file
diff --git a/api/src/main/java/rs/api/RSCanvas.java b/api/src/main/java/rs/api/RSCanvas.java
deleted file mode 100644
index 28d37bc0b4..0000000000
--- a/api/src/main/java/rs/api/RSCanvas.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package rs.api;
-
-public interface RSCanvas
-{
-}
diff --git a/api/src/main/java/rs/api/RSChatChannel.java b/api/src/main/java/rs/api/RSChatChannel.java
deleted file mode 100644
index 91bc1a9fbe..0000000000
--- a/api/src/main/java/rs/api/RSChatChannel.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package rs.api;
-
-import api.ChatLineBuffer;
-import net.runelite.mapping.Import;
-
-public interface RSChatChannel extends ChatLineBuffer
-{
- @Import("messages")
- @Override
- RSMessage[] getLines();
-
- @Import("count")
- @Override
- int getLength();
-
- @Import("count")
- void setLength(int length);
-}
diff --git a/api/src/main/java/rs/api/RSClanChat.java b/api/src/main/java/rs/api/RSClanChat.java
deleted file mode 100644
index dab7c5f895..0000000000
--- a/api/src/main/java/rs/api/RSClanChat.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package rs.api;
-
-import net.runelite.mapping.Import;
-
-public interface RSClanChat extends RSUserList
-{
- @Import("owner")
- String getClanOwner();
-
- @Import("name")
- String getClanChatName();
-}
diff --git a/api/src/main/java/rs/api/RSClanMate.java b/api/src/main/java/rs/api/RSClanMate.java
deleted file mode 100644
index 362d7a8904..0000000000
--- a/api/src/main/java/rs/api/RSClanMate.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package rs.api;
-
-import api.ClanMember;
-
-public interface RSClanMate extends RSBuddy, ClanMember
-{
-}
diff --git a/api/src/main/java/rs/api/RSClientPreferences.java b/api/src/main/java/rs/api/RSClientPreferences.java
deleted file mode 100644
index 5faf552236..0000000000
--- a/api/src/main/java/rs/api/RSClientPreferences.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package rs.api;
-
-import api.Preferences;
-import net.runelite.mapping.Import;
-
-public interface RSClientPreferences extends Preferences
-{
- @Import("rememberedUsername")
- @Override
- String getRememberedUsername();
-
- @Import("rememberedUsername")
- @Override
- void setRememberedUsername(String username);
-}
diff --git a/api/src/main/java/rs/api/RSCollisionMap.java b/api/src/main/java/rs/api/RSCollisionMap.java
deleted file mode 100644
index c5202c120d..0000000000
--- a/api/src/main/java/rs/api/RSCollisionMap.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package rs.api;
-
-import api.CollisionData;
-import net.runelite.mapping.Import;
-
-public interface RSCollisionMap extends CollisionData
-{
- @Import("flags")
- int[][] getFlags();
-}
diff --git a/api/src/main/java/rs/api/RSDynamicObject.java b/api/src/main/java/rs/api/RSDynamicObject.java
deleted file mode 100644
index ee582d4c45..0000000000
--- a/api/src/main/java/rs/api/RSDynamicObject.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package rs.api;
-
-import api.Renderable;
-import net.runelite.mapping.Import;
-
-public interface RSDynamicObject extends RSEntity, Renderable
-{
- @Import("id")
- int getId();
-
- @Import("frame")
- int getAnimFrame();
-
- @Import("frame")
- void setAnimFrame(int frame);
-
- @Import("cycleStart")
- int getAnimCycleCount();
-}
diff --git a/api/src/main/java/rs/api/RSEnumDefinition.java b/api/src/main/java/rs/api/RSEnumDefinition.java
deleted file mode 100644
index 22c0ebe3c6..0000000000
--- a/api/src/main/java/rs/api/RSEnumDefinition.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package rs.api;
-
-import api.EnumDefinition;
-import net.runelite.mapping.Import;
-
-public interface RSEnumDefinition extends EnumDefinition, RSDualNode
-{
- @Import("keys")
- @Override
- int[] getKeys();
-
- @Import("intVals")
- @Override
- int[] getIntVals();
-
- @Import("stringVals")
- @Override
- String[] getStringVals();
-
- @Import("defaultInt")
- int getDefaultInt();
-
- @Import("defaultString")
- String getDefaultString();
-}
diff --git a/api/src/main/java/rs/api/RSEvictingDualNodeHashTable.java b/api/src/main/java/rs/api/RSEvictingDualNodeHashTable.java
deleted file mode 100644
index b9a1563305..0000000000
--- a/api/src/main/java/rs/api/RSEvictingDualNodeHashTable.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package rs.api;
-
-import api.NodeCache;
-import net.runelite.mapping.Import;
-
-public interface RSEvictingDualNodeHashTable extends NodeCache
-{
- @Import("get")
- RSDualNode get(long id);
-
- @Import("clear")
- @Override
- void reset();
-
- @Import("capacity")
- @Override
- void setCapacity(int capacity);
-
- @Import("remainingCapacity")
- @Override
- void setRemainingCapacity(int remainingCapacity);
-}
diff --git a/api/src/main/java/rs/api/RSFileOnDisk.java b/api/src/main/java/rs/api/RSFileOnDisk.java
deleted file mode 100644
index 315064b4f7..0000000000
--- a/api/src/main/java/rs/api/RSFileOnDisk.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package rs.api;
-
-import java.io.RandomAccessFile;
-import net.runelite.mapping.Import;
-
-public interface RSFileOnDisk
-{
- @Import("file")
- RandomAccessFile getFile();
-
- @Import("index")
- long getPosition();
-
- @Import("capacity")
- long getLength();
-}
diff --git a/api/src/main/java/rs/api/RSFloorDecoration.java b/api/src/main/java/rs/api/RSFloorDecoration.java
deleted file mode 100644
index 0c8c5b65ac..0000000000
--- a/api/src/main/java/rs/api/RSFloorDecoration.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package rs.api;
-
-import api.GroundObject;
-import net.runelite.mapping.Import;
-
-public interface RSFloorDecoration extends GroundObject
-{
- @Import("tag")
- @Override
- long getHash();
-
- @Import("x")
- int getX();
-
- @Import("y")
- int getY();
-
- @Import("entity")
- @Override
- RSEntity getRenderable();
-
- void setPlane(int plane);
-}
diff --git a/api/src/main/java/rs/api/RSFont.java b/api/src/main/java/rs/api/RSFont.java
deleted file mode 100644
index 7b12a9d543..0000000000
--- a/api/src/main/java/rs/api/RSFont.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package rs.api;
-
-public interface RSFont extends RSAbstractFont
-{
-}
diff --git a/api/src/main/java/rs/api/RSFriend.java b/api/src/main/java/rs/api/RSFriend.java
deleted file mode 100644
index 4c5b799d9a..0000000000
--- a/api/src/main/java/rs/api/RSFriend.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package rs.api;
-
-import api.Friend;
-
-public interface RSFriend extends Friend, RSBuddy
-{
-}
diff --git a/api/src/main/java/rs/api/RSFriendSystem.java b/api/src/main/java/rs/api/RSFriendSystem.java
deleted file mode 100644
index 1d01b23183..0000000000
--- a/api/src/main/java/rs/api/RSFriendSystem.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package rs.api;
-
-import api.FriendManager;
-import net.runelite.mapping.Import;
-
-public interface RSFriendSystem extends FriendManager
-{
- @Import("friendsList")
- RSFriendsList getFriendContainer();
-
- @Import("ignoreList")
- RSIgnoreList getIgnoreContainer();
-
- @Import("isFriended")
- boolean isFriended(RSUsername var1, boolean var2);
-}
diff --git a/api/src/main/java/rs/api/RSFriendsList.java b/api/src/main/java/rs/api/RSFriendsList.java
deleted file mode 100644
index ef36674350..0000000000
--- a/api/src/main/java/rs/api/RSFriendsList.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package rs.api;
-
-public interface RSFriendsList extends RSUserList
-{
-}
diff --git a/api/src/main/java/rs/api/RSGameObject.java b/api/src/main/java/rs/api/RSGameObject.java
deleted file mode 100644
index e649b310dc..0000000000
--- a/api/src/main/java/rs/api/RSGameObject.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package rs.api;
-
-import api.GameObject;
-import net.runelite.mapping.Import;
-
-public interface RSGameObject extends GameObject
-{
- @Import("entity")
- RSEntity getRenderable();
-
- @Import("plane")
- int getPlane();
-
- @Import("startX")
- int getRelativeX();
-
- @Import("startY")
- int getRelativeY();
-
- @Import("endX")
- int getOffsetX();
-
- @Import("endY")
- int getOffsetY();
-
- @Import("centerX")
- @Override
- int getX();
-
- @Import("centerY")
- @Override
- int getY();
-
- @Import("height")
- int getHeight();
-
- @Import("orientation")
- int getRsOrientation();
-
- @Import("tag")
- @Override
- long getHash();
-
- @Import("flags")
- int getFlags();
-}
diff --git a/api/src/main/java/rs/api/RSGrandExchangeOffer.java b/api/src/main/java/rs/api/RSGrandExchangeOffer.java
deleted file mode 100644
index 9bffb96730..0000000000
--- a/api/src/main/java/rs/api/RSGrandExchangeOffer.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package rs.api;
-
-import api.GrandExchangeOffer;
-import net.runelite.mapping.Import;
-
-public interface RSGrandExchangeOffer extends GrandExchangeOffer
-{
- @Import("currentQuantity")
- @Override
- int getQuantitySold();
-
- @Import("id")
- @Override
- int getItemId();
-
- @Import("totalQuantity")
- @Override
- int getTotalQuantity();
-
- @Import("unitPrice")
- @Override
- int getPrice();
-
- @Import("currentPrice")
- @Override
- int getSpent();
-
- @Import("state")
- byte getRSState();
-}
diff --git a/api/src/main/java/rs/api/RSGraphicsObject.java b/api/src/main/java/rs/api/RSGraphicsObject.java
deleted file mode 100644
index 2471d7de4d..0000000000
--- a/api/src/main/java/rs/api/RSGraphicsObject.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package rs.api;
-
-import api.GraphicsObject;
-import net.runelite.mapping.Import;
-
-public interface RSGraphicsObject extends GraphicsObject, RSEntity
-{
- @Import("id")
- @Override
- int getId();
-
- @Import("x")
- int getX();
-
- @Import("y")
- int getY();
-
- @Import("cycleStart")
- @Override
- int getStartCycle();
-
- @Import("plane")
- @Override
- int getLevel();
-
- @Import("height")
- @Override
- int getHeight();
-}
diff --git a/api/src/main/java/rs/api/RSGroundItem.java b/api/src/main/java/rs/api/RSGroundItem.java
deleted file mode 100644
index f23800fe84..0000000000
--- a/api/src/main/java/rs/api/RSGroundItem.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package rs.api;
-
-import api.Item;
-import api.Tile;
-import net.runelite.mapping.Import;
-
-public interface RSGroundItem extends RSEntity, Item
-{
- @Import("id")
- @Override
- int getId();
-
- @Import("id")
- void setId(int id);
-
- @Import("quantity")
- @Override
- int getQuantity();
-
- @Import("quantity")
- void setQuantity(int quantity);
-
- int getX();
-
- void setX(int x);
-
- int getY();
-
- void setY(int y);
-
- /**
- * Get the tile this item is on
- * @return
- */
- Tile getTile();
-}
diff --git a/api/src/main/java/rs/api/RSGroundItemPile.java b/api/src/main/java/rs/api/RSGroundItemPile.java
deleted file mode 100644
index 3fc5742d90..0000000000
--- a/api/src/main/java/rs/api/RSGroundItemPile.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package rs.api;
-
-import api.ItemLayer;
-import net.runelite.mapping.Import;
-
-public interface RSGroundItemPile extends ItemLayer
-{
- @Import("x")
- int getX();
-
- @Import("y")
- int getY();
-
- @Import("tag")
- @Override
- long getHash();
-
- @Import("height")
- int getHeight();
-
- @Import("third")
- @Override
- RSEntity getBottom();
-
- @Import("second")
- @Override
- RSEntity getMiddle();
-
- @Import("first")
- @Override
- RSEntity getTop();
-
- void setPlane(int plane);
-}
diff --git a/api/src/main/java/rs/api/RSHealthBar.java b/api/src/main/java/rs/api/RSHealthBar.java
deleted file mode 100644
index 13b8871a47..0000000000
--- a/api/src/main/java/rs/api/RSHealthBar.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package rs.api;
-
-import net.runelite.mapping.Import;
-
-public interface RSHealthBar extends RSNode
-{
- @Import("updates")
- RSIterableNodeDeque getUpdates(); // "combatinfolist" but only thing it has is getNode so this works
-
- @Import("definition")
- RSHealthBarDefinition getDefinition();
-}
diff --git a/api/src/main/java/rs/api/RSHealthBarDefinition.java b/api/src/main/java/rs/api/RSHealthBarDefinition.java
deleted file mode 100644
index d688530a85..0000000000
--- a/api/src/main/java/rs/api/RSHealthBarDefinition.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package rs.api;
-
-import api.HealthBar;
-import net.runelite.mapping.Import;
-
-public interface RSHealthBarDefinition extends RSDualNode, HealthBar
-{
- @Import("width")
- int getHealthScale();
-
- @Import("getSprite1")
- RSSprite getHealthBarFrontSprite();
-
- @Import("getSprite2")
- RSSprite getHealthBarBackSprite();
-
- @Import("widthPadding")
- @Override
- void setPadding(int padding);
-}
diff --git a/api/src/main/java/rs/api/RSHealthBarUpdate.java b/api/src/main/java/rs/api/RSHealthBarUpdate.java
deleted file mode 100644
index 9b2f9ee5d4..0000000000
--- a/api/src/main/java/rs/api/RSHealthBarUpdate.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package rs.api;
-
-import net.runelite.mapping.Import;
-
-public interface RSHealthBarUpdate
-{
- @Import("health")
- int getHealthRatio();
-
- @Import("health2") // not sure about that one but it isn't used and I am sure about the other one
- int getHealth();
-}
diff --git a/api/src/main/java/rs/api/RSIgnoreList.java b/api/src/main/java/rs/api/RSIgnoreList.java
deleted file mode 100644
index aa53114779..0000000000
--- a/api/src/main/java/rs/api/RSIgnoreList.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package rs.api;
-
-public interface RSIgnoreList extends RSUserList
-{
-}
diff --git a/api/src/main/java/rs/api/RSIgnored.java b/api/src/main/java/rs/api/RSIgnored.java
deleted file mode 100644
index 1e17d128d1..0000000000
--- a/api/src/main/java/rs/api/RSIgnored.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package rs.api;
-
-import api.Ignore;
-
-public interface RSIgnored extends Ignore, RSUser
-{
-}
diff --git a/api/src/main/java/rs/api/RSIndexCache.java b/api/src/main/java/rs/api/RSIndexCache.java
deleted file mode 100644
index 18be69a891..0000000000
--- a/api/src/main/java/rs/api/RSIndexCache.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package rs.api;
-
-import net.runelite.mapping.Import;
-
-public interface RSIndexCache extends RSAbstractIndexCache
-{
- @Import("index")
- int getIndex();
-}
diff --git a/api/src/main/java/rs/api/RSIndexedSprite.java b/api/src/main/java/rs/api/RSIndexedSprite.java
deleted file mode 100644
index 4af8e04a37..0000000000
--- a/api/src/main/java/rs/api/RSIndexedSprite.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package rs.api;
-
-import api.IndexedSprite;
-import net.runelite.mapping.Import;
-
-public interface RSIndexedSprite extends IndexedSprite
-{
- @Import("pixels")
- @Override
- byte[] getPixels();
-
- @Import("pixels")
- @Override
- void setPixels(byte[] pixels);
-
- @Import("palette")
- @Override
- int[] getPalette();
-
- @Import("palette")
- @Override
- void setPalette(int[] palette);
-
- @Import("width")
- @Override
- int getOriginalWidth();
-
- @Import("width")
- @Override
- void setOriginalWidth(int originalWidth);
-
- @Import("height")
- @Override
- int getOriginalHeight();
-
- @Import("height")
- @Override
- void setOriginalHeight(int originalHeight);
-
- @Import("subHeight")
- @Override
- int getHeight();
-
- @Import("subHeight")
- @Override
- void setHeight(int height);
-
- @Import("xOffset")
- @Override
- int getOffsetX();
-
- @Import("xOffset")
- @Override
- void setOffsetX(int offsetX);
-
- @Import("yOffset")
- @Override
- int getOffsetY();
-
- @Import("yOffset")
- @Override
- void setOffsetY(int offsetY);
-
- @Import("subWidth")
- @Override
- int getWidth();
-
- @Import("subWidth")
- @Override
- void setWidth(int width);
-}
diff --git a/api/src/main/java/rs/api/RSIntegerNode.java b/api/src/main/java/rs/api/RSIntegerNode.java
deleted file mode 100644
index 3d2d2f819f..0000000000
--- a/api/src/main/java/rs/api/RSIntegerNode.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package rs.api;
-
-import api.IntegerNode;
-import net.runelite.mapping.Import;
-
-public interface RSIntegerNode extends RSNode, IntegerNode
-{
- @Import("integer")
- @Override
- int getValue();
-
- @Import("integer")
- @Override
- void setValue(int value);
-}
\ No newline at end of file
diff --git a/api/src/main/java/rs/api/RSItemContainer.java b/api/src/main/java/rs/api/RSItemContainer.java
deleted file mode 100644
index 964bd545fc..0000000000
--- a/api/src/main/java/rs/api/RSItemContainer.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package rs.api;
-
-import api.ItemContainer;
-import net.runelite.mapping.Import;
-
-public interface RSItemContainer extends RSNode, ItemContainer
-{
- @Import("ids")
- int[] getItemIds();
-
- @Import("quantities")
- int[] getStackSizes();
-}
diff --git a/api/src/main/java/rs/api/RSItemDefinition.java b/api/src/main/java/rs/api/RSItemDefinition.java
deleted file mode 100644
index 2c624b3dc7..0000000000
--- a/api/src/main/java/rs/api/RSItemDefinition.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package rs.api;
-
-import api.ItemDefinition;
-import net.runelite.mapping.Import;
-
-public interface RSItemDefinition extends ItemDefinition
-{
- @Import("name")
- @Override
- String getName();
-
- @Import("id")
- @Override
- int getId();
-
- @Import("noteTemplate")
- @Override
- int getNote();
-
- @Import("notedId")
- @Override
- int getLinkedNoteId();
-
- @Import("placeholder")
- @Override
- int getPlaceholderId();
-
- @Import("placeholderTemplate")
- @Override
- int getPlaceholderTemplateId();
-
- @Import("price")
- @Override
- int getPrice();
-
- @Import("isMembersOnly")
- @Override
- boolean isMembers();
-
- @Import("isTradable")
- @Override
- boolean isTradeable();
-
- /**
- * You probably want {@link #isStackable}
- *
- * This is the {@code int} that client code uses internally to represent this true/false value. It appears to only ever be set to 1 or 0
- * @return 0 when this type of item isn't stackable, 1 otherwise
- */
- @Import("isStackable")
- int getIsStackable();
-
- @Import("maleModel")
- int getMaleModel();
-
- @Import("inventoryActions")
- @Override
- String[] getInventoryActions();
-
- @Import("getShiftClickIndex")
- @Override
- int getShiftClickActionIndex();
-}
diff --git a/api/src/main/java/rs/api/RSIterableNodeDeque.java b/api/src/main/java/rs/api/RSIterableNodeDeque.java
deleted file mode 100644
index 17ba1b7a32..0000000000
--- a/api/src/main/java/rs/api/RSIterableNodeDeque.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package rs.api;
-
-import net.runelite.mapping.Import;
-
-public interface RSIterableNodeDeque
-{
- @Import("current")
- RSNode getCurrent();
-}
diff --git a/api/src/main/java/rs/api/RSIterableNodeHashTable.java b/api/src/main/java/rs/api/RSIterableNodeHashTable.java
deleted file mode 100644
index ed732da8d9..0000000000
--- a/api/src/main/java/rs/api/RSIterableNodeHashTable.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package rs.api;
-
-import api.IterableHashTable;
-import net.runelite.mapping.Import;
-
-public interface RSIterableNodeHashTable extends IterableHashTable
-{
- @Import("get")
- @Override
- RSNode get(long hash);
-}
diff --git a/api/src/main/java/rs/api/RSKeyHandler.java b/api/src/main/java/rs/api/RSKeyHandler.java
deleted file mode 100644
index 886b285419..0000000000
--- a/api/src/main/java/rs/api/RSKeyHandler.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package rs.api;
-
-import api.KeyFocusListener;
-import java.awt.event.FocusListener;
-import java.awt.event.KeyListener;
-
-public interface RSKeyHandler extends KeyListener, FocusListener, KeyFocusListener
-{
-}
diff --git a/api/src/main/java/rs/api/RSLoginType.java b/api/src/main/java/rs/api/RSLoginType.java
deleted file mode 100644
index ffb1c207eb..0000000000
--- a/api/src/main/java/rs/api/RSLoginType.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package rs.api;
-
-public interface RSLoginType
-{
-}
diff --git a/api/src/main/java/rs/api/RSMessage.java b/api/src/main/java/rs/api/RSMessage.java
deleted file mode 100644
index 7c7b90a6db..0000000000
--- a/api/src/main/java/rs/api/RSMessage.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package rs.api;
-
-import api.MessageNode;
-import net.runelite.mapping.Import;
-
-public interface RSMessage extends MessageNode
-{
- @Import("count")
- @Override
- int getId();
-
- @Import("type")
- int getRSType();
-
- @Import("prefix")
- @Override
- String getName();
-
- @Import("prefix")
- @Override
- void setName(String name);
-
- @Import("sender")
- @Override
- String getSender();
-
- @Import("sender")
- @Override
- void setSender(String sender);
-
- @Import("text")
- @Override
- String getValue();
-
- @Import("text")
- @Override
- void setValue(String value);
-}
diff --git a/api/src/main/java/rs/api/RSModelData.java b/api/src/main/java/rs/api/RSModelData.java
deleted file mode 100644
index 7dc6c4798f..0000000000
--- a/api/src/main/java/rs/api/RSModelData.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package rs.api;
-
-import net.runelite.mapping.Import;
-
-public interface RSModelData extends RSEntity
-{
- @Import("faceCount")
- int getTriangleFaceCount();
-
- @Import("indices1")
- int[] getTrianglePointsX();
-
- @Import("indices2")
- int[] getTrianglePointsY();
-
- @Import("indices3")
- int[] getTrianglePointsZ();
-
- @Import("verticesX")
- int[] getVertexX();
-
- @Import("verticesY")
- int[] getVertexY();
-
- @Import("verticesZ")
- int[] getVertexZ();
-
- @Import("texTriangleX")
- short[] getTexTriangleX();
-
- @Import("texTriangleY")
- short[] getTexTriangleY();
-
- @Import("texTriangleZ")
- short[] getTexTriangleZ();
-
- @Import("faceTextures")
- short[] getFaceTextures();
-
- @Import("textureCoords")
- byte[] getTextureCoords();
-
- @Import("textureRenderTypes")
- byte[] getTextureRenderTypes();
-}
diff --git a/api/src/main/java/rs/api/RSMouseHandler.java b/api/src/main/java/rs/api/RSMouseHandler.java
deleted file mode 100644
index 853716f7db..0000000000
--- a/api/src/main/java/rs/api/RSMouseHandler.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package rs.api;
-
-import java.awt.event.FocusListener;
-import java.awt.event.MouseListener;
-import java.awt.event.MouseMotionListener;
-
-public interface RSMouseHandler extends MouseListener, MouseMotionListener, FocusListener
-{
-}
diff --git a/api/src/main/java/rs/api/RSMouseRecorder.java b/api/src/main/java/rs/api/RSMouseRecorder.java
deleted file mode 100644
index 9427606814..0000000000
--- a/api/src/main/java/rs/api/RSMouseRecorder.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package rs.api;
-
-import api.MouseRecorder;
-import net.runelite.mapping.Import;
-
-public interface RSMouseRecorder extends MouseRecorder
-{
- @Import("xs")
- int[] getXs();
-
- @Import("ys")
- int[] getYs();
-
- @Import("millis")
- long[] getMillis();
-
- @Import("index")
- int getIndex();
-}
diff --git a/api/src/main/java/rs/api/RSMouseWheelHandler.java b/api/src/main/java/rs/api/RSMouseWheelHandler.java
deleted file mode 100644
index 4d49700d5d..0000000000
--- a/api/src/main/java/rs/api/RSMouseWheelHandler.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package rs.api;
-
-import java.awt.event.MouseWheelListener;
-
-public interface RSMouseWheelHandler extends MouseWheelListener
-{
-}
diff --git a/api/src/main/java/rs/api/RSNPC.java b/api/src/main/java/rs/api/RSNPC.java
deleted file mode 100644
index b32f8e4c74..0000000000
--- a/api/src/main/java/rs/api/RSNPC.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package rs.api;
-
-import api.NPC;
-import net.runelite.mapping.Import;
-
-public interface RSNPC extends RSActor, NPC
-{
- @Import("definition")
- @Override
- RSNPCDefinition getDefinition();
-
- @Override
- int getIndex();
-
- void setIndex(int id);
-
- void setDead(boolean dead);
-}
diff --git a/api/src/main/java/rs/api/RSNPCDefinition.java b/api/src/main/java/rs/api/RSNPCDefinition.java
deleted file mode 100644
index c34073e54d..0000000000
--- a/api/src/main/java/rs/api/RSNPCDefinition.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package rs.api;
-
-import api.NPCDefinition;
-import net.runelite.mapping.Import;
-
-public interface RSNPCDefinition extends NPCDefinition
-{
- @Import("name")
- @Override
- String getName();
-
- @Import("archives")
- @Override
- int[] getModels();
-
- @Import("actions")
- @Override
- String[] getActions();
-
- @Import("isClickable")
- @Override
- boolean isClickable();
-
- @Import("drawMapDot")
- @Override
- boolean isMinimapVisible();
-
- @Import("isVisible")
- @Override
- boolean isVisible();
-
- @Import("id")
- @Override
- int getId();
-
- @Import("combatLevel")
- @Override
- int getCombatLevel();
-
- @Import("transforms")
- @Override
- int[] getConfigs();
-
- @Import("transform")
- @Override
- RSNPCDefinition transform();
-
- @Import("size")
- @Override
- int getSize();
-
- @Import("headIconPrayer")
- int getRsOverheadIcon();
-}
diff --git a/api/src/main/java/rs/api/RSNodeDeque.java b/api/src/main/java/rs/api/RSNodeDeque.java
deleted file mode 100644
index 1d19ecab80..0000000000
--- a/api/src/main/java/rs/api/RSNodeDeque.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package rs.api;
-
-import net.runelite.mapping.Import;
-
-public interface RSNodeDeque
-{
- @Import("current")
- RSNode getCurrent();
-
- @Import("sentinel")
- RSNode getHead();
-}
diff --git a/api/src/main/java/rs/api/RSNodeHashTable.java b/api/src/main/java/rs/api/RSNodeHashTable.java
deleted file mode 100644
index fc18df3b3b..0000000000
--- a/api/src/main/java/rs/api/RSNodeHashTable.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package rs.api;
-
-import api.HashTable;
-import net.runelite.mapping.Import;
-
-public interface RSNodeHashTable extends HashTable
-{
- @Import("get")
- @Override
- RSNode get(long value);
-
- @Import("size")
- int getSize();
-
- @Import("buckets")
- RSNode[] getBuckets();
-}
diff --git a/api/src/main/java/rs/api/RSObjectDefinition.java b/api/src/main/java/rs/api/RSObjectDefinition.java
deleted file mode 100644
index feeb0922ae..0000000000
--- a/api/src/main/java/rs/api/RSObjectDefinition.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package rs.api;
-
-import api.ObjectDefinition;
-import net.runelite.mapping.Import;
-
-public interface RSObjectDefinition extends ObjectDefinition
-{
- @Import("id")
- @Override
- int getId();
-
- @Import("name")
- @Override
- String getName();
-
- @Import("actions")
- @Override
- String[] getActions();
-
- @Import("mapSceneId")
- @Override
- int getMapSceneId();
-
- @Import("mapIconId")
- @Override
- int getMapIconId();
-
- @Import("transforms")
- @Override
- int[] getImpostorIds();
-
- @Import("transform")
- @Override
- RSObjectDefinition getImpostor();
-}
diff --git a/api/src/main/java/rs/api/RSPacketBuffer.java b/api/src/main/java/rs/api/RSPacketBuffer.java
deleted file mode 100644
index f9dbfac32e..0000000000
--- a/api/src/main/java/rs/api/RSPacketBuffer.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package rs.api;
-
-import api.PacketBuffer;
-
-public interface RSPacketBuffer extends PacketBuffer
-{
-}
diff --git a/api/src/main/java/rs/api/RSPlayerAppearance.java b/api/src/main/java/rs/api/RSPlayerAppearance.java
deleted file mode 100644
index b1bf272845..0000000000
--- a/api/src/main/java/rs/api/RSPlayerAppearance.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package rs.api;
-
-import api.PlayerAppearance;
-import net.runelite.mapping.Import;
-
-public interface RSPlayerAppearance extends PlayerAppearance
-{
- @Import("isFemale")
- boolean isFemale();
-
- @Import("bodyColors")
- int[] getBodyPartColours();
-
- @Import("equipment")
- @Override
- int[] getEquipmentIds();
-
- @Import("npcTransformId")
- @Override
- void setTransformedNpcId(int id);
-
- @Import("setHash")
- @Override
- void setHash();
-}
diff --git a/api/src/main/java/rs/api/RSReflectionCheck.java b/api/src/main/java/rs/api/RSReflectionCheck.java
deleted file mode 100644
index 5de9c99b1e..0000000000
--- a/api/src/main/java/rs/api/RSReflectionCheck.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package rs.api;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import net.runelite.mapping.Import;
-
-public interface RSReflectionCheck
-{
- @Import("methods")
- Method[] getMethods();
-
- @Import("fields")
- Field[] getFields();
-
- @Import("arguments")
- byte[][][] getArgs();
-}
diff --git a/api/src/main/java/rs/api/RSRunException.java b/api/src/main/java/rs/api/RSRunException.java
deleted file mode 100644
index acdd484585..0000000000
--- a/api/src/main/java/rs/api/RSRunException.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package rs.api;
-
-import net.runelite.mapping.Import;
-
-public interface RSRunException
-{
- @Import("throwable")
- Throwable getParent();
-}
diff --git a/api/src/main/java/rs/api/RSScene.java b/api/src/main/java/rs/api/RSScene.java
deleted file mode 100644
index 9df00300fc..0000000000
--- a/api/src/main/java/rs/api/RSScene.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package rs.api;
-
-import api.Scene;
-import api.Tile;
-import net.runelite.mapping.Import;
-
-public interface RSScene extends Scene
-{
- //@Import("Scene_gameObjects") --- unused and causing trouble
- //RSGameObject[] getObjects();
-
- @Import("tiles")
- @Override
- RSTile[][][] getTiles();
-
- @Import("drawTile")
- void draw(Tile tile, boolean var2);
-
- @Import("tileHeights")
- int[][][] getTileHeights();
-
- @Import("drawTileMinimap")
- void drawTile(int[] pixels, int pixelOffset, int width, int z, int x, int y);
-
- @Import("occlude")
- void updateOccluders();
-
- @Import("xSize")
- int getMaxX();
-
- @Import("planes")
- int getMaxY();
-
- @Import("ySize")
- int getMaxZ();
-
- @Import("Scene_minPlane")
- int getMinLevel();
-}
diff --git a/api/src/main/java/rs/api/RSScript.java b/api/src/main/java/rs/api/RSScript.java
deleted file mode 100644
index eb76b24058..0000000000
--- a/api/src/main/java/rs/api/RSScript.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package rs.api;
-
-import api.Script;
-import net.runelite.mapping.Import;
-
-public interface RSScript extends Script, RSDualNode
-{
- @Import("intOperands")
- @Override
- int[] getIntOperands();
-
- @Import("opcodes")
- @Override
- int[] getInstructions();
-}
diff --git a/api/src/main/java/rs/api/RSScriptEvent.java b/api/src/main/java/rs/api/RSScriptEvent.java
deleted file mode 100644
index 885879cd1d..0000000000
--- a/api/src/main/java/rs/api/RSScriptEvent.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package rs.api;
-
-import api.ScriptEvent;
-import api.widgets.Widget;
-import net.runelite.mapping.Import;
-
-public interface RSScriptEvent extends ScriptEvent
-{
- @Import("args0")
- Object[] getArguments();
-
- @Import("args0")
- void setArguments(Object[] args);
-
- @Import("widget")
- Widget getSource();
-
- @Import("opIndex")
- int getOp();
-
- @Import("targetName")
- String getOpbase();
-}
diff --git a/api/src/main/java/rs/api/RSSequenceDefinition.java b/api/src/main/java/rs/api/RSSequenceDefinition.java
deleted file mode 100644
index 591e535a01..0000000000
--- a/api/src/main/java/rs/api/RSSequenceDefinition.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package rs.api;
-
-import net.runelite.mapping.Import;
-
-public interface RSSequenceDefinition
-{
-// @Import("stretches")
-// boolean getStretches();
-//
-// @Import("maxLoops")
-// int getMaxLoops();
-//
-// @Import("precedenceAnimating") --- All unused
-// int getPrecedenceAnimating();
-//
-// @Import("replyMode")
-// int getReplyMode();
-//
-// @Import("interleaveLeave")
-// int[] getInterleaveLeave();
-
- @Import("frameIds")
- int[] getFrameIDs();
-
- @Import("frameLengths")
- int[] getFrameLenths();
-}
diff --git a/api/src/main/java/rs/api/RSSoundEffect.java b/api/src/main/java/rs/api/RSSoundEffect.java
deleted file mode 100644
index 7c7fd22ffe..0000000000
--- a/api/src/main/java/rs/api/RSSoundEffect.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package rs.api;
-
-public interface RSSoundEffect
-{
-}
diff --git a/api/src/main/java/rs/api/RSSprite.java b/api/src/main/java/rs/api/RSSprite.java
deleted file mode 100644
index 98425e05b2..0000000000
--- a/api/src/main/java/rs/api/RSSprite.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package rs.api;
-
-import api.Sprite;
-import net.runelite.mapping.Import;
-
-public interface RSSprite extends Sprite
-{
- @Import("drawAt")
- @Override
- void drawAt(int x, int y);
-
- @Import("subHeight")
- @Override
- int getHeight();
-
- @Import("subWidth")
- @Override
- int getWidth();
-
- @Import("pixels")
- @Override
- int[] getPixels();
-
- @Import("setRaster")
- void setRaster();
-
- @Import("width")
- void setMaxWidth(int maxWidth);
-
- @Import("height")
- void setMaxHeight(int maxHeight);
-
- @Import("xOffset")
- void setOffsetX(int offsetX);
-
- @Import("yOffset")
- void setOffsetY(int offsetY);
-}
diff --git a/api/src/main/java/rs/api/RSTexture.java b/api/src/main/java/rs/api/RSTexture.java
deleted file mode 100644
index aa525f793c..0000000000
--- a/api/src/main/java/rs/api/RSTexture.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package rs.api;
-
-import api.Texture;
-import net.runelite.mapping.Import;
-
-public interface RSTexture extends Texture, RSNode
-{
- @Import("pixels")
- @Override
- int[] getPixels();
-
- @Import("animationDirection")
- @Override
- int getAnimationDirection();
-
- @Import("animationSpeed")
- @Override
- int getAnimationSpeed();
-
- @Import("isLoaded")
- @Override
- boolean isLoaded();
-}
diff --git a/api/src/main/java/rs/api/RSTextureProvider.java b/api/src/main/java/rs/api/RSTextureProvider.java
deleted file mode 100644
index 30306c1a4f..0000000000
--- a/api/src/main/java/rs/api/RSTextureProvider.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package rs.api;
-
-import api.TextureProvider;
-import net.runelite.mapping.Import;
-
-public interface RSTextureProvider extends TextureProvider
-{
- @Import("brightness0")
- @Override
- double getBrightness();
-
- @Import("setBrightness")
- @Override
- void setBrightness(double brightness);
-
- @Import("capacity")
- void setMaxSize(int maxSize);
-
- @Import("remaining")
- void setSize(int size);
-
- @Import("textures")
- @Override
- RSTexture[] getTextures();
-
- @Import("load")
- @Override
- int[] load(int textureId);
-}
diff --git a/api/src/main/java/rs/api/RSTile.java b/api/src/main/java/rs/api/RSTile.java
deleted file mode 100644
index eb0ff71378..0000000000
--- a/api/src/main/java/rs/api/RSTile.java
+++ /dev/null
@@ -1,84 +0,0 @@
-package rs.api;
-
-import api.DecorativeObject;
-import api.GameObject;
-import api.GroundObject;
-import api.ItemLayer;
-import api.SceneTileModel;
-import api.SceneTilePaint;
-import api.Tile;
-import api.WallObject;
-import net.runelite.mapping.Import;
-
-public interface RSTile extends Tile
-{
- @Import("gameObjects")
- @Override
- GameObject[] getGameObjects();
-
- @Import("groundItemPile")
- @Override
- ItemLayer getItemLayer();
-
- @Import("wallDecoration")
- @Override
- DecorativeObject getDecorativeObject();
-
- @Import("floorDecoration")
- @Override
- GroundObject getGroundObject();
-
- @Import("boundaryObject")
- @Override
- WallObject getWallObject();
-
- @Import("paint")
- @Override
- SceneTilePaint getSceneTilePaint();
-
- @Import("model")
- @Override
- SceneTileModel getSceneTileModel();
-
- @Import("x")
- int getX();
-
- @Import("y")
- int getY();
-
- @Import("plane")
- @Override
- int getPlane();
-
- @Import("originalPlane")
- @Override
- int getRenderLevel();
-
- @Import("minPlane")
- int getPhysicalLevel();
-
- //@Import("flags")
- //int getFlags(); ---- unused, think it's gameobjectedgemask
-
- @Import("linkedBelowTile")
- @Override
- RSTile getBridge();
-
- @Import("drawPrimary")
- boolean isDraw();
-
- @Import("drawPrimary")
- void setDraw(boolean draw);
-
- @Import("drawSecondary")
- boolean isVisible();
-
- @Import("drawSecondary")
- void setVisible(boolean visible);
-
- @Import("drawGameObjects")
- void setDrawEntities(boolean drawEntities);
-
- @Import("drawGameObjectEdges")
- void setWallCullDirection(int wallCullDirection);
-}
diff --git a/api/src/main/java/rs/api/RSTileModel.java b/api/src/main/java/rs/api/RSTileModel.java
deleted file mode 100644
index 1863e8b61f..0000000000
--- a/api/src/main/java/rs/api/RSTileModel.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package rs.api;
-
-import api.SceneTileModel;
-import net.runelite.mapping.Import;
-
-public interface RSTileModel extends SceneTileModel
-{
- @Import("underlayRgb")
- @Override
- int getModelUnderlay();
-
- @Import("overlayRgb")
- @Override
- int getModelOverlay();
-
- @Import("shape")
- @Override
- int getShape();
-
- @Import("rotation")
- @Override
- int getRotation();
-
- @Import("faceX")
- @Override
- int[] getFaceX();
-
- @Import("faceY")
- @Override
- int[] getFaceY();
-
- @Import("faceZ")
- @Override
- int[] getFaceZ();
-
- @Import("vertexX")
- @Override
- int[] getVertexX();
-
- @Import("vertexY")
- @Override
- int[] getVertexY();
-
- @Import("vertexZ")
- @Override
- int[] getVertexZ();
-
- @Import("triangleColorA")
- @Override
- int[] getTriangleColorA();
-
- @Import("triangleColorB")
- @Override
- int[] getTriangleColorB();
-
- @Import("triangleColorC")
- @Override
- int[] getTriangleColorC();
-
- @Import("triangleTextureId")
- @Override
- int[] getTriangleTextureId();
-}
diff --git a/api/src/main/java/rs/api/RSTilePaint.java b/api/src/main/java/rs/api/RSTilePaint.java
deleted file mode 100644
index 9e1d4355e6..0000000000
--- a/api/src/main/java/rs/api/RSTilePaint.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package rs.api;
-
-import api.SceneTilePaint;
-import net.runelite.mapping.Import;
-
-public interface RSTilePaint extends SceneTilePaint
-{
- @Import("rgb")
- @Override
- int getRBG();
-
- @Import("swColor")
- @Override
- int getSwColor();
-
- @Import("seColor")
- @Override
- int getSeColor();
-
- @Import("nwColor")
- @Override
- int getNwColor();
-
- @Import("neColor")
- @Override
- int getNeColor();
-
- @Import("texture")
- @Override
- int getTexture();
-}
diff --git a/api/src/main/java/rs/api/RSUser.java b/api/src/main/java/rs/api/RSUser.java
deleted file mode 100644
index 9a57f8f3f6..0000000000
--- a/api/src/main/java/rs/api/RSUser.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package rs.api;
-
-import api.Nameable;
-import net.runelite.mapping.Import;
-
-public interface RSUser extends Nameable, Comparable
-{
- @Import("username")
- RSUsername getRsName();
-
- @Import("previousUsername")
- RSUsername getRsPrevName();
-}
diff --git a/api/src/main/java/rs/api/RSUserList.java b/api/src/main/java/rs/api/RSUserList.java
deleted file mode 100644
index 4542b5ef30..0000000000
--- a/api/src/main/java/rs/api/RSUserList.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package rs.api;
-
-import net.runelite.mapping.Import;
-
-public interface RSUserList
-{
- @Import("size0")
- int getCount();
-
- @Import("array")
- T[] getNameables();
-
- @Import("contains")
- boolean isMember(RSUsername var1);
-
- @Import("getByUsername")
- T findByName(RSUsername name);
-
- /**
- * Method called by the container when an element is added
- * @param name
- * @param prevName
- */
- void rl$add(RSUsername name, RSUsername prevName);
-
- /**
- * Method called by the container when an element is removed
- * @param nameable
- */
- void rl$remove(RSUser nameable);
-}
diff --git a/api/src/main/java/rs/api/RSVarbitDefinition.java b/api/src/main/java/rs/api/RSVarbitDefinition.java
deleted file mode 100644
index d3328a7d38..0000000000
--- a/api/src/main/java/rs/api/RSVarbitDefinition.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package rs.api;
-
-import net.runelite.mapping.Import;
-
-public interface RSVarbitDefinition extends RSDualNode
-{
- @Import("varp")
- int getIndex();
-
- @Import("lowBit")
- int getLeastSignificantBit();
-
- @Import("highBit")
- int getMostSignificantBit();
-}
diff --git a/api/src/main/java/rs/api/RSVarcs.java b/api/src/main/java/rs/api/RSVarcs.java
deleted file mode 100644
index 93f0ad15b1..0000000000
--- a/api/src/main/java/rs/api/RSVarcs.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package rs.api;
-
-import java.util.Map;
-import net.runelite.mapping.Import;
-
-public interface RSVarcs
-{
- @Import("map")
- Map getVarcMap();
-}
diff --git a/api/src/main/java/rs/api/RSWallDecoration.java b/api/src/main/java/rs/api/RSWallDecoration.java
deleted file mode 100644
index f671202a9d..0000000000
--- a/api/src/main/java/rs/api/RSWallDecoration.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package rs.api;
-
-import api.DecorativeObject;
-import net.runelite.mapping.Import;
-
-public interface RSWallDecoration extends DecorativeObject
-{
- @Import("tag")
- @Override
- long getHash();
-
- @Import("x")
- int getX();
-
- @Import("y")
- int getY();
-
- @Import("xOffset")
- int getXOffset();
-
- @Import("yOffset")
- int getYOffset();
-
- @Import("orientation")
- int getOrientation();
-
- @Import("entity1")
- @Override
- RSEntity getRenderable();
-
- @Import("entity2")
- @Override
- RSEntity getRenderable2();
-
- void setPlane(int plane);
-}
diff --git a/api/src/main/java/rs/api/RSWidgetGroupParent.java b/api/src/main/java/rs/api/RSWidgetGroupParent.java
deleted file mode 100644
index b3e1f9c4be..0000000000
--- a/api/src/main/java/rs/api/RSWidgetGroupParent.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package rs.api;
-
-import api.WidgetNode;
-import net.runelite.mapping.Import;
-
-public interface RSWidgetGroupParent extends RSNode, WidgetNode
-{
- @Import("group")
- @Override
- int getId();
-}
diff --git a/api/src/main/java/rs/api/RSWorld.java b/api/src/main/java/rs/api/RSWorld.java
deleted file mode 100644
index d176873c8f..0000000000
--- a/api/src/main/java/rs/api/RSWorld.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package rs.api;
-
-import api.World;
-import net.runelite.mapping.Import;
-
-public interface RSWorld extends World
-{
- @Import("properties")
- int getMask();
-
- @Import("properties")
- void setMask(int mask);
-
- @Import("population")
- @Override
- int getPlayerCount();
-
- @Import("population")
- @Override
- void setPlayerCount(int playerCount);
-
- @Import("location")
- @Override
- int getLocation();
-
- @Import("location")
- @Override
- void setLocation(int location);
-
- @Import("index")
- @Override
- int getIndex();
-
- @Import("index")
- @Override
- void setIndex(int index);
-
- @Import("id")
- @Override
- int getId();
-
- @Import("id")
- @Override
- void setId(int id);
-
- @Import("activity")
- @Override
- String getActivity();
-
- @Import("activity")
- @Override
- void setActivity(String activity);
-
- @Import("host")
- @Override
- String getAddress();
-
- @Import("host")
- @Override
- void setAddress(String address);
-}
diff --git a/api/src/main/java/rs/api/RSWorldMap.java b/api/src/main/java/rs/api/RSWorldMap.java
deleted file mode 100644
index fe74a34d86..0000000000
--- a/api/src/main/java/rs/api/RSWorldMap.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package rs.api;
-
-import api.RenderOverview;
-import api.WorldMapData;
-import net.runelite.mapping.Import;
-
-public interface RSWorldMap extends RenderOverview
-{
- @Import("worldMapX")
- int getWorldMapX();
-
- @Import("worldMapY")
- int getWorldMapY();
-
- @Import("zoomTarget")
- float getWorldMapZoom();
-
- @Import("worldMapTargetX")
- int getWorldMapTargetX();
-
- @Import("worldMapTargetY")
- int getWorldMapTargetY();
-
- //@Import("worldMapDisplayWidth")
- //int getWorldMapDisplayWidth();
-//Both unused
- //@Import("worldMapDisplayHeight")
- //int getWorldMapDisplayHeight();
-
- //@Import("worldMapDisplayX")
- //int getWorldMapDisplayX();
-
- //@Import("worldMapDisplayY")
- //int getWorldMapDisplayY();
-
- @Import("setWorldMapPosition")
- void setWorldMapPosition(int worldMapX, int worldMapY, boolean changedSurface);
-
- @Import("setWorldMapPositionTarget")
- void setWorldMapPositionTarget(int worldPointX, int worldPointY);
-
- @Import("worldMapManager")
- @Override
- RSWorldMapManager getWorldMapManager();
-
- @Import("initializeWorldMap")
- @Override
- void initializeWorldMap(WorldMapData var1);
-
- @Import("mainMapArea")
- @Override
- RSWorldMapArea getWorldMapData();
-}
diff --git a/api/src/main/java/rs/api/RSWorldMapArea.java b/api/src/main/java/rs/api/RSWorldMapArea.java
deleted file mode 100644
index 6035b64b51..0000000000
--- a/api/src/main/java/rs/api/RSWorldMapArea.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package rs.api;
-
-import api.WorldMapData;
-import net.runelite.mapping.Import;
-
-public interface RSWorldMapArea extends WorldMapData
-{
- @Import("containsPosition")
- boolean surfaceContainsPosition(int x, int y);
-}
diff --git a/api/src/main/java/rs/api/RSWorldMapElement.java b/api/src/main/java/rs/api/RSWorldMapElement.java
deleted file mode 100644
index 6957121a56..0000000000
--- a/api/src/main/java/rs/api/RSWorldMapElement.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package rs.api;
-
-import api.MapElementConfig;
-import net.runelite.mapping.Import;
-
-public interface RSWorldMapElement extends RSDualNode, MapElementConfig
-{
- @Import("getSprite")
- @Override
- RSSprite getMapIcon(boolean var1);
-}
diff --git a/api/src/main/java/rs/api/RSWorldMapManager.java b/api/src/main/java/rs/api/RSWorldMapManager.java
deleted file mode 100644
index 1c1a74fa55..0000000000
--- a/api/src/main/java/rs/api/RSWorldMapManager.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package rs.api;
-
-import api.WorldMapManager;
-import net.runelite.mapping.Import;
-
-public interface RSWorldMapManager extends WorldMapManager
-{
- @Import("isLoaded0")
- @Override
- boolean isLoaded();
-
- @Import("surfaceOffsetX")
- int getSurfaceOffsetX();
-
- @Import("surfaceOffsetY")
- int getSurfaceOffsetY();
-
- @Import("getPixelsPerTile")
- float getPixelsPerTile(int graphicsDiff, int worldDiff);
-}
diff --git a/injected-client/pom.xml b/cache-client/pom.xml
similarity index 57%
rename from injected-client/pom.xml
rename to cache-client/pom.xml
index 98f48b022e..ebe28ee8c8 100644
--- a/injected-client/pom.xml
+++ b/cache-client/pom.xml
@@ -27,62 +27,40 @@
4.0.0
- com.runeswag
- runeswag-parent
- 1.0-SNAPSHOT
+ net.runelite
+ runelite-parent
+ 1.5.27-SNAPSHOT
- injected-client
- Injected Client
+ cache-client
+ Cache Clientnet.runelite
- client
- 1.5.26-SNAPSHOT
- true
+ cache
+ ${project.version}
- com.runeswag
- api
- 1.0-SNAPSHOT
- false
+ net.runelite
+ protocol
+ ${project.version}
+
+
+
+ junit
+ junit
- net.runelite.rs
- vanilla
- 180
- true
+ org.slf4j
+ slf4j-simple
+
+
+ net.runelite
+ cache
+ ${project.version}
+ test-jar
+ test
-
-
-
-
- net.runelite.rs
- injector-plugin
- 1.5.26-SNAPSHOT
-
-
-
- runelite-injector
-
-
-
-
-
- org.apache.maven.plugins
- maven-dependency-plugin
- 2.3
-
-
- generate-sources
-
- properties
-
-
-
-
-
-
diff --git a/deobfuscator/src/main/java/net/runelite/asm/attributes/Exceptions.java b/cache-client/src/main/java/net/runelite/cache/client/ArchiveResponseHandler.java
similarity index 68%
rename from deobfuscator/src/main/java/net/runelite/asm/attributes/Exceptions.java
rename to cache-client/src/main/java/net/runelite/cache/client/ArchiveResponseHandler.java
index 0b12c513fd..f6bffbeba1 100644
--- a/deobfuscator/src/main/java/net/runelite/asm/attributes/Exceptions.java
+++ b/cache-client/src/main/java/net/runelite/cache/client/ArchiveResponseHandler.java
@@ -22,38 +22,27 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+package net.runelite.cache.client;
-package net.runelite.asm.attributes;
+import io.netty.channel.ChannelHandlerContext;
+import io.netty.channel.SimpleChannelInboundHandler;
+import net.runelite.protocol.api.update.ArchiveResponsePacket;
-import java.util.ArrayList;
-import java.util.List;
-import net.runelite.asm.ClassFile;
-import net.runelite.asm.pool.Class;
-
-public class Exceptions
+public class ArchiveResponseHandler extends SimpleChannelInboundHandler
{
- private final List classes = new ArrayList<>();
+ private final CacheClient client;
- public void addException(Class cl)
+ public ArchiveResponseHandler(CacheClient client)
{
- classes.add(cl);
+ this.client = client;
}
- public List getExceptions()
+ @Override
+ protected void channelRead0(ChannelHandlerContext ctx, ArchiveResponsePacket archiveResponse) throws Exception
{
- return classes;
- }
-
- public void renameClass(ClassFile cf, String name)
- {
- for (Class c : new ArrayList<>(classes))
- {
- if (c.getName().equals(cf.getName()))
- {
- int idx = classes.indexOf(c);
- classes.remove(idx);
- classes.add(idx, new Class(name));
- }
- }
+ client.onFileFinish(archiveResponse.getIndex(),
+ archiveResponse.getArchive(),
+ archiveResponse.getData());
}
+
}
diff --git a/cache-client/src/main/java/net/runelite/cache/client/CacheClient.java b/cache-client/src/main/java/net/runelite/cache/client/CacheClient.java
new file mode 100644
index 0000000000..273da5d5fa
--- /dev/null
+++ b/cache-client/src/main/java/net/runelite/cache/client/CacheClient.java
@@ -0,0 +1,459 @@
+/*
+ * Copyright (c) 2016-2017, Adam
+ * 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.cache.client;
+
+import com.google.common.base.Stopwatch;
+import io.netty.bootstrap.Bootstrap;
+import io.netty.buffer.ByteBuf;
+import io.netty.buffer.Unpooled;
+import io.netty.channel.Channel;
+import io.netty.channel.ChannelFuture;
+import io.netty.channel.ChannelInitializer;
+import io.netty.channel.ChannelOption;
+import io.netty.channel.ChannelPipeline;
+import io.netty.channel.EventLoopGroup;
+import io.netty.channel.nio.NioEventLoopGroup;
+import io.netty.channel.socket.SocketChannel;
+import io.netty.channel.socket.nio.NioSocketChannel;
+import java.io.IOException;
+import java.util.ArrayDeque;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Queue;
+import java.util.concurrent.CompletableFuture;
+import net.runelite.cache.fs.Archive;
+import net.runelite.cache.fs.Index;
+import net.runelite.cache.fs.Storage;
+import net.runelite.cache.fs.Store;
+import net.runelite.cache.index.ArchiveData;
+import net.runelite.cache.index.IndexData;
+import net.runelite.protocol.update.decoders.HandshakeResponseDecoder;
+import net.runelite.protocol.update.encoders.ArchiveRequestEncoder;
+import net.runelite.protocol.update.encoders.EncryptionEncoder;
+import net.runelite.protocol.api.update.ArchiveRequestPacket;
+import net.runelite.protocol.api.login.HandshakeResponseType;
+import net.runelite.cache.util.Crc32;
+import net.runelite.protocol.api.handshake.UpdateHandshakePacket;
+import net.runelite.protocol.handshake.UpdateHandshakeEncoder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class CacheClient implements AutoCloseable
+{
+ private static final Logger logger = LoggerFactory.getLogger(CacheClient.class);
+
+ private static final String HOST = "oldschool1.runescape.com";
+ private static final int PORT = 43594;
+
+ private static final int MAX_REQUESTS = 19; // too many and the server closes the conncetion
+
+ private final Store store; // store cache will be written to
+ private final String host;
+ private final int clientRevision;
+ private DownloadWatcher watcher;
+
+ private ClientState state;
+
+ private final EventLoopGroup group = new NioEventLoopGroup(1);
+ private Channel channel;
+
+ private CompletableFuture handshakeFuture;
+ private final Queue requests = new ArrayDeque<>();
+
+ public CacheClient(Store store, int clientRevision)
+ {
+ this(store, HOST, clientRevision);
+ }
+
+ public CacheClient(Store store, String host, int clientRevision)
+ {
+ this.store = store;
+ this.host = host;
+ this.clientRevision = clientRevision;
+ }
+
+ public CacheClient(Store store, int clientRevision, DownloadWatcher watcher)
+ {
+ this(store, clientRevision);
+ this.watcher = watcher;
+ }
+
+ public void connect()
+ {
+ Bootstrap b = new Bootstrap();
+ b.group(group)
+ .channel(NioSocketChannel.class)
+ .option(ChannelOption.TCP_NODELAY, true)
+ .handler(new ChannelInitializer()
+ {
+ @Override
+ public void initChannel(SocketChannel ch) throws Exception
+ {
+ ChannelPipeline p = ch.pipeline();
+
+ //p.addFirst(new HttpProxyHandler(new InetSocketAddress("runelite.net", 3128)));
+ p.addLast("decoder", new HandshakeResponseDecoder());
+
+ p.addLast(
+ new CacheClientHandler(),
+ new HandshakeResponseHandler(CacheClient.this),
+ new ArchiveResponseHandler(CacheClient.this)
+ );
+
+ p.addLast(
+ new UpdateHandshakeEncoder(),
+ new EncryptionEncoder(),
+ new ArchiveRequestEncoder()
+ );
+ }
+ });
+
+ // Start the client.
+ ChannelFuture f = b.connect(host, PORT).syncUninterruptibly();
+ channel = f.channel();
+ }
+
+ public CompletableFuture handshake()
+ {
+ UpdateHandshakePacket handshakePacket = new UpdateHandshakePacket();
+ handshakePacket.setRevision(getClientRevision());
+
+ state = ClientState.HANDSHAKING;
+
+ assert handshakeFuture == null;
+ handshakeFuture = new CompletableFuture<>();
+
+ channel.writeAndFlush(handshakePacket);
+
+ logger.info("Sent handshake with revision {}", handshakePacket.getRevision());
+
+ return handshakeFuture;
+ }
+
+ @Override
+ public void close()
+ {
+ channel.close().syncUninterruptibly();
+ group.shutdownGracefully();
+ }
+
+ public int getClientRevision()
+ {
+ return clientRevision;
+ }
+
+ public ClientState getState()
+ {
+ return state;
+ }
+
+ void setState(ClientState state)
+ {
+ this.state = state;
+ }
+
+ CompletableFuture getHandshakeFuture()
+ {
+ return handshakeFuture;
+ }
+
+ public List requestIndexes() throws IOException
+ {
+ logger.info("Requesting indexes");
+
+ FileResult result = requestFile(255, 255, true).join();
+ result.decompress(null);
+
+ ByteBuf buffer = Unpooled.wrappedBuffer(result.getContents());
+ int indexCount = result.getContents().length / 8;
+ List indexInfo = new ArrayList<>();
+
+ for (int i = 0; i < indexCount; ++i)
+ {
+ int crc = buffer.readInt();
+ int revision = buffer.readInt();
+ indexInfo.add(new IndexInfo(i, crc, revision));
+ }
+
+ return indexInfo;
+ }
+
+ public void download() throws IOException
+ {
+ Stopwatch stopwatch = Stopwatch.createStarted();
+
+ List indexes = requestIndexes();
+ for (IndexInfo indexInfo : indexes)
+ {
+ int i = indexInfo.getId();
+ int crc = indexInfo.getCrc();
+ int revision = indexInfo.getRevision();
+
+ Index index = store.findIndex(i);
+
+ if (index == null)
+ {
+ logger.info("Index {} does not exist, creating", i);
+ }
+ else if (index.getRevision() != revision)
+ {
+ if (revision < index.getRevision())
+ {
+ logger.warn("Index {} revision is going BACKWARDS! (our revision {}, their revision {})", index.getId(), index.getRevision(), revision);
+ }
+ else
+ {
+ logger.info("Index {} has the wrong revision (our revision {}, their revision {})", index.getId(), index.getRevision(), revision);
+ }
+ }
+ else if (index.getCrc() != crc)
+ {
+ logger.warn("Index {} CRC has changed! (our crc {}, their crc {})",
+ index.getCrc(), index.getCrc(), crc);
+ }
+ else
+ {
+ // despite the index being up to date, not everything
+ // can be downloaded, eg. for tracks.
+ logger.info("Index {} is up to date", index.getId());
+ }
+
+ logger.info("Downloading index {}", i);
+
+ FileResult indexFileResult = requestFile(255, i, true).join();
+ indexFileResult.decompress(null);
+
+ logger.info("Downloaded index {}", i);
+
+ if (indexFileResult.getCrc() != crc)
+ {
+ logger.warn("Corrupted download for index {}", i);
+ continue;
+ }
+
+ IndexData indexData = new IndexData();
+ indexData.load(indexFileResult.getContents());
+
+ if (index == null)
+ {
+ index = store.addIndex(i);
+ }
+
+ // update index settings
+ index.setProtocol(indexData.getProtocol());
+ index.setNamed(indexData.isNamed());
+ index.setCrc(crc);
+ index.setRevision(revision);
+
+ logger.info("Index {} has {} archives", i, indexData.getArchives().length);
+
+ for (ArchiveData ad : indexData.getArchives())
+ {
+ Archive existing = index.getArchive(ad.getId());
+
+ if (existing != null && existing.getRevision() == ad.getRevision()
+ && existing.getCrc() == ad.getCrc()
+ && existing.getNameHash() == ad.getNameHash())
+ {
+ logger.debug("Archive {}/{} in index {} is up to date",
+ ad.getId(), indexData.getArchives().length, index.getId());
+ continue;
+ }
+
+ if (existing == null)
+ {
+ logger.info("Archive {}/{} in index {} is out of date, downloading",
+ ad.getId(), indexData.getArchives().length, index.getId());
+ }
+ else if (ad.getRevision() < existing.getRevision())
+ {
+ logger.warn("Archive {}/{} in index {} revision is going BACKWARDS! (our revision {}, their revision {})",
+ ad.getId(), indexData.getArchives().length, index.getId(),
+ existing.getRevision(), ad.getRevision());
+ }
+ else
+ {
+ logger.info("Archive {}/{} in index {} is out of date, downloading. " +
+ "revision: ours: {} theirs: {}, crc: ours: {} theirs {}, name: ours {} theirs {}",
+ ad.getId(), indexData.getArchives().length, index.getId(),
+ existing.getRevision(), ad.getRevision(),
+ existing.getCrc(), ad.getCrc(),
+ existing.getNameHash(), ad.getNameHash());
+ }
+
+ final Archive archive = existing == null
+ ? index.addArchive(ad.getId())
+ : existing;
+
+ archive.setRevision(ad.getRevision());
+ archive.setCrc(ad.getCrc());
+ archive.setNameHash(ad.getNameHash());
+
+ // Add files
+ archive.setFileData(ad.getFiles());
+
+ CompletableFuture future = requestFile(index.getId(), ad.getId(), false);
+ future.handle((fr, ex) ->
+ {
+ byte[] data = fr.getCompressedData();
+
+ Crc32 crc32 = new Crc32();
+ crc32.update(data, 0, data.length);
+ int hash = crc32.getHash();
+
+ if (hash != archive.getCrc())
+ {
+ logger.warn("crc mismatch on downloaded archive {}/{}: {} != {}",
+ archive.getIndex().getId(), archive.getArchiveId(),
+ hash, archive.getCrc());
+ throw new RuntimeException("crc mismatch");
+ }
+
+ if (watcher != null)
+ {
+ watcher.downloadComplete(archive, data);
+ }
+ else
+ {
+ try
+ {
+ Storage storage = store.getStorage();
+ storage.saveArchive(archive, data);
+ }
+ catch (IOException ex1)
+ {
+ logger.warn("unable to save archive data", ex1);
+ }
+ }
+ return null;
+ });
+ }
+ }
+
+ // flush any pending requests
+ channel.flush();
+
+ while (!requests.isEmpty())
+ {
+ // wait for pending requests
+ synchronized (this)
+ {
+ try
+ {
+ wait();
+ }
+ catch (InterruptedException ex)
+ {
+ logger.warn(null, ex);
+ }
+ }
+ }
+
+ stopwatch.stop();
+ logger.info("Download completed in {}", stopwatch);
+ }
+
+ private synchronized CompletableFuture requestFile(int index, int fileId, boolean flush)
+ {
+ if (state != ClientState.CONNECTED)
+ {
+ throw new IllegalStateException("Can't request files until connected!");
+ }
+
+ if (!flush)
+ {
+ while (requests.size() >= MAX_REQUESTS)
+ {
+ channel.flush();
+
+ try
+ {
+ wait();
+ }
+ catch (InterruptedException ex)
+ {
+ logger.warn("interrupted while waiting for requests", ex);
+ }
+ }
+ }
+
+ ArchiveRequestPacket archiveRequest = new ArchiveRequestPacket();
+ archiveRequest.setPriority(false);
+ archiveRequest.setIndex(index);
+ archiveRequest.setArchive(fileId);
+
+ CompletableFuture future = new CompletableFuture<>();
+ PendingFileRequest pf = new PendingFileRequest(index,
+ fileId, future);
+
+ logger.trace("Sending request for {}/{}", index, fileId);
+
+ requests.add(pf);
+
+ if (!flush)
+ {
+ channel.write(archiveRequest);
+ }
+ else
+ {
+ channel.writeAndFlush(archiveRequest);
+ }
+
+ return future;
+ }
+
+ private PendingFileRequest findRequest(int index, int file)
+ {
+ for (PendingFileRequest pr : requests)
+ {
+ if (pr.getIndex() == index && pr.getArchive() == file)
+ {
+ return pr;
+ }
+ }
+ return null;
+ }
+
+ protected synchronized void onFileFinish(int index, int file, byte[] compressedData)
+ {
+ PendingFileRequest pr = findRequest(index, file);
+
+ if (pr == null)
+ {
+ logger.warn("File download {}/{} with no pending request", index, file);
+ return;
+ }
+
+ requests.remove(pr);
+
+ notify();
+
+ FileResult result = new FileResult(index, file, compressedData);
+
+ logger.debug("File download finished for index {} file {}, length {}", index, file, compressedData.length);
+
+ pr.getFuture().complete(result);
+ }
+}
diff --git a/cache-client/src/main/java/net/runelite/cache/client/CacheClientHandler.java b/cache-client/src/main/java/net/runelite/cache/client/CacheClientHandler.java
new file mode 100644
index 0000000000..9afe8f976b
--- /dev/null
+++ b/cache-client/src/main/java/net/runelite/cache/client/CacheClientHandler.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2016-2017, Adam
+ * 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.cache.client;
+
+import io.netty.channel.ChannelHandlerContext;
+import io.netty.channel.ChannelInboundHandlerAdapter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class CacheClientHandler extends ChannelInboundHandlerAdapter
+{
+ private static final Logger logger = LoggerFactory.getLogger(CacheClientHandler.class);
+
+ @Override
+ public void channelInactive(ChannelHandlerContext ctx) throws Exception
+ {
+ logger.warn("Channel has gone inactive");
+ }
+
+ @Override
+ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause)
+ {
+ // Close the connection when an exception is raised.
+ logger.warn(null, cause);
+ ctx.close();
+ }
+}
diff --git a/deobfuscator/src/main/java/net/runelite/asm/execution/FrameVisitor.java b/cache-client/src/main/java/net/runelite/cache/client/ClientState.java
similarity index 93%
rename from deobfuscator/src/main/java/net/runelite/asm/execution/FrameVisitor.java
rename to cache-client/src/main/java/net/runelite/cache/client/ClientState.java
index e5d59cfba1..5c859aa61c 100644
--- a/deobfuscator/src/main/java/net/runelite/asm/execution/FrameVisitor.java
+++ b/cache-client/src/main/java/net/runelite/cache/client/ClientState.java
@@ -22,10 +22,10 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+package net.runelite.cache.client;
-package net.runelite.asm.execution;
-
-public interface FrameVisitor
+public enum ClientState
{
- void visit(Frame f);
+ HANDSHAKING,
+ CONNECTED
}
diff --git a/cache-client/src/main/java/net/runelite/cache/client/DownloadWatcher.java b/cache-client/src/main/java/net/runelite/cache/client/DownloadWatcher.java
new file mode 100644
index 0000000000..3924c74541
--- /dev/null
+++ b/cache-client/src/main/java/net/runelite/cache/client/DownloadWatcher.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2016-2017, Adam
+ * 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.cache.client;
+
+import net.runelite.cache.fs.Archive;
+
+@FunctionalInterface
+public interface DownloadWatcher
+{
+ void downloadComplete(Archive archive, byte[] data);
+}
diff --git a/deobfuscator/src/main/java/net/runelite/asm/attributes/annotation/Annotation.java b/cache-client/src/main/java/net/runelite/cache/client/FileResult.java
similarity index 57%
rename from deobfuscator/src/main/java/net/runelite/asm/attributes/annotation/Annotation.java
rename to cache-client/src/main/java/net/runelite/cache/client/FileResult.java
index 7c727eb788..2c5046af62 100644
--- a/deobfuscator/src/main/java/net/runelite/asm/attributes/annotation/Annotation.java
+++ b/cache-client/src/main/java/net/runelite/cache/client/FileResult.java
@@ -22,61 +22,71 @@
* (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.cache.client;
-package net.runelite.asm.attributes.annotation;
+import java.io.IOException;
+import net.runelite.cache.fs.Container;
-import java.util.ArrayList;
-import java.util.List;
-
-import net.runelite.asm.Type;
-import net.runelite.asm.attributes.Annotations;
-import org.objectweb.asm.AnnotationVisitor;
-
-public class Annotation
+public class FileResult
{
- private final Annotations annotations;
- private Type type;
- private final List elements = new ArrayList<>();
+ private final int index;
+ private final int fileId;
+ private final byte[] compressedData;
- public Annotation(Annotations annotations)
+ private byte[] contents;
+ private int revision;
+ private int crc;
+ private int compression; // compression method used by archive data
+
+ public FileResult(int index, int fileId, byte[] compressedData)
{
- this.annotations = annotations;
+ this.index = index;
+ this.fileId = fileId;
+ this.compressedData = compressedData;
}
- public Annotations getAnnotations()
+ public int getIndex()
{
- return annotations;
+ return index;
}
- public void setType(Type type)
+ public int getFileId()
{
- this.type = type;
+ return fileId;
}
- public Type getType()
+ public byte[] getCompressedData()
{
- return type;
+ return compressedData;
}
- public List getElements()
+ public void decompress(int[] keys) throws IOException
{
- return elements;
+ Container res = Container.decompress(compressedData, keys);
+
+ contents = res.data;
+ revision = res.revision;
+ crc = res.crc;
+ compression = res.compression;
}
-
- public Element getElement()
+
+ public byte[] getContents()
{
- return elements.get(0);
+ return contents;
}
-
- public void addElement(Element element)
+
+ public int getRevision()
{
- elements.add(element);
+ return revision;
}
-
- public void accept(AnnotationVisitor visitor)
+
+ public int getCrc()
{
- for (Element element : elements)
- visitor.visit(element.getName(), element.getValue());
- visitor.visitEnd();
+ return crc;
+ }
+
+ public int getCompression()
+ {
+ return compression;
}
}
diff --git a/cache-client/src/main/java/net/runelite/cache/client/HandshakeResponseHandler.java b/cache-client/src/main/java/net/runelite/cache/client/HandshakeResponseHandler.java
new file mode 100644
index 0000000000..bcbb01bafb
--- /dev/null
+++ b/cache-client/src/main/java/net/runelite/cache/client/HandshakeResponseHandler.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2016-2017, Adam
+ * 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.cache.client;
+
+import io.netty.channel.Channel;
+import io.netty.channel.ChannelHandlerContext;
+import io.netty.channel.ChannelPipeline;
+import io.netty.channel.SimpleChannelInboundHandler;
+import java.util.concurrent.CompletableFuture;
+import net.runelite.protocol.update.decoders.ArchiveResponseDecoder;
+import net.runelite.protocol.api.update.EncryptionPacket;
+import net.runelite.protocol.api.handshake.HandshakeResponsePacket;
+import net.runelite.protocol.api.login.HandshakeResponseType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class HandshakeResponseHandler extends SimpleChannelInboundHandler
+{
+ private static final Logger logger = LoggerFactory.getLogger(HandshakeResponseHandler.class);
+
+ private final CacheClient client;
+
+ public HandshakeResponseHandler(CacheClient client)
+ {
+ this.client = client;
+ }
+
+ @Override
+ protected void channelRead0(ChannelHandlerContext ctx, HandshakeResponsePacket handshakeResponse) throws Exception
+ {
+ Channel channel = ctx.channel();
+ ChannelPipeline p = ctx.pipeline();
+ CompletableFuture handshakeFuture = client.getHandshakeFuture();
+
+ assert handshakeFuture != null;
+
+ if (handshakeResponse.getResponse() != HandshakeResponseType.RESPONSE_OK)
+ {
+ logger.warn("Non-ok response from server {}", handshakeResponse.getResponse());
+ handshakeFuture.complete(handshakeResponse.getResponse());
+ ctx.close();
+ return;
+ }
+
+ // Send encryption packet
+ EncryptionPacket encryptionPacket = new EncryptionPacket();
+ encryptionPacket.setKey((byte) 0);
+ channel.writeAndFlush(encryptionPacket);
+
+ client.setState(ClientState.CONNECTED);
+
+ logger.info("Client is now connected!");
+
+ p.replace("decoder", "decoder", new ArchiveResponseDecoder());
+
+ handshakeFuture.complete(handshakeResponse.getResponse());
+ }
+
+}
diff --git a/deobfuscator/src/main/java/net/runelite/asm/pool/Method.java b/cache-client/src/main/java/net/runelite/cache/client/IndexInfo.java
similarity index 68%
rename from deobfuscator/src/main/java/net/runelite/asm/pool/Method.java
rename to cache-client/src/main/java/net/runelite/cache/client/IndexInfo.java
index 510868d191..b6f088e84b 100644
--- a/deobfuscator/src/main/java/net/runelite/asm/pool/Method.java
+++ b/cache-client/src/main/java/net/runelite/cache/client/IndexInfo.java
@@ -22,37 +22,34 @@
* (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.asm.pool;
+package net.runelite.cache.client;
-import java.util.Objects;
-import net.runelite.asm.signature.Signature;
-
-public class Method
+public class IndexInfo
{
- private final Class clazz;
- private final String name;
- private final Signature type;
+ private final int id;
+ private final int crc;
+ private final int revision;
- public Method(Class clazz, String name, Signature type)
+ public IndexInfo(int id, int crc, int revision)
{
- this.clazz = clazz;
- this.name = name;
- this.type = type;
+ this.id = id;
+ this.crc = crc;
+ this.revision = revision;
}
@Override
public String toString()
{
- return clazz + "." + name + type;
+ return "IndexInfo{" + "id=" + id + ", crc=" + crc + ", revision=" + revision + '}';
}
@Override
public int hashCode()
{
- int hash = 7;
- hash = 59 * hash + Objects.hashCode(this.clazz);
- hash = 59 * hash + Objects.hashCode(this.name);
- hash = 59 * hash + Objects.hashCode(this.type);
+ int hash = 5;
+ hash = 71 * hash + this.id;
+ hash = 71 * hash + this.crc;
+ hash = 71 * hash + this.revision;
return hash;
}
@@ -71,34 +68,34 @@ public class Method
{
return false;
}
- final Method other = (Method) obj;
- if (!Objects.equals(this.name, other.name))
+ final IndexInfo other = (IndexInfo) obj;
+ if (this.id != other.id)
{
return false;
}
- if (!Objects.equals(this.clazz, other.clazz))
+ if (this.crc != other.crc)
{
return false;
}
- if (!Objects.equals(this.type, other.type))
+ if (this.revision != other.revision)
{
return false;
}
return true;
}
- public Class getClazz()
+ public int getId()
{
- return clazz;
+ return id;
}
- public String getName()
+ public int getCrc()
{
- return name;
+ return crc;
}
- public Signature getType()
+ public int getRevision()
{
- return type;
+ return revision;
}
}
diff --git a/deobfuscator/src/main/java/net/runelite/deob/clientver/VersionMethodVisitor.java b/cache-client/src/main/java/net/runelite/cache/client/PendingFileRequest.java
similarity index 72%
rename from deobfuscator/src/main/java/net/runelite/deob/clientver/VersionMethodVisitor.java
rename to cache-client/src/main/java/net/runelite/cache/client/PendingFileRequest.java
index a8f5c4dec6..d07dc4f606 100644
--- a/deobfuscator/src/main/java/net/runelite/deob/clientver/VersionMethodVisitor.java
+++ b/cache-client/src/main/java/net/runelite/cache/client/PendingFileRequest.java
@@ -22,39 +22,35 @@
* (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.cache.client;
-package net.runelite.deob.clientver;
+import java.util.concurrent.CompletableFuture;
-import org.objectweb.asm.MethodVisitor;
-import org.objectweb.asm.Opcodes;
-
-public class VersionMethodVisitor extends MethodVisitor
+public class PendingFileRequest
{
- private int state = 0;
- private int version = -1;
+ private final int index;
+ private final int archive;
+ private final CompletableFuture future;
- VersionMethodVisitor()
+ public PendingFileRequest(int index, int archive, CompletableFuture future)
{
- super(Opcodes.ASM5);
+ this.index = index;
+ this.archive = archive;
+ this.future = future;
}
- @Override
- public void visitIntInsn(int opcode, int operand)
+ public int getIndex()
{
- if (state == 2)
- {
- version = operand;
- ++state;
- }
-
- if (operand == 765 || operand == 503)
- {
- ++state;
- }
+ return index;
}
- public int getVersion()
+ public int getArchive()
{
- return version;
+ return archive;
+ }
+
+ public CompletableFuture getFuture()
+ {
+ return future;
}
}
diff --git a/cache-client/src/test/java/net/runelite/cache/client/CacheClientTest.java b/cache-client/src/test/java/net/runelite/cache/client/CacheClientTest.java
new file mode 100644
index 0000000000..f5ba5d6824
--- /dev/null
+++ b/cache-client/src/test/java/net/runelite/cache/client/CacheClientTest.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2016-2017, Adam
+ * 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.cache.client;
+
+import java.io.File;
+import java.util.concurrent.CompletableFuture;
+import net.runelite.cache.CacheProperties;
+import net.runelite.cache.fs.Store;
+import net.runelite.protocol.api.login.HandshakeResponseType;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.slf4j.impl.SimpleLogger;
+
+public class CacheClientTest
+{
+ private static final Logger logger = LoggerFactory.getLogger(CacheClientTest.class);
+
+ @Before
+ public void before()
+ {
+ System.setProperty(SimpleLogger.DEFAULT_LOG_LEVEL_KEY, "TRACE");
+ }
+
+ @Test
+ @Ignore
+ public void test() throws Exception
+ {
+ try (Store store = new Store(new File("D:\\rs\\07\\temp\\cache")))
+ {
+ store.load();
+
+ CacheClient c = new CacheClient(store, CacheProperties.getRsVersion());
+ c.connect();
+ CompletableFuture handshake = c.handshake();
+
+ HandshakeResponseType result = handshake.get();
+ logger.info("Handshake result: {}", result);
+
+ Assert.assertEquals(HandshakeResponseType.RESPONSE_OK, result);
+
+ c.download();
+
+ c.close();
+
+ store.save();
+ }
+ }
+}
diff --git a/cache-updater/pom.xml b/cache-updater/pom.xml
new file mode 100644
index 0000000000..eec033bd29
--- /dev/null
+++ b/cache-updater/pom.xml
@@ -0,0 +1,104 @@
+
+
+
+ 4.0.0
+
+ net.runelite
+ runelite-parent
+ 1.5.27-SNAPSHOT
+
+
+ Cache Updater
+ cache-updater
+
+
+ 1.5.6.RELEASE
+ 5.1.45
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter
+ ${spring.boot.version}
+
+
+ org.springframework.boot
+ spring-boot-starter-jdbc
+ ${spring.boot.version}
+
+
+ org.springframework.boot
+ spring-boot-devtools
+ ${spring.boot.version}
+ true
+
+
+ mysql
+ mysql-connector-java
+ ${mysql.connector.version}
+
+
+ net.runelite
+ cache-client
+ ${project.version}
+
+
+ org.sql2o
+ sql2o
+
+
+ io.minio
+ minio
+
+
+ org.projectlombok
+ lombok
+ provided
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+ ${spring.boot.version}
+
+
+
+ repackage
+
+
+ spring-boot
+ net.runelite.cache.updater.CacheUpdater
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/cache-updater/schema.sql b/cache-updater/schema.sql
new file mode 100644
index 0000000000..a4e063e1a6
--- /dev/null
+++ b/cache-updater/schema.sql
@@ -0,0 +1,118 @@
+-- MySQL dump 10.16 Distrib 10.2.9-MariaDB, for Linux (x86_64)
+--
+-- Host: localhost Database: cache
+-- ------------------------------------------------------
+-- Server version 10.2.9-MariaDB
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+
+--
+-- Table structure for table `archive`
+--
+
+DROP TABLE IF EXISTS `archive`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `archive` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `archiveId` int(11) NOT NULL,
+ `nameHash` int(11) NOT NULL,
+ `crc` int(11) NOT NULL,
+ `revision` int(11) NOT NULL,
+ `hash` binary(32) NOT NULL,
+ PRIMARY KEY (`id`),
+ KEY `archive_revision` (`archiveId`,`revision`) USING BTREE
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `cache`
+--
+
+DROP TABLE IF EXISTS `cache`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `cache` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `revision` int(11) NOT NULL,
+ `date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `revision_date` (`revision`,`date`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `file`
+--
+
+DROP TABLE IF EXISTS `file`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `file` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `archive` int(11) NOT NULL,
+ `fileId` int(11) NOT NULL,
+ `nameHash` int(11) NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `archive_file` (`archive`,`fileId`),
+ CONSTRAINT `file_ibfk_1` FOREIGN KEY (`archive`) REFERENCES `archive` (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `index`
+--
+
+DROP TABLE IF EXISTS `index`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `index` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `cache` int(11) NOT NULL,
+ `indexId` int(11) NOT NULL,
+ `crc` int(11) NOT NULL,
+ `revision` int(11) NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `indexId` (`cache`,`indexId`,`revision`,`crc`) USING BTREE,
+ CONSTRAINT `index_ibfk_1` FOREIGN KEY (`cache`) REFERENCES `cache` (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `index_archive`
+--
+
+DROP TABLE IF EXISTS `index_archive`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `index_archive` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `index` int(11) NOT NULL,
+ `archive` int(11) NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `idx_index_archive` (`index`,`archive`) USING BTREE,
+ KEY `archive` (`archive`) USING BTREE,
+ CONSTRAINT `index_archive_ibfk_1` FOREIGN KEY (`index`) REFERENCES `index` (`id`),
+ CONSTRAINT `index_archive_ibfk_2` FOREIGN KEY (`archive`) REFERENCES `archive` (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
+/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+
+-- Dump completed on 2018-02-02 21:55:48
diff --git a/cache-updater/src/main/java/net/runelite/cache/updater/CacheConfiguration.java b/cache-updater/src/main/java/net/runelite/cache/updater/CacheConfiguration.java
new file mode 100644
index 0000000000..229ea1d268
--- /dev/null
+++ b/cache-updater/src/main/java/net/runelite/cache/updater/CacheConfiguration.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2018, Adam
+ * 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.cache.updater;
+
+import io.minio.MinioClient;
+import io.minio.errors.InvalidEndpointException;
+import io.minio.errors.InvalidPortException;
+import java.time.Instant;
+import java.util.HashMap;
+import java.util.Map;
+import javax.sql.DataSource;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.sql2o.Sql2o;
+import org.sql2o.converters.Converter;
+import org.sql2o.quirks.NoQuirks;
+
+@Configuration
+public class CacheConfiguration
+{
+ @Value("${minio.endpoint}")
+ private String minioUrl;
+
+ @Value("${minio.accesskey}")
+ private String minioAccessKey;
+
+ @Value("${minio.secretkey}")
+ private String minioSecretKey;
+
+ @Bean
+ @ConfigurationProperties(prefix = "datasource.runelite-cache")
+ public DataSource dataSource()
+ {
+ return DataSourceBuilder.create().build();
+ }
+
+ @Bean
+ @Qualifier("Runelite Cache SQL2O")
+ public Sql2o sql2o(DataSource dataSource)
+ {
+ Map converters = new HashMap<>();
+ converters.put(Instant.class, new InstantConverter());
+ return new Sql2o(dataSource, new NoQuirks(converters));
+ }
+
+ @Bean
+ public MinioClient minioClient() throws InvalidEndpointException, InvalidPortException
+ {
+ return new MinioClient(minioUrl, minioAccessKey, minioSecretKey);
+ }
+}
diff --git a/cache-updater/src/main/java/net/runelite/cache/updater/CacheDAO.java b/cache-updater/src/main/java/net/runelite/cache/updater/CacheDAO.java
new file mode 100644
index 0000000000..2834e5bb1e
--- /dev/null
+++ b/cache-updater/src/main/java/net/runelite/cache/updater/CacheDAO.java
@@ -0,0 +1,177 @@
+/*
+ * Copyright (c) 2017, Adam
+ * 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.cache.updater;
+
+import java.time.Instant;
+import java.util.List;
+import net.runelite.cache.updater.beans.ArchiveEntry;
+import net.runelite.cache.updater.beans.CacheEntry;
+import net.runelite.cache.updater.beans.IndexEntry;
+import org.sql2o.Connection;
+import org.sql2o.Query;
+import org.sql2o.ResultSetIterable;
+
+class CacheDAO
+{
+ // cache prepared statements for high volume queries
+ private Query associateArchive;
+ private Query findArchive, insertArchive;
+ private Query associateFile;
+
+ public CacheEntry findMostRecent(Connection con)
+ {
+ return con.createQuery("select id, revision, date from cache order by revision desc, date desc limit 1")
+ .executeAndFetchFirst(CacheEntry.class);
+ }
+
+ public List findIndexesForCache(Connection con, CacheEntry cache)
+ {
+ return con.createQuery("select id, indexId, crc, revision from `index` where cache = :cache")
+ .addParameter("cache", cache.getId())
+ .executeAndFetch(IndexEntry.class);
+ }
+
+ public ResultSetIterable findArchivesForIndex(Connection con, IndexEntry indexEntry)
+ {
+ return con.createQuery("select archive.id, archive.archiveId, archive.nameHash,"
+ + " archive.crc, archive.revision, archive.hash from index_archive "
+ + "join archive on index_archive.archive = archive.id "
+ + "where index_archive.index = :id")
+ .addParameter("id", indexEntry.getId())
+ .executeAndFetchLazy(ArchiveEntry.class);
+ }
+
+ public CacheEntry createCache(Connection con, int revision, Instant date)
+ {
+ int cacheId = con.createQuery("insert into cache (revision, date) values (:revision, :date)")
+ .addParameter("revision", revision)
+ .addParameter("date", date)
+ .executeUpdate()
+ .getKey(int.class);
+
+ CacheEntry entry = new CacheEntry();
+ entry.setId(cacheId);
+ entry.setRevision(revision);
+ entry.setDate(date);
+ return entry;
+ }
+
+ public IndexEntry createIndex(Connection con, CacheEntry cache, int indexId, int crc, int revision)
+ {
+ int id = con.createQuery("insert into `index` (cache, indexId, crc, revision) values (:cache, :indexId, :crc, :revision)")
+ .addParameter("cache", cache.getId())
+ .addParameter("indexId", indexId)
+ .addParameter("crc", crc)
+ .addParameter("revision", revision)
+ .executeUpdate()
+ .getKey(int.class);
+
+ IndexEntry entry = new IndexEntry();
+ entry.setId(id);
+ entry.setIndexId(indexId);
+ entry.setCrc(crc);
+ entry.setRevision(revision);
+ return entry;
+ }
+
+ public void associateArchiveToIndex(Connection con, ArchiveEntry archive, IndexEntry index)
+ {
+ if (associateArchive == null)
+ {
+ associateArchive = con.createQuery("insert into index_archive (`index`, archive) values (:index, :archive)");
+ }
+ associateArchive
+ .addParameter("index", index.getId())
+ .addParameter("archive", archive.getId())
+ .executeUpdate();
+ }
+
+ public ArchiveEntry findArchive(Connection con, IndexEntry index,
+ int archiveId, int nameHash, int crc, int revision)
+ {
+ if (findArchive == null)
+ {
+ findArchive = con.createQuery("select distinct archive.id, archive.archiveId, archive.nameHash,"
+ + " archive.crc, archive.revision, archive.hash from archive "
+ + " join index_archive on index_archive.archive = archive.id"
+ + " join `index` on index.id = index_archive.index"
+ + " where archive.archiveId = :archiveId"
+ + " and archive.nameHash = :nameHash"
+ + " and archive.crc = :crc"
+ + " and archive.revision = :revision"
+ + " and index.indexId = :indexId");
+ }
+
+ ArchiveEntry entry = findArchive
+ .addParameter("archiveId", archiveId)
+ .addParameter("nameHash", nameHash)
+ .addParameter("crc", crc)
+ .addParameter("revision", revision)
+ .addParameter("indexId", index.getIndexId())
+ .executeAndFetchFirst(ArchiveEntry.class);
+ return entry;
+ }
+
+ public ArchiveEntry createArchive(Connection con, IndexEntry index,
+ int archiveId, int nameHash, int crc, int revision, byte[] hash)
+ {
+ if (insertArchive == null)
+ {
+ insertArchive = con.createQuery("insert into archive (archiveId, nameHash, crc, revision, hash) values "
+ + "(:archiveId, :nameHash, :crc, :revision, :hash)");
+ }
+
+ int id = insertArchive
+ .addParameter("archiveId", archiveId)
+ .addParameter("nameHash", nameHash)
+ .addParameter("crc", crc)
+ .addParameter("revision", revision)
+ .addParameter("hash", hash)
+ .executeUpdate()
+ .getKey(int.class);
+
+ ArchiveEntry entry = new ArchiveEntry();
+ entry.setId(id);
+ entry.setArchiveId(archiveId);
+ entry.setNameHash(nameHash);
+ entry.setCrc(crc);
+ entry.setRevision(revision);
+ entry.setHash(hash);
+ return entry;
+ }
+
+ public void associateFileToArchive(Connection con, ArchiveEntry archive, int fileId, int nameHash)
+ {
+ if (associateFile == null)
+ {
+ associateFile = con.createQuery("insert into file (archive, fileId, nameHash) values (:archive, :fileId, :nameHash)");
+ }
+ associateFile
+ .addParameter("archive", archive.getId())
+ .addParameter("fileId", fileId)
+ .addParameter("nameHash", nameHash)
+ .executeUpdate();
+ }
+}
diff --git a/cache-updater/src/main/java/net/runelite/cache/updater/CacheStorage.java b/cache-updater/src/main/java/net/runelite/cache/updater/CacheStorage.java
new file mode 100644
index 0000000000..cac605da09
--- /dev/null
+++ b/cache-updater/src/main/java/net/runelite/cache/updater/CacheStorage.java
@@ -0,0 +1,144 @@
+/*
+ * Copyright (c) 2017, Adam
+ * 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.cache.updater;
+
+import java.io.IOException;
+import java.util.List;
+import net.runelite.cache.fs.Archive;
+import net.runelite.cache.fs.Index;
+import net.runelite.cache.fs.Storage;
+import net.runelite.cache.fs.Store;
+import net.runelite.cache.index.FileData;
+import net.runelite.cache.updater.beans.ArchiveEntry;
+import net.runelite.cache.updater.beans.CacheEntry;
+import net.runelite.cache.updater.beans.IndexEntry;
+import org.sql2o.Connection;
+import org.sql2o.ResultSetIterable;
+
+public class CacheStorage implements Storage
+{
+ private CacheEntry cacheEntry;
+ private final CacheDAO cacheDao;
+ private final Connection con;
+
+ public CacheStorage(CacheEntry cacheEntry, CacheDAO cacheDao, Connection con)
+ {
+ this.cacheEntry = cacheEntry;
+ this.cacheDao = cacheDao;
+ this.con = con;
+ }
+
+ public CacheEntry getCacheEntry()
+ {
+ return cacheEntry;
+ }
+
+ public void setCacheEntry(CacheEntry cacheEntry)
+ {
+ this.cacheEntry = cacheEntry;
+ }
+
+ @Override
+ public void init(Store store) throws IOException
+ {
+ }
+
+ @Override
+ public void close() throws IOException
+ {
+ }
+
+ @Override
+ public void load(Store store) throws IOException
+ {
+ List indexes = cacheDao.findIndexesForCache(con, cacheEntry);
+ for (IndexEntry indexEntry : indexes)
+ {
+ Index index = store.addIndex(indexEntry.getIndexId());
+ index.setCrc(indexEntry.getCrc());
+ index.setRevision(indexEntry.getRevision());
+
+ try (ResultSetIterable archives = cacheDao.findArchivesForIndex(con, indexEntry))
+ {
+ for (ArchiveEntry archiveEntry : archives)
+ {
+ if (index.getArchive(archiveEntry.getArchiveId()) != null)
+ {
+ throw new IOException("Duplicate archive " + archiveEntry + " on " + indexEntry);
+ }
+
+ Archive archive = index.addArchive(archiveEntry.getArchiveId());
+ archive.setNameHash(archiveEntry.getNameHash());
+ archive.setCrc(archiveEntry.getCrc());
+ archive.setRevision(archiveEntry.getRevision());
+ archive.setHash(archiveEntry.getHash());
+
+ // File data is not necessary for cache updating
+ }
+ }
+ }
+ }
+
+ @Override
+ public void save(Store store) throws IOException
+ {
+ for (Index index : store.getIndexes())
+ {
+ IndexEntry entry = cacheDao.createIndex(con, cacheEntry, index.getId(), index.getCrc(), index.getRevision());
+
+ for (Archive archive : index.getArchives())
+ {
+ ArchiveEntry archiveEntry = cacheDao.findArchive(con, entry, archive.getArchiveId(),
+ archive.getNameHash(), archive.getCrc(), archive.getRevision());
+ if (archiveEntry == null)
+ {
+ byte[] hash = archive.getHash();
+ archiveEntry = cacheDao.createArchive(con, entry, archive.getArchiveId(),
+ archive.getNameHash(), archive.getCrc(), archive.getRevision(), hash);
+
+ for (FileData file : archive.getFileData())
+ {
+ cacheDao.associateFileToArchive(con, archiveEntry, file.getId(), file.getNameHash());
+ }
+ }
+
+ cacheDao.associateArchiveToIndex(con, archiveEntry, entry);
+ }
+ }
+ }
+
+ @Override
+ public byte[] loadArchive(Archive archive) throws IOException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void saveArchive(Archive archive, byte[] data) throws IOException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+}
diff --git a/cache-updater/src/main/java/net/runelite/cache/updater/CacheUpdater.java b/cache-updater/src/main/java/net/runelite/cache/updater/CacheUpdater.java
new file mode 100644
index 0000000000..1a8f81c5ec
--- /dev/null
+++ b/cache-updater/src/main/java/net/runelite/cache/updater/CacheUpdater.java
@@ -0,0 +1,173 @@
+/*
+ * Copyright (c) 2017, Adam
+ * 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.cache.updater;
+
+import io.minio.MinioClient;
+import io.minio.errors.InvalidEndpointException;
+import io.minio.errors.InvalidPortException;
+import java.io.IOException;
+import java.time.Instant;
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+import net.runelite.cache.client.CacheClient;
+import net.runelite.cache.client.IndexInfo;
+import net.runelite.cache.fs.Archive;
+import net.runelite.cache.fs.Store;
+import net.runelite.cache.updater.beans.CacheEntry;
+import net.runelite.cache.updater.beans.IndexEntry;
+import net.runelite.http.api.RuneLiteAPI;
+import net.runelite.protocol.api.login.HandshakeResponseType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.CommandLineRunner;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.sql2o.Connection;
+import org.sql2o.Sql2o;
+
+@SpringBootApplication
+public class CacheUpdater implements CommandLineRunner
+{
+ private static final Logger logger = LoggerFactory.getLogger(CacheUpdater.class);
+
+ private final Sql2o sql2o;
+ private final MinioClient minioClient;
+
+ @Value("${minio.bucket}")
+ private String minioBucket;
+
+ @Autowired
+ public CacheUpdater(
+ @Qualifier("Runelite Cache SQL2O") Sql2o sql2o,
+ MinioClient minioClient
+ )
+ {
+ this.sql2o = sql2o;
+ this.minioClient = minioClient;
+ }
+
+ public void update() throws IOException, InvalidEndpointException, InvalidPortException, InterruptedException
+ {
+ int rsVersion = RuneLiteAPI.getRsVersion();
+
+ try (Connection con = sql2o.beginTransaction())
+ {
+ CacheDAO cacheDao = new CacheDAO();
+ CacheEntry cache = cacheDao.findMostRecent(con);
+ boolean created = false;
+ if (cache == null)
+ {
+ created = true;
+ cache = cacheDao.createCache(con, rsVersion, Instant.now());
+ }
+
+ CacheStorage storage = new CacheStorage(cache, cacheDao, con);
+ Store store = new Store(storage);
+ store.load();
+
+ ExecutorService executor = Executors.newSingleThreadExecutor();
+
+ CacheClient client = new CacheClient(store, rsVersion,
+ (Archive archive, byte[] data) -> executor.submit(new CacheUploader(minioClient, minioBucket, archive, data)));
+
+ client.connect();
+ HandshakeResponseType result = client.handshake().join();
+
+ if (result != HandshakeResponseType.RESPONSE_OK)
+ {
+ logger.warn("Out of date!");
+ return;
+ }
+
+ List indexes = client.requestIndexes();
+ List entries = cacheDao.findIndexesForCache(con, cache);
+
+ if (!checkOutOfDate(indexes, entries))
+ {
+ logger.info("All up to date.");
+ return;
+ }
+
+ client.download();
+
+ CacheEntry newCache = created ? cache : cacheDao.createCache(con, rsVersion, Instant.now());
+
+ storage.setCacheEntry(newCache);
+ store.save();
+
+ // ensure objects are added to the store before they become
+ // visible in the database
+ executor.shutdown();
+ while (!executor.awaitTermination(1, TimeUnit.SECONDS))
+ {
+ logger.debug("Waiting for termination of executor...");
+ }
+
+ // commit database
+ con.commit();
+ }
+ }
+
+ private boolean checkOutOfDate(List indexes, List dbIndexes)
+ {
+ if (indexes.size() != dbIndexes.size())
+ {
+ return true;
+ }
+
+ for (int i = 0; i < indexes.size(); ++i)
+ {
+ IndexInfo ii = indexes.get(i);
+ IndexEntry ie = dbIndexes.get(i);
+
+ if (ii.getId() != ie.getIndexId()
+ || ii.getRevision() != ie.getRevision()
+ || ii.getCrc() != ie.getCrc())
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ @Override
+ public void run(String... args) throws Exception
+ {
+ update();
+ }
+
+ public static void main(String[] args)
+ {
+ SpringApplication.run(CacheUpdater.class, args).close();
+ System.exit(0);
+ }
+
+}
diff --git a/cache-updater/src/main/java/net/runelite/cache/updater/CacheUploader.java b/cache-updater/src/main/java/net/runelite/cache/updater/CacheUploader.java
new file mode 100644
index 0000000000..ed685a9034
--- /dev/null
+++ b/cache-updater/src/main/java/net/runelite/cache/updater/CacheUploader.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2017, Adam
+ * 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.cache.updater;
+
+import com.google.common.hash.Hashing;
+import com.google.common.io.BaseEncoding;
+import io.minio.MinioClient;
+import io.minio.errors.ErrorResponseException;
+import io.minio.errors.InsufficientDataException;
+import io.minio.errors.InternalException;
+import io.minio.errors.InvalidArgumentException;
+import io.minio.errors.InvalidBucketNameException;
+import io.minio.errors.NoResponseException;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.security.InvalidKeyException;
+import java.security.NoSuchAlgorithmException;
+import net.runelite.cache.fs.Archive;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xmlpull.v1.XmlPullParserException;
+
+public class CacheUploader implements Runnable
+{
+ private static final Logger logger = LoggerFactory.getLogger(CacheUploader.class);
+
+ private final MinioClient minioClient;
+ private final String minioBucket;
+ private final Archive archive;
+ private final byte[] data;
+
+ public CacheUploader(MinioClient minioClient, String minioBucket, Archive archive, byte[] data)
+ {
+ this.minioClient = minioClient;
+ this.minioBucket = minioBucket;
+ this.archive = archive;
+ this.data = data;
+ }
+
+ @Override
+ public void run()
+ {
+ byte[] hash = Hashing.sha256().hashBytes(data).asBytes();
+ String hashStr = BaseEncoding.base16().encode(hash);
+
+ archive.setHash(hash);
+
+ String path = new StringBuilder()
+ .append(hashStr, 0, 2)
+ .append('/')
+ .append(hashStr.substring(2))
+ .toString();
+
+ try
+ {
+ try (InputStream in = minioClient.getObject(minioBucket, path))
+ {
+ return; // already exists
+ }
+ catch (ErrorResponseException ex)
+ {
+ // doesn't exist
+ }
+
+ minioClient.putObject(minioBucket, path, new ByteArrayInputStream(data), data.length, "binary/octet-stream");
+ }
+ catch (ErrorResponseException | InsufficientDataException | InternalException | InvalidArgumentException | InvalidBucketNameException | NoResponseException | IOException | InvalidKeyException | NoSuchAlgorithmException | XmlPullParserException ex)
+ {
+ logger.warn("unable to upload data to store", ex);
+ }
+ }
+
+}
diff --git a/api/src/main/java/rs/api/RSProjectile.java b/cache-updater/src/main/java/net/runelite/cache/updater/InstantConverter.java
similarity index 55%
rename from api/src/main/java/rs/api/RSProjectile.java
rename to cache-updater/src/main/java/net/runelite/cache/updater/InstantConverter.java
index e2c8b16a53..953fe9bd3a 100644
--- a/api/src/main/java/rs/api/RSProjectile.java
+++ b/cache-updater/src/main/java/net/runelite/cache/updater/InstantConverter.java
@@ -1,7 +1,5 @@
/*
- * BSD 2-Clause License
- *
- * Copyright (c) 2019, ThatGamerBlue
+ * Copyright (c) 2017, Adam
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -25,82 +23,26 @@
* 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.cache.updater;
-package rs.api;
+import java.sql.Timestamp;
+import java.time.Instant;
+import org.sql2o.converters.Converter;
+import org.sql2o.converters.ConverterException;
-import api.Projectile;
-import net.runelite.mapping.Import;
-
-public interface RSProjectile extends RSEntity, Projectile
+public class InstantConverter implements Converter
{
- @Import("id")
@Override
- int getId();
+ public Instant convert(Object val) throws ConverterException
+ {
+ Timestamp ts = (Timestamp) val;
+ return ts.toInstant();
+ }
- @Import("targetIndex")
- int getRsInteracting();
-
- @Import("sourceZ")
@Override
- int getHeight();
+ public Object toDatabaseParam(Instant val)
+ {
+ return Timestamp.from(val);
+ }
- @Import("endHeight")
- @Override
- int getEndHeight();
-
- @Import("sourceX")
- @Override
- int getX1();
-
- @Import("sourceY")
- @Override
- int getY1();
-
- @Import("plane")
- @Override
- int getFloor();
-
- @Import("cycleStart")
- @Override
- int getStartMovementCycle();
-
- @Import("cycleEnd")
- @Override
- int getEndCycle();
-
- @Import("slope")
- @Override
- int getSlope();
-
- @Import("startHeight")
- @Override
- int getStartHeight();
-
- @Import("x")
- @Override
- double getX();
-
- @Import("y")
- @Override
- double getY();
-
- @Import("z")
- @Override
- double getZ();
-
- @Import("speed")
- @Override
- double getScalar();
-
- @Import("speedX")
- @Override
- double getVelocityX();
-
- @Import("speedY")
- @Override
- double getVelocityY();
-
- @Import("speedZ")
- @Override
- double getVelocityZ();
}
diff --git a/cache-updater/src/main/java/net/runelite/cache/updater/beans/ArchiveEntry.java b/cache-updater/src/main/java/net/runelite/cache/updater/beans/ArchiveEntry.java
new file mode 100644
index 0000000000..9bacab75b8
--- /dev/null
+++ b/cache-updater/src/main/java/net/runelite/cache/updater/beans/ArchiveEntry.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2017, Adam
+ * 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.cache.updater.beans;
+
+import lombok.Data;
+
+@Data
+public class ArchiveEntry
+{
+ private int id;
+ private int archiveId;
+ private int nameHash;
+ private int crc;
+ private int revision;
+ private byte[] hash;
+}
diff --git a/cache-updater/src/main/java/net/runelite/cache/updater/beans/CacheEntry.java b/cache-updater/src/main/java/net/runelite/cache/updater/beans/CacheEntry.java
new file mode 100644
index 0000000000..c9081cd883
--- /dev/null
+++ b/cache-updater/src/main/java/net/runelite/cache/updater/beans/CacheEntry.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2017, Adam
+ * 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.cache.updater.beans;
+
+import java.time.Instant;
+import lombok.Data;
+
+@Data
+public class CacheEntry
+{
+ private int id;
+ private int revision;
+ private Instant date;
+}
diff --git a/cache-updater/src/main/java/net/runelite/cache/updater/beans/FileEntry.java b/cache-updater/src/main/java/net/runelite/cache/updater/beans/FileEntry.java
new file mode 100644
index 0000000000..bb43c2a189
--- /dev/null
+++ b/cache-updater/src/main/java/net/runelite/cache/updater/beans/FileEntry.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2017, Adam
+ * 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.cache.updater.beans;
+
+import lombok.Data;
+
+@Data
+public class FileEntry
+{
+ private int id;
+ private int archiveId;
+ private int fileId;
+ private int nameHash;
+}
diff --git a/cache-updater/src/main/java/net/runelite/cache/updater/beans/IndexEntry.java b/cache-updater/src/main/java/net/runelite/cache/updater/beans/IndexEntry.java
new file mode 100644
index 0000000000..a5a0748f18
--- /dev/null
+++ b/cache-updater/src/main/java/net/runelite/cache/updater/beans/IndexEntry.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2017, Adam
+ * 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.cache.updater.beans;
+
+import lombok.Data;
+
+@Data
+public class IndexEntry
+{
+ private int id;
+ private int indexId;
+ private int crc;
+ private int revision;
+}
diff --git a/cache-updater/src/main/resources/application.yaml b/cache-updater/src/main/resources/application.yaml
new file mode 100644
index 0000000000..df290d680f
--- /dev/null
+++ b/cache-updater/src/main/resources/application.yaml
@@ -0,0 +1,16 @@
+---
+# Database
+datasource:
+ runelite-cache:
+ driverClassName: com.mysql.jdbc.Driver
+ type: com.mysql.jdbc.jdbc2.optional.MysqlDataSource
+ url: jdbc:mysql://localhost/runelite-cache
+ username: runelite
+ password: runelite
+
+# Minio client storage for cache
+minio:
+ endpoint: http://localhost:9000
+ accesskey: AM54M27O4WZK65N6F8IP
+ secretkey: /PZCxzmsJzwCHYlogcymuprniGCaaLUOET2n6yMP
+ bucket: runelite
diff --git a/cache/pom.xml b/cache/pom.xml
new file mode 100644
index 0000000000..6fd5d36c0f
--- /dev/null
+++ b/cache/pom.xml
@@ -0,0 +1,168 @@
+
+
+
+ 4.0.0
+
+
+ net.runelite
+ runelite-parent
+ 1.5.27-SNAPSHOT
+
+
+ cache
+ Cache
+
+
+ 1.3.1
+ 1.10
+ 4.6
+
+ 165
+
+
+
+
+ net.runelite
+ http-api
+ ${project.version}
+
+
+
+ com.google.guava
+ guava
+
+
+ org.slf4j
+ slf4j-api
+
+
+ org.apache.commons
+ commons-compress
+ ${commons.compress.version}
+
+
+ com.google.code.gson
+ gson
+
+
+ io.netty
+ netty-buffer
+
+
+ org.antlr
+ antlr4-runtime
+ ${antlr4.version}
+
+
+ commons-cli
+ commons-cli
+ ${commons.cli.version}
+
+
+ org.projectlombok
+ lombok
+ provided
+
+
+
+ junit
+ junit
+
+
+ org.slf4j
+ slf4j-simple
+
+
+ net.runelite.rs
+ cache
+ ${cache.version}
+ test
+
+
+
+
+
+
+ src/test/resources
+ true
+
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+
+ true
+ -Xmx2048m
+
+ ${cache.tmpdir}
+
+
+
+
+ maven-assembly-plugin
+
+
+ jar-with-dependencies
+
+
+
+
+ make-assembly
+ package
+
+ single
+
+
+
+
+
+ org.antlr
+ antlr4-maven-plugin
+ ${antlr4.version}
+
+
+ process-resources
+
+ antlr4
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+
+
+
+ test-jar
+
+
+
+
+
+
+
diff --git a/cache/src/main/antlr4/net/runelite/cache/script/assembler/rs2asm.g4 b/cache/src/main/antlr4/net/runelite/cache/script/assembler/rs2asm.g4
new file mode 100644
index 0000000000..f8b33e8676
--- /dev/null
+++ b/cache/src/main/antlr4/net/runelite/cache/script/assembler/rs2asm.g4
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2017, Adam
+ * 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.
+ */
+grammar rs2asm;
+
+prog: NEWLINE* (header NEWLINE+)* (line NEWLINE+)+ ;
+
+header: id | int_stack_count | string_stack_count | int_var_count | string_var_count ;
+
+id: '.id ' id_value ;
+int_stack_count: '.int_stack_count ' int_stack_value ;
+string_stack_count: '.string_stack_count ' string_stack_value ;
+int_var_count: '.int_var_count ' int_var_value ;
+string_var_count: '.string_var_count ' string_var_value ;
+
+id_value: INT ;
+int_stack_value: INT ;
+string_stack_value: INT ;
+int_var_value: INT ;
+string_var_value: INT ;
+
+line: instruction | label | switch_lookup ;
+instruction: instruction_name instruction_operand ;
+label: IDENTIFIER ':' ;
+
+instruction_name: name_string | name_opcode ;
+name_string: IDENTIFIER ;
+name_opcode: INT ;
+
+instruction_operand: operand_int | operand_qstring | operand_label | ;
+operand_int: INT ;
+operand_qstring: QSTRING ;
+operand_label: IDENTIFIER ;
+
+switch_lookup: switch_key ':' switch_value ;
+switch_key: INT ;
+switch_value: IDENTIFIER ;
+
+NEWLINE: ( '\r' | '\n' )+ ;
+INT: '-'? [0-9]+ ;
+QSTRING: '"' (~('"' | '\\' | '\r' | '\n') | '\\' ('"' | '\\'))* '"' ;
+IDENTIFIER: [a-zA-Z0-9_]+ ;
+COMMENT: ';' ~( '\r' | '\n' )* -> channel(HIDDEN) ;
+
+WS: (' ' | '\t')+ -> channel(HIDDEN) ;
\ No newline at end of file
diff --git a/cache/src/main/java/net/runelite/cache/AreaManager.java b/cache/src/main/java/net/runelite/cache/AreaManager.java
new file mode 100644
index 0000000000..96967b84b6
--- /dev/null
+++ b/cache/src/main/java/net/runelite/cache/AreaManager.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2017, Adam
+ * 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.cache;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import net.runelite.cache.definitions.AreaDefinition;
+import net.runelite.cache.definitions.loaders.AreaLoader;
+import net.runelite.cache.fs.Archive;
+import net.runelite.cache.fs.ArchiveFiles;
+import net.runelite.cache.fs.FSFile;
+import net.runelite.cache.fs.Index;
+import net.runelite.cache.fs.Storage;
+import net.runelite.cache.fs.Store;
+
+public class AreaManager
+{
+ private final Store store;
+ private final Map areas = new HashMap<>();
+
+ public AreaManager(Store store)
+ {
+ this.store = store;
+ }
+
+ public void load() throws IOException
+ {
+ Storage storage = store.getStorage();
+ Index index = store.getIndex(IndexType.CONFIGS);
+ Archive archive = index.getArchive(ConfigType.AREA.getId());
+
+ byte[] archiveData = storage.loadArchive(archive);
+ ArchiveFiles files = archive.getFiles(archiveData);
+
+ for (FSFile file : files.getFiles())
+ {
+ AreaLoader loader = new AreaLoader();
+ AreaDefinition area = loader.load(file.getContents(), file.getFileId());
+ areas.put(area.id, area);
+ }
+ }
+
+ public Collection getAreas()
+ {
+ return Collections.unmodifiableCollection(areas.values());
+ }
+
+ public AreaDefinition getArea(int areaId)
+ {
+ return areas.get(areaId);
+ }
+}
diff --git a/cache/src/main/java/net/runelite/cache/Cache.java b/cache/src/main/java/net/runelite/cache/Cache.java
new file mode 100644
index 0000000000..0f2c2d36b1
--- /dev/null
+++ b/cache/src/main/java/net/runelite/cache/Cache.java
@@ -0,0 +1,161 @@
+/*
+ * Copyright (c) 2017, Adam
+ * 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.cache;
+
+import java.io.File;
+import java.io.IOException;
+import net.runelite.cache.fs.Store;
+import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.CommandLineParser;
+import org.apache.commons.cli.DefaultParser;
+import org.apache.commons.cli.Options;
+import org.apache.commons.cli.ParseException;
+
+public class Cache
+{
+ public static void main(String[] args) throws IOException
+ {
+ Options options = new Options();
+
+ options.addOption("c", "cache", true, "cache base");
+
+ options.addOption(null, "items", true, "directory to dump items to");
+ options.addOption(null, "npcs", true, "directory to dump npcs to");
+ options.addOption(null, "objects", true, "directory to dump objects to");
+ options.addOption(null, "sprites", true, "directory to dump sprites to");
+
+ CommandLineParser parser = new DefaultParser();
+ CommandLine cmd;
+ try
+ {
+ cmd = parser.parse(options, args);
+ }
+ catch (ParseException ex)
+ {
+ System.err.println("Error parsing command line options: " + ex.getMessage());
+ System.exit(-1);
+ return;
+ }
+
+ String cache = cmd.getOptionValue("cache");
+
+ Store store = loadStore(cache);
+
+ if (cmd.hasOption("items"))
+ {
+ String itemdir = cmd.getOptionValue("items");
+
+ if (itemdir == null)
+ {
+ System.err.println("Item directory must be specified");
+ return;
+ }
+
+ System.out.println("Dumping items to " + itemdir);
+ dumpItems(store, new File(itemdir));
+ }
+ else if (cmd.hasOption("npcs"))
+ {
+ String npcdir = cmd.getOptionValue("npcs");
+
+ if (npcdir == null)
+ {
+ System.err.println("NPC directory must be specified");
+ return;
+ }
+
+ System.out.println("Dumping npcs to " + npcdir);
+ dumpNpcs(store, new File(npcdir));
+ }
+ else if (cmd.hasOption("objects"))
+ {
+ String objectdir = cmd.getOptionValue("objects");
+
+ if (objectdir == null)
+ {
+ System.err.println("Object directory must be specified");
+ return;
+ }
+
+ System.out.println("Dumping objects to " + objectdir);
+ dumpObjects(store, new File(objectdir));
+ }
+ else if (cmd.hasOption("sprites"))
+ {
+ String spritedir = cmd.getOptionValue("sprites");
+
+ if (spritedir == null)
+ {
+ System.err.println("Sprite directory must be specified");
+ return;
+ }
+
+ System.out.println("Dumping sprites to " + spritedir);
+ dumpSprites(store, new File(spritedir));
+ }
+ else
+ {
+ System.err.println("Nothing to do");
+ }
+ }
+
+ private static Store loadStore(String cache) throws IOException
+ {
+ Store store = new Store(new File(cache));
+ store.load();
+ return store;
+ }
+
+ private static void dumpItems(Store store, File itemdir) throws IOException
+ {
+ ItemManager dumper = new ItemManager(store);
+ dumper.load();
+ dumper.export(itemdir);
+ dumper.java(itemdir);
+ }
+
+ private static void dumpNpcs(Store store, File npcdir) throws IOException
+ {
+ NpcManager dumper = new NpcManager(store);
+ dumper.load();
+ dumper.dump(npcdir);
+ dumper.java(npcdir);
+ }
+
+ private static void dumpObjects(Store store, File objectdir) throws IOException
+ {
+ ObjectManager dumper = new ObjectManager(store);
+ dumper.load();
+ dumper.dump(objectdir);
+ dumper.java(objectdir);
+ }
+
+ private static void dumpSprites(Store store, File spritedir) throws IOException
+ {
+ SpriteManager dumper = new SpriteManager(store);
+ dumper.load();
+ dumper.export(spritedir);
+ }
+}
diff --git a/cache/src/main/java/net/runelite/cache/ConfigType.java b/cache/src/main/java/net/runelite/cache/ConfigType.java
new file mode 100644
index 0000000000..48d8e229c0
--- /dev/null
+++ b/cache/src/main/java/net/runelite/cache/ConfigType.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2016-2017, Adam
+ * 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.cache;
+
+public enum ConfigType
+{
+ // types from https://github.com/im-frizzy/OpenRS/blob/master/source/net/openrs/cache/type/ConfigArchive.java
+ UNDERLAY(1),
+ IDENTKIT(3),
+ OVERLAY(4),
+ INV(5),
+ OBJECT(6),
+ ENUM(8),
+ NPC(9),
+ ITEM(10),
+ SEQUENCE(12),
+ SPOTANIM(13),
+ VARBIT(14),
+ VARCLIENT(19),
+ VARCLIENTSTRING(15),
+ VARPLAYER(16),
+ STRUCT(34),
+ AREA(35);
+
+ private final int id;
+
+ ConfigType(int id)
+ {
+ this.id = id;
+ }
+
+ public int getId()
+ {
+ return id;
+ }
+}
diff --git a/cache/src/main/java/net/runelite/cache/HeightMapDumper.java b/cache/src/main/java/net/runelite/cache/HeightMapDumper.java
new file mode 100644
index 0000000000..5db30815ff
--- /dev/null
+++ b/cache/src/main/java/net/runelite/cache/HeightMapDumper.java
@@ -0,0 +1,149 @@
+/*
+ * Copyright (c) 2016-2017, Adam
+ * 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.cache;
+
+import java.awt.Color;
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+import net.runelite.cache.fs.Store;
+import net.runelite.cache.region.Region;
+import net.runelite.cache.region.RegionLoader;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class HeightMapDumper
+{
+ private static final Logger logger = LoggerFactory.getLogger(HeightMapDumper.class);
+
+ private static final int MAP_SCALE = 1;
+ private static final float MAX_HEIGHT = 2048f;
+
+ private final Store store;
+ private RegionLoader regionLoader;
+
+ public HeightMapDumper(Store store)
+ {
+ this.store = store;
+ }
+
+ public void load() throws IOException
+ {
+ regionLoader = new RegionLoader(store);
+ regionLoader.loadRegions();
+ regionLoader.calculateBounds();
+ }
+
+ public BufferedImage drawHeightMap(int z)
+ {
+ int minX = regionLoader.getLowestX().getBaseX();
+ int minY = regionLoader.getLowestY().getBaseY();
+
+ int maxX = regionLoader.getHighestX().getBaseX() + Region.X;
+ int maxY = regionLoader.getHighestY().getBaseY() + Region.Y;
+
+ int dimX = maxX - minX;
+ int dimY = maxY - minY;
+
+ dimX *= MAP_SCALE;
+ dimY *= MAP_SCALE;
+
+ logger.info("Map image dimensions: {}px x {}px, {}px per map square ({} MB)", dimX, dimY, MAP_SCALE, (dimX * dimY / 1024 / 1024));
+
+ BufferedImage image = new BufferedImage(dimX, dimY, BufferedImage.TYPE_INT_RGB);
+ draw(image, z);
+ return image;
+ }
+
+ private void draw(BufferedImage image, int z)
+ {
+ int max = Integer.MIN_VALUE;
+ int min = Integer.MAX_VALUE;
+
+ for (Region region : regionLoader.getRegions())
+ {
+ int baseX = region.getBaseX();
+ int baseY = region.getBaseY();
+
+ // to pixel X
+ int drawBaseX = baseX - regionLoader.getLowestX().getBaseX();
+
+ // to pixel Y. top most y is 0, but the top most
+ // region has the greatest y, so invert
+ int drawBaseY = regionLoader.getHighestY().getBaseY() - baseY;
+
+ for (int x = 0; x < Region.X; ++x)
+ {
+ int drawX = drawBaseX + x;
+
+ for (int y = 0; y < Region.Y; ++y)
+ {
+ int drawY = drawBaseY + (Region.Y - 1 - y);
+
+ int height = region.getTileHeight(z, x, y);
+ if (height > max)
+ {
+ max = height;
+ }
+ if (height < min)
+ {
+ min = height;
+ }
+
+ int rgb = toColor(height);
+
+ drawMapSquare(image, drawX, drawY, rgb);
+ }
+ }
+ }
+ System.out.println("max " + max);
+ System.out.println("min " + min);
+ }
+
+ private int toColor(int height)
+ {
+ // height seems to be between -2040 and 0, inclusive
+ height = -height;
+ // Convert to between 0 and 1
+ float color = (float) height / MAX_HEIGHT;
+
+ assert color >= 0.0f && color <= 1.0f;
+
+ return new Color(color, color, color).getRGB();
+ }
+
+ private void drawMapSquare(BufferedImage image, int x, int y, int rgb)
+ {
+ x *= MAP_SCALE;
+ y *= MAP_SCALE;
+
+ for (int i = 0; i < MAP_SCALE; ++i)
+ {
+ for (int j = 0; j < MAP_SCALE; ++j)
+ {
+ image.setRGB(x + i, y + j, rgb);
+ }
+ }
+ }
+}
diff --git a/api/src/main/java/mapping/ObfuscatedName.java b/cache/src/main/java/net/runelite/cache/IndexType.java
similarity index 78%
rename from api/src/main/java/mapping/ObfuscatedName.java
rename to cache/src/main/java/net/runelite/cache/IndexType.java
index 10ccf9ecd4..813594bac5 100644
--- a/api/src/main/java/mapping/ObfuscatedName.java
+++ b/cache/src/main/java/net/runelite/cache/IndexType.java
@@ -22,19 +22,38 @@
* (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.mapping;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
+package net.runelite.cache;
-@Retention(RetentionPolicy.RUNTIME)
-@Target(
- {
- ElementType.FIELD, ElementType.METHOD, ElementType.TYPE
- })
-public @interface ObfuscatedName
+public enum IndexType
{
- String value();
-}
+ FRAMES(0),
+ FRAMEMAPS(1),
+ CONFIGS(2),
+ INTERFACES(3),
+ SOUNDEFFECTS(4),
+ MAPS(5),
+ TRACK1(6),
+ MODELS(7),
+ SPRITES(8),
+ TEXTURES(9),
+ BINARY(10),
+ TRACK2(11),
+ CLIENTSCRIPT(12),
+ FONTS(13),
+ VORBIS(14),
+ INSTRUMENTS(15),
+ WORLDMAP(16);
+
+ private int id;
+
+ IndexType(int id)
+ {
+ this.id = id;
+ }
+
+ public int getNumber()
+ {
+ return id;
+ }
+}
\ No newline at end of file
diff --git a/cache/src/main/java/net/runelite/cache/InterfaceManager.java b/cache/src/main/java/net/runelite/cache/InterfaceManager.java
new file mode 100644
index 0000000000..ccfcfedd3b
--- /dev/null
+++ b/cache/src/main/java/net/runelite/cache/InterfaceManager.java
@@ -0,0 +1,176 @@
+/*
+ * Copyright (c) 2017, Adam
+ * 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.cache;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintWriter;
+import net.runelite.cache.definitions.InterfaceDefinition;
+import net.runelite.cache.definitions.exporters.InterfaceExporter;
+import net.runelite.cache.definitions.loaders.InterfaceLoader;
+import net.runelite.cache.fs.Archive;
+import net.runelite.cache.fs.ArchiveFiles;
+import net.runelite.cache.fs.FSFile;
+import net.runelite.cache.fs.Index;
+import net.runelite.cache.fs.Storage;
+import net.runelite.cache.fs.Store;
+import net.runelite.cache.util.Namer;
+
+public class InterfaceManager
+{
+ private final Store store;
+ private InterfaceDefinition[][] interfaces;
+ private final Namer namer = new Namer();
+
+ public InterfaceManager(Store store)
+ {
+ this.store = store;
+ }
+
+ public void load() throws IOException
+ {
+ InterfaceLoader loader = new InterfaceLoader();
+
+ Storage storage = store.getStorage();
+ Index index = store.getIndex(IndexType.INTERFACES);
+
+ int max = index.getArchives().stream().mapToInt(a -> a.getArchiveId()).max().getAsInt();
+ interfaces = new InterfaceDefinition[max + 1][];
+
+ for (Archive archive : index.getArchives())
+ {
+ int archiveId = archive.getArchiveId();
+ byte[] archiveData = storage.loadArchive(archive);
+ ArchiveFiles files = archive.getFiles(archiveData);
+
+ InterfaceDefinition[] ifaces = interfaces[archiveId];
+ if (ifaces == null)
+ {
+ ifaces = interfaces[archiveId] = new InterfaceDefinition[archive.getFileData().length];
+ }
+
+ for (FSFile file : files.getFiles())
+ {
+ int fileId = file.getFileId();
+
+ int widgetId = (archiveId << 16) + fileId;
+
+ InterfaceDefinition iface = loader.load(widgetId, file.getContents());
+ ifaces[fileId] = iface;
+ }
+ }
+ }
+
+ public int getNumInterfaceGroups()
+ {
+ return interfaces.length;
+ }
+
+ public int getNumChildren(int groupId)
+ {
+ return interfaces[groupId].length;
+ }
+
+ public InterfaceDefinition[] getIntefaceGroup(int groupId)
+ {
+ return interfaces[groupId];
+ }
+
+ public InterfaceDefinition getInterface(int groupId, int childId)
+ {
+ return interfaces[groupId][childId];
+ }
+
+ public InterfaceDefinition[][] getInterfaces()
+ {
+ return interfaces;
+ }
+
+ public void export(File out) throws IOException
+ {
+ out.mkdirs();
+
+ for (InterfaceDefinition[] defs : interfaces)
+ {
+ if (defs == null)
+ {
+ continue;
+ }
+
+ for (InterfaceDefinition def : defs)
+ {
+ if (def == null)
+ {
+ continue;
+ }
+
+ InterfaceExporter exporter = new InterfaceExporter(def);
+
+ File folder = new File(out, "" + (def.id >>> 16));
+ folder.mkdirs();
+
+ File targ = new File(folder, (def.id & 0xffff) + ".json");
+ exporter.exportTo(targ);
+ }
+ }
+ }
+
+ public void java(File java) throws IOException
+ {
+ System.setProperty("line.separator", "\n");
+ java.mkdirs();
+ File targ = new File(java, "InterfaceID.java");
+ try (PrintWriter fw = new PrintWriter(targ))
+ {
+ fw.println("/* This file is automatically generated. Do not edit. */");
+ fw.println("package net.runelite.api;");
+ fw.println("");
+ fw.println("public final class InterfaceID {");
+ for (InterfaceDefinition[] defs : interfaces)
+ {
+ if (defs == null)
+ {
+ continue;
+ }
+ for (InterfaceDefinition def : defs)
+ {
+ if (def == null || def.name == null || def.name.equalsIgnoreCase("NULL"))
+ {
+ continue;
+ }
+
+ String name = namer.name(def.name, def.id);
+ if (name == null)
+ {
+ continue;
+ }
+
+ fw.println(" public static final int " + name + " = " + def.id + ";");
+ }
+ }
+ fw.println("}");
+ }
+ }
+}
diff --git a/deobfuscator/src/main/java/net/runelite/asm/ClassGroup.java b/cache/src/main/java/net/runelite/cache/InventoryManager.java
similarity index 52%
rename from deobfuscator/src/main/java/net/runelite/asm/ClassGroup.java
rename to cache/src/main/java/net/runelite/cache/InventoryManager.java
index 2c6ba531a5..772d48b1a9 100644
--- a/deobfuscator/src/main/java/net/runelite/asm/ClassGroup.java
+++ b/cache/src/main/java/net/runelite/cache/InventoryManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2017, Adam
+ * Copyright (c) 2017, Adam
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -22,89 +22,63 @@
* (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.asm;
+package net.runelite.cache;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
-import net.runelite.asm.attributes.Code;
+import net.runelite.cache.definitions.InventoryDefinition;
+import net.runelite.cache.definitions.loaders.InventoryLoader;
+import net.runelite.cache.fs.Archive;
+import net.runelite.cache.fs.ArchiveFiles;
+import net.runelite.cache.fs.FSFile;
+import net.runelite.cache.fs.Index;
+import net.runelite.cache.fs.Storage;
+import net.runelite.cache.fs.Store;
-public class ClassGroup
+public class InventoryManager
{
- private final List classes = new ArrayList<>(); // to keep order
- private final Map classMap = new HashMap<>();
+ private final Store store;
+ private final List inventories = new ArrayList<>();
- public void addClass(ClassFile cf)
+ public InventoryManager(Store store)
{
- assert cf.getGroup() == this || cf.getGroup() == null;
- cf.setGroup(this);
-
- classes.add(cf);
- classMap.put(cf.getName(), cf);
+ this.store = store;
}
- public void removeClass(ClassFile cf)
+ public void load() throws IOException
{
- classes.remove(cf);
- classMap.remove(cf.getName());
- }
+ InventoryLoader loader = new InventoryLoader();
- public void renameClass(ClassFile cf, String newName)
- {
- assert classes.contains(cf);
- assert classMap.get(cf.getName()) == cf;
+ Storage storage = store.getStorage();
+ Index index = store.getIndex(IndexType.CONFIGS);
+ Archive archive = index.getArchive(ConfigType.INV.getId());
- classMap.remove(cf.getName());
- cf.setName(newName);
- classMap.put(cf.getName(), cf);
- }
+ byte[] archiveData = storage.loadArchive(archive);
+ ArchiveFiles files = archive.getFiles(archiveData);
- public List getClasses()
- {
- return Collections.unmodifiableList(classes);
- }
-
- public ClassFile findClass(String name)
- {
- return classMap.get(name);
- }
-
- public void initialize()
- {
- buildClassGraph();
- lookup();
- }
-
- public void buildClassGraph()
- {
- for (ClassFile c : classes)
+ for (FSFile file : files.getFiles())
{
- c.clearClassGraph();
- }
-
- for (ClassFile c : classes)
- {
- c.buildClassGraph();
+ InventoryDefinition inv = loader.load(file.getFileId(), file.getContents());
+ inventories.add(inv);
}
}
- public void lookup()
+ public List getInventories()
{
- for (ClassFile cf : this.getClasses())
+ return Collections.unmodifiableList(inventories);
+ }
+
+ public InventoryDefinition findInventory(int id)
+ {
+ for (InventoryDefinition def : inventories)
{
- for (Method m : cf.getMethods())
+ if (def.id == id)
{
- Code code = m.getCode();
-
- if (code == null)
- {
- continue;
- }
-
- code.getInstructions().lookup();
+ return def;
}
}
+ return null;
}
}
diff --git a/cache/src/main/java/net/runelite/cache/ItemManager.java b/cache/src/main/java/net/runelite/cache/ItemManager.java
new file mode 100644
index 0000000000..b3449a51a4
--- /dev/null
+++ b/cache/src/main/java/net/runelite/cache/ItemManager.java
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2016-2017, Adam
+ * 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.cache;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import net.runelite.cache.definitions.ItemDefinition;
+import net.runelite.cache.definitions.exporters.ItemExporter;
+import net.runelite.cache.definitions.loaders.ItemLoader;
+import net.runelite.cache.definitions.providers.ItemProvider;
+import net.runelite.cache.fs.Archive;
+import net.runelite.cache.fs.ArchiveFiles;
+import net.runelite.cache.fs.FSFile;
+import net.runelite.cache.fs.Index;
+import net.runelite.cache.fs.Storage;
+import net.runelite.cache.fs.Store;
+import net.runelite.cache.util.IDClass;
+
+public class ItemManager implements ItemProvider
+{
+ private final Store store;
+ private final Map items = new HashMap<>();
+
+ public ItemManager(Store store)
+ {
+ this.store = store;
+ }
+
+ public void load() throws IOException
+ {
+ ItemLoader loader = new ItemLoader();
+
+ Storage storage = store.getStorage();
+ Index index = store.getIndex(IndexType.CONFIGS);
+ Archive archive = index.getArchive(ConfigType.ITEM.getId());
+
+ byte[] archiveData = storage.loadArchive(archive);
+ ArchiveFiles files = archive.getFiles(archiveData);
+
+ for (FSFile f : files.getFiles())
+ {
+ ItemDefinition def = loader.load(f.getFileId(), f.getContents());
+ items.put(f.getFileId(), def);
+ }
+ }
+
+ public Collection getItems()
+ {
+ return Collections.unmodifiableCollection(items.values());
+ }
+
+ public ItemDefinition getItem(int itemId)
+ {
+ return items.get(itemId);
+ }
+
+ public void export(File out) throws IOException
+ {
+ out.mkdirs();
+
+ for (ItemDefinition def : items.values())
+ {
+ ItemExporter exporter = new ItemExporter(def);
+
+ File targ = new File(out, def.id + ".json");
+ exporter.exportTo(targ);
+ }
+ }
+
+ public void java(File java) throws IOException
+ {
+ java.mkdirs();
+ try (IDClass ids = IDClass.create(java, "ItemID"))
+ {
+ try (IDClass nulls = IDClass.create(java, "NullItemID"))
+ {
+ for (ItemDefinition def : items.values())
+ {
+ if (def.name.equalsIgnoreCase("NULL"))
+ {
+ nulls.add(def.name, def.id);
+ }
+ else
+ {
+ ids.add(def.name, def.id);
+ }
+ }
+ }
+ }
+ }
+
+ @Override
+ public ItemDefinition provide(int itemId)
+ {
+ return getItem(itemId);
+ }
+}
diff --git a/cache/src/main/java/net/runelite/cache/MapImageDumper.java b/cache/src/main/java/net/runelite/cache/MapImageDumper.java
new file mode 100644
index 0000000000..5235d97fb6
--- /dev/null
+++ b/cache/src/main/java/net/runelite/cache/MapImageDumper.java
@@ -0,0 +1,987 @@
+/*
+ * Copyright (c) 2016-2017, Adam
+ * 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.cache;
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.Image;
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import lombok.Getter;
+import lombok.Setter;
+import net.runelite.cache.definitions.AreaDefinition;
+import net.runelite.cache.definitions.ObjectDefinition;
+import net.runelite.cache.definitions.OverlayDefinition;
+import net.runelite.cache.definitions.SpriteDefinition;
+import net.runelite.cache.definitions.UnderlayDefinition;
+import net.runelite.cache.definitions.loaders.OverlayLoader;
+import net.runelite.cache.definitions.loaders.SpriteLoader;
+import net.runelite.cache.definitions.loaders.UnderlayLoader;
+import net.runelite.cache.fs.Archive;
+import net.runelite.cache.fs.ArchiveFiles;
+import net.runelite.cache.fs.FSFile;
+import net.runelite.cache.fs.Index;
+import net.runelite.cache.fs.Storage;
+import net.runelite.cache.fs.Store;
+import net.runelite.cache.item.ColorPalette;
+import net.runelite.cache.item.RSTextureProvider;
+import net.runelite.cache.region.Location;
+import net.runelite.cache.region.Region;
+import net.runelite.cache.region.RegionLoader;
+import net.runelite.cache.util.Djb2;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class MapImageDumper
+{
+ private static final Logger logger = LoggerFactory.getLogger(MapImageDumper.class);
+
+ private static final int MAP_SCALE = 4; // this squared is the number of pixels per map square
+ private static final int MAPICON_MAX_WIDTH = 5; // scale minimap icons down to this size so they fit..
+ private static final int MAPICON_MAX_HEIGHT = 6;
+ private static final int BLEND = 5; // number of surrounding tiles for ground blending
+
+ private static int[] colorPalette = new ColorPalette(0.9d, 0, 512).getColorPalette();
+
+ private static int[][] TILE_SHAPE_2D = new int[][]{{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, {1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1}, {1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0}, {0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1}, {0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, {1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1}, {1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0}, {1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1}, {1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1}};
+ private static int[][] TILE_ROTATION_2D = new int[][]{{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, {12, 8, 4, 0, 13, 9, 5, 1, 14, 10, 6, 2, 15, 11, 7, 3}, {15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0}, {3, 7, 11, 15, 2, 6, 10, 14, 1, 5, 9, 13, 0, 4, 8, 12}};
+
+ private final int wallColor = (238 + (int) (Math.random() * 20.0D) - 10 << 16) + (238 + (int) (Math.random() * 20.0D) - 10 << 8) + (238 + (int) (Math.random() * 20.0D) - 10);
+ private final int doorColor = 238 + (int) (Math.random() * 20.0D) - 10 << 16;
+
+ private final Store store;
+
+ private final Map underlays = new HashMap<>();
+ private final Map overlays = new HashMap<>();
+ private final Map scaledMapIcons = new HashMap<>();
+
+ private RegionLoader regionLoader;
+ private final AreaManager areas;
+ private final SpriteManager sprites;
+ private RSTextureProvider rsTextureProvider;
+ private final ObjectManager objectManager;
+
+ @Getter
+ @Setter
+ private boolean labelRegions;
+
+ @Getter
+ @Setter
+ private boolean outlineRegions;
+
+ public MapImageDumper(Store store)
+ {
+ this.store = store;
+ this.areas = new AreaManager(store);
+ this.sprites = new SpriteManager(store);
+ objectManager = new ObjectManager(store);
+ }
+
+ public void load() throws IOException
+ {
+ loadUnderlays(store);
+ loadOverlays(store);
+ objectManager.load();
+
+ TextureManager textureManager = new TextureManager(store);
+ textureManager.load();
+ rsTextureProvider = new RSTextureProvider(textureManager, sprites);
+
+ loadRegions(store);
+ areas.load();
+ sprites.load();
+ loadSprites();
+ }
+
+ public BufferedImage drawMap(int z)
+ {
+ int minX = regionLoader.getLowestX().getBaseX();
+ int minY = regionLoader.getLowestY().getBaseY();
+
+ int maxX = regionLoader.getHighestX().getBaseX() + Region.X;
+ int maxY = regionLoader.getHighestY().getBaseY() + Region.Y;
+
+ int dimX = maxX - minX;
+ int dimY = maxY - minY;
+
+ int pixelsX = dimX * MAP_SCALE;
+ int pixelsY = dimY * MAP_SCALE;
+
+ logger.info("Map image dimensions: {}px x {}px, {}px per map square ({} MB). Max memory: {}mb", pixelsX, pixelsY,
+ MAP_SCALE, (pixelsX * pixelsY * 3 / 1024 / 1024),
+ Runtime.getRuntime().maxMemory() / 1024L / 1024L);
+
+ BufferedImage image = new BufferedImage(pixelsX, pixelsY, BufferedImage.TYPE_INT_RGB);
+
+ drawMap(image, z);
+ drawObjects(image, z);
+ drawMapIcons(image, z);
+
+ return image;
+ }
+
+ public BufferedImage drawRegion(Region region, int z)
+ {
+ int pixelsX = Region.X * MAP_SCALE;
+ int pixelsY = Region.Y * MAP_SCALE;
+
+ BufferedImage image = new BufferedImage(pixelsX, pixelsY, BufferedImage.TYPE_INT_RGB);
+
+ drawMap(image, 0, 0, z, region);
+ drawObjects(image, 0, 0, region, z);
+ drawMapIcons(image, 0, 0, region, z);
+
+ return image;
+ }
+
+ private void drawMap(BufferedImage image, int drawBaseX, int drawBaseY, int z, Region region)
+ {
+ int[][] map = new int[Region.X * MAP_SCALE][Region.Y * MAP_SCALE];
+ drawMap(map, region, z);
+
+ int[][] above = null;
+ if (z < 3)
+ {
+ above = new int[Region.X * MAP_SCALE][Region.Y * MAP_SCALE];
+ drawMap(above, region, z + 1);
+ }
+
+ for (int x = 0; x < Region.X; ++x)
+ {
+ for (int y = 0; y < Region.Y; ++y)
+ {
+ boolean isBridge = (region.getTileSetting(1, x, Region.Y - y - 1) & 2) != 0;
+
+ int tileSetting = region.getTileSetting(z, x, Region.Y - y - 1);
+ if (!isBridge && ((tileSetting & 24) == 0))
+ {
+ drawTile(image, map, drawBaseX, drawBaseY, x, y);
+ }
+
+ if (z < 3 && isBridge) // client also has a check for &8 != 0 here
+ {
+ drawTile(image, above, drawBaseX, drawBaseY, x, y);
+ }
+ }
+ }
+ }
+
+ private void drawMap(BufferedImage image, int z)
+ {
+ for (Region region : regionLoader.getRegions())
+ {
+ int baseX = region.getBaseX();
+ int baseY = region.getBaseY();
+
+ // to pixel X
+ int drawBaseX = baseX - regionLoader.getLowestX().getBaseX();
+
+ // to pixel Y. top most y is 0, but the top most
+ // region has the greatest y, so invert
+ int drawBaseY = regionLoader.getHighestY().getBaseY() - baseY;
+
+ drawMap(image, drawBaseX, drawBaseY, z, region);
+ }
+ }
+
+ private void drawTile(BufferedImage to, int[][] pixels, int drawBaseX, int drawBaseY, int x, int y)
+ {
+ for (int i = 0; i < MAP_SCALE; ++i)
+ {
+ for (int j = 0; j < MAP_SCALE; ++j)
+ {
+ to.setRGB(drawBaseX * MAP_SCALE + x * MAP_SCALE + i,
+ drawBaseY * MAP_SCALE + y * MAP_SCALE + j,
+ pixels[x * MAP_SCALE + i][y * MAP_SCALE + j]);
+ }
+ }
+ }
+
+ private void drawMap(int[][] pixels, Region region, int z)
+ {
+ int baseX = region.getBaseX();
+ int baseY = region.getBaseY();
+
+ int len = Region.X + BLEND * 2;
+ int[] hues = new int[len];
+ int[] sats = new int[len];
+ int[] light = new int[len];
+ int[] mul = new int[len];
+ int[] num = new int[len];
+
+ boolean hasLeftRegion = regionLoader.findRegionForWorldCoordinates(baseX - 1, baseY) != null;
+ boolean hasRightRegion = regionLoader.findRegionForWorldCoordinates(baseX + Region.X, baseY) != null;
+ boolean hasUpRegion = regionLoader.findRegionForWorldCoordinates(baseX, baseY + Region.Y) != null;
+ boolean hasDownRegion = regionLoader.findRegionForWorldCoordinates(baseX, baseY - 1) != null;
+
+ for (int xi = (hasLeftRegion ? -BLEND * 2 : -BLEND); xi < Region.X + (hasRightRegion ? BLEND * 2 : BLEND); ++xi)
+ {
+ for (int yi = (hasDownRegion ? -BLEND : 0); yi < Region.Y + (hasUpRegion ? BLEND : 0); ++yi)
+ {
+ int xr = xi + BLEND;
+ if (xr >= (hasLeftRegion ? -BLEND : 0) && xr < Region.X + (hasRightRegion ? BLEND : 0))
+ {
+ Region r = regionLoader.findRegionForWorldCoordinates(baseX + xr, baseY + yi);
+ if (r != null)
+ {
+ int underlayId = r.getUnderlayId(z, convert(xr), convert(yi));
+ if (underlayId > 0)
+ {
+ UnderlayDefinition underlay = findUnderlay(underlayId - 1);
+ hues[yi + BLEND] += underlay.getHue();
+ sats[yi + BLEND] += underlay.getSaturation();
+ light[yi + BLEND] += underlay.getLightness();
+ mul[yi + BLEND] += underlay.getHueMultiplier();
+ num[yi + BLEND]++;
+ }
+ }
+ }
+
+ int xl = xi - BLEND;
+ if (xl >= (hasLeftRegion ? -BLEND : 0) && xl < Region.X + (hasRightRegion ? BLEND : 0))
+ {
+ Region r = regionLoader.findRegionForWorldCoordinates(baseX + xl, baseY + yi);
+ if (r != null)
+ {
+ int underlayId = r.getUnderlayId(z, convert(xl), convert(yi));
+ if (underlayId > 0)
+ {
+ UnderlayDefinition underlay = findUnderlay(underlayId - 1);
+ hues[yi + BLEND] -= underlay.getHue();
+ sats[yi + BLEND] -= underlay.getSaturation();
+ light[yi + BLEND] -= underlay.getLightness();
+ mul[yi + BLEND] -= underlay.getHueMultiplier();
+ num[yi + BLEND]--;
+ }
+ }
+ }
+ }
+
+ if (xi >= 0 && xi < Region.X)
+ {
+ int runningHues = 0;
+ int runningSat = 0;
+ int runningLight = 0;
+ int runningMultiplier = 0;
+ int runningNumber = 0;
+
+ for (int yi = (hasDownRegion ? -BLEND * 2 : -BLEND); yi < Region.Y + (hasUpRegion ? BLEND * 2 : BLEND); ++yi)
+ {
+ int yu = yi + BLEND;
+ if (yu >= (hasDownRegion ? -BLEND : 0) && yu < Region.Y + (hasUpRegion ? BLEND : 0))
+ {
+ runningHues += hues[yu + BLEND];
+ runningSat += sats[yu + BLEND];
+ runningLight += light[yu + BLEND];
+ runningMultiplier += mul[yu + BLEND];
+ runningNumber += num[yu + BLEND];
+ }
+
+ int yd = yi - BLEND;
+ if (yd >= (hasDownRegion ? -BLEND : 0) && yd < Region.Y + (hasUpRegion ? BLEND : 0))
+ {
+ runningHues -= hues[yd + BLEND];
+ runningSat -= sats[yd + BLEND];
+ runningLight -= light[yd + BLEND];
+ runningMultiplier -= mul[yd + BLEND];
+ runningNumber -= num[yd + BLEND];
+ }
+
+ if (yi >= 0 && yi < Region.Y)
+ {
+ Region r = regionLoader.findRegionForWorldCoordinates(baseX + xi, baseY + yi);
+ if (r != null)
+ {
+ int underlayId = r.getUnderlayId(z, convert(xi), convert(yi));
+ int overlayId = r.getOverlayId(z, convert(xi), convert(yi));
+
+ if (underlayId > 0 || overlayId > 0)
+ {
+ int underlayHsl = -1;
+ if (underlayId > 0)
+ {
+ int avgHue = runningHues * 256 / runningMultiplier;
+ int avgSat = runningSat / runningNumber;
+ int avgLight = runningLight / runningNumber;
+ // randomness is added to avgHue here
+
+ if (avgLight < 0)
+ {
+ avgLight = 0;
+ }
+ else if (avgLight > 255)
+ {
+ avgLight = 255;
+ }
+
+ underlayHsl = packHsl(avgHue, avgSat, avgLight);
+ }
+
+ int underlayRgb = 0;
+ if (underlayHsl != -1)
+ {
+ int var0 = method1792(underlayHsl, 96);
+ underlayRgb = colorPalette[var0];
+ }
+
+ int shape, rotation;
+ Integer overlayRgb = null;
+ if (overlayId == 0)
+ {
+ shape = rotation = 0;
+ }
+ else
+ {
+ shape = r.getOverlayPath(z, convert(xi), convert(yi)) + 1;
+ rotation = r.getOverlayRotation(z, convert(xi), convert(yi));
+
+ OverlayDefinition overlayDefinition = findOverlay(overlayId - 1);
+ int overlayTexture = overlayDefinition.getTexture();
+ int rgb;
+
+ if (overlayTexture >= 0)
+ {
+ rgb = rsTextureProvider.getAverageTextureRGB(overlayTexture);
+ }
+ else if (overlayDefinition.getRgbColor() == 0xFF_00FF)
+ {
+ rgb = -2;
+ }
+ else
+ {
+ // randomness added here
+ int overlayHsl = packHsl(overlayDefinition.getHue(), overlayDefinition.getSaturation(), overlayDefinition.getLightness());
+ rgb = overlayHsl;
+ }
+
+ overlayRgb = 0;
+ if (rgb != -2)
+ {
+ int var0 = adjustHSLListness0(rgb, 96);
+ overlayRgb = colorPalette[var0];
+ }
+
+ if (overlayDefinition.getSecondaryRgbColor() != -1)
+ {
+ int hue = overlayDefinition.getOtherHue();
+ int sat = overlayDefinition.getOtherSaturation();
+ int olight = overlayDefinition.getOtherLightness();
+ rgb = packHsl(hue, sat, olight);
+ int var0 = adjustHSLListness0(rgb, 96);
+ overlayRgb = colorPalette[var0];
+ }
+ }
+
+ if (shape == 0)
+ {
+ int drawX = xi;
+ int drawY = Region.Y - 1 - yi;
+ if (underlayRgb != 0)
+ {
+ drawMapSquare(pixels, drawX, drawY, underlayRgb);
+ }
+ }
+ else if (shape == 1)
+ {
+ int drawX = xi;
+ int drawY = Region.Y - 1 - yi;
+ drawMapSquare(pixels, drawX, drawY, overlayRgb);
+ }
+ else
+ {
+ int drawX = xi * MAP_SCALE;
+ int drawY = (Region.Y - 1 - yi) * MAP_SCALE;
+ int[] tileShapes = TILE_SHAPE_2D[shape];
+ int[] tileRotations = TILE_ROTATION_2D[rotation];
+ if (underlayRgb != 0)
+ {
+ int rotIdx = 0;
+ for (int i = 0; i < Region.Z; ++i)
+ {
+ int p1 = tileShapes[tileRotations[rotIdx++]] == 0 ? underlayRgb : overlayRgb;
+ int p2 = tileShapes[tileRotations[rotIdx++]] == 0 ? underlayRgb : overlayRgb;
+ int p3 = tileShapes[tileRotations[rotIdx++]] == 0 ? underlayRgb : overlayRgb;
+ int p4 = tileShapes[tileRotations[rotIdx++]] == 0 ? underlayRgb : overlayRgb;
+ pixels[drawX + 0][drawY + i] = p1;
+ pixels[drawX + 1][drawY + i] = p2;
+ pixels[drawX + 2][drawY + i] = p3;
+ pixels[drawX + 3][drawY + i] = p4;
+ }
+ }
+ else
+ {
+ int rotIdx = 0;
+ for (int i = 0; i < Region.Z; ++i)
+ {
+ int p1 = tileShapes[tileRotations[rotIdx++]];
+ int p2 = tileShapes[tileRotations[rotIdx++]];
+ int p3 = tileShapes[tileRotations[rotIdx++]];
+ int p4 = tileShapes[tileRotations[rotIdx++]];
+
+ if (p1 != 0)
+ {
+ pixels[drawX + 0][drawY + i] = overlayRgb;
+ }
+
+ if (p2 != 0)
+ {
+ pixels[drawX + 1][drawY + i] = overlayRgb;
+ }
+
+ if (p3 != 0)
+ {
+ pixels[drawX + 2][drawY + i] = overlayRgb;
+ }
+
+ if (p4 != 0)
+ {
+ pixels[drawX + 3][drawY + i] = overlayRgb;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private static int convert(int d)
+ {
+ if (d >= 0)
+ {
+ return d % 64;
+ }
+ else
+ {
+ return 64 - -(d % 64) - 1;
+ }
+ }
+
+ private void drawObjects(BufferedImage image, int drawBaseX, int drawBaseY, Region region, int z)
+ {
+ Graphics2D graphics = image.createGraphics();
+
+ for (Location location : region.getLocations())
+ {
+
+ int rotation = location.getOrientation();
+ int type = location.getType();
+
+ int localX = location.getPosition().getX() - region.getBaseX();
+ int localY = location.getPosition().getY() - region.getBaseY();
+
+ boolean isBridge = (region.getTileSetting(1, localX, localY) & 2) != 0;
+
+ if (location.getPosition().getZ() == z + 1)
+ {
+ if (!isBridge)
+ {
+ continue;
+ }
+ }
+ else if (location.getPosition().getZ() == z)
+ {
+ if (isBridge)
+ {
+ continue;
+ }
+
+ if ((region.getTileSetting(z, localX, localY) & 24) != 0)
+ {
+ continue;
+ }
+ }
+ else
+ {
+ continue;
+ }
+
+ ObjectDefinition object = findObject(location.getId());
+
+ int drawX = (drawBaseX + localX) * MAP_SCALE;
+ int drawY = (drawBaseY + (Region.Y - 1 - localY)) * MAP_SCALE;
+
+ if (type >= 0 && type <= 3)
+ {
+ // this is a wall
+ int hash = (localY << 7) + localX + (location.getId() << 14) + 0x4000_0000;
+ if (object.getAnInt2088() == 0)
+ {
+ hash -= Integer.MIN_VALUE;
+ }
+
+ int rgb = wallColor;
+ if (hash > 0)
+ {
+ rgb = doorColor;
+ }
+
+ if (object.getMapSceneID() != -1)
+ {
+ Image spriteImage = scaledMapIcons.get(object.getMapSceneID());
+ graphics.drawImage(spriteImage, drawX * MAP_SCALE, drawY * MAP_SCALE, null);
+ }
+ else
+ {
+ if (type == 0 || type == 2)
+ {
+ if (rotation == 0)
+ {
+ image.setRGB(drawX + 0, drawY + 0, rgb);
+ image.setRGB(drawX + 0, drawY + 1, rgb);
+ image.setRGB(drawX + 0, drawY + 2, rgb);
+ image.setRGB(drawX + 0, drawY + 3, rgb);
+ }
+ else if (rotation == 1)
+ {
+ image.setRGB(drawX + 0, drawY + 0, rgb);
+ image.setRGB(drawX + 1, drawY + 0, rgb);
+ image.setRGB(drawX + 2, drawY + 0, rgb);
+ image.setRGB(drawX + 3, drawY + 0, rgb);
+ }
+ else if (rotation == 2)
+ {
+ image.setRGB(drawX + 3, drawY + 0, rgb);
+ image.setRGB(drawX + 3, drawY + 1, rgb);
+ image.setRGB(drawX + 3, drawY + 2, rgb);
+ image.setRGB(drawX + 3, drawY + 3, rgb);
+ }
+ else if (rotation == 3)
+ {
+ image.setRGB(drawX + 0, drawY + 3, rgb);
+ image.setRGB(drawX + 1, drawY + 3, rgb);
+ image.setRGB(drawX + 2, drawY + 3, rgb);
+ image.setRGB(drawX + 3, drawY + 3, rgb);
+ }
+ }
+
+ if (type == 3)
+ {
+ if (rotation == 0)
+ {
+ image.setRGB(drawX + 0, drawY + 0, rgb);
+ }
+ else if (rotation == 1)
+ {
+ image.setRGB(drawX + 3, drawY + 0, rgb);
+ }
+ else if (rotation == 2)
+ {
+ image.setRGB(drawX + 3, drawY + 3, rgb);
+ }
+ else if (rotation == 3)
+ {
+ image.setRGB(drawX + 0, drawY + 3, rgb);
+ }
+ }
+
+ if (type == 2)
+ {
+ if (rotation == 3)
+ {
+ image.setRGB(drawX + 0, drawY + 0, rgb);
+ image.setRGB(drawX + 0, drawY + 1, rgb);
+ image.setRGB(drawX + 0, drawY + 2, rgb);
+ image.setRGB(drawX + 0, drawY + 3, rgb);
+ }
+ else if (rotation == 0)
+ {
+ image.setRGB(drawX + 0, drawY + 0, rgb);
+ image.setRGB(drawX + 1, drawY + 0, rgb);
+ image.setRGB(drawX + 2, drawY + 0, rgb);
+ image.setRGB(drawX + 3, drawY + 0, rgb);
+ }
+ else if (rotation == 1)
+ {
+ image.setRGB(drawX + 3, drawY + 0, rgb);
+ image.setRGB(drawX + 3, drawY + 1, rgb);
+ image.setRGB(drawX + 3, drawY + 2, rgb);
+ image.setRGB(drawX + 3, drawY + 3, rgb);
+ }
+ else if (rotation == 2)
+ {
+ image.setRGB(drawX + 0, drawY + 3, rgb);
+ image.setRGB(drawX + 1, drawY + 3, rgb);
+ image.setRGB(drawX + 2, drawY + 3, rgb);
+ image.setRGB(drawX + 3, drawY + 3, rgb);
+ }
+ }
+ }
+ }
+ else if (type == 9)
+ {
+ if (object.getMapSceneID() != -1)
+ {
+ Image spriteImage = scaledMapIcons.get(object.getMapSceneID());
+ graphics.drawImage(spriteImage, drawX, drawY, null);
+ continue;
+ }
+
+ int hash = (localY << 7) + localX + (location.getId() << 14) + 0x4000_0000;
+ if (object.getAnInt2088() == 0)
+ {
+ hash -= Integer.MIN_VALUE;
+ }
+
+ if ((hash >> 29 & 3) != 2)
+ {
+ continue;
+ }
+
+ int rgb = 0xEE_EEEE;
+ if (hash > 0)
+ {
+ rgb = 0xEE_0000;
+ }
+
+ if (rotation != 0 && rotation != 2)
+ {
+ image.setRGB(drawX + 0, drawY + 0, rgb);
+ image.setRGB(drawX + 1, drawY + 1, rgb);
+ image.setRGB(drawX + 2, drawY + 2, rgb);
+ image.setRGB(drawX + 3, drawY + 3, rgb);
+ }
+ else
+ {
+ image.setRGB(drawX + 0, drawY + 3, rgb);
+ image.setRGB(drawX + 1, drawY + 2, rgb);
+ image.setRGB(drawX + 2, drawY + 1, rgb);
+ image.setRGB(drawX + 3, drawY + 0, rgb);
+ }
+ }
+ else if (type == 22 || (type >= 9 && type <= 11))
+ {
+ // ground object
+ if (object.getMapSceneID() != -1)
+ {
+ Image spriteImage = scaledMapIcons.get(object.getMapSceneID());
+ graphics.drawImage(spriteImage, drawX, drawY, null);
+ }
+ }
+ }
+
+ graphics.dispose();
+ }
+
+ private void drawObjects(BufferedImage image, int z)
+ {
+ for (Region region : regionLoader.getRegions())
+ {
+ int baseX = region.getBaseX();
+ int baseY = region.getBaseY();
+
+ // to pixel X
+ int drawBaseX = baseX - regionLoader.getLowestX().getBaseX();
+
+ // to pixel Y. top most y is 0, but the top most
+ // region has the greatest y, so invert
+ int drawBaseY = regionLoader.getHighestY().getBaseY() - baseY;
+
+ drawObjects(image, drawBaseX, drawBaseY, region, z);
+ }
+ }
+
+ private void drawMapIcons(BufferedImage image, int drawBaseX, int drawBaseY, Region region, int z)
+ {
+ int baseX = region.getBaseX();
+ int baseY = region.getBaseY();
+
+ Graphics2D graphics = image.createGraphics();
+
+ drawMapIcons(graphics, region, z, drawBaseX, drawBaseY);
+
+ if (labelRegions)
+ {
+ graphics.setColor(Color.WHITE);
+ String str = baseX + "," + baseY + " (" + region.getRegionX() + "," + region.getRegionY() + ")";
+ graphics.drawString(str, drawBaseX * MAP_SCALE, drawBaseY * MAP_SCALE + graphics.getFontMetrics().getHeight());
+ }
+
+ if (outlineRegions)
+ {
+ graphics.setColor(Color.WHITE);
+ graphics.drawRect(drawBaseX * MAP_SCALE, drawBaseY * MAP_SCALE, Region.X * MAP_SCALE, Region.Y * MAP_SCALE);
+ }
+
+ graphics.dispose();
+ }
+
+ private void drawMapIcons(BufferedImage image, int z)
+ {
+ // map icons
+ for (Region region : regionLoader.getRegions())
+ {
+ int baseX = region.getBaseX();
+ int baseY = region.getBaseY();
+
+ // to pixel X
+ int drawBaseX = baseX - regionLoader.getLowestX().getBaseX();
+
+ // to pixel Y. top most y is 0, but the top most
+ // region has the greatest y, so invert
+ int drawBaseY = regionLoader.getHighestY().getBaseY() - baseY;
+
+ drawMapIcons(image, drawBaseX, drawBaseY, region, z);
+ }
+ }
+
+ private ObjectDefinition findObject(int id)
+ {
+ return objectManager.getObject(id);
+ }
+
+ private int packHsl(int var0, int var1, int var2)
+ {
+ if (var2 > 179)
+ {
+ var1 /= 2;
+ }
+
+ if (var2 > 192)
+ {
+ var1 /= 2;
+ }
+
+ if (var2 > 217)
+ {
+ var1 /= 2;
+ }
+
+ if (var2 > 243)
+ {
+ var1 /= 2;
+ }
+
+ int var3 = (var1 / 32 << 7) + (var0 / 4 << 10) + var2 / 2;
+ return var3;
+ }
+
+ static int method1792(int var0, int var1)
+ {
+ if (var0 == -1)
+ {
+ return 12345678;
+ }
+ else
+ {
+ var1 = (var0 & 127) * var1 / 128;
+ if (var1 < 2)
+ {
+ var1 = 2;
+ }
+ else if (var1 > 126)
+ {
+ var1 = 126;
+ }
+
+ return (var0 & 65408) + var1;
+ }
+ }
+
+ static final int adjustHSLListness0(int var0, int var1)
+ {
+ if (var0 == -2)
+ {
+ return 12345678;
+ }
+ else if (var0 == -1)
+ {
+ if (var1 < 2)
+ {
+ var1 = 2;
+ }
+ else if (var1 > 126)
+ {
+ var1 = 126;
+ }
+
+ return var1;
+ }
+ else
+ {
+ var1 = (var0 & 127) * var1 / 128;
+ if (var1 < 2)
+ {
+ var1 = 2;
+ }
+ else if (var1 > 126)
+ {
+ var1 = 126;
+ }
+
+ return (var0 & 65408) + var1;
+ }
+ }
+
+ private void drawMapSquare(int[][] pixels, int x, int y, int rgb)
+ {
+ x *= MAP_SCALE;
+ y *= MAP_SCALE;
+
+ for (int i = 0; i < MAP_SCALE; ++i)
+ {
+ for (int j = 0; j < MAP_SCALE; ++j)
+ {
+ pixels[x + i][y + j] = rgb;
+ }
+ }
+ }
+
+ private void drawMapIcons(Graphics2D graphics, Region region, int z, int drawBaseX, int drawBaseY)
+ {
+ for (Location location : region.getLocations())
+ {
+ int localZ = location.getPosition().getZ();
+ if (z != 0 && localZ != z)
+ {
+ // draw all icons on z=0
+ continue;
+ }
+
+ ObjectDefinition od = findObject(location.getId());
+
+ assert od != null;
+
+ int localX = location.getPosition().getX() - region.getBaseX();
+ int localY = location.getPosition().getY() - region.getBaseY();
+
+ int drawX = drawBaseX + localX;
+ int drawY = drawBaseY + (Region.Y - 1 - localY);
+
+ if (od.getMapAreaId() != -1)
+ {
+ AreaDefinition area = areas.getArea(od.getMapAreaId());
+ assert area != null;
+
+ int spriteId = area.spriteId;
+
+ SpriteDefinition sprite = sprites.findSprite(spriteId, 0);
+ assert sprite != null;
+
+ BufferedImage iconImage = sprites.getSpriteImage(sprite);
+ graphics.drawImage(iconImage, drawX * MAP_SCALE, drawY * MAP_SCALE, null);
+ }
+ }
+ }
+
+ private void loadRegions(Store store) throws IOException
+ {
+ regionLoader = new RegionLoader(store);
+ regionLoader.loadRegions();
+ regionLoader.calculateBounds();
+
+ logger.info("North most region: {}", regionLoader.getLowestY().getBaseY());
+ logger.info("South most region: {}", regionLoader.getHighestY().getBaseY());
+ logger.info("West most region: {}", regionLoader.getLowestX().getBaseX());
+ logger.info("East most region: {}", regionLoader.getHighestX().getBaseX());
+ }
+
+ private void loadUnderlays(Store store) throws IOException
+ {
+ Storage storage = store.getStorage();
+ Index index = store.getIndex(IndexType.CONFIGS);
+ Archive archive = index.getArchive(ConfigType.UNDERLAY.getId());
+
+ byte[] archiveData = storage.loadArchive(archive);
+ ArchiveFiles files = archive.getFiles(archiveData);
+
+ for (FSFile file : files.getFiles())
+ {
+ UnderlayLoader loader = new UnderlayLoader();
+ UnderlayDefinition underlay = loader.load(file.getFileId(), file.getContents());
+
+ underlays.put(underlay.getId(), underlay);
+ }
+ }
+
+ private UnderlayDefinition findUnderlay(int id)
+ {
+ return underlays.get(id);
+ }
+
+ private void loadOverlays(Store store) throws IOException
+ {
+ Storage storage = store.getStorage();
+ Index index = store.getIndex(IndexType.CONFIGS);
+ Archive archive = index.getArchive(ConfigType.OVERLAY.getId());
+
+ byte[] archiveData = storage.loadArchive(archive);
+ ArchiveFiles files = archive.getFiles(archiveData);
+
+ for (FSFile file : files.getFiles())
+ {
+ OverlayLoader loader = new OverlayLoader();
+ OverlayDefinition overlay = loader.load(file.getFileId(), file.getContents());
+
+ overlays.put(overlay.getId(), overlay);
+ }
+ }
+
+ private OverlayDefinition findOverlay(int id)
+ {
+ return overlays.get(id);
+ }
+
+ private void loadSprites() throws IOException
+ {
+ Storage storage = store.getStorage();
+ Index index = store.getIndex(IndexType.SPRITES);
+ final int mapsceneHash = Djb2.hash("mapscene");
+
+ for (Archive a : index.getArchives())
+ {
+ byte[] contents = a.decompress(storage.loadArchive(a));
+
+ SpriteLoader loader = new SpriteLoader();
+ SpriteDefinition[] sprites = loader.load(a.getArchiveId(), contents);
+
+ for (SpriteDefinition sprite : sprites)
+ {
+ if (sprite.getHeight() <= 0 || sprite.getWidth() <= 0)
+ {
+ continue;
+ }
+
+ if (a.getNameHash() == mapsceneHash)
+ {
+ BufferedImage spriteImage = new BufferedImage(sprite.getWidth(), sprite.getHeight(), BufferedImage.TYPE_INT_ARGB);
+ spriteImage.setRGB(0, 0, sprite.getWidth(), sprite.getHeight(), sprite.getPixels(), 0, sprite.getWidth());
+
+ // scale image down so it fits
+ Image scaledImage = spriteImage.getScaledInstance(MAPICON_MAX_WIDTH, MAPICON_MAX_HEIGHT, 0);
+
+ assert scaledMapIcons.containsKey(sprite.getFrame()) == false;
+ scaledMapIcons.put(sprite.getFrame(), scaledImage);
+ }
+ }
+ }
+ }
+
+}
diff --git a/cache/src/main/java/net/runelite/cache/NpcManager.java b/cache/src/main/java/net/runelite/cache/NpcManager.java
new file mode 100644
index 0000000000..3124eb455f
--- /dev/null
+++ b/cache/src/main/java/net/runelite/cache/NpcManager.java
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2016-2017, Adam
+ * 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.cache;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import net.runelite.cache.definitions.NpcDefinition;
+import net.runelite.cache.definitions.exporters.NpcExporter;
+import net.runelite.cache.definitions.loaders.NpcLoader;
+import net.runelite.cache.fs.Archive;
+import net.runelite.cache.fs.ArchiveFiles;
+import net.runelite.cache.fs.FSFile;
+import net.runelite.cache.fs.Index;
+import net.runelite.cache.fs.Storage;
+import net.runelite.cache.fs.Store;
+import net.runelite.cache.util.IDClass;
+
+public class NpcManager
+{
+ private final Store store;
+ private final Map npcs = new HashMap<>();
+
+ public NpcManager(Store store)
+ {
+ this.store = store;
+ }
+
+ public void load() throws IOException
+ {
+ NpcLoader loader = new NpcLoader();
+
+ Storage storage = store.getStorage();
+ Index index = store.getIndex(IndexType.CONFIGS);
+ Archive archive = index.getArchive(ConfigType.NPC.getId());
+
+ byte[] archiveData = storage.loadArchive(archive);
+ ArchiveFiles files = archive.getFiles(archiveData);
+
+ for (FSFile f : files.getFiles())
+ {
+ NpcDefinition npc = loader.load(f.getFileId(), f.getContents());
+ npcs.put(f.getFileId(), npc);
+ }
+ }
+
+ public Collection getNpcs()
+ {
+ return Collections.unmodifiableCollection(npcs.values());
+ }
+
+ public NpcDefinition get(int npcId)
+ {
+ return npcs.get(npcId);
+ }
+
+ public void dump(File out) throws IOException
+ {
+ out.mkdirs();
+
+ for (NpcDefinition def : npcs.values())
+ {
+ NpcExporter exporter = new NpcExporter(def);
+
+ File targ = new File(out, def.id + ".json");
+ exporter.exportTo(targ);
+ }
+ }
+
+ public void java(File java) throws IOException
+ {
+ java.mkdirs();
+ try (IDClass ids = IDClass.create(java, "NpcID"))
+ {
+ for (NpcDefinition def : npcs.values())
+ {
+ if (def.name.equalsIgnoreCase("NULL"))
+ {
+ continue;
+ }
+
+ ids.add(def.name, def.id);
+ }
+ }
+ }
+}
diff --git a/cache/src/main/java/net/runelite/cache/ObjectManager.java b/cache/src/main/java/net/runelite/cache/ObjectManager.java
new file mode 100644
index 0000000000..cb1372ed65
--- /dev/null
+++ b/cache/src/main/java/net/runelite/cache/ObjectManager.java
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 2016-2017, Adam
+ * 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.cache;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import net.runelite.cache.definitions.ObjectDefinition;
+import net.runelite.cache.definitions.exporters.ObjectExporter;
+import net.runelite.cache.definitions.loaders.ObjectLoader;
+import net.runelite.cache.fs.Archive;
+import net.runelite.cache.fs.ArchiveFiles;
+import net.runelite.cache.fs.FSFile;
+import net.runelite.cache.fs.Index;
+import net.runelite.cache.fs.Storage;
+import net.runelite.cache.fs.Store;
+import net.runelite.cache.util.IDClass;
+
+public class ObjectManager
+{
+ private final Store store;
+ private final Map objects = new HashMap<>();
+
+ public ObjectManager(Store store)
+ {
+ this.store = store;
+ }
+
+ public void load() throws IOException
+ {
+ ObjectLoader loader = new ObjectLoader();
+
+ Storage storage = store.getStorage();
+ Index index = store.getIndex(IndexType.CONFIGS);
+ Archive archive = index.getArchive(ConfigType.OBJECT.getId());
+
+ byte[] archiveData = storage.loadArchive(archive);
+ ArchiveFiles files = archive.getFiles(archiveData);
+
+ for (FSFile f : files.getFiles())
+ {
+ ObjectDefinition def = loader.load(f.getFileId(), f.getContents());
+ objects.put(f.getFileId(), def);
+ }
+ }
+
+ public Collection getObjects()
+ {
+ return Collections.unmodifiableCollection(objects.values());
+ }
+
+ public ObjectDefinition getObject(int id)
+ {
+ return objects.get(id);
+ }
+
+ public void dump(File out) throws IOException
+ {
+ out.mkdirs();
+
+ for (ObjectDefinition def : objects.values())
+ {
+ ObjectExporter exporter = new ObjectExporter(def);
+
+ File targ = new File(out, def.getId() + ".json");
+ exporter.exportTo(targ);
+ }
+ }
+
+ public void java(File java) throws IOException
+ {
+ java.mkdirs();
+ try (IDClass ids = IDClass.create(java, "ObjectID"))
+ {
+ try (IDClass nulls = IDClass.create(java, "NullObjectID"))
+ {
+ for (ObjectDefinition def : objects.values())
+ {
+ if ("null".equals(def.getName()))
+ {
+ nulls.add(def.getName(), def.getId());
+ }
+ else
+ {
+ ids.add(def.getName(), def.getId());
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/cache/src/main/java/net/runelite/cache/OverlayManager.java b/cache/src/main/java/net/runelite/cache/OverlayManager.java
new file mode 100644
index 0000000000..6940227c0f
--- /dev/null
+++ b/cache/src/main/java/net/runelite/cache/OverlayManager.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Adam
+ * 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.cache;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import net.runelite.cache.definitions.OverlayDefinition;
+import net.runelite.cache.definitions.loaders.OverlayLoader;
+import net.runelite.cache.definitions.providers.OverlayProvider;
+import net.runelite.cache.fs.Archive;
+import net.runelite.cache.fs.ArchiveFiles;
+import net.runelite.cache.fs.FSFile;
+import net.runelite.cache.fs.Index;
+import net.runelite.cache.fs.Storage;
+import net.runelite.cache.fs.Store;
+
+public class OverlayManager implements OverlayProvider
+{
+ private final Store store;
+ private final Map overlays = new HashMap<>();
+
+ public OverlayManager(Store store)
+ {
+ this.store = store;
+ }
+
+ public void load() throws IOException
+ {
+ Storage storage = store.getStorage();
+ Index index = store.getIndex(IndexType.CONFIGS);
+ Archive archive = index.getArchive(ConfigType.OVERLAY.getId());
+
+ byte[] archiveData = storage.loadArchive(archive);
+ ArchiveFiles files = archive.getFiles(archiveData);
+
+ for (FSFile file : files.getFiles())
+ {
+ OverlayLoader loader = new OverlayLoader();
+ OverlayDefinition overlay = loader.load(file.getFileId(), file.getContents());
+
+ overlays.put(overlay.getId(), overlay);
+ }
+ }
+
+ public Collection getOverlays()
+ {
+ return Collections.unmodifiableCollection(overlays.values());
+ }
+
+ @Override
+ public OverlayDefinition provide(int overlayId)
+ {
+ return overlays.get(overlayId);
+ }
+}
diff --git a/cache/src/main/java/net/runelite/cache/SpriteManager.java b/cache/src/main/java/net/runelite/cache/SpriteManager.java
new file mode 100644
index 0000000000..a18dd4f6ba
--- /dev/null
+++ b/cache/src/main/java/net/runelite/cache/SpriteManager.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2016-2017, Adam
+ * 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.cache;
+
+import com.google.common.collect.LinkedListMultimap;
+import com.google.common.collect.Multimap;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Collections;
+import net.runelite.cache.definitions.SpriteDefinition;
+import net.runelite.cache.definitions.exporters.SpriteExporter;
+import net.runelite.cache.definitions.loaders.SpriteLoader;
+import net.runelite.cache.definitions.providers.SpriteProvider;
+import net.runelite.cache.fs.Archive;
+import net.runelite.cache.fs.Index;
+import net.runelite.cache.fs.Storage;
+import net.runelite.cache.fs.Store;
+
+public class SpriteManager implements SpriteProvider
+{
+ private final Store store;
+ private final Multimap sprites = LinkedListMultimap.create();
+
+ public SpriteManager(Store store)
+ {
+ this.store = store;
+ }
+
+ public void load() throws IOException
+ {
+ Storage storage = store.getStorage();
+ Index index = store.getIndex(IndexType.SPRITES);
+
+ for (Archive a : index.getArchives())
+ {
+ byte[] contents = a.decompress(storage.loadArchive(a));
+
+ SpriteLoader loader = new SpriteLoader();
+ SpriteDefinition[] defs = loader.load(a.getArchiveId(), contents);
+
+ for (SpriteDefinition sprite : defs)
+ {
+ sprites.put(sprite.getId(), sprite);
+ }
+ }
+ }
+
+ public Collection getSprites()
+ {
+ return Collections.unmodifiableCollection(sprites.values());
+ }
+
+ public SpriteDefinition findSprite(int spriteId, int frameId)
+ {
+ for (SpriteDefinition sprite : sprites.get(spriteId))
+ {
+ if (sprite.getFrame() == frameId)
+ {
+ return sprite;
+ }
+ }
+ return null;
+ }
+
+ public BufferedImage getSpriteImage(SpriteDefinition sprite)
+ {
+ BufferedImage image = new BufferedImage(sprite.getWidth(), sprite.getHeight(), BufferedImage.TYPE_INT_ARGB);
+ image.setRGB(0, 0, sprite.getWidth(), sprite.getHeight(), sprite.getPixels(), 0, sprite.getWidth());
+ return image;
+ }
+
+ public void export(File outDir) throws IOException
+ {
+ for (SpriteDefinition sprite : sprites.values())
+ {
+ // I don't know why this happens
+ if (sprite.getHeight() <= 0 || sprite.getWidth() <= 0)
+ {
+ continue;
+ }
+
+ SpriteExporter exporter = new SpriteExporter(sprite);
+ File png = new File(outDir, sprite.getId() + "-" + sprite.getFrame() + ".png");
+
+ exporter.exportTo(png);
+ }
+ }
+
+ @Override
+ public SpriteDefinition provide(int spriteId, int frameId)
+ {
+ return findSprite(spriteId, frameId);
+ }
+}
diff --git a/cache/src/main/java/net/runelite/cache/StructManager.java b/cache/src/main/java/net/runelite/cache/StructManager.java
new file mode 100644
index 0000000000..bd816a4abb
--- /dev/null
+++ b/cache/src/main/java/net/runelite/cache/StructManager.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2018, Joshua Filby
+ * 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.cache;
+
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import net.runelite.cache.definitions.StructDefinition;
+import net.runelite.cache.definitions.loaders.StructLoader;
+import net.runelite.cache.definitions.providers.StructProvider;
+import net.runelite.cache.fs.Archive;
+import net.runelite.cache.fs.ArchiveFiles;
+import net.runelite.cache.fs.FSFile;
+import net.runelite.cache.fs.Index;
+import net.runelite.cache.fs.Storage;
+import net.runelite.cache.fs.Store;
+
+public class StructManager implements StructProvider
+{
+ private final Store store;
+ private final Map structs = new HashMap<>();
+
+ public StructManager(Store store)
+ {
+ this.store = store;
+ }
+
+ public void load() throws IOException
+ {
+ StructLoader loader = new StructLoader();
+
+ Storage storage = store.getStorage();
+ Index index = store.getIndex(IndexType.CONFIGS);
+ Archive archive = index.getArchive(ConfigType.STRUCT.getId());
+
+ byte[] archiveData = storage.loadArchive(archive);
+ ArchiveFiles files = archive.getFiles(archiveData);
+
+ for (FSFile f : files.getFiles())
+ {
+ StructDefinition def = loader.load(f.getFileId(), f.getContents());
+ structs.put(f.getFileId(), def);
+ }
+ }
+
+ public Map getStructs()
+ {
+ return Collections.unmodifiableMap(structs);
+ }
+
+ public StructDefinition getStruct(int structId)
+ {
+ return structs.get(structId);
+ }
+
+ @Override
+ public StructDefinition provide(int structId)
+ {
+ return getStruct(structId);
+ }
+}
diff --git a/deobfuscator/src/main/java/net/runelite/deob/deobfuscators/exprargorder/Expression.java b/cache/src/main/java/net/runelite/cache/TextureManager.java
similarity index 50%
rename from deobfuscator/src/main/java/net/runelite/deob/deobfuscators/exprargorder/Expression.java
rename to cache/src/main/java/net/runelite/cache/TextureManager.java
index 8ba1dd8c71..9eeb3504f2 100644
--- a/deobfuscator/src/main/java/net/runelite/deob/deobfuscators/exprargorder/Expression.java
+++ b/cache/src/main/java/net/runelite/cache/TextureManager.java
@@ -22,79 +22,69 @@
* (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.deob.deobfuscators.exprargorder;
+package net.runelite.cache;
+import java.io.IOException;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.List;
-import net.runelite.asm.attributes.code.InstructionType;
-import net.runelite.asm.execution.InstructionContext;
-import net.runelite.asm.execution.MethodContext;
+import net.runelite.cache.definitions.TextureDefinition;
+import net.runelite.cache.definitions.loaders.TextureLoader;
+import net.runelite.cache.definitions.providers.TextureProvider;
+import net.runelite.cache.fs.Archive;
+import net.runelite.cache.fs.ArchiveFiles;
+import net.runelite.cache.fs.FSFile;
+import net.runelite.cache.fs.Index;
+import net.runelite.cache.fs.Storage;
+import net.runelite.cache.fs.Store;
-public class Expression
+public class TextureManager implements TextureProvider
{
- private final InstructionContext head;
- private final List exprs = new ArrayList<>();
- private final List comExprs = new ArrayList<>();
+ private final Store store;
+ private final List textures = new ArrayList<>();
- public List sortedExprs;
- private int exprHash;
-
- public Expression(InstructionContext head)
+ public TextureManager(Store store)
{
- this.head = head;
+ this.store = store;
}
- public InstructionType getType()
+ public void load() throws IOException
{
- return head.getInstruction().getType();
- }
+ Storage storage = store.getStorage();
+ Index index = store.getIndex(IndexType.TEXTURES);
+ Archive archive = index.getArchive(0);
- public InstructionContext getHead()
- {
- return head;
- }
+ byte[] archiveData = storage.loadArchive(archive);
+ ArchiveFiles files = archive.getFiles(archiveData);
- public void addExpr(Expression expr)
- {
- exprs.add(expr);
- }
+ TextureLoader loader = new TextureLoader();
- public List getExprs()
- {
- return Collections.unmodifiableList(exprs);
- }
-
- public void addComExpr(Expression expr)
- {
- comExprs.add(expr);
- }
-
- public List getComExprs()
- {
- return Collections.unmodifiableList(comExprs);
- }
-
- public void sort(MethodContext ctx)
- {
- for (Expression e : comExprs)
+ for (FSFile file : files.getFiles())
{
- e.sort(ctx);
- }
- for (Expression e : exprs)
- {
- e.sort(ctx);
+ TextureDefinition texture = loader.load(file.getFileId(), file.getContents());
+ textures.add(texture);
}
+ }
- sortedExprs = new ArrayList<>(comExprs);
- Collections.sort(sortedExprs, (e1, e2) -> ExprArgOrder.compare(ctx.getMethod(), getType(), e1, e2));
- Collections.reverse(sortedExprs);
+ public List getTextures()
+ {
+ return textures;
+ }
- int hash = 0;
- for (Expression e : sortedExprs)
+ public TextureDefinition findTexture(int id)
+ {
+ for (TextureDefinition td : textures)
{
- hash ^= e.exprHash;
+ if (td.getId() == id)
+ {
+ return td;
+ }
}
- exprHash = hash;
+ return null;
+ }
+
+ @Override
+ public TextureDefinition[] provide()
+ {
+ return textures.toArray(new TextureDefinition[textures.size()]);
}
}
diff --git a/cache/src/main/java/net/runelite/cache/UnderlayManager.java b/cache/src/main/java/net/runelite/cache/UnderlayManager.java
new file mode 100644
index 0000000000..3bba2230a4
--- /dev/null
+++ b/cache/src/main/java/net/runelite/cache/UnderlayManager.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, Adam
+ * 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.cache;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import net.runelite.cache.definitions.UnderlayDefinition;
+import net.runelite.cache.definitions.loaders.UnderlayLoader;
+import net.runelite.cache.definitions.providers.UnderlayProvider;
+import net.runelite.cache.fs.Archive;
+import net.runelite.cache.fs.ArchiveFiles;
+import net.runelite.cache.fs.FSFile;
+import net.runelite.cache.fs.Index;
+import net.runelite.cache.fs.Storage;
+import net.runelite.cache.fs.Store;
+
+public class UnderlayManager implements UnderlayProvider
+{
+ private final Store store;
+ private final Map underlays = new HashMap<>();
+
+ public UnderlayManager(Store store)
+ {
+ this.store = store;
+ }
+
+ public void load() throws IOException
+ {
+ Storage storage = store.getStorage();
+ Index index = store.getIndex(IndexType.CONFIGS);
+ Archive archive = index.getArchive(ConfigType.UNDERLAY.getId());
+
+ byte[] archiveData = storage.loadArchive(archive);
+ ArchiveFiles files = archive.getFiles(archiveData);
+
+ for (FSFile file : files.getFiles())
+ {
+ UnderlayLoader loader = new UnderlayLoader();
+ UnderlayDefinition underlay = loader.load(file.getFileId(), file.getContents());
+
+ underlays.put(underlay.getId(), underlay);
+ }
+ }
+
+ public Collection getUnderlays()
+ {
+ return Collections.unmodifiableCollection(underlays.values());
+ }
+
+ @Override
+ public UnderlayDefinition provide(int underlayId)
+ {
+ return underlays.get(underlayId);
+ }
+}
diff --git a/cache/src/main/java/net/runelite/cache/definitions/AreaDefinition.java b/cache/src/main/java/net/runelite/cache/definitions/AreaDefinition.java
new file mode 100644
index 0000000000..7abdbdfddd
--- /dev/null
+++ b/cache/src/main/java/net/runelite/cache/definitions/AreaDefinition.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2017, Adam
+ * 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.cache.definitions;
+
+import lombok.Data;
+
+@Data
+public class AreaDefinition
+{
+ public int id;
+ public int[] field3292;
+ public int spriteId = -1;
+ public int field3294 = -1;
+ public String name;
+ public int field3296;
+ public int field3297 = -1;
+ public String[] field3298 = new String[5];
+ public int[] field3300;
+ public String field3308;
+ public byte[] field3309;
+ public int field3310;
+
+}
diff --git a/cache/src/main/java/net/runelite/cache/definitions/ClientScript1Instruction.java b/cache/src/main/java/net/runelite/cache/definitions/ClientScript1Instruction.java
new file mode 100644
index 0000000000..b56c0a42d1
--- /dev/null
+++ b/cache/src/main/java/net/runelite/cache/definitions/ClientScript1Instruction.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2018 Abex
+ * 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.cache.definitions;
+
+import lombok.Data;
+import lombok.RequiredArgsConstructor;
+
+@Data
+public class ClientScript1Instruction
+{
+ @RequiredArgsConstructor
+ public enum Opcode
+ {
+ RETURN(0),
+ BOOSTED_SKILL_LEVELS(1),
+ REAL_SKILL_LEVELS(1),
+ SKILL_EXPERIENCE(1),
+ WIDGET_CONTAINS_ITEM_GET_QUANTITY(3),
+ VARP(1),
+ EXPERIENCE_AT_LEVEL_FOR_SKILL(1),
+ VARP_TIMES_469(1),
+ COMBAT_LEVEL(1),
+ TOTAL_LEVEL(0),
+ WIDGET_CONTAINS_ITEM_STAR(3),
+ RUN_ENERGY(0),
+ WEIGHT(0),
+ VARP_TESTBIT(2),
+ VARBIT(1),
+ MINUS(0),
+ DIV(0),
+ MUL(0),
+ WORLD_X(0),
+ WORLD_Y(1),
+ CONSTANT(1);
+
+ public final int argumentCount;
+ }
+
+ public Opcode opcode;
+ public int[] operands;
+}
diff --git a/api/src/main/java/mapping/ObfuscatedGetter.java b/cache/src/main/java/net/runelite/cache/definitions/EnumDefinition.java
similarity index 78%
rename from api/src/main/java/mapping/ObfuscatedGetter.java
rename to cache/src/main/java/net/runelite/cache/definitions/EnumDefinition.java
index b8e2873006..e9f1c11b02 100644
--- a/api/src/main/java/mapping/ObfuscatedGetter.java
+++ b/cache/src/main/java/net/runelite/cache/definitions/EnumDefinition.java
@@ -22,18 +22,22 @@
* (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.mapping;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
+package net.runelite.cache.definitions;
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.FIELD)
-public @interface ObfuscatedGetter
+import lombok.Data;
+import net.runelite.cache.util.ScriptVarType;
+
+@Data
+public class EnumDefinition
{
- int intValue() default 0;
-
- long longValue() default 0L;
+ private int id;
+ private int[] intVals;
+ private ScriptVarType keyType;
+ private ScriptVarType valType;
+ private String defaultString = "null";
+ private int defaultInt;
+ private int size;
+ private int[] keys;
+ private String[] stringVals;
}
diff --git a/cache/src/main/java/net/runelite/cache/definitions/FrameDefinition.java b/cache/src/main/java/net/runelite/cache/definitions/FrameDefinition.java
new file mode 100644
index 0000000000..c31f0330ac
--- /dev/null
+++ b/cache/src/main/java/net/runelite/cache/definitions/FrameDefinition.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2017, Adam
+ * 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.cache.definitions;
+
+import lombok.Data;
+
+@Data
+public class FrameDefinition
+{
+ public int id; // file id
+ public FramemapDefinition framemap;
+ public int[] translator_x;
+ public int[] translator_y;
+ public int[] translator_z;
+ public int translatorCount = -1;
+ public int[] indexFrameIds;
+ public boolean showing;
+}
diff --git a/cache/src/main/java/net/runelite/cache/definitions/FramemapDefinition.java b/cache/src/main/java/net/runelite/cache/definitions/FramemapDefinition.java
new file mode 100644
index 0000000000..00669d6690
--- /dev/null
+++ b/cache/src/main/java/net/runelite/cache/definitions/FramemapDefinition.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2017, Adam
+ * 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.cache.definitions;
+
+import lombok.Data;
+
+@Data
+public class FramemapDefinition
+{
+ public int id;
+ public int[] types;
+ public int[][] frameMaps;
+ public int length;
+}
diff --git a/cache/src/main/java/net/runelite/cache/definitions/InterfaceDefinition.java b/cache/src/main/java/net/runelite/cache/definitions/InterfaceDefinition.java
new file mode 100644
index 0000000000..aede6d6d7b
--- /dev/null
+++ b/cache/src/main/java/net/runelite/cache/definitions/InterfaceDefinition.java
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) 2017, Adam
+ * 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.cache.definitions;
+
+import lombok.Data;
+
+@Data
+public class InterfaceDefinition
+{
+ public int id = -1;
+ public boolean isIf3 = false;
+ public int type;
+ public int contentType;
+ public int originalX;
+ public int originalY;
+ public int originalWidth;
+ public int originalHeight;
+ public int widthMode;
+ public int heightMode;
+ public int xPositionMode;
+ public int yPositionMode;
+ public int parentId = -1;
+ public boolean isHidden;
+ public int scrollWidth;
+ public int scrollHeight;
+ public boolean noClickThrough;
+ public int spriteId;
+ public int textureId;
+ public boolean spriteTiling;
+ public int opacity;
+ public int borderType;
+ public int shadowColor;
+ public boolean flippedVertically;
+ public boolean flippedHorizontally;
+ public int modelType;
+ public int modelId;
+ public int offsetX2d;
+ public int offsetY2d;
+ public int rotationX;
+ public int rotationY;
+ public int rotationZ;
+ public int modelZoom;
+ public int animation;
+ public boolean orthogonal;
+ public int modelHeightOverride;
+ public int fontId;
+ public String text;
+ public int lineHeight;
+ public int xTextAlignment;
+ public int yTextAlignment;
+ public boolean textShadowed;
+ public int textColor;
+ public boolean filled;
+ public int lineWidth;
+ public boolean lineDirection;
+ public int clickMask;
+ public String name;
+ public String[] actions;
+ public int dragDeadZone;
+ public int dragDeadTime;
+ public boolean dragRenderBehavior;
+ public String targetVerb;
+ public Object[] onLoadListener;
+ public Object[] onMouseOverListener;
+ public Object[] onMouseLeaveListener;
+ public Object[] onTargetLeaveListener;
+ public Object[] onTargetEnterListener;
+ public Object[] onVarTransmitListener;
+ public Object[] onInvTransmitListener;
+ public Object[] onStatTransmitListener;
+ public Object[] onTimerListener;
+ public Object[] onOpListener;
+ public Object[] onMouseRepeatListener;
+ public Object[] onClickListener;
+ public Object[] onClickRepeatListener;
+ public Object[] onReleaseListener;
+ public Object[] onHoldListener;
+ public Object[] onDragListener;
+ public Object[] onDragCompleteListener;
+ public Object[] onScrollWheelListener;
+ public int[] varTransmitTriggers;
+ public int[] invTransmitTriggers;
+ public int[] statTransmitTriggers;
+ public boolean hasListener;
+
+ public int menuType;
+ // This is set to a siblings' child id when that widget should get a hover effect when this one is hovered
+ public int hoveredSiblingId;
+ public int[] alternateOperators;
+ public int[] alternateRhs;
+ public ClientScript1Instruction[][] clientScripts;
+ public int[] itemIds;
+ public int[] itemQuantities;
+ public int xPitch;
+ public int yPitch;
+ public int[] xOffsets;
+ public int[] yOffsets;
+ public int[] sprites;
+ public String[] configActions;
+ public String alternateText;
+ public int alternateTextColor;
+ public int hoveredTextColor;
+ public int alternateHoveredTextColor;
+ public int alternateSpriteId;
+ public int alternateModelId;
+ public int alternateAnimation;
+ public String spellName;
+ public String tooltip;
+}
diff --git a/cache/src/main/java/net/runelite/cache/definitions/InventoryDefinition.java b/cache/src/main/java/net/runelite/cache/definitions/InventoryDefinition.java
new file mode 100644
index 0000000000..5239f5c093
--- /dev/null
+++ b/cache/src/main/java/net/runelite/cache/definitions/InventoryDefinition.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2017, Adam
+ * 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.cache.definitions;
+
+import lombok.Data;
+
+@Data
+public class InventoryDefinition
+{
+ public int id;
+ public int size;
+}
diff --git a/cache/src/main/java/net/runelite/cache/definitions/ItemDefinition.java b/cache/src/main/java/net/runelite/cache/definitions/ItemDefinition.java
new file mode 100644
index 0000000000..8f67622b24
--- /dev/null
+++ b/cache/src/main/java/net/runelite/cache/definitions/ItemDefinition.java
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2016-2017, Adam
+ * 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.cache.definitions;
+
+import java.util.Map;
+import lombok.Data;
+
+@Data
+public class ItemDefinition
+{
+ public final int id;
+
+ public String name = "null";
+
+ public int resizeX = 128;
+ public int resizeY = 128;
+ public int resizeZ = 128;
+
+ public int xan2d = 0;
+ public int yan2d = 0;
+ public int zan2d = 0;
+
+ public int cost = 1;
+ public boolean isTradeable;
+ public int stackable = 0;
+ public int inventoryModel;
+ public boolean members = false;
+
+ public short[] colorFind;
+ public short[] colorReplace;
+ public short[] textureFind;
+ public short[] textureReplace;
+
+ public int zoom2d = 2000;
+ public int xOffset2d = 0;
+ public int yOffset2d = 0;
+
+ public int ambient;
+ public int contrast;
+
+ public int[] countCo;
+ public int[] countObj;
+
+ public String[] options = new String[]
+ {
+ null, null, "Take", null, null
+ };
+
+ public String[] interfaceOptions = new String[]
+ {
+ null, null, null, null, "Drop"
+ };
+
+ public int maleModel0 = -1;
+ public int maleModel1 = -1;
+ public int maleModel2 = -1;
+ public int maleOffset;
+ public int maleHeadModel = -1;
+ public int maleHeadModel2 = -1;
+
+ public int femaleModel0 = -1;
+ public int femaleModel1 = -1;
+ public int femaleModel2 = -1;
+ public int femaleOffset;
+ public int femaleHeadModel = -1;
+ public int femaleHeadModel2 = -1;
+
+ public int notedID = -1;
+ public int notedTemplate = -1;
+
+ public int team;
+
+ public int shiftClickDropIndex = -2;
+
+ public int boughtId = -1;
+ public int boughtTemplateId = -1;
+
+ public int placeholderId = -1;
+ public int placeholderTemplateId = -1;
+
+ public Map params = null;
+
+ public void updateNote(ItemDefinition notedItem, ItemDefinition unnotedItem)
+ {
+ this.inventoryModel = notedItem.inventoryModel;
+ this.zoom2d = notedItem.zoom2d;
+ this.xan2d = notedItem.xan2d;
+ this.yan2d = notedItem.yan2d;
+ this.zan2d = notedItem.zan2d;
+ this.xOffset2d = notedItem.xOffset2d;
+ this.yOffset2d = notedItem.yOffset2d;
+ this.colorFind = notedItem.colorFind;
+ this.colorReplace = notedItem.colorReplace;
+ this.textureFind = notedItem.textureFind;
+ this.textureReplace = notedItem.textureReplace;
+ this.name = unnotedItem.name;
+ this.members = unnotedItem.members;
+ this.cost = unnotedItem.cost;
+ this.stackable = 1;
+ }
+}
diff --git a/cache/src/main/java/net/runelite/cache/definitions/KitDefinition.java b/cache/src/main/java/net/runelite/cache/definitions/KitDefinition.java
new file mode 100644
index 0000000000..bd2ee535f5
--- /dev/null
+++ b/cache/src/main/java/net/runelite/cache/definitions/KitDefinition.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2017, Adam
+ * 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.cache.definitions;
+
+import lombok.Data;
+
+@Data
+public class KitDefinition
+{
+ private final int id;
+ public short[] recolorToReplace;
+ public short[] recolorToFind;
+ public short[] retextureToFind;
+ public short[] retextureToReplace;
+ public int bodyPartId = -1;
+ public int[] modelIds;
+ public int[] models = new int[]
+ {
+ -1, -1, -1, -1, -1
+ };
+ public boolean nonSelectable = false;
+}
diff --git a/cache/src/main/java/net/runelite/cache/definitions/LocationsDefinition.java b/cache/src/main/java/net/runelite/cache/definitions/LocationsDefinition.java
new file mode 100644
index 0000000000..435cdd4746
--- /dev/null
+++ b/cache/src/main/java/net/runelite/cache/definitions/LocationsDefinition.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2017, Adam
+ * 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.cache.definitions;
+
+import java.util.ArrayList;
+import java.util.List;
+import lombok.Data;
+import net.runelite.cache.region.Location;
+
+@Data
+public class LocationsDefinition
+{
+ private int regionX;
+ private int regionY;
+ private List locations = new ArrayList<>();
+}
diff --git a/cache/src/main/java/net/runelite/cache/definitions/MapDefinition.java b/cache/src/main/java/net/runelite/cache/definitions/MapDefinition.java
new file mode 100644
index 0000000000..b695b24cbe
--- /dev/null
+++ b/cache/src/main/java/net/runelite/cache/definitions/MapDefinition.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2017, Adam
+ * 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.cache.definitions;
+
+import lombok.Data;
+
+@Data
+public class MapDefinition
+{
+ public static final int X = 64;
+ public static final int Y = 64;
+ public static final int Z = 4;
+
+ @Data
+ public static class Tile
+ {
+ public Integer height;
+ public int attrOpcode;
+ public byte settings;
+ public byte overlayId;
+ public byte overlayPath;
+ public byte overlayRotation;
+ public byte underlayId;
+ }
+
+ private int regionX;
+ private int regionY;
+ private Tile[][][] tiles = new Tile[Z][X][Y];
+}
diff --git a/cache/src/main/java/net/runelite/cache/definitions/ModelDefinition.java b/cache/src/main/java/net/runelite/cache/definitions/ModelDefinition.java
new file mode 100644
index 0000000000..2259026a4d
--- /dev/null
+++ b/cache/src/main/java/net/runelite/cache/definitions/ModelDefinition.java
@@ -0,0 +1,635 @@
+package net.runelite.cache.definitions;
+
+import java.util.Arrays;
+import lombok.Data;
+import net.runelite.cache.models.CircularAngle;
+import net.runelite.cache.models.FaceNormal;
+import net.runelite.cache.models.VertexNormal;
+
+@Data
+public class ModelDefinition
+{
+ public int id;
+
+ public int vertexCount = 0;
+ public int[] vertexPositionsX;
+ public int[] vertexPositionsY;
+ public int[] vertexPositionsZ;
+ public transient VertexNormal[] vertexNormals;
+
+ public int faceCount;
+ public int[] faceVertexIndices1;
+ public int[] faceVertexIndices2;
+ public int[] faceVertexIndices3;
+ public byte[] faceAlphas;
+ public short[] faceColors;
+ public byte[] faceRenderPriorities;
+ public byte[] faceRenderTypes;
+ public transient FaceNormal[] faceNormals;
+
+ public int textureTriangleCount;
+ public short[] textureTriangleVertexIndices1;
+ public short[] textureTriangleVertexIndices2;
+ public short[] textureTriangleVertexIndices3;
+ public transient float[][] faceTextureUCoordinates;
+ public transient float[][] faceTextureVCoordinates;
+ public short[] texturePrimaryColors;
+ public short[] faceTextures;
+ public byte[] textureCoordinates;
+ public byte[] textureRenderTypes;
+
+ public int[] vertexSkins;
+ public int[] faceSkins;
+
+ public byte priority;
+
+ public short[] aShortArray2574;
+ public short[] aShortArray2575;
+ public short[] aShortArray2577;
+ public short[] aShortArray2578;
+ public byte[] aByteArray2580;
+ public short[] aShortArray2586;
+
+ private transient int[][] vertexGroups;
+
+ private transient int[] origVX;
+ private transient int[] origVY;
+ private transient int[] origVZ;
+
+ public transient int maxPriority;
+
+ public static transient int animOffsetX, animOffsetY, animOffsetZ;
+
+ public void computeNormals()
+ {
+ if (this.vertexNormals != null)
+ {
+ return;
+ }
+
+ this.vertexNormals = new VertexNormal[this.vertexCount];
+
+ int var1;
+ for (var1 = 0; var1 < this.vertexCount; ++var1)
+ {
+ this.vertexNormals[var1] = new VertexNormal();
+ }
+
+ for (var1 = 0; var1 < this.faceCount; ++var1)
+ {
+ int vertexA = this.faceVertexIndices1[var1];
+ int vertexB = this.faceVertexIndices2[var1];
+ int vertexC = this.faceVertexIndices3[var1];
+
+ int xA = this.vertexPositionsX[vertexB] - this.vertexPositionsX[vertexA];
+ int yA = this.vertexPositionsY[vertexB] - this.vertexPositionsY[vertexA];
+ int zA = this.vertexPositionsZ[vertexB] - this.vertexPositionsZ[vertexA];
+
+ int xB = this.vertexPositionsX[vertexC] - this.vertexPositionsX[vertexA];
+ int yB = this.vertexPositionsY[vertexC] - this.vertexPositionsY[vertexA];
+ int zB = this.vertexPositionsZ[vertexC] - this.vertexPositionsZ[vertexA];
+
+ // Compute cross product
+ int var11 = yA * zB - yB * zA;
+ int var12 = zA * xB - zB * xA;
+ int var13 = xA * yB - xB * yA;
+
+ while (var11 > 8192 || var12 > 8192 || var13 > 8192 || var11 < -8192 || var12 < -8192 || var13 < -8192)
+ {
+ var11 >>= 1;
+ var12 >>= 1;
+ var13 >>= 1;
+ }
+
+ int length = (int) Math.sqrt((double) (var11 * var11 + var12 * var12 + var13 * var13));
+ if (length <= 0)
+ {
+ length = 1;
+ }
+
+ var11 = var11 * 256 / length;
+ var12 = var12 * 256 / length;
+ var13 = var13 * 256 / length;
+
+ byte var15;
+ if (this.faceRenderTypes == null)
+ {
+ var15 = 0;
+ }
+ else
+ {
+ var15 = this.faceRenderTypes[var1];
+ }
+
+ if (var15 == 0)
+ {
+ VertexNormal var16 = this.vertexNormals[vertexA];
+ var16.x += var11;
+ var16.y += var12;
+ var16.z += var13;
+ ++var16.magnitude;
+
+ var16 = this.vertexNormals[vertexB];
+ var16.x += var11;
+ var16.y += var12;
+ var16.z += var13;
+ ++var16.magnitude;
+
+ var16 = this.vertexNormals[vertexC];
+ var16.x += var11;
+ var16.y += var12;
+ var16.z += var13;
+ ++var16.magnitude;
+ }
+ else if (var15 == 1)
+ {
+ if (this.faceNormals == null)
+ {
+ this.faceNormals = new FaceNormal[this.faceCount];
+ }
+
+ FaceNormal var17 = this.faceNormals[var1] = new FaceNormal();
+ var17.x = var11;
+ var17.y = var12;
+ var17.z = var13;
+ }
+ }
+ }
+
+ /**
+ * Computes the UV coordinates for every three-vertex face that has a
+ * texture.
+ */
+ public void computeTextureUVCoordinates()
+ {
+ this.faceTextureUCoordinates = new float[faceCount][];
+ this.faceTextureVCoordinates = new float[faceCount][];
+
+ for (int i = 0; i < faceCount; i++)
+ {
+ int textureCoordinate;
+ if (textureCoordinates == null)
+ {
+ textureCoordinate = -1;
+ }
+ else
+ {
+ textureCoordinate = textureCoordinates[i];
+ }
+
+ int textureIdx;
+ if (faceTextures == null)
+ {
+ textureIdx = -1;
+ }
+ else
+ {
+ textureIdx = faceTextures[i] & 0xFFFF;
+ }
+
+ if (textureIdx != -1)
+ {
+ float[] u = new float[3];
+ float[] v = new float[3];
+
+ if (textureCoordinate == -1)
+ {
+ u[0] = 0.0F;
+ v[0] = 1.0F;
+
+ u[1] = 1.0F;
+ v[1] = 1.0F;
+
+ u[2] = 0.0F;
+ v[2] = 0.0F;
+ }
+ else
+ {
+ textureCoordinate &= 0xFF;
+
+ byte textureRenderType = 0;
+ if (textureRenderTypes != null)
+ {
+ textureRenderType = textureRenderTypes[textureCoordinate];
+ }
+
+ if (textureRenderType == 0)
+ {
+ int faceVertexIdx1 = faceVertexIndices1[i];
+ int faceVertexIdx2 = faceVertexIndices2[i];
+ int faceVertexIdx3 = faceVertexIndices3[i];
+
+ short triangleVertexIdx1 = textureTriangleVertexIndices1[textureCoordinate];
+ short triangleVertexIdx2 = textureTriangleVertexIndices2[textureCoordinate];
+ short triangleVertexIdx3 = textureTriangleVertexIndices3[textureCoordinate];
+
+ float triangleX = (float) vertexPositionsX[triangleVertexIdx1];
+ float triangleY = (float) vertexPositionsY[triangleVertexIdx1];
+ float triangleZ = (float) vertexPositionsZ[triangleVertexIdx1];
+
+ float f_882_ = (float) vertexPositionsX[triangleVertexIdx2] - triangleX;
+ float f_883_ = (float) vertexPositionsY[triangleVertexIdx2] - triangleY;
+ float f_884_ = (float) vertexPositionsZ[triangleVertexIdx2] - triangleZ;
+ float f_885_ = (float) vertexPositionsX[triangleVertexIdx3] - triangleX;
+ float f_886_ = (float) vertexPositionsY[triangleVertexIdx3] - triangleY;
+ float f_887_ = (float) vertexPositionsZ[triangleVertexIdx3] - triangleZ;
+ float f_888_ = (float) vertexPositionsX[faceVertexIdx1] - triangleX;
+ float f_889_ = (float) vertexPositionsY[faceVertexIdx1] - triangleY;
+ float f_890_ = (float) vertexPositionsZ[faceVertexIdx1] - triangleZ;
+ float f_891_ = (float) vertexPositionsX[faceVertexIdx2] - triangleX;
+ float f_892_ = (float) vertexPositionsY[faceVertexIdx2] - triangleY;
+ float f_893_ = (float) vertexPositionsZ[faceVertexIdx2] - triangleZ;
+ float f_894_ = (float) vertexPositionsX[faceVertexIdx3] - triangleX;
+ float f_895_ = (float) vertexPositionsY[faceVertexIdx3] - triangleY;
+ float f_896_ = (float) vertexPositionsZ[faceVertexIdx3] - triangleZ;
+
+ float f_897_ = f_883_ * f_887_ - f_884_ * f_886_;
+ float f_898_ = f_884_ * f_885_ - f_882_ * f_887_;
+ float f_899_ = f_882_ * f_886_ - f_883_ * f_885_;
+ float f_900_ = f_886_ * f_899_ - f_887_ * f_898_;
+ float f_901_ = f_887_ * f_897_ - f_885_ * f_899_;
+ float f_902_ = f_885_ * f_898_ - f_886_ * f_897_;
+ float f_903_ = 1.0F / (f_900_ * f_882_ + f_901_ * f_883_ + f_902_ * f_884_);
+
+ u[0] = (f_900_ * f_888_ + f_901_ * f_889_ + f_902_ * f_890_) * f_903_;
+ u[1] = (f_900_ * f_891_ + f_901_ * f_892_ + f_902_ * f_893_) * f_903_;
+ u[2] = (f_900_ * f_894_ + f_901_ * f_895_ + f_902_ * f_896_) * f_903_;
+
+ f_900_ = f_883_ * f_899_ - f_884_ * f_898_;
+ f_901_ = f_884_ * f_897_ - f_882_ * f_899_;
+ f_902_ = f_882_ * f_898_ - f_883_ * f_897_;
+ f_903_ = 1.0F / (f_900_ * f_885_ + f_901_ * f_886_ + f_902_ * f_887_);
+
+ v[0] = (f_900_ * f_888_ + f_901_ * f_889_ + f_902_ * f_890_) * f_903_;
+ v[1] = (f_900_ * f_891_ + f_901_ * f_892_ + f_902_ * f_893_) * f_903_;
+ v[2] = (f_900_ * f_894_ + f_901_ * f_895_ + f_902_ * f_896_) * f_903_;
+ }
+ }
+
+ this.faceTextureUCoordinates[i] = u;
+ this.faceTextureVCoordinates[i] = v;
+ }
+ }
+ }
+
+ public void computeAnimationTables()
+ {
+ if (this.vertexSkins != null)
+ {
+ int[] groupCounts = new int[256];
+ int numGroups = 0;
+ int var3, var4;
+
+ for (var3 = 0; var3 < this.vertexCount; ++var3)
+ {
+ var4 = this.vertexSkins[var3];
+ ++groupCounts[var4];
+ if (var4 > numGroups)
+ {
+ numGroups = var4;
+ }
+ }
+
+ this.vertexGroups = new int[numGroups + 1][];
+
+ for (var3 = 0; var3 <= numGroups; ++var3)
+ {
+ this.vertexGroups[var3] = new int[groupCounts[var3]];
+ groupCounts[var3] = 0;
+ }
+
+ for (var3 = 0; var3 < this.vertexCount; this.vertexGroups[var4][groupCounts[var4]++] = var3++)
+ {
+ var4 = this.vertexSkins[var3];
+ }
+
+ this.vertexSkins = null;
+ }
+
+ // triangleSkinValues is here
+ }
+
+ public void rotate(int orientation)
+ {
+ int sin = CircularAngle.SINE[orientation];
+ int cos = CircularAngle.COSINE[orientation];
+
+ assert vertexPositionsX.length == vertexPositionsY.length;
+ assert vertexPositionsY.length == vertexPositionsZ.length;
+
+ for (int i = 0; i < vertexPositionsX.length; ++i)
+ {
+ vertexPositionsX[i] = vertexPositionsX[i] * cos + vertexPositionsZ[i] * sin >> 16;
+ vertexPositionsZ[i] = vertexPositionsZ[i] * cos - vertexPositionsX[i] * sin >> 16;
+ }
+
+ reset();
+ }
+
+ public void resetAnim()
+ {
+ if (origVX == null)
+ {
+ return;
+ }
+
+ System.arraycopy(origVX, 0, vertexPositionsX, 0, origVX.length);
+ System.arraycopy(origVY, 0, vertexPositionsY, 0, origVY.length);
+ System.arraycopy(origVZ, 0, vertexPositionsZ, 0, origVZ.length);
+ }
+
+ public void animate(int type, int[] frameMap, int dx, int dy, int dz)
+ {
+ if (origVX == null)
+ {
+ origVX = Arrays.copyOf(vertexPositionsX, vertexPositionsX.length);
+ origVY = Arrays.copyOf(vertexPositionsY, vertexPositionsY.length);
+ origVZ = Arrays.copyOf(vertexPositionsZ, vertexPositionsZ.length);
+ }
+
+ final int[] verticesX = vertexPositionsX;
+ final int[] verticesY = vertexPositionsY;
+ final int[] verticesZ = vertexPositionsZ;
+ int var6 = frameMap.length;
+ int var7;
+ int var8;
+ int var11;
+ int var12;
+ if (type == 0)
+ {
+ var7 = 0;
+ animOffsetX = 0;
+ animOffsetY = 0;
+ animOffsetZ = 0;
+
+ for (var8 = 0; var8 < var6; ++var8)
+ {
+ int var9 = frameMap[var8];
+ if (var9 < this.vertexGroups.length)
+ {
+ int[] var10 = this.vertexGroups[var9];
+
+ for (var11 = 0; var11 < var10.length; ++var11)
+ {
+ var12 = var10[var11];
+ animOffsetX += verticesX[var12];
+ animOffsetY += verticesY[var12];
+ animOffsetZ += verticesZ[var12];
+ ++var7;
+ }
+ }
+ }
+
+ if (var7 > 0)
+ {
+ animOffsetX = dx + animOffsetX / var7;
+ animOffsetY = dy + animOffsetY / var7;
+ animOffsetZ = dz + animOffsetZ / var7;
+ }
+ else
+ {
+ animOffsetX = dx;
+ animOffsetY = dy;
+ animOffsetZ = dz;
+ }
+
+ }
+ else
+ {
+ int[] var18;
+ int var19;
+ if (type == 1)
+ {
+ for (var7 = 0; var7 < var6; ++var7)
+ {
+ var8 = frameMap[var7];
+ if (var8 < this.vertexGroups.length)
+ {
+ var18 = this.vertexGroups[var8];
+
+ for (var19 = 0; var19 < var18.length; ++var19)
+ {
+ var11 = var18[var19];
+ verticesX[var11] += dx;
+ verticesY[var11] += dy;
+ verticesZ[var11] += dz;
+ }
+ }
+ }
+
+ }
+ else if (type == 2)
+ {
+ for (var7 = 0; var7 < var6; ++var7)
+ {
+ var8 = frameMap[var7];
+ if (var8 < this.vertexGroups.length)
+ {
+ var18 = this.vertexGroups[var8];
+
+ for (var19 = 0; var19 < var18.length; ++var19)
+ {
+ var11 = var18[var19];
+ verticesX[var11] -= animOffsetX;
+ verticesY[var11] -= animOffsetY;
+ verticesZ[var11] -= animOffsetZ;
+ var12 = (dx & 255) * 8;
+ int var13 = (dy & 255) * 8;
+ int var14 = (dz & 255) * 8;
+ int var15;
+ int var16;
+ int var17;
+ if (var14 != 0)
+ {
+ var15 = CircularAngle.SINE[var14];
+ var16 = CircularAngle.COSINE[var14];
+ var17 = var15 * verticesY[var11] + var16 * verticesX[var11] >> 16;
+ verticesY[var11] = var16 * verticesY[var11] - var15 * verticesX[var11] >> 16;
+ verticesX[var11] = var17;
+ }
+
+ if (var12 != 0)
+ {
+ var15 = CircularAngle.SINE[var12];
+ var16 = CircularAngle.COSINE[var12];
+ var17 = var16 * verticesY[var11] - var15 * verticesZ[var11] >> 16;
+ verticesZ[var11] = var15 * verticesY[var11] + var16 * verticesZ[var11] >> 16;
+ verticesY[var11] = var17;
+ }
+
+ if (var13 != 0)
+ {
+ var15 = CircularAngle.SINE[var13];
+ var16 = CircularAngle.COSINE[var13];
+ var17 = var15 * verticesZ[var11] + var16 * verticesX[var11] >> 16;
+ verticesZ[var11] = var16 * verticesZ[var11] - var15 * verticesX[var11] >> 16;
+ verticesX[var11] = var17;
+ }
+
+ verticesX[var11] += animOffsetX;
+ verticesY[var11] += animOffsetY;
+ verticesZ[var11] += animOffsetZ;
+ }
+ }
+ }
+
+ }
+ else if (type == 3)
+ {
+ for (var7 = 0; var7 < var6; ++var7)
+ {
+ var8 = frameMap[var7];
+ if (var8 < this.vertexGroups.length)
+ {
+ var18 = this.vertexGroups[var8];
+
+ for (var19 = 0; var19 < var18.length; ++var19)
+ {
+ var11 = var18[var19];
+ verticesX[var11] -= animOffsetX;
+ verticesY[var11] -= animOffsetY;
+ verticesZ[var11] -= animOffsetZ;
+ verticesX[var11] = dx * verticesX[var11] / 128;
+ verticesY[var11] = dy * verticesY[var11] / 128;
+ verticesZ[var11] = dz * verticesZ[var11] / 128;
+ verticesX[var11] += animOffsetX;
+ verticesY[var11] += animOffsetY;
+ verticesZ[var11] += animOffsetZ;
+ }
+ }
+ }
+
+ }
+ else if (type == 5)
+ {
+ // alpha animation
+ }
+ }
+ }
+
+ public void method1493()
+ {
+ int var1;
+ for (var1 = 0; var1 < this.vertexCount; ++var1)
+ {
+ this.vertexPositionsZ[var1] = -this.vertexPositionsZ[var1];
+ }
+
+ for (var1 = 0; var1 < this.faceCount; ++var1)
+ {
+ int var2 = this.faceVertexIndices1[var1];
+ this.faceVertexIndices1[var1] = this.faceVertexIndices3[var1];
+ this.faceVertexIndices3[var1] = var2;
+ }
+
+ reset();
+ }
+
+ public void rotate1()
+ {
+ for (int var1 = 0; var1 < this.vertexCount; ++var1)
+ {
+ int var2 = this.vertexPositionsX[var1];
+ this.vertexPositionsX[var1] = this.vertexPositionsZ[var1];
+ this.vertexPositionsZ[var1] = -var2;
+ }
+
+ reset();
+ }
+
+ public void rotate2()
+ {
+ for (int var1 = 0; var1 < this.vertexCount; ++var1)
+ {
+ this.vertexPositionsX[var1] = -this.vertexPositionsX[var1];
+ this.vertexPositionsZ[var1] = -this.vertexPositionsZ[var1];
+ }
+
+ reset();
+ }
+
+ public void rotate3()
+ {
+ for (int var1 = 0; var1 < this.vertexCount; ++var1)
+ {
+ int var2 = this.vertexPositionsZ[var1];
+ this.vertexPositionsZ[var1] = this.vertexPositionsX[var1];
+ this.vertexPositionsX[var1] = -var2;
+ }
+
+ reset();
+ }
+
+ private void reset()
+ {
+ vertexNormals = null;
+ faceNormals = null;
+ faceTextureUCoordinates = faceTextureVCoordinates = null;
+ }
+
+ public void resize(int var1, int var2, int var3)
+ {
+ for (int var4 = 0; var4 < this.vertexCount; ++var4)
+ {
+ this.vertexPositionsX[var4] = this.vertexPositionsX[var4] * var1 / 128;
+ this.vertexPositionsY[var4] = var2 * this.vertexPositionsY[var4] / 128;
+ this.vertexPositionsZ[var4] = var3 * this.vertexPositionsZ[var4] / 128;
+ }
+
+ reset();
+ }
+
+ public void recolor(short var1, short var2)
+ {
+ for (int var3 = 0; var3 < this.faceCount; ++var3)
+ {
+ if (this.faceColors[var3] == var1)
+ {
+ this.faceColors[var3] = var2;
+ }
+ }
+
+ }
+
+ public void retexture(short var1, short var2)
+ {
+ if (this.faceTextures != null)
+ {
+ for (int var3 = 0; var3 < this.faceCount; ++var3)
+ {
+ if (this.faceTextures[var3] == var1)
+ {
+ this.faceTextures[var3] = var2;
+ }
+ }
+
+ }
+ }
+
+ public void move(int xOffset, int yOffset, int zOffset)
+ {
+ for (int i = 0; i < this.vertexCount; i++)
+ {
+ this.vertexPositionsX[i] += xOffset;
+ this.vertexPositionsY[i] += yOffset;
+ this.vertexPositionsZ[i] += zOffset;
+ }
+ this.reset();
+ }
+
+ public void computeMaxPriority()
+ {
+ if (faceRenderPriorities == null)
+ {
+ return;
+ }
+
+ for (int i = 0; i < faceCount; ++i)
+ {
+ if (faceRenderPriorities[i] > maxPriority)
+ {
+ maxPriority = faceRenderPriorities[i];
+ }
+ }
+ }
+}
diff --git a/deobfuscator/src/main/java/net/runelite/deob/util/NameMappings.java b/cache/src/main/java/net/runelite/cache/definitions/NpcDefinition.java
similarity index 55%
rename from deobfuscator/src/main/java/net/runelite/deob/util/NameMappings.java
rename to cache/src/main/java/net/runelite/cache/definitions/NpcDefinition.java
index 36c1b52c92..8ba160c97a 100644
--- a/deobfuscator/src/main/java/net/runelite/deob/util/NameMappings.java
+++ b/cache/src/main/java/net/runelite/cache/definitions/NpcDefinition.java
@@ -23,52 +23,46 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-package net.runelite.deob.util;
+package net.runelite.cache.definitions;
-import java.util.HashMap;
import java.util.Map;
-import net.runelite.asm.pool.Class;
-import net.runelite.asm.pool.Field;
-import net.runelite.asm.pool.Method;
+import lombok.Data;
-public class NameMappings
+@Data
+public class NpcDefinition
{
- private final Map