diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000..dfe0770424 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md deleted file mode 100644 index fe0d820eca..0000000000 --- a/.github/CONTRIBUTING.md +++ /dev/null @@ -1,134 +0,0 @@ -# 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 deleted file mode 100644 index 219706327f..0000000000 --- a/.github/ISSUE_TEMPLATE/Bug_report.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -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 deleted file mode 100644 index 57cf66a8dd..0000000000 --- a/.github/ISSUE_TEMPLATE/Feature_request.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -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 51854a9d2e..9b27729015 100644 --- a/.gitignore +++ b/.gitignore @@ -1,15 +1,6 @@ -target -nbactions.xml -nb-configuration.xml -/nbproject/ -project.properties -*.iml -.idea/ -.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 +*.iml + +.idea/ +dependency-reduced-pom.xml +**/target/* \ No newline at end of file diff --git a/.mvn/jvm.config b/.mvn/jvm.config deleted file mode 100644 index 67bd169f31..0000000000 --- a/.mvn/jvm.config +++ /dev/null @@ -1 +0,0 @@ --Xmx512m diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ada8108a37..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -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 9426de9b87..8410c20079 100644 --- a/LICENSE +++ b/LICENSE @@ -1,25 +1,661 @@ -BSD 2-Clause License +GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 -Copyright (c) 2016-2017, Adam -All rights reserved. + 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. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: + Preamble -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. + 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. -* 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. + 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. -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. + 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 diff --git a/README.md b/README.md deleted file mode 100644 index 7ff563d196..0000000000 --- a/README.md +++ /dev/null @@ -1,25 +0,0 @@ -![](https://i.imgur.com/OVRdQBz.png) - - - -# RuneLitePlus [![Build Status](https://travis-ci.org/runelite-extended/runelite.svg?branch=master)](https://travis-ci.org/runelite-extended/runelite) [![Discord](https://img.shields.io/discord/373382904769675265.svg)](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 new file mode 100644 index 0000000000..bffdcb6707 --- /dev/null +++ b/RuneLitePlus/Test.java @@ -0,0 +1,111 @@ +/* + * 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/runelite-client/src/test/java/net/runelite/client/config/TestConfig.java b/RuneLitePlus/TestConfig.java similarity index 75% rename from runelite-client/src/test/java/net/runelite/client/config/TestConfig.java rename to RuneLitePlus/TestConfig.java index 9bc5f29b37..940c65441a 100644 --- a/runelite-client/src/test/java/net/runelite/client/config/TestConfig.java +++ b/RuneLitePlus/TestConfig.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Adam + * Copyright (c) 2018, Cas * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -22,25 +22,25 @@ * (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.config; +package com.runeswag.client.plugins; + +import com.runeswag.client.config.Config; +import com.runeswag.client.config.ConfigGroup; +import com.runeswag.client.config.ConfigItem; + +import java.awt.*; @ConfigGroup("test") -public interface TestConfig +public interface TestConfig extends Config { @ConfigItem( - keyName = "key", - name = "Key Name", - description = "value" + keyName = "Testing 1", + name = "Test option", + description = "Enable/disable nothing", + position = 1 ) - default String key() + default boolean tested() { - return "default"; + return true; } - - @ConfigItem( - keyName = "key", - name = "Key Name", - description = "value" - ) - void key(String key); } diff --git a/runelite-mixins/src/main/java/net/runelite/mixins/RSIgnoreMixin.java b/RuneLitePlus/TestOverlay.java similarity index 61% rename from runelite-mixins/src/main/java/net/runelite/mixins/RSIgnoreMixin.java rename to RuneLitePlus/TestOverlay.java index 98bcd7b3b2..94b47c5bd5 100644 --- a/runelite-mixins/src/main/java/net/runelite/mixins/RSIgnoreMixin.java +++ b/RuneLitePlus/TestOverlay.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2018, Adam + * Copyright (c) 2018, Cas * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -22,28 +23,41 @@ * (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.mixins; +package com.runeswag.client.plugins; -import net.runelite.api.mixins.Inject; -import net.runelite.api.mixins.Mixin; -import net.runelite.rs.api.RSIgnore; -import net.runelite.rs.api.RSName; +import api.Client; +import com.runeswag.client.ui.Overlay; +import com.runeswag.client.ui.OverlayLayer; +import com.runeswag.client.ui.OverlayPosition; -@Mixin(RSIgnore.class) -public abstract class RSIgnoreMixin implements RSIgnore +import javax.inject.Inject; +import java.awt.*; + +class TestOverlay extends Overlay { - @Override + private static final Color SHORTCUT_HIGH_LEVEL_COLOR = Color.ORANGE; + + private final Client client; + private final Test plugin; + private final TestConfig config; + @Inject - public String getName() + private TestOverlay(Client client, Test plugin, TestConfig config) { - return getRsName().getName(); + super(plugin); + setPosition(OverlayPosition.DYNAMIC); + setLayer(OverlayLayer.ABOVE_SCENE); + this.client = client; + this.plugin = plugin; + this.config = config; } @Override - @Inject - public String getPrevName() + public Dimension render(Graphics2D graphics) { - RSName prevName = getRsPrevName(); - return prevName == null ? null : prevName.getName(); + System.out.println("Rendered Test"); + graphics.setColor(Color.RED); + graphics.drawString("Hello World", 20, 20); + return null; } } diff --git a/runelite-client/pom.xml b/RuneLitePlus/pom.xml similarity index 89% rename from runelite-client/pom.xml rename to RuneLitePlus/pom.xml index 589f88fd64..dfabd9ea28 100644 --- a/runelite-client/pom.xml +++ b/RuneLitePlus/pom.xml @@ -27,9 +27,9 @@ 4.0.0 - net.runelite - runelite-parent - 1.5.27-SNAPSHOT + com.runeswag + runeswag-parent + 1.0-SNAPSHOT client @@ -66,121 +66,126 @@ org.slf4j slf4j-api + 1.8.0-beta4 ch.qos.logback logback-classic + 1.3.0-alpha4 net.sf.jopt-simple jopt-simple - ${jopt.version} + 5.0.1 com.google.guava guava + 27.1-jre com.google.inject guice - ${guice.version} + 4.2.2 no_aop com.google.code.gson gson + 2.8.5 net.runelite.pushingpixels substance - ${runelite.pushingpixels.substance.version} + 8.0.02 net.runelite.pushingpixels trident - ${runelite.pushingpixels.trident.version} + 1.5.00 runtime org.projectlombok lombok + 1.18.6 provided org.apache.commons commons-text - ${commons.text.version} + 1.6 org.jogamp.jogl jogl-all - ${jogl.version} + 2.3.2 org.jogamp.jogl jogl-all - ${jogl.version} + 2.3.2 natives-windows-amd64 runtime org.jogamp.jogl jogl-all - ${jogl.version} + 2.3.2 natives-windows-i586 runtime org.jogamp.jogl jogl-all - ${jogl.version} + 2.3.2 natives-linux-amd64 runtime org.jogamp.jogl jogl-all - ${jogl.version} + 2.3.2 natives-linux-i586 runtime org.jogamp.gluegen gluegen-rt - ${jogl.version} + 2.3.2 org.jogamp.gluegen gluegen-rt - ${jogl.version} + 2.3.2 natives-windows-amd64 runtime org.jogamp.gluegen gluegen-rt - ${jogl.version} + 2.3.2 natives-windows-i586 runtime org.jogamp.gluegen gluegen-rt - ${jogl.version} + 2.3.2 natives-linux-amd64 runtime org.jogamp.gluegen gluegen-rt - ${jogl.version} + 2.3.2 natives-linux-i586 runtime io.sigpipe jbsdiff - ${sigpipe.jbsdiff.version} + 1.0 org.tukaani @@ -192,18 +197,18 @@ net.java.dev.jna jna - ${java.dev.jna.version} + 4.5.1 net.java.dev.jna jna-platform - ${java.dev.jna.version} + 4.5.1 - net.runelite - runelite-api - ${project.version} + com.runeswag + api + 1.0-SNAPSHOT net.runelit @@ -214,17 +219,17 @@ net.runelite http-api - ${project.version} + 1.5.26-SNAPSHOT net.runelite discord - ${runelite.discord.version} + 1.1 net.runelite orange-extensions - ${runelite.orange.extensions.version} + 1.0 provided + + + ERROR + + + + + + WARN + + + + + + + + + + + + \ No newline at end of file diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/account/login_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/account/login_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/account/login_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/account/login_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/account/logout_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/account/logout_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/account/logout_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/account/logout_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/banktags/tabs/down-arrow.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/banktags/tabs/down-arrow.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/banktags/tabs/down-arrow.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/banktags/tabs/down-arrow.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/banktags/tabs/incinerator.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/banktags/tabs/incinerator.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/banktags/tabs/incinerator.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/banktags/tabs/incinerator.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/banktags/tabs/new-tab.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/banktags/tabs/new-tab.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/banktags/tabs/new-tab.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/banktags/tabs/new-tab.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/banktags/tabs/tag-tab-active.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/banktags/tabs/tag-tab-active.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/banktags/tabs/tag-tab-active.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/banktags/tabs/tag-tab-active.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/banktags/tabs/tag-tab.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/banktags/tabs/tag-tab.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/banktags/tabs/tag-tab.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/banktags/tabs/tag-tab.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/banktags/tabs/up-arrow.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/banktags/tabs/up-arrow.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/banktags/tabs/up-arrow.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/banktags/tabs/up-arrow.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/barbarianassault/clock.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/barbarianassault/clock.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/barbarianassault/clock.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/barbarianassault/clock.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/boosts/buffed.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/boosts/buffed.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/boosts/buffed.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/boosts/buffed.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/boosts/buffedSmall.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/boosts/buffedSmall.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/boosts/buffedSmall.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/boosts/buffedSmall.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/boosts/debuffed.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/boosts/debuffed.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/boosts/debuffed.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/boosts/debuffed.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/boosts/debuffedSmall.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/boosts/debuffedSmall.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/boosts/debuffedSmall.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/boosts/debuffedSmall.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/cluescrolls/emote.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/cluescrolls/emote.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/cluescrolls/emote.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/cluescrolls/emote.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/config/config_back_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/config/config_back_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/config/config_back_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/config/config_back_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/config/config_edit_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/config/config_edit_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/config/config_edit_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/config/config_edit_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/config/config_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/config/config_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/config/config_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/config/config_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/config/star_on.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/config/star_on.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/config/star_on.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/config/star_on.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/config/switcher_on.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/config/switcher_on.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/config/switcher_on.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/config/switcher_on.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/customcursor/cursor-armadyl-godsword.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/customcursor/cursor-armadyl-godsword.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/customcursor/cursor-armadyl-godsword.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/customcursor/cursor-armadyl-godsword.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/customcursor/cursor-bandos-godsword.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/customcursor/cursor-bandos-godsword.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/customcursor/cursor-bandos-godsword.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/customcursor/cursor-bandos-godsword.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/customcursor/cursor-dragon-dagger.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/customcursor/cursor-dragon-dagger.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/customcursor/cursor-dragon-dagger.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/customcursor/cursor-dragon-dagger.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/customcursor/cursor-dragon-scimitar.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/customcursor/cursor-dragon-scimitar.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/customcursor/cursor-dragon-scimitar.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/customcursor/cursor-dragon-scimitar.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/customcursor/cursor-mouse.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/customcursor/cursor-mouse.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/customcursor/cursor-mouse.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/customcursor/cursor-mouse.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/customcursor/cursor-rs3-gold.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/customcursor/cursor-rs3-gold.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/customcursor/cursor-rs3-gold.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/customcursor/cursor-rs3-gold.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/customcursor/cursor-rs3-silver.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/customcursor/cursor-rs3-silver.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/customcursor/cursor-rs3-silver.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/customcursor/cursor-rs3-silver.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/customcursor/cursor-saradomin-godsword.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/customcursor/cursor-saradomin-godsword.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/customcursor/cursor-saradomin-godsword.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/customcursor/cursor-saradomin-godsword.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/customcursor/cursor-trout.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/customcursor/cursor-trout.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/customcursor/cursor-trout.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/customcursor/cursor-trout.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/customcursor/cursor-zamorak-godsword.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/customcursor/cursor-zamorak-godsword.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/customcursor/cursor-zamorak-godsword.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/customcursor/cursor-zamorak-godsword.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/devtools/devtools_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/devtools/devtools_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/devtools/devtools_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/devtools/devtools_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/discord/discord.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/discord/discord.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/discord/discord.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/discord/discord.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/LICENSE b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/LICENSE similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/LICENSE rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/LICENSE diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/blush.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/blush.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/blush.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/blush.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/broken_heart.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/broken_heart.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/broken_heart.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/broken_heart.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/cat.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/cat.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/cat.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/cat.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/confused.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/confused.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/confused.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/confused.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/cooking.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/cooking.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/cooking.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/cooking.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/cowboy.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/cowboy.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/cowboy.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/cowboy.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/crab.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/crab.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/crab.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/crab.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/cry.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/cry.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/cry.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/cry.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/dancer.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/dancer.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/dancer.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/dancer.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/dog.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/dog.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/dog.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/dog.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/expressionless.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/expressionless.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/expressionless.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/expressionless.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/eyes.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/eyes.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/eyes.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/eyes.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/fish.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/fish.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/fish.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/fish.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/flushed.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/flushed.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/flushed.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/flushed.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/fork_and_knife.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/fork_and_knife.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/fork_and_knife.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/fork_and_knife.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/frowning2.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/frowning2.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/frowning2.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/frowning2.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/grinning.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/grinning.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/grinning.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/grinning.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/hearts.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/hearts.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/hearts.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/hearts.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/hugging.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/hugging.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/hugging.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/hugging.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/hushed.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/hushed.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/hushed.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/hushed.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/innocent.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/innocent.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/innocent.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/innocent.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/joy.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/joy.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/joy.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/joy.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/kissing.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/kissing.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/kissing.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/kissing.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/neutral_face.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/neutral_face.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/neutral_face.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/neutral_face.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/ok_hand.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/ok_hand.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/ok_hand.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/ok_hand.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/open_mouth.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/open_mouth.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/open_mouth.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/open_mouth.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/party_popper.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/party_popper.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/party_popper.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/party_popper.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/persevere.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/persevere.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/persevere.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/persevere.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/pile_of_poo.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/pile_of_poo.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/pile_of_poo.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/pile_of_poo.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/rage.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/rage.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/rage.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/rage.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/scream.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/scream.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/scream.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/scream.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/see_no_evil.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/see_no_evil.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/see_no_evil.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/see_no_evil.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/slight_frown.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/slight_frown.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/slight_frown.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/slight_frown.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/slight_smile.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/slight_smile.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/slight_smile.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/slight_smile.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/smile.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/smile.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/smile.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/smile.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/smiling_imp.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/smiling_imp.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/smiling_imp.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/smiling_imp.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/sob.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/sob.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/sob.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/sob.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/stuck_out_tongue.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/stuck_out_tongue.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/stuck_out_tongue.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/stuck_out_tongue.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/stuck_out_tongue_closed_eyes.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/stuck_out_tongue_closed_eyes.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/stuck_out_tongue_closed_eyes.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/stuck_out_tongue_closed_eyes.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/sunglasses.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/sunglasses.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/sunglasses.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/sunglasses.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/sweat.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/sweat.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/sweat.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/sweat.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/thinking.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/thinking.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/thinking.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/thinking.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/thumbsdown.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/thumbsdown.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/thumbsdown.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/thumbsdown.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/thumbsup.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/thumbsup.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/thumbsup.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/thumbsup.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/triumph.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/triumph.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/triumph.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/triumph.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/unamused.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/unamused.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/unamused.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/unamused.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/wink.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/wink.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/wink.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/wink.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/yum.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/yum.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/yum.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/yum.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/zipper_mouth.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/zipper_mouth.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/zipper_mouth.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/zipper_mouth.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/emojis/zzz.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/zzz.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/emojis/zzz.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/emojis/zzz.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/equipmentinspector/normal.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/equipmentinspector/normal.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/equipmentinspector/normal.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/equipmentinspector/normal.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/feed/icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/feed/icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/feed/icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/feed/icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/feed/osrs.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/feed/osrs.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/feed/osrs.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/feed/osrs.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/feed/runelite.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/feed/runelite.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/feed/runelite.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/feed/runelite.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/freezetimers/freeze.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/freezetimers/freeze.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/freezetimers/freeze.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/freezetimers/freeze.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/freezetimers/teleblock.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/freezetimers/teleblock.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/freezetimers/teleblock.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/freezetimers/teleblock.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/freezetimers/veng.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/freezetimers/veng.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/freezetimers/veng.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/freezetimers/veng.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/common.glsl b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/gpu/common.glsl similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/gpu/common.glsl rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/gpu/common.glsl diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/common_func.glsl b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/gpu/common_func.glsl similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/gpu/common_func.glsl rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/gpu/common_func.glsl diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/comp.glsl b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/gpu/comp.glsl similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/gpu/comp.glsl rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/gpu/comp.glsl diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/comp_common.glsl b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/gpu/comp_common.glsl similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/gpu/comp_common.glsl rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/gpu/comp_common.glsl diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/comp_small.glsl b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/gpu/comp_small.glsl similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/gpu/comp_small.glsl rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/gpu/comp_small.glsl diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/comp_unordered.glsl b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/gpu/comp_unordered.glsl similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/gpu/comp_unordered.glsl rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/gpu/comp_unordered.glsl diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/frag.glsl b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/gpu/frag.glsl similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/gpu/frag.glsl rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/gpu/frag.glsl diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/fragui.glsl b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/gpu/fragui.glsl similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/gpu/fragui.glsl rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/gpu/fragui.glsl diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/geom.glsl b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/gpu/geom.glsl similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/gpu/geom.glsl rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/gpu/geom.glsl diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/hsl_to_rgb.glsl b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/gpu/hsl_to_rgb.glsl similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/gpu/hsl_to_rgb.glsl rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/gpu/hsl_to_rgb.glsl diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/priority_render.glsl b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/gpu/priority_render.glsl similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/gpu/priority_render.glsl rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/gpu/priority_render.glsl diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/to_screen.glsl b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/gpu/to_screen.glsl similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/gpu/to_screen.glsl rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/gpu/to_screen.glsl diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/vert.glsl b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/gpu/vert.glsl similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/gpu/vert.glsl rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/gpu/vert.glsl diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/vertui.glsl b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/gpu/vertui.glsl similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/gpu/vertui.glsl rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/gpu/vertui.glsl diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/grandexchange/ge_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/grandexchange/ge_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/grandexchange/ge_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/grandexchange/ge_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/grandexchange/ge_limits.json b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/grandexchange/ge_limits.json similarity index 99% rename from runelite-client/src/main/resources/net/runelite/client/plugins/grandexchange/ge_limits.json rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/grandexchange/ge_limits.json index 37072ae9b1..94bcc83a44 100644 --- a/runelite-client/src/main/resources/net/runelite/client/plugins/grandexchange/ge_limits.json +++ b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/grandexchange/ge_limits.json @@ -3314,7 +3314,7 @@ "21521": 250, "21543": 13000, "21545": 13000, - "21555": 30000, + "21555": 18000, "21622": 13000, "21634": 8, "21637": 5, diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/hiscore/deadman.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/hiscore/deadman.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/hiscore/deadman.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/hiscore/deadman.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/hiscore/deadman_tournament.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/hiscore/deadman_tournament.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/hiscore/deadman_tournament.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/hiscore/deadman_tournament.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/hiscore/hardcore_ironman.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/hiscore/hardcore_ironman.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/hiscore/hardcore_ironman.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/hiscore/hardcore_ironman.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/hiscore/hiscore.gif b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/hiscore/hiscore.gif similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/hiscore/hiscore.gif rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/hiscore/hiscore.gif diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/hiscore/ironman.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/hiscore/ironman.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/hiscore/ironman.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/hiscore/ironman.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/hiscore/normal.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/hiscore/normal.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/hiscore/normal.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/hiscore/normal.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/hiscore/seasonal_deadman.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/hiscore/seasonal_deadman.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/hiscore/seasonal_deadman.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/hiscore/seasonal_deadman.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/hiscore/ultimate_ironman.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/hiscore/ultimate_ironman.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/hiscore/ultimate_ironman.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/hiscore/ultimate_ironman.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/info/discord_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/info/discord_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/info/discord_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/info/discord_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/info/github_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/info/github_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/info/github_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/info/github_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/info/import_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/info/import_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/info/import_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/info/import_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/info/info_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/info/info_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/info/info_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/info/info_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/info/patreon_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/info/patreon_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/info/patreon_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/info/patreon_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/info/wiki_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/info/wiki_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/info/wiki_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/info/wiki_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1017.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1017.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1017.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1017.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1018.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1018.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1018.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1018.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1019.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1019.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1019.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1019.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1020.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1020.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1020.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1020.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1021.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1021.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1021.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1021.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1022.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1022.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1022.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1022.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1023.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1023.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1023.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1023.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1024.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1024.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1024.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1024.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1025.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1025.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1025.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1025.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1031.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1031.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1031.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1031.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1032.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1032.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1032.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1032.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1033.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1033.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1033.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1033.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1034.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1034.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1034.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1034.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1035.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1035.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1035.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1035.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1036.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1036.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1036.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1036.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1037.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1037.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1037.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1037.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1038.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1038.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1038.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1038.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1039.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1039.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1039.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1039.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1053.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1053.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1053.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1053.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1182.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1182.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1182.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1182.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1299.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1299.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1299.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1299.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1414.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1414.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1414.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1414.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1441.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1441.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1441.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1441.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1583.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1583.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1583.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1583.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1584.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1584.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1584.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1584.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1611.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1611.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1611.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1611.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/168.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/168.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/168.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/168.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/169.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/169.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/169.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/169.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1711.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1711.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1711.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/1711.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/201.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/201.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/201.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/201.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/773.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/773.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/773.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/773.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/776.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/776.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/776.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/776.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/780.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/780.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/780.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/780.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/782.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/782.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/782.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/782.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/783.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/783.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/783.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/783.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/788.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/788.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/788.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/788.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/789.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/789.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/789.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/789.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/790.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/790.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/790.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/790.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/791.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/791.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/791.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/791.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/792.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/792.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/792.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/792.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/898.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/898.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/898.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/898.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/900.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/900.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/900.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/900.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/901.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/901.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/901.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/901.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/902.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/902.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/902.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/902.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/904.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/904.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/904.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/904.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/907.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/907.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/907.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/907.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/908.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/908.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/908.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/908.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/909.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/909.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/909.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/909.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/910.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/910.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/910.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/910.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1026.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1026.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1026.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1026.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1027.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1027.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1027.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1027.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1028.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1028.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1028.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1028.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1029.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1029.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1029.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1029.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1030_bottom_left.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1030_bottom_left.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1030_bottom_left.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1030_bottom_left.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1030_bottom_middle.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1030_bottom_middle.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1030_bottom_middle.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1030_bottom_middle.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1030_bottom_right.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1030_bottom_right.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1030_bottom_right.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1030_bottom_right.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1030_top_left.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1030_top_left.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1030_top_left.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1030_top_left.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1030_top_middle.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1030_top_middle.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1030_top_middle.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1030_top_middle.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1030_top_right.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1030_top_right.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1030_top_right.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2005/widget/1030_top_right.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1026.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1026.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1026.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1026.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1027.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1027.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1027.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1027.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1028.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1028.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1028.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1028.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1029.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1029.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1029.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1029.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1030.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1030.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1030.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1030.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1032.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1032.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1032.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1032.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1033.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1033.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1033.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1033.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1034.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1034.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1034.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1034.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1035.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1035.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1035.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1035.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1036.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1036.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1036.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1036.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1037.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1037.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1037.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1037.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1038.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1038.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1038.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1038.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1039.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1039.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1039.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1039.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1071.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1071.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1071.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1071.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1072.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1072.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1072.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1072.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1173.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1173.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1173.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1173.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1174.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1174.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1174.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1174.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1175.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1175.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1175.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1175.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1176.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1176.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1176.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1176.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1177.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1177.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1177.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1177.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1180.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1180.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1180.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1180.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1181.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1181.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1181.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1181.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1182.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1182.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1182.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1182.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1196.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1196.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1196.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1196.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1197.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1197.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1197.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1197.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1198.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1198.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1198.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1198.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1199.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1199.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1199.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1199.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1438.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1438.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1438.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1438.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1439.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1439.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1439.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1439.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1440.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1440.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1440.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/1440.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/168.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/168.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/168.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/168.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/197.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/197.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/197.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/197.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/198.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/198.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/198.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/198.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/199.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/199.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/199.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/199.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/200.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/200.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/200.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/200.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/201.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/201.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/201.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/201.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/202.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/202.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/202.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/202.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/203.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/203.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/203.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/203.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/204.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/204.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/204.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/204.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/205.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/205.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/205.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/205.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/206.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/206.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/206.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/206.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/207.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/207.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/207.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/207.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/208.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/208.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/208.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/208.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/209.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/209.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/209.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/209.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/210.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/210.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/210.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/210.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/211.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/211.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/211.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/211.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/212.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/212.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/212.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/212.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/213.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/213.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/213.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/213.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/214.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/214.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/214.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/214.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/215.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/215.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/215.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/215.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/216.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/216.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/216.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/216.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/217.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/217.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/217.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/217.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/220.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/220.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/220.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/220.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/221.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/221.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/221.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/221.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/539.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/539.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/539.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/539.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/540.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/540.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/540.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/540.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/541.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/541.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/541.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/541.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/542.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/542.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/542.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/542.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/780.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/780.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/780.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/780.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/782.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/782.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/782.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/782.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/783.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/783.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/783.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/783.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/898.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/898.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/898.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/898.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/900.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/900.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/900.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/900.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/901.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/901.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/901.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/901.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/902.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/902.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/902.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/902.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/904.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/904.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/904.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/904.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/907.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/907.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/907.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/907.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/908.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/908.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/908.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/908.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/909.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/909.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/909.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/909.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/910.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/910.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/910.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/910.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/healthbar/back.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/healthbar/back.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/healthbar/back.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/healthbar/back.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/healthbar/back_large.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/healthbar/back_large.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/healthbar/back_large.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/healthbar/back_large.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/healthbar/front.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/healthbar/front.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/healthbar/front.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/healthbar/front.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/healthbar/front_large.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/healthbar/front_large.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/healthbar/front_large.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/interfacestyles/2010/healthbar/front_large.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/inventorysetups/add_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/inventorysetups/add_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/inventorysetups/add_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/inventorysetups/add_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/inventorysetups/inventorysetups_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/inventorysetups/inventorysetups_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/inventorysetups/inventorysetups_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/inventorysetups/inventorysetups_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/inventorysetups/remove_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/inventorysetups/remove_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/inventorysetups/remove_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/inventorysetups/remove_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/kourendlibrary/panel_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/kourendlibrary/panel_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/kourendlibrary/panel_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/kourendlibrary/panel_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/loottracker/back_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/loottracker/back_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/loottracker/back_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/loottracker/back_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/loottracker/grouped_loot_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/loottracker/grouped_loot_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/loottracker/grouped_loot_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/loottracker/grouped_loot_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/loottracker/invisible_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/loottracker/invisible_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/loottracker/invisible_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/loottracker/invisible_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/loottracker/panel_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/loottracker/panel_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/loottracker/panel_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/loottracker/panel_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/loottracker/single_loot_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/loottracker/single_loot_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/loottracker/single_loot_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/loottracker/single_loot_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/loottracker/visible_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/loottracker/visible_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/loottracker/visible_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/loottracker/visible_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/notes/notes_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/notes/notes_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/notes/notes_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/notes/notes_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/playerindicators/skull.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/playerindicators/skull.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/playerindicators/skull.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/playerindicators/skull.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/poh/altar.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/altar.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/poh/altar.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/altar.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/poh/annakarl.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/annakarl.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/poh/annakarl.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/annakarl.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/poh/ardougne.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/ardougne.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/poh/ardougne.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/ardougne.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/poh/camelot.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/camelot.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/poh/camelot.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/camelot.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/poh/carrallangar.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/carrallangar.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/poh/carrallangar.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/carrallangar.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/poh/catherby.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/catherby.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/poh/catherby.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/catherby.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/poh/digsitependant.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/digsitependant.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/poh/digsitependant.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/digsitependant.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/poh/exitportal.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/exitportal.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/poh/exitportal.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/exitportal.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/poh/falador.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/falador.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/poh/falador.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/falador.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/poh/fishingguild.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/fishingguild.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/poh/fishingguild.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/fishingguild.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/poh/ghorrock.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/ghorrock.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/poh/ghorrock.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/ghorrock.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/poh/glory.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/glory.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/poh/glory.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/glory.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/poh/jewellery.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/jewellery.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/poh/jewellery.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/jewellery.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/poh/kharyll.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/kharyll.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/poh/kharyll.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/kharyll.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/poh/kourend.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/kourend.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/poh/kourend.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/kourend.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/poh/lumbridge.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/lumbridge.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/poh/lumbridge.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/lumbridge.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/poh/lunarisle.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/lunarisle.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/poh/lunarisle.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/lunarisle.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/poh/marim.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/marim.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/poh/marim.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/marim.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/poh/pool.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/pool.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/poh/pool.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/pool.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/poh/portalnexus.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/portalnexus.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/poh/portalnexus.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/portalnexus.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/poh/repair.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/repair.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/poh/repair.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/repair.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/poh/senntisten.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/senntisten.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/poh/senntisten.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/senntisten.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/poh/spellbook.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/spellbook.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/poh/spellbook.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/spellbook.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/poh/transportation.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/transportation.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/poh/transportation.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/transportation.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/poh/trollheim.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/trollheim.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/poh/trollheim.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/trollheim.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/poh/varrock.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/varrock.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/poh/varrock.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/varrock.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/poh/waterbirth.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/waterbirth.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/poh/waterbirth.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/waterbirth.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/poh/xericstalisman.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/xericstalisman.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/poh/xericstalisman.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/xericstalisman.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/poh/yanille.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/yanille.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/poh/yanille.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/poh/yanille.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/poison/1067-DISEASE.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/poison/1067-DISEASE.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/poison/1067-DISEASE.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/poison/1067-DISEASE.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/poison/1067-POISON.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/poison/1067-POISON.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/poison/1067-POISON.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/poison/1067-POISON.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/poison/1067-VENOM.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/poison/1067-VENOM.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/poison/1067-VENOM.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/poison/1067-VENOM.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/profiles/delete_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/profiles/delete_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/profiles/delete_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/profiles/delete_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/profiles/profiles_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/profiles/profiles_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/profiles/profiles_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/profiles/profiles_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/pvptools/skull.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/pvptools/skull.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/pvptools/skull.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/pvptools/skull.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/raids/instancereloadhelper.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/raids/instancereloadhelper.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/raids/instancereloadhelper.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/raids/instancereloadhelper.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/screenmarkers/add_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/screenmarkers/add_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/screenmarkers/add_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/screenmarkers/add_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/screenmarkers/border_color_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/screenmarkers/border_color_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/screenmarkers/border_color_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/screenmarkers/border_color_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/screenmarkers/cancel_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/screenmarkers/cancel_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/screenmarkers/cancel_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/screenmarkers/cancel_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/screenmarkers/confirm_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/screenmarkers/confirm_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/screenmarkers/confirm_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/screenmarkers/confirm_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/screenmarkers/delete_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/screenmarkers/delete_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/screenmarkers/delete_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/screenmarkers/delete_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/screenmarkers/fill_color_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/screenmarkers/fill_color_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/screenmarkers/fill_color_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/screenmarkers/fill_color_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/screenmarkers/invisible_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/screenmarkers/invisible_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/screenmarkers/invisible_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/screenmarkers/invisible_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/screenmarkers/opacity_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/screenmarkers/opacity_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/screenmarkers/opacity_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/screenmarkers/opacity_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/screenmarkers/panel_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/screenmarkers/panel_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/screenmarkers/panel_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/screenmarkers/panel_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/screenmarkers/visible_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/screenmarkers/visible_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/screenmarkers/visible_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/screenmarkers/visible_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/screenshot/screenshot.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/screenshot/screenshot.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/screenshot/screenshot.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/screenshot/screenshot.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/calc.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/skillcalculator/calc.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/calc.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/skillcalculator/calc.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_agility.json b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_agility.json similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_agility.json rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_agility.json diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_construction.json b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_construction.json similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_construction.json rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_construction.json diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_cooking.json b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_cooking.json similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_cooking.json rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_cooking.json diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_crafting.json b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_crafting.json similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_crafting.json rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_crafting.json diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_farming.json b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_farming.json similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_farming.json rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_farming.json diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_firemaking.json b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_firemaking.json similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_firemaking.json rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_firemaking.json diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_fishing.json b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_fishing.json similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_fishing.json rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_fishing.json diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_fletching.json b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_fletching.json similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_fletching.json rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_fletching.json diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_herblore.json b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_herblore.json similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_herblore.json rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_herblore.json diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_hunter.json b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_hunter.json similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_hunter.json rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_hunter.json diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_magic.json b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_magic.json similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_magic.json rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_magic.json diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_mining.json b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_mining.json similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_mining.json rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_mining.json diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_prayer.json b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_prayer.json similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_prayer.json rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_prayer.json diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_runecraft.json b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_runecraft.json similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_runecraft.json rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_runecraft.json diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_smithing.json b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_smithing.json similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_smithing.json rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_smithing.json diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_thieving.json b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_thieving.json similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_thieving.json rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_thieving.json diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_woodcutting.json b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_woodcutting.json similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_woodcutting.json rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_woodcutting.json diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/view-more-white.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/skillcalculator/view-more-white.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/view-more-white.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/skillcalculator/view-more-white.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/skybox/skybox.txt b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/skybox/skybox.txt similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/skybox/skybox.txt rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/skybox/skybox.txt diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/slayer/panel_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/slayer/panel_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/slayer/panel_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/slayer/panel_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/slayer/pause_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/slayer/pause_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/slayer/pause_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/slayer/pause_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/slayer/play_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/slayer/play_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/slayer/play_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/slayer/play_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/stonedloottracker/back-arrow-white.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/stonedloottracker/back-arrow-white.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/stonedloottracker/back-arrow-white.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/stonedloottracker/back-arrow-white.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/stonedloottracker/back_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/stonedloottracker/back_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/stonedloottracker/back_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/stonedloottracker/back_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/stonedloottracker/delete-white.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/stonedloottracker/delete-white.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/stonedloottracker/delete-white.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/stonedloottracker/delete-white.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/stonedloottracker/grouped_loot_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/stonedloottracker/grouped_loot_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/stonedloottracker/grouped_loot_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/stonedloottracker/grouped_loot_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/stonedloottracker/invisible_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/stonedloottracker/invisible_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/stonedloottracker/invisible_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/stonedloottracker/invisible_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/stonedloottracker/panel_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/stonedloottracker/panel_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/stonedloottracker/panel_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/stonedloottracker/panel_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/stonedloottracker/refresh-white.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/stonedloottracker/refresh-white.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/stonedloottracker/refresh-white.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/stonedloottracker/refresh-white.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/stonedloottracker/replay-white.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/stonedloottracker/replay-white.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/stonedloottracker/replay-white.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/stonedloottracker/replay-white.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/stonedloottracker/single_loot_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/stonedloottracker/single_loot_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/stonedloottracker/single_loot_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/stonedloottracker/single_loot_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/stonedloottracker/visible_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/stonedloottracker/visible_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/stonedloottracker/visible_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/stonedloottracker/visible_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/suppliestracker/back_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/suppliestracker/back_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/suppliestracker/back_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/suppliestracker/back_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/suppliestracker/panel_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/suppliestracker/panel_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/suppliestracker/panel_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/suppliestracker/panel_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/suppliestracker/plus_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/suppliestracker/plus_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/suppliestracker/plus_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/suppliestracker/plus_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/suppliestracker/sarabrew.jpg b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/suppliestracker/sarabrew.jpg similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/suppliestracker/sarabrew.jpg rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/suppliestracker/sarabrew.jpg diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/timetracking/add_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/timetracking/add_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/timetracking/add_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/timetracking/add_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/timetracking/arrow_right.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/timetracking/arrow_right.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/timetracking/arrow_right.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/timetracking/arrow_right.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/timetracking/delete_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/timetracking/delete_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/timetracking/delete_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/timetracking/delete_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/timetracking/lap_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/timetracking/lap_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/timetracking/lap_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/timetracking/lap_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/timetracking/pause_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/timetracking/pause_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/timetracking/pause_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/timetracking/pause_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/timetracking/reset_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/timetracking/reset_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/timetracking/reset_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/timetracking/reset_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/timetracking/start_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/timetracking/start_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/timetracking/start_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/timetracking/start_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/timetracking/watch.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/timetracking/watch.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/timetracking/watch.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/timetracking/watch.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/vorkath/acid.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/vorkath/acid.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/vorkath/acid.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/vorkath/acid.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/vorkath/ice.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/vorkath/ice.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/vorkath/ice.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/vorkath/ice.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/vorkath/magerange.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/vorkath/magerange.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/vorkath/magerange.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/vorkath/magerange.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/wiki/fixed_mode_minimap_clickmask.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/wiki/fixed_mode_minimap_clickmask.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/wiki/fixed_mode_minimap_clickmask.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/wiki/fixed_mode_minimap_clickmask.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/wiki/wiki.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/wiki/wiki.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/wiki/wiki.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/wiki/wiki.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/wiki/wiki_selected.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/wiki/wiki_selected.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/wiki/wiki_selected.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/wiki/wiki_selected.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldhopper/arrow_down.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldhopper/arrow_down.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldhopper/arrow_down.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldhopper/arrow_down.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldhopper/flag_aus.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldhopper/flag_aus.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldhopper/flag_aus.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldhopper/flag_aus.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldhopper/flag_ger.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldhopper/flag_ger.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldhopper/flag_ger.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldhopper/flag_ger.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldhopper/flag_uk.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldhopper/flag_uk.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldhopper/flag_uk.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldhopper/flag_uk.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldhopper/flag_us.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldhopper/flag_us.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldhopper/flag_us.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldhopper/flag_us.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldhopper/icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldhopper/icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldhopper/icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldhopper/icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/amulet_of_glory_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/amulet_of_glory_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/amulet_of_glory_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/amulet_of_glory_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/annakarl_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/annakarl_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/annakarl_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/annakarl_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/ape_atoll_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/ape_atoll_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/ape_atoll_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/ape_atoll_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/ape_atoll_teleport_icon_arceuus.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/ape_atoll_teleport_icon_arceuus.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/ape_atoll_teleport_icon_arceuus.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/ape_atoll_teleport_icon_arceuus.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/ardougne_cloak_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/ardougne_cloak_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/ardougne_cloak_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/ardougne_cloak_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/ardougne_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/ardougne_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/ardougne_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/ardougne_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/barbarian_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/barbarian_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/barbarian_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/barbarian_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/barrows_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/barrows_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/barrows_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/barrows_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/battlefront_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/battlefront_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/battlefront_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/battlefront_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/burning_amulet_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/burning_amulet_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/burning_amulet_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/burning_amulet_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/camelot_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/camelot_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/camelot_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/camelot_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/camulet_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/camulet_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/camulet_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/camulet_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/carrallangar_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/carrallangar_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/carrallangar_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/carrallangar_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/catherby_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/catherby_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/catherby_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/catherby_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/cemetery_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/cemetery_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/cemetery_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/cemetery_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/chronicle_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/chronicle_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/chronicle_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/chronicle_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/combat_bracelet_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/combat_bracelet_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/combat_bracelet_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/combat_bracelet_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/dareeyak_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/dareeyak_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/dareeyak_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/dareeyak_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/desert_amulet_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/desert_amulet_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/desert_amulet_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/desert_amulet_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/digsite_pendant_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/digsite_pendant_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/digsite_pendant_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/digsite_pendant_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/draynor_manor_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/draynor_manor_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/draynor_manor_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/draynor_manor_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/ectophial_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/ectophial_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/ectophial_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/ectophial_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/enchanted_lyre_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/enchanted_lyre_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/enchanted_lyre_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/enchanted_lyre_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/explorers_ring_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/explorers_ring_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/explorers_ring_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/explorers_ring_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/fairy_ring_travel.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/fairy_ring_travel.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/fairy_ring_travel.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/fairy_ring_travel.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/falador_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/falador_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/falador_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/falador_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/fenkenstrains_castle_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/fenkenstrains_castle_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/fenkenstrains_castle_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/fenkenstrains_castle_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/fishing_guild_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/fishing_guild_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/fishing_guild_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/fishing_guild_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/fremennik_boots_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/fremennik_boots_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/fremennik_boots_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/fremennik_boots_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/games_necklace_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/games_necklace_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/games_necklace_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/games_necklace_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/ghorrock_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/ghorrock_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/ghorrock_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/ghorrock_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/harmony_island_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/harmony_island_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/harmony_island_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/harmony_island_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/house_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/house_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/house_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/house_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/ice_plateau_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/ice_plateau_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/ice_plateau_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/ice_plateau_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/icy_basalt_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/icy_basalt_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/icy_basalt_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/icy_basalt_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/kandarin_headgear_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/kandarin_headgear_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/kandarin_headgear_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/kandarin_headgear_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/karamja_gloves_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/karamja_gloves_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/karamja_gloves_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/karamja_gloves_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/kharedsts_memoirs_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/kharedsts_memoirs_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/kharedsts_memoirs_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/kharedsts_memoirs_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/kharyrll_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/kharyrll_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/kharyrll_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/kharyrll_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/khazard_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/khazard_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/khazard_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/khazard_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/kourend_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/kourend_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/kourend_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/kourend_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/lassar_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/lassar_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/lassar_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/lassar_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/lumbridge_graveyard_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/lumbridge_graveyard_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/lumbridge_graveyard_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/lumbridge_graveyard_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/lumbridge_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/lumbridge_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/lumbridge_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/lumbridge_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/mind_altar_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/mind_altar_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/mind_altar_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/mind_altar_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/moonclan_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/moonclan_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/moonclan_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/moonclan_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/morytania_legs_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/morytania_legs_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/morytania_legs_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/morytania_legs_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/mythical_cape_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/mythical_cape_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/mythical_cape_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/mythical_cape_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/necklace_of_passage_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/necklace_of_passage_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/necklace_of_passage_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/necklace_of_passage_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/nope_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/nope_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/nope_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/nope_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/obelisk_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/obelisk_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/obelisk_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/obelisk_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/ourania_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/ourania_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/ourania_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/ourania_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/paddewwa_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/paddewwa_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/paddewwa_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/paddewwa_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/pharaohs_sceptre_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/pharaohs_sceptre_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/pharaohs_sceptre_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/pharaohs_sceptre_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/quest_highlight_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/quest_highlight_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/quest_highlight_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/quest_highlight_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/radas_blessing_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/radas_blessing_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/radas_blessing_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/radas_blessing_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/respawn_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/respawn_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/respawn_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/respawn_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/ring_of_dueling_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/ring_of_dueling_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/ring_of_dueling_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/ring_of_dueling_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/ring_of_wealth_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/ring_of_wealth_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/ring_of_wealth_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/ring_of_wealth_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/royal_seed_pod_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/royal_seed_pod_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/royal_seed_pod_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/royal_seed_pod_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/salve_graveyard_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/salve_graveyard_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/salve_graveyard_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/salve_graveyard_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/scroll_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/scroll_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/scroll_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/scroll_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/senntisten_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/senntisten_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/senntisten_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/senntisten_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/skills_necklace_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/skills_necklace_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/skills_necklace_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/skills_necklace_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/skull_sceptre_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/skull_sceptre_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/skull_sceptre_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/skull_sceptre_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/slayer_ring_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/slayer_ring_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/slayer_ring_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/slayer_ring_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/stony_basalt_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/stony_basalt_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/stony_basalt_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/stony_basalt_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/trollheim_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/trollheim_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/trollheim_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/trollheim_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/varrock_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/varrock_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/varrock_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/varrock_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/watchtower_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/watchtower_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/watchtower_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/watchtower_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/waterbirth_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/waterbirth_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/waterbirth_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/waterbirth_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/west_ardougne_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/west_ardougne_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/west_ardougne_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/west_ardougne_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/western_banner_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/western_banner_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/western_banner_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/western_banner_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/wilderness_sword_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/wilderness_sword_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/wilderness_sword_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/wilderness_sword_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/xerics_talisman_teleport_icon.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/xerics_talisman_teleport_icon.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/worldmap/xerics_talisman_teleport_icon.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/worldmap/xerics_talisman_teleport_icon.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/zulrah/protect_from_magic.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/zulrah/protect_from_magic.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/zulrah/protect_from_magic.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/zulrah/protect_from_magic.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/zulrah/protect_from_missiles.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/zulrah/protect_from_missiles.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/zulrah/protect_from_missiles.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/zulrah/protect_from_missiles.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/zulrah/zulrah_magic.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/zulrah/zulrah_magic.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/zulrah/zulrah_magic.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/zulrah/zulrah_magic.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/zulrah/zulrah_melee.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/zulrah/zulrah_melee.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/zulrah/zulrah_melee.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/zulrah/zulrah_melee.png diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/zulrah/zulrah_range.png b/RuneLitePlus/src/main/resources/net/runelite/client/plugins/zulrah/zulrah_range.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/plugins/zulrah/zulrah_range.png rename to RuneLitePlus/src/main/resources/net/runelite/client/plugins/zulrah/zulrah_range.png diff --git a/runelite-client/src/main/resources/net/runelite/client/rs/jagex.crt b/RuneLitePlus/src/main/resources/net/runelite/client/rs/jagex.crt similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/rs/jagex.crt rename to RuneLitePlus/src/main/resources/net/runelite/client/rs/jagex.crt diff --git a/runelite-client/src/main/resources/net/runelite/client/runelite.properties b/RuneLitePlus/src/main/resources/net/runelite/client/runelite.properties similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/runelite.properties rename to RuneLitePlus/src/main/resources/net/runelite/client/runelite.properties diff --git a/runelite-client/src/main/resources/net/runelite/client/ui/components/error.png b/RuneLitePlus/src/main/resources/net/runelite/client/ui/components/error.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/ui/components/error.png rename to RuneLitePlus/src/main/resources/net/runelite/client/ui/components/error.png diff --git a/runelite-client/src/main/resources/net/runelite/client/ui/components/loading_spinner.gif b/RuneLitePlus/src/main/resources/net/runelite/client/ui/components/loading_spinner.gif similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/ui/components/loading_spinner.gif rename to RuneLitePlus/src/main/resources/net/runelite/client/ui/components/loading_spinner.gif diff --git a/runelite-client/src/main/resources/net/runelite/client/ui/components/loading_spinner_darker.gif b/RuneLitePlus/src/main/resources/net/runelite/client/ui/components/loading_spinner_darker.gif similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/ui/components/loading_spinner_darker.gif rename to RuneLitePlus/src/main/resources/net/runelite/client/ui/components/loading_spinner_darker.gif diff --git a/runelite-client/src/main/resources/net/runelite/client/ui/components/search.png b/RuneLitePlus/src/main/resources/net/runelite/client/ui/components/search.png similarity index 100% rename from runelite-client/src/main/resources/net/runelite/client/ui/components/search.png rename to RuneLitePlus/src/main/resources/net/runelite/client/ui/components/search.png diff --git a/RuneLitePlus/src/main/resources/net/runelite/client/ui/open.png b/RuneLitePlus/src/main/resources/net/runelite/client/ui/open.png new file mode 100644 index 0000000000..6d5ca35ad4 Binary files /dev/null and b/RuneLitePlus/src/main/resources/net/runelite/client/ui/open.png 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 new file mode 100644 index 0000000000..e0cb3df043 Binary files /dev/null and b/RuneLitePlus/src/main/resources/net/runelite/client/ui/open_rs.png 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 new file mode 100644 index 0000000000..9d15fc64ff Binary files /dev/null and b/RuneLitePlus/src/main/resources/net/runelite/client/ui/runescape.ttf 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 new file mode 100644 index 0000000000..1eaf0e7b82 Binary files /dev/null and b/RuneLitePlus/src/main/resources/net/runelite/client/ui/runescape_bold.ttf 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 new file mode 100644 index 0000000000..7998560026 Binary files /dev/null and b/RuneLitePlus/src/main/resources/net/runelite/client/ui/runescape_small.ttf 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 new file mode 100644 index 0000000000..1d9ffee41b --- /dev/null +++ b/RuneLitePlus/src/main/resources/net/runelite/client/ui/skin/RuneLite.colorschemes @@ -0,0 +1,166 @@ +# 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/runelite-client/src/main/resources/npc_stats.json b/RuneLitePlus/src/main/resources/npc_stats.json similarity index 100% rename from runelite-client/src/main/resources/npc_stats.json rename to RuneLitePlus/src/main/resources/npc_stats.json diff --git a/runelite-client/src/main/resources/runelite.png b/RuneLitePlus/src/main/resources/runelite.png similarity index 100% rename from runelite-client/src/main/resources/runelite.png rename to RuneLitePlus/src/main/resources/runelite.png diff --git a/runelite-client/src/main/resources/runelite_transparent.png b/RuneLitePlus/src/main/resources/runelite_transparent.png similarity index 100% rename from runelite-client/src/main/resources/runelite_transparent.png rename to RuneLitePlus/src/main/resources/runelite_transparent.png diff --git a/runelite-client/src/main/resources/runeliteplus.png b/RuneLitePlus/src/main/resources/runeliteplus.png similarity index 100% rename from runelite-client/src/main/resources/runeliteplus.png rename to RuneLitePlus/src/main/resources/runeliteplus.png diff --git a/runelite-client/src/main/resources/runeliteplus_transparent.png b/RuneLitePlus/src/main/resources/runeliteplus_transparent.png similarity index 100% rename from runelite-client/src/main/resources/runeliteplus_transparent.png rename to RuneLitePlus/src/main/resources/runeliteplus_transparent.png diff --git a/runelite-client/src/main/resources/skill_icons/agility.png b/RuneLitePlus/src/main/resources/skill_icons/agility.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons/agility.png rename to RuneLitePlus/src/main/resources/skill_icons/agility.png diff --git a/runelite-client/src/main/resources/skill_icons/attack.png b/RuneLitePlus/src/main/resources/skill_icons/attack.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons/attack.png rename to RuneLitePlus/src/main/resources/skill_icons/attack.png diff --git a/runelite-client/src/main/resources/skill_icons/combat.png b/RuneLitePlus/src/main/resources/skill_icons/combat.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons/combat.png rename to RuneLitePlus/src/main/resources/skill_icons/combat.png diff --git a/runelite-client/src/main/resources/skill_icons/construction.png b/RuneLitePlus/src/main/resources/skill_icons/construction.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons/construction.png rename to RuneLitePlus/src/main/resources/skill_icons/construction.png diff --git a/runelite-client/src/main/resources/skill_icons/cooking.png b/RuneLitePlus/src/main/resources/skill_icons/cooking.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons/cooking.png rename to RuneLitePlus/src/main/resources/skill_icons/cooking.png diff --git a/runelite-client/src/main/resources/skill_icons/crafting.png b/RuneLitePlus/src/main/resources/skill_icons/crafting.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons/crafting.png rename to RuneLitePlus/src/main/resources/skill_icons/crafting.png diff --git a/runelite-client/src/main/resources/skill_icons/defence.png b/RuneLitePlus/src/main/resources/skill_icons/defence.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons/defence.png rename to RuneLitePlus/src/main/resources/skill_icons/defence.png diff --git a/runelite-client/src/main/resources/skill_icons/farming.png b/RuneLitePlus/src/main/resources/skill_icons/farming.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons/farming.png rename to RuneLitePlus/src/main/resources/skill_icons/farming.png diff --git a/runelite-client/src/main/resources/skill_icons/firemaking.png b/RuneLitePlus/src/main/resources/skill_icons/firemaking.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons/firemaking.png rename to RuneLitePlus/src/main/resources/skill_icons/firemaking.png diff --git a/runelite-client/src/main/resources/skill_icons/fishing.png b/RuneLitePlus/src/main/resources/skill_icons/fishing.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons/fishing.png rename to RuneLitePlus/src/main/resources/skill_icons/fishing.png diff --git a/runelite-client/src/main/resources/skill_icons/fletching.png b/RuneLitePlus/src/main/resources/skill_icons/fletching.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons/fletching.png rename to RuneLitePlus/src/main/resources/skill_icons/fletching.png diff --git a/runelite-client/src/main/resources/skill_icons/herblore.png b/RuneLitePlus/src/main/resources/skill_icons/herblore.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons/herblore.png rename to RuneLitePlus/src/main/resources/skill_icons/herblore.png diff --git a/runelite-client/src/main/resources/skill_icons/hitpoints.png b/RuneLitePlus/src/main/resources/skill_icons/hitpoints.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons/hitpoints.png rename to RuneLitePlus/src/main/resources/skill_icons/hitpoints.png diff --git a/runelite-client/src/main/resources/skill_icons/hunter.png b/RuneLitePlus/src/main/resources/skill_icons/hunter.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons/hunter.png rename to RuneLitePlus/src/main/resources/skill_icons/hunter.png diff --git a/runelite-client/src/main/resources/skill_icons/magic.png b/RuneLitePlus/src/main/resources/skill_icons/magic.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons/magic.png rename to RuneLitePlus/src/main/resources/skill_icons/magic.png diff --git a/runelite-client/src/main/resources/skill_icons/mining.png b/RuneLitePlus/src/main/resources/skill_icons/mining.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons/mining.png rename to RuneLitePlus/src/main/resources/skill_icons/mining.png diff --git a/runelite-client/src/main/resources/skill_icons/overall.png b/RuneLitePlus/src/main/resources/skill_icons/overall.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons/overall.png rename to RuneLitePlus/src/main/resources/skill_icons/overall.png diff --git a/runelite-client/src/main/resources/skill_icons/prayer.png b/RuneLitePlus/src/main/resources/skill_icons/prayer.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons/prayer.png rename to RuneLitePlus/src/main/resources/skill_icons/prayer.png diff --git a/runelite-client/src/main/resources/skill_icons/ranged.png b/RuneLitePlus/src/main/resources/skill_icons/ranged.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons/ranged.png rename to RuneLitePlus/src/main/resources/skill_icons/ranged.png diff --git a/runelite-client/src/main/resources/skill_icons/runecraft.png b/RuneLitePlus/src/main/resources/skill_icons/runecraft.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons/runecraft.png rename to RuneLitePlus/src/main/resources/skill_icons/runecraft.png diff --git a/runelite-client/src/main/resources/skill_icons/slayer.png b/RuneLitePlus/src/main/resources/skill_icons/slayer.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons/slayer.png rename to RuneLitePlus/src/main/resources/skill_icons/slayer.png diff --git a/runelite-client/src/main/resources/skill_icons/smithing.png b/RuneLitePlus/src/main/resources/skill_icons/smithing.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons/smithing.png rename to RuneLitePlus/src/main/resources/skill_icons/smithing.png diff --git a/runelite-client/src/main/resources/skill_icons/strength.png b/RuneLitePlus/src/main/resources/skill_icons/strength.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons/strength.png rename to RuneLitePlus/src/main/resources/skill_icons/strength.png diff --git a/runelite-client/src/main/resources/skill_icons/thieving.png b/RuneLitePlus/src/main/resources/skill_icons/thieving.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons/thieving.png rename to RuneLitePlus/src/main/resources/skill_icons/thieving.png diff --git a/runelite-client/src/main/resources/skill_icons/woodcutting.png b/RuneLitePlus/src/main/resources/skill_icons/woodcutting.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons/woodcutting.png rename to RuneLitePlus/src/main/resources/skill_icons/woodcutting.png diff --git a/runelite-client/src/main/resources/skill_icons_small/agility.png b/RuneLitePlus/src/main/resources/skill_icons_small/agility.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons_small/agility.png rename to RuneLitePlus/src/main/resources/skill_icons_small/agility.png diff --git a/runelite-client/src/main/resources/skill_icons_small/attack.png b/RuneLitePlus/src/main/resources/skill_icons_small/attack.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons_small/attack.png rename to RuneLitePlus/src/main/resources/skill_icons_small/attack.png diff --git a/runelite-client/src/main/resources/skill_icons_small/bounty hunter - hunter.png b/RuneLitePlus/src/main/resources/skill_icons_small/bounty hunter - hunter.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons_small/bounty hunter - hunter.png rename to RuneLitePlus/src/main/resources/skill_icons_small/bounty hunter - hunter.png diff --git a/runelite-client/src/main/resources/skill_icons_small/bounty hunter - rogue.png b/RuneLitePlus/src/main/resources/skill_icons_small/bounty hunter - rogue.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons_small/bounty hunter - rogue.png rename to RuneLitePlus/src/main/resources/skill_icons_small/bounty hunter - rogue.png diff --git a/runelite-client/src/main/resources/skill_icons_small/clue scrolls (all).png b/RuneLitePlus/src/main/resources/skill_icons_small/clue scrolls (all).png similarity index 100% rename from runelite-client/src/main/resources/skill_icons_small/clue scrolls (all).png rename to RuneLitePlus/src/main/resources/skill_icons_small/clue scrolls (all).png diff --git a/runelite-client/src/main/resources/skill_icons_small/combat.png b/RuneLitePlus/src/main/resources/skill_icons_small/combat.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons_small/combat.png rename to RuneLitePlus/src/main/resources/skill_icons_small/combat.png diff --git a/runelite-client/src/main/resources/skill_icons_small/construction.png b/RuneLitePlus/src/main/resources/skill_icons_small/construction.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons_small/construction.png rename to RuneLitePlus/src/main/resources/skill_icons_small/construction.png diff --git a/runelite-client/src/main/resources/skill_icons_small/cooking.png b/RuneLitePlus/src/main/resources/skill_icons_small/cooking.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons_small/cooking.png rename to RuneLitePlus/src/main/resources/skill_icons_small/cooking.png diff --git a/runelite-client/src/main/resources/skill_icons_small/crafting.png b/RuneLitePlus/src/main/resources/skill_icons_small/crafting.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons_small/crafting.png rename to RuneLitePlus/src/main/resources/skill_icons_small/crafting.png diff --git a/runelite-client/src/main/resources/skill_icons_small/defence.png b/RuneLitePlus/src/main/resources/skill_icons_small/defence.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons_small/defence.png rename to RuneLitePlus/src/main/resources/skill_icons_small/defence.png diff --git a/runelite-client/src/main/resources/skill_icons_small/farming.png b/RuneLitePlus/src/main/resources/skill_icons_small/farming.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons_small/farming.png rename to RuneLitePlus/src/main/resources/skill_icons_small/farming.png diff --git a/runelite-client/src/main/resources/skill_icons_small/firemaking.png b/RuneLitePlus/src/main/resources/skill_icons_small/firemaking.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons_small/firemaking.png rename to RuneLitePlus/src/main/resources/skill_icons_small/firemaking.png diff --git a/runelite-client/src/main/resources/skill_icons_small/fishing.png b/RuneLitePlus/src/main/resources/skill_icons_small/fishing.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons_small/fishing.png rename to RuneLitePlus/src/main/resources/skill_icons_small/fishing.png diff --git a/runelite-client/src/main/resources/skill_icons_small/fletching.png b/RuneLitePlus/src/main/resources/skill_icons_small/fletching.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons_small/fletching.png rename to RuneLitePlus/src/main/resources/skill_icons_small/fletching.png diff --git a/runelite-client/src/main/resources/skill_icons_small/herblore.png b/RuneLitePlus/src/main/resources/skill_icons_small/herblore.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons_small/herblore.png rename to RuneLitePlus/src/main/resources/skill_icons_small/herblore.png diff --git a/runelite-client/src/main/resources/skill_icons_small/hitpoints.png b/RuneLitePlus/src/main/resources/skill_icons_small/hitpoints.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons_small/hitpoints.png rename to RuneLitePlus/src/main/resources/skill_icons_small/hitpoints.png diff --git a/runelite-client/src/main/resources/skill_icons_small/hunter.png b/RuneLitePlus/src/main/resources/skill_icons_small/hunter.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons_small/hunter.png rename to RuneLitePlus/src/main/resources/skill_icons_small/hunter.png diff --git a/runelite-client/src/main/resources/skill_icons_small/last man standing.png b/RuneLitePlus/src/main/resources/skill_icons_small/last man standing.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons_small/last man standing.png rename to RuneLitePlus/src/main/resources/skill_icons_small/last man standing.png diff --git a/runelite-client/src/main/resources/skill_icons_small/magic.png b/RuneLitePlus/src/main/resources/skill_icons_small/magic.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons_small/magic.png rename to RuneLitePlus/src/main/resources/skill_icons_small/magic.png diff --git a/runelite-client/src/main/resources/skill_icons_small/mining.png b/RuneLitePlus/src/main/resources/skill_icons_small/mining.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons_small/mining.png rename to RuneLitePlus/src/main/resources/skill_icons_small/mining.png diff --git a/runelite-client/src/main/resources/skill_icons_small/overall.png b/RuneLitePlus/src/main/resources/skill_icons_small/overall.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons_small/overall.png rename to RuneLitePlus/src/main/resources/skill_icons_small/overall.png diff --git a/runelite-client/src/main/resources/skill_icons_small/prayer.png b/RuneLitePlus/src/main/resources/skill_icons_small/prayer.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons_small/prayer.png rename to RuneLitePlus/src/main/resources/skill_icons_small/prayer.png diff --git a/runelite-client/src/main/resources/skill_icons_small/ranged.png b/RuneLitePlus/src/main/resources/skill_icons_small/ranged.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons_small/ranged.png rename to RuneLitePlus/src/main/resources/skill_icons_small/ranged.png diff --git a/runelite-client/src/main/resources/skill_icons_small/runecraft.png b/RuneLitePlus/src/main/resources/skill_icons_small/runecraft.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons_small/runecraft.png rename to RuneLitePlus/src/main/resources/skill_icons_small/runecraft.png diff --git a/runelite-client/src/main/resources/skill_icons_small/slayer.png b/RuneLitePlus/src/main/resources/skill_icons_small/slayer.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons_small/slayer.png rename to RuneLitePlus/src/main/resources/skill_icons_small/slayer.png diff --git a/runelite-client/src/main/resources/skill_icons_small/smithing.png b/RuneLitePlus/src/main/resources/skill_icons_small/smithing.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons_small/smithing.png rename to RuneLitePlus/src/main/resources/skill_icons_small/smithing.png diff --git a/runelite-client/src/main/resources/skill_icons_small/strength.png b/RuneLitePlus/src/main/resources/skill_icons_small/strength.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons_small/strength.png rename to RuneLitePlus/src/main/resources/skill_icons_small/strength.png diff --git a/runelite-client/src/main/resources/skill_icons_small/thieving.png b/RuneLitePlus/src/main/resources/skill_icons_small/thieving.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons_small/thieving.png rename to RuneLitePlus/src/main/resources/skill_icons_small/thieving.png diff --git a/runelite-client/src/main/resources/skill_icons_small/woodcutting.png b/RuneLitePlus/src/main/resources/skill_icons_small/woodcutting.png similarity index 100% rename from runelite-client/src/main/resources/skill_icons_small/woodcutting.png rename to RuneLitePlus/src/main/resources/skill_icons_small/woodcutting.png diff --git a/runelite-client/src/main/resources/slayer_xp.json b/RuneLitePlus/src/main/resources/slayer_xp.json similarity index 100% rename from runelite-client/src/main/resources/slayer_xp.json rename to RuneLitePlus/src/main/resources/slayer_xp.json diff --git a/runelite-client/src/main/resources/util/arrow_right.png b/RuneLitePlus/src/main/resources/util/arrow_right.png similarity index 100% rename from runelite-client/src/main/resources/util/arrow_right.png rename to RuneLitePlus/src/main/resources/util/arrow_right.png diff --git a/runelite-client/src/main/resources/util/clue_arrow.png b/RuneLitePlus/src/main/resources/util/clue_arrow.png similarity index 100% rename from runelite-client/src/main/resources/util/clue_arrow.png rename to RuneLitePlus/src/main/resources/util/clue_arrow.png diff --git a/runelite-client/src/main/resources/util/reset.png b/RuneLitePlus/src/main/resources/util/reset.png similarity index 100% rename from runelite-client/src/main/resources/util/reset.png rename to RuneLitePlus/src/main/resources/util/reset.png diff --git a/runelite-client/src/main/scripts/BankBuildTab.hash b/RuneLitePlus/src/main/scripts/BankBuildTab.hash similarity index 100% rename from runelite-client/src/main/scripts/BankBuildTab.hash rename to RuneLitePlus/src/main/scripts/BankBuildTab.hash diff --git a/runelite-client/src/main/scripts/BankBuildTab.rs2asm b/RuneLitePlus/src/main/scripts/BankBuildTab.rs2asm similarity index 100% rename from runelite-client/src/main/scripts/BankBuildTab.rs2asm rename to RuneLitePlus/src/main/scripts/BankBuildTab.rs2asm diff --git a/runelite-client/src/main/scripts/BankLayoutTabSeparator.hash b/RuneLitePlus/src/main/scripts/BankLayoutTabSeparator.hash similarity index 100% rename from runelite-client/src/main/scripts/BankLayoutTabSeparator.hash rename to RuneLitePlus/src/main/scripts/BankLayoutTabSeparator.hash diff --git a/runelite-client/src/main/scripts/BankLayoutTabSeparator.rs2asm b/RuneLitePlus/src/main/scripts/BankLayoutTabSeparator.rs2asm similarity index 100% rename from runelite-client/src/main/scripts/BankLayoutTabSeparator.rs2asm rename to RuneLitePlus/src/main/scripts/BankLayoutTabSeparator.rs2asm diff --git a/runelite-client/src/main/scripts/BankSearchFilter.hash b/RuneLitePlus/src/main/scripts/BankSearchFilter.hash similarity index 100% rename from runelite-client/src/main/scripts/BankSearchFilter.hash rename to RuneLitePlus/src/main/scripts/BankSearchFilter.hash diff --git a/runelite-client/src/main/scripts/BankSearchFilter.rs2asm b/RuneLitePlus/src/main/scripts/BankSearchFilter.rs2asm similarity index 100% rename from runelite-client/src/main/scripts/BankSearchFilter.rs2asm rename to RuneLitePlus/src/main/scripts/BankSearchFilter.rs2asm diff --git a/runelite-client/src/main/scripts/BankSearchLayout.hash b/RuneLitePlus/src/main/scripts/BankSearchLayout.hash similarity index 100% rename from runelite-client/src/main/scripts/BankSearchLayout.hash rename to RuneLitePlus/src/main/scripts/BankSearchLayout.hash diff --git a/runelite-client/src/main/scripts/BankSearchLayout.rs2asm b/RuneLitePlus/src/main/scripts/BankSearchLayout.rs2asm similarity index 100% rename from runelite-client/src/main/scripts/BankSearchLayout.rs2asm rename to RuneLitePlus/src/main/scripts/BankSearchLayout.rs2asm diff --git a/runelite-client/src/main/scripts/ChatBuilder.hash b/RuneLitePlus/src/main/scripts/ChatBuilder.hash similarity index 100% rename from runelite-client/src/main/scripts/ChatBuilder.hash rename to RuneLitePlus/src/main/scripts/ChatBuilder.hash diff --git a/runelite-client/src/main/scripts/ChatBuilder.rs2asm b/RuneLitePlus/src/main/scripts/ChatBuilder.rs2asm similarity index 100% rename from runelite-client/src/main/scripts/ChatBuilder.rs2asm rename to RuneLitePlus/src/main/scripts/ChatBuilder.rs2asm diff --git a/runelite-client/src/main/scripts/ChatSplitBuilder.hash b/RuneLitePlus/src/main/scripts/ChatSplitBuilder.hash similarity index 100% rename from runelite-client/src/main/scripts/ChatSplitBuilder.hash rename to RuneLitePlus/src/main/scripts/ChatSplitBuilder.hash diff --git a/runelite-client/src/main/scripts/ChatSplitBuilder.rs2asm b/RuneLitePlus/src/main/scripts/ChatSplitBuilder.rs2asm similarity index 100% rename from runelite-client/src/main/scripts/ChatSplitBuilder.rs2asm rename to RuneLitePlus/src/main/scripts/ChatSplitBuilder.rs2asm diff --git a/runelite-client/src/main/scripts/ChatboxInput.hash b/RuneLitePlus/src/main/scripts/ChatboxInput.hash similarity index 100% rename from runelite-client/src/main/scripts/ChatboxInput.hash rename to RuneLitePlus/src/main/scripts/ChatboxInput.hash diff --git a/runelite-client/src/main/scripts/ChatboxInput.rs2asm b/RuneLitePlus/src/main/scripts/ChatboxInput.rs2asm similarity index 100% rename from runelite-client/src/main/scripts/ChatboxInput.rs2asm rename to RuneLitePlus/src/main/scripts/ChatboxInput.rs2asm diff --git a/runelite-client/src/main/scripts/ChatboxInputWidgetBuilder.hash b/RuneLitePlus/src/main/scripts/ChatboxInputWidgetBuilder.hash similarity index 100% rename from runelite-client/src/main/scripts/ChatboxInputWidgetBuilder.hash rename to RuneLitePlus/src/main/scripts/ChatboxInputWidgetBuilder.hash diff --git a/runelite-client/src/main/scripts/ChatboxInputWidgetBuilder.rs2asm b/RuneLitePlus/src/main/scripts/ChatboxInputWidgetBuilder.rs2asm similarity index 100% rename from runelite-client/src/main/scripts/ChatboxInputWidgetBuilder.rs2asm rename to RuneLitePlus/src/main/scripts/ChatboxInputWidgetBuilder.rs2asm diff --git a/runelite-client/src/main/scripts/CombatInterfaceSP.hash b/RuneLitePlus/src/main/scripts/CombatInterfaceSP.hash similarity index 100% rename from runelite-client/src/main/scripts/CombatInterfaceSP.hash rename to RuneLitePlus/src/main/scripts/CombatInterfaceSP.hash diff --git a/runelite-client/src/main/scripts/CombatInterfaceSP.rs2asm b/RuneLitePlus/src/main/scripts/CombatInterfaceSP.rs2asm similarity index 100% rename from runelite-client/src/main/scripts/CombatInterfaceSP.rs2asm rename to RuneLitePlus/src/main/scripts/CombatInterfaceSP.rs2asm diff --git a/runelite-client/src/main/scripts/CommandScript.hash b/RuneLitePlus/src/main/scripts/CommandScript.hash similarity index 100% rename from runelite-client/src/main/scripts/CommandScript.hash rename to RuneLitePlus/src/main/scripts/CommandScript.hash diff --git a/runelite-client/src/main/scripts/CommandScript.rs2asm b/RuneLitePlus/src/main/scripts/CommandScript.rs2asm similarity index 100% rename from runelite-client/src/main/scripts/CommandScript.rs2asm rename to RuneLitePlus/src/main/scripts/CommandScript.rs2asm diff --git a/runelite-client/src/main/scripts/CustomJoinClan.rs2asm b/RuneLitePlus/src/main/scripts/CustomJoinClan.rs2asm similarity index 100% rename from runelite-client/src/main/scripts/CustomJoinClan.rs2asm rename to RuneLitePlus/src/main/scripts/CustomJoinClan.rs2asm diff --git a/runelite-client/src/main/scripts/DeathKeepBuildScript.hash b/RuneLitePlus/src/main/scripts/DeathKeepBuildScript.hash similarity index 100% rename from runelite-client/src/main/scripts/DeathKeepBuildScript.hash rename to RuneLitePlus/src/main/scripts/DeathKeepBuildScript.hash diff --git a/runelite-client/src/main/scripts/DeathKeepBuildScript.rs2asm b/RuneLitePlus/src/main/scripts/DeathKeepBuildScript.rs2asm similarity index 100% rename from runelite-client/src/main/scripts/DeathKeepBuildScript.rs2asm rename to RuneLitePlus/src/main/scripts/DeathKeepBuildScript.rs2asm diff --git a/runelite-client/src/main/scripts/DestroyOnOpKey.hash b/RuneLitePlus/src/main/scripts/DestroyOnOpKey.hash similarity index 100% rename from runelite-client/src/main/scripts/DestroyOnOpKey.hash rename to RuneLitePlus/src/main/scripts/DestroyOnOpKey.hash diff --git a/runelite-client/src/main/scripts/DestroyOnOpKey.rs2asm b/RuneLitePlus/src/main/scripts/DestroyOnOpKey.rs2asm similarity index 100% rename from runelite-client/src/main/scripts/DestroyOnOpKey.rs2asm rename to RuneLitePlus/src/main/scripts/DestroyOnOpKey.rs2asm diff --git a/runelite-client/src/main/scripts/FakeXPDrops.hash b/RuneLitePlus/src/main/scripts/FakeXPDrops.hash similarity index 100% rename from runelite-client/src/main/scripts/FakeXPDrops.hash rename to RuneLitePlus/src/main/scripts/FakeXPDrops.hash diff --git a/runelite-client/src/main/scripts/FakeXPDrops.rs2asm b/RuneLitePlus/src/main/scripts/FakeXPDrops.rs2asm similarity index 100% rename from runelite-client/src/main/scripts/FakeXPDrops.rs2asm rename to RuneLitePlus/src/main/scripts/FakeXPDrops.rs2asm diff --git a/runelite-client/src/main/scripts/GEOffersSetupInit.hash b/RuneLitePlus/src/main/scripts/GEOffersSetupInit.hash similarity index 100% rename from runelite-client/src/main/scripts/GEOffersSetupInit.hash rename to RuneLitePlus/src/main/scripts/GEOffersSetupInit.hash diff --git a/runelite-client/src/main/scripts/GEOffersSetupInit.rs2asm b/RuneLitePlus/src/main/scripts/GEOffersSetupInit.rs2asm similarity index 100% rename from runelite-client/src/main/scripts/GEOffersSetupInit.rs2asm rename to RuneLitePlus/src/main/scripts/GEOffersSetupInit.rs2asm diff --git a/runelite-client/src/main/scripts/MagicSpellBookRedraw.hash b/RuneLitePlus/src/main/scripts/MagicSpellBookRedraw.hash similarity index 100% rename from runelite-client/src/main/scripts/MagicSpellBookRedraw.hash rename to RuneLitePlus/src/main/scripts/MagicSpellBookRedraw.hash diff --git a/runelite-client/src/main/scripts/MagicSpellBookRedraw.rs2asm b/RuneLitePlus/src/main/scripts/MagicSpellBookRedraw.rs2asm similarity index 96% rename from runelite-client/src/main/scripts/MagicSpellBookRedraw.rs2asm rename to RuneLitePlus/src/main/scripts/MagicSpellBookRedraw.rs2asm index b51f3aa637..60807af8e1 100644 --- a/runelite-client/src/main/scripts/MagicSpellBookRedraw.rs2asm +++ b/RuneLitePlus/src/main/scripts/MagicSpellBookRedraw.rs2asm @@ -1,843 +1,843 @@ -.id 2611 -.int_stack_count 11 -.string_stack_count 2 -.int_var_count 30 -.string_var_count 2 - sconst "startSpellRedraw" - runelite_callback - iconst 190 - istore 11 - iconst 261 - istore 12 - iconst 0 - istore 13 - iload 10 - iconst 1 - if_icmpeq LABEL10 - jump LABEL76 -LABEL10: - iconst 6 - iconst 240 - iconst 1 - iconst 0 - iload 3 - if_setsize - iconst 190 - iconst 6 - sub - iconst 240 - istore 12 - istore 11 - iconst 0 - iconst 0 - iconst 1 - iconst 0 - iload 3 - if_setposition - iconst 0 - iload 4 - if_sethide - sload 0 - iconst 190 - iconst 494 - parawidth - sload 1 - iconst 190 - iconst 494 - parawidth - invoke 1045 - iconst 14 - add - istore 13 - iload 13 - iconst 0 - iconst 0 - iconst 1 - iload 5 - if_setsize - iload 13 - iconst 0 - iconst 0 - iconst 1 - iload 6 - if_setsize - iconst 190 - iload 13 - iconst 2 - multiply - sub - iconst 3 - div - istore 13 - iload 13 - iconst 0 - iconst 0 - iconst 1 - iload 5 - if_setposition - iload 13 - iconst 0 - iconst 2 - iconst 1 - iload 6 - if_setposition - jump LABEL147 -LABEL76: - get_varbit 6718 - iconst 1 - if_icmpeq LABEL80 - jump LABEL109 -LABEL80: - iconst 0 - iconst 0 - iconst 1 - iconst 1 - iload 3 - if_setsize - iconst 0 - iconst 0 - iconst 1 - iconst 1 - iload 3 - if_setposition - iconst 1 - iload 4 - if_sethide - iconst -1 - iload 10 - iload 5 - iload 6 - iload 0 - iload 1 - iload 7 - iload 8 - iload 9 - iload 2 - sload 0 - sload 1 - invoke 2603 - jump LABEL147 -LABEL109: - iconst 6 - iconst 240 - iconst 1 - iconst 0 - iload 3 - if_setsize - iconst 190 - iconst 6 - sub - iconst 240 - istore 12 - istore 11 - iconst 0 - iconst 0 - iconst 1 - iconst 0 - iload 3 - if_setposition - iconst 0 - iload 4 - if_sethide - sload 1 - iconst 190 - iconst 494 - parawidth - iconst 14 - add - iconst 0 - iconst 0 - iconst 1 - iload 6 - if_setsize - iconst 0 - iconst 0 - iconst 1 - iconst 1 - iload 6 - if_setposition -LABEL147: - iload 0 - cc_deleteall - iload 1 - cc_deleteall - iload 2 - cc_deleteall - iconst 105 - iconst 103 - iconst 1981 - get_varbit 4070 - enum - istore 14 - iload 14 - iconst 1982 - if_icmpne LABEL163 - jump LABEL165 -LABEL163: - iconst 1982 - invoke 2618 -LABEL165: - iload 14 - iconst 1983 - if_icmpne LABEL169 - jump LABEL171 -LABEL169: - iconst 1983 - invoke 2618 -LABEL171: - iload 14 - iconst 1984 - if_icmpne LABEL175 - jump LABEL177 -LABEL175: - iconst 1984 - invoke 2618 -LABEL177: - iload 14 - iconst 1985 - if_icmpne LABEL181 - jump LABEL183 -LABEL181: - iconst 1985 - invoke 2618 -LABEL183: - iload 14 - iconst -1 - if_icmpeq LABEL187 - jump LABEL188 -LABEL187: - return -LABEL188: - iload 14 - enum_getoutputcount - istore 15 - iload 15 - define_array 105 - iconst 0 - istore 16 - iconst -1 - istore 17 - iconst 0 - istore 18 - iload 10 - iconst 0 - if_icmpeq LABEL203 - jump LABEL235 -LABEL203: - get_varbit 6718 - iconst 1 - if_icmpeq LABEL207 - jump LABEL235 -LABEL207: - iload 18 - iload 15 - if_icmplt LABEL211 - jump LABEL234 -LABEL211: - iconst 105 - iconst 111 - iload 14 - iload 18 - enum - istore 17 - iconst 0 - iload 17 - iconst 596 - oc_param - if_sethide - iload 16 - iload 18 - set_array_int - iload 16 - iconst 1 - add - istore 16 - iload 18 - iconst 1 - add - istore 18 - jump LABEL207 -LABEL234: - jump LABEL273 -LABEL235: - iload 18 - iload 15 - if_icmplt LABEL239 - jump LABEL273 -LABEL239: - iconst 105 - iconst 111 - iload 14 - iload 18 - enum - istore 17 - iload 17 - invoke 2619 - iconst 1 - if_icmpeq FILTER_SPELL - jump LABEL263 -FILTER_SPELL: - iconst 1 ; boolean the callback modifies - iload 17 - iconst 596 ; widgetID, to populate config - oc_param - iload 17 - iconst 601 ; spell_name - oc_param ; look up from object composition - sconst "shouldFilterSpell" - runelite_callback - pop_string ; pop the name - pop_int ; and the widgetID - iconst 1 ; default true, so the script still functions without plugin on - if_icmpeq LABEL250 - jump LABEL263 -LABEL250: - iconst 0 - iload 17 - iconst 596 - oc_param - if_sethide - iload 16 - iload 18 - set_array_int - iload 16 - iconst 1 - add - istore 16 - jump LABEL268 -LABEL263: - iconst 1 - iload 17 - iconst 596 - oc_param - if_sethide -LABEL268: - iload 18 - iconst 1 - add - istore 18 - jump LABEL235 -LABEL273: - iload 16 - iconst 2 - if_icmpge LABEL277 - jump LABEL285 -LABEL277: - iconst 0 - iconst 0 - iload 16 - iconst 1 - sub - iload 14 - invoke 2621 - jump LABEL316 -LABEL285: - iload 16 - iconst 0 - if_icmple LABEL289 - jump LABEL316 -LABEL289: - iload 0 - iconst 4 - iconst 0 - cc_create - iconst 0 - iconst 0 - iconst 1 - iconst 1 - cc_setsize - iconst 0 - iconst 0 - iconst 1 - iconst 1 - cc_setposition - iconst 16750623 - cc_setcolour - iconst 495 - cc_settextfont - iconst 1 - cc_settextshadow - iconst 1 - iconst 1 - iconst 0 - cc_settextalign - sconst "No spells match your selected filters." - cc_settext - return -LABEL316: - iconst 24 - istore 19 - iconst 0 - istore 20 - iconst 0 - istore 21 - iconst 0 - istore 22 - iconst 0 - istore 23 - iload 12 - istore 24 - iconst 0 - sconst "isMobileSpellbookEnabled" - runelite_callback - iconst 1 - if_icmpeq LABEL332 - jump LABEL422 -LABEL332: - iload 16 - iconst 15 - if_icmple LABEL336 - jump LABEL341 -LABEL336: - iconst 40 - iconst 3 - sconst "resizeSpell" - runelite_callback - istore 20 - istore 19 - jump LABEL360 -LABEL341: - iload 16 - iconst 20 - if_icmple LABEL345 - jump LABEL350 -LABEL345: - iconst 40 - iconst 4 - istore 20 - istore 19 - jump LABEL360 -LABEL350: - iconst 4 - iconst 7 - iload 16 - iconst 8 - add - iconst 9 - div - invoke 1046 - invoke 1045 - istore 20 -LABEL360: - iconst 0 - iconst 5 - iconst 7 - iload 19 - scale - iload 11 - iload 19 - iload 20 - multiply - sub - iload 20 - iconst 1 - sub - div - invoke 1046 - invoke 1045 - istore 23 - iconst 1 - iload 16 - iload 20 - iconst 1 - sub - add - iload 20 - div - invoke 1045 - istore 21 - iload 21 - iconst 2 - if_icmpge LABEL391 - jump LABEL405 -LABEL391: - iconst 0 - iload 23 - iload 12 - iload 19 - iload 21 - multiply - sub - iload 21 - iconst 1 - sub - div - invoke 1046 - invoke 1045 - istore 22 -LABEL405: - iload 21 - iload 19 - multiply - iload 21 - iconst 1 - sub - iload 22 - multiply - add - istore 24 - iconst 0 - iconst 0 - iconst 1 - iconst 1 - iload 0 - if_setposition - jump LABEL577 -LABEL422: - get_varbit 6718 - iconst 1 - if_icmpeq LABEL426 - jump LABEL498 -LABEL426: - get_varbit 4070 - switch - 1: LABEL443 - 2: LABEL458 - 3: LABEL473 - iconst 7 - iconst 10 - iconst 0 - iconst 0 - istore 22 - istore 23 - istore 21 - istore 20 - iconst 1 - iconst 15 - iconst 1 - iconst 0 - iload 0 - if_setposition - jump LABEL487 -LABEL443: - iconst 4 - iconst 7 - iconst 20 - iconst 4 - istore 22 - istore 23 - istore 21 - istore 20 - iconst 2 - iconst 8 - iconst 1 - iconst 0 - iload 0 - if_setposition - jump LABEL487 -LABEL458: - iconst 6 - iconst 8 - iconst 6 - iconst 5 - istore 22 - istore 23 - istore 21 - istore 20 - iconst 0 - iconst 8 - iconst 1 - iconst 0 - iload 0 - if_setposition - jump LABEL487 -LABEL473: - iconst 4 - iconst 9 - iconst 21 - iconst 5 - istore 22 - istore 23 - istore 21 - istore 20 - iconst 0 - iconst 3 - iconst 1 - iconst 0 - iload 0 - if_setposition -LABEL487: - iload 21 - iload 19 - multiply - iload 21 - iconst 1 - sub - iload 22 - multiply - add - istore 24 - jump LABEL577 -LABEL498: - iload 16 - iconst 28 - if_icmple LABEL502 - jump LABEL505 -LABEL502: - iconst 4 - istore 20 - jump LABEL515 -LABEL505: - iconst 4 - iconst 7 - iload 16 - iconst 8 - add - iconst 9 - div - invoke 1046 - invoke 1045 - istore 20 -LABEL515: - iconst 0 - iload 19 - iload 11 - iload 19 - iload 20 - multiply - sub - iload 20 - iconst 1 - sub - div - invoke 1046 - invoke 1045 - istore 23 - iconst 1 - iload 16 - iload 20 - iconst 1 - sub - add - iload 20 - div - invoke 1045 - istore 21 - iload 21 - iconst 2 - if_icmpge LABEL543 - jump LABEL557 -LABEL543: - iconst 0 - iload 23 - iload 12 - iload 19 - iload 21 - multiply - sub - iload 21 - iconst 1 - sub - div - invoke 1046 - invoke 1045 - istore 22 -LABEL557: - iload 21 - iload 19 - multiply - iload 21 - iconst 1 - sub - iload 22 - multiply - add - iload 12 - iconst 30 - sub - invoke 1045 - istore 24 - iconst 0 - iconst 0 - iconst 1 - iconst 1 - iload 0 - if_setposition -LABEL577: - iload 20 - iload 19 - multiply - iload 20 - iconst 1 - sub - iload 23 - multiply - add ; start of the label until here calcs total width - iload 24 ; total height - sconst "setSpellAreaSize" - runelite_callback - iconst 0 - iconst 0 - iload 0 - if_setsize - iconst -1 - istore 25 - iload 19 - iload 23 - add - istore 26 - iload 19 - iload 22 - add - istore 27 - iconst 0 - istore 28 - iconst 0 - istore 29 - iconst 0 - istore 18 -LABEL607: - iload 18 - iload 16 - if_icmplt LABEL611 - jump LABEL741 -LABEL611: - iconst 105 - iconst 111 - iload 14 - iload 18 - get_array_int - enum - istore 17 - iload 17 - iconst 596 - oc_param - istore 25 - iload 19 - iload 19 - iload 25 - sconst "resizeIndividualSpells" - runelite_callback - pop_int - iconst 0 - iconst 0 - iload 25 - if_setsize - iload 18 - iload 20 - mod - iload 26 - multiply - iload 18 - iload 20 - div - iload 27 - multiply - istore 29 - istore 28 - iload 28 - iload 29 - iconst 0 - iconst 0 - iload 25 - sconst "setSpellPosition" - runelite_callback - if_setposition - iload 17 - iload 25 - invoke 2614 - iconst 1 - if_icmpeq LABEL652 - jump LABEL668 -LABEL652: - iload 19 - iconst 40 - if_icmpge LABEL656 - jump LABEL662 -LABEL656: - iload 17 - iconst 599 - oc_param - iload 25 - if_setgraphic - jump LABEL667 -LABEL662: - iload 17 - iconst 597 - oc_param - iload 25 - if_setgraphic -LABEL667: - jump LABEL683 -LABEL668: - iload 19 - iconst 40 - if_icmpge LABEL672 - jump LABEL678 -LABEL672: - iload 17 - iconst 600 - oc_param - iload 25 - if_setgraphic - jump LABEL683 -LABEL678: - iload 17 - iconst 598 - oc_param - iload 25 - if_setgraphic -LABEL683: - iload 25 - invoke 2615 - iload 10 - iconst 1 - if_icmpeq LABEL689 - jump LABEL716 -LABEL689: - iload 1 - iconst 5 - iload 18 - cc_create - iload 19 - iload 19 - iconst 0 - iconst 0 - cc_setsize - iload 28 - iload 29 - iconst 0 - iconst 0 - cc_setposition - iload 17 - iconst 1 - cc_setobject - iconst 255 - cc_settrans - iconst 2612 - iload 17 - iload 1 - iload 2 - iload 12 - sconst "oIIi" - cc_setonclick - jump LABEL736 -LABEL716: - iconst 2622 - iconst 1 - iload 17 - iconst -2147483645 - iconst -1 - iload 2 - iload 12 - sconst "1oIiIi" - iload 25 - if_setonmouserepeat - iconst 2622 - iconst 0 - iload 17 - iconst -2147483645 - iconst -1 - iload 2 - iload 12 - sconst "1oIiIi" - iload 25 - if_setonmouseleave -LABEL736: - iload 18 - iconst 1 - add - istore 18 - jump LABEL607 -LABEL741: - return +.id 2611 +.int_stack_count 11 +.string_stack_count 2 +.int_var_count 30 +.string_var_count 2 + sconst "startSpellRedraw" + runelite_callback + iconst 190 + istore 11 + iconst 261 + istore 12 + iconst 0 + istore 13 + iload 10 + iconst 1 + if_icmpeq LABEL10 + jump LABEL76 +LABEL10: + iconst 6 + iconst 240 + iconst 1 + iconst 0 + iload 3 + if_setsize + iconst 190 + iconst 6 + sub + iconst 240 + istore 12 + istore 11 + iconst 0 + iconst 0 + iconst 1 + iconst 0 + iload 3 + if_setposition + iconst 0 + iload 4 + if_sethide + sload 0 + iconst 190 + iconst 494 + parawidth + sload 1 + iconst 190 + iconst 494 + parawidth + invoke 1045 + iconst 14 + add + istore 13 + iload 13 + iconst 0 + iconst 0 + iconst 1 + iload 5 + if_setsize + iload 13 + iconst 0 + iconst 0 + iconst 1 + iload 6 + if_setsize + iconst 190 + iload 13 + iconst 2 + multiply + sub + iconst 3 + div + istore 13 + iload 13 + iconst 0 + iconst 0 + iconst 1 + iload 5 + if_setposition + iload 13 + iconst 0 + iconst 2 + iconst 1 + iload 6 + if_setposition + jump LABEL147 +LABEL76: + get_varbit 6718 + iconst 1 + if_icmpeq LABEL80 + jump LABEL109 +LABEL80: + iconst 0 + iconst 0 + iconst 1 + iconst 1 + iload 3 + if_setsize + iconst 0 + iconst 0 + iconst 1 + iconst 1 + iload 3 + if_setposition + iconst 1 + iload 4 + if_sethide + iconst -1 + iload 10 + iload 5 + iload 6 + iload 0 + iload 1 + iload 7 + iload 8 + iload 9 + iload 2 + sload 0 + sload 1 + invoke 2603 + jump LABEL147 +LABEL109: + iconst 6 + iconst 240 + iconst 1 + iconst 0 + iload 3 + if_setsize + iconst 190 + iconst 6 + sub + iconst 240 + istore 12 + istore 11 + iconst 0 + iconst 0 + iconst 1 + iconst 0 + iload 3 + if_setposition + iconst 0 + iload 4 + if_sethide + sload 1 + iconst 190 + iconst 494 + parawidth + iconst 14 + add + iconst 0 + iconst 0 + iconst 1 + iload 6 + if_setsize + iconst 0 + iconst 0 + iconst 1 + iconst 1 + iload 6 + if_setposition +LABEL147: + iload 0 + cc_deleteall + iload 1 + cc_deleteall + iload 2 + cc_deleteall + iconst 105 + iconst 103 + iconst 1981 + get_varbit 4070 + enum + istore 14 + iload 14 + iconst 1982 + if_icmpne LABEL163 + jump LABEL165 +LABEL163: + iconst 1982 + invoke 2618 +LABEL165: + iload 14 + iconst 1983 + if_icmpne LABEL169 + jump LABEL171 +LABEL169: + iconst 1983 + invoke 2618 +LABEL171: + iload 14 + iconst 1984 + if_icmpne LABEL175 + jump LABEL177 +LABEL175: + iconst 1984 + invoke 2618 +LABEL177: + iload 14 + iconst 1985 + if_icmpne LABEL181 + jump LABEL183 +LABEL181: + iconst 1985 + invoke 2618 +LABEL183: + iload 14 + iconst -1 + if_icmpeq LABEL187 + jump LABEL188 +LABEL187: + return +LABEL188: + iload 14 + enum_getoutputcount + istore 15 + iload 15 + define_array 105 + iconst 0 + istore 16 + iconst -1 + istore 17 + iconst 0 + istore 18 + iload 10 + iconst 0 + if_icmpeq LABEL203 + jump LABEL235 +LABEL203: + get_varbit 6718 + iconst 1 + if_icmpeq LABEL207 + jump LABEL235 +LABEL207: + iload 18 + iload 15 + if_icmplt LABEL211 + jump LABEL234 +LABEL211: + iconst 105 + iconst 111 + iload 14 + iload 18 + enum + istore 17 + iconst 0 + iload 17 + iconst 596 + oc_param + if_sethide + iload 16 + iload 18 + set_array_int + iload 16 + iconst 1 + add + istore 16 + iload 18 + iconst 1 + add + istore 18 + jump LABEL207 +LABEL234: + jump LABEL273 +LABEL235: + iload 18 + iload 15 + if_icmplt LABEL239 + jump LABEL273 +LABEL239: + iconst 105 + iconst 111 + iload 14 + iload 18 + enum + istore 17 + iload 17 + invoke 2619 + iconst 1 + if_icmpeq FILTER_SPELL + jump LABEL263 +FILTER_SPELL: + iconst 1 ; boolean the callback modifies + iload 17 + iconst 596 ; widgetID, to populate config + oc_param + iload 17 + iconst 601 ; spell_name + oc_param ; look up from object composition + sconst "shouldFilterSpell" + runelite_callback + pop_string ; pop the name + pop_int ; and the widgetID + iconst 1 ; default true, so the script still functions without plugin on + if_icmpeq LABEL250 + jump LABEL263 +LABEL250: + iconst 0 + iload 17 + iconst 596 + oc_param + if_sethide + iload 16 + iload 18 + set_array_int + iload 16 + iconst 1 + add + istore 16 + jump LABEL268 +LABEL263: + iconst 1 + iload 17 + iconst 596 + oc_param + if_sethide +LABEL268: + iload 18 + iconst 1 + add + istore 18 + jump LABEL235 +LABEL273: + iload 16 + iconst 2 + if_icmpge LABEL277 + jump LABEL285 +LABEL277: + iconst 0 + iconst 0 + iload 16 + iconst 1 + sub + iload 14 + invoke 2621 + jump LABEL316 +LABEL285: + iload 16 + iconst 0 + if_icmple LABEL289 + jump LABEL316 +LABEL289: + iload 0 + iconst 4 + iconst 0 + cc_create + iconst 0 + iconst 0 + iconst 1 + iconst 1 + cc_setsize + iconst 0 + iconst 0 + iconst 1 + iconst 1 + cc_setposition + iconst 16750623 + cc_setcolour + iconst 495 + cc_settextfont + iconst 1 + cc_settextshadow + iconst 1 + iconst 1 + iconst 0 + cc_settextalign + sconst "No spells match your selected filters." + cc_settext + return +LABEL316: + iconst 24 + istore 19 + iconst 0 + istore 20 + iconst 0 + istore 21 + iconst 0 + istore 22 + iconst 0 + istore 23 + iload 12 + istore 24 + iconst 0 + sconst "isMobileSpellbookEnabled" + runelite_callback + iconst 1 + if_icmpeq LABEL332 + jump LABEL422 +LABEL332: + iload 16 + iconst 15 + if_icmple LABEL336 + jump LABEL341 +LABEL336: + iconst 40 + iconst 3 + sconst "resizeSpell" + runelite_callback + istore 20 + istore 19 + jump LABEL360 +LABEL341: + iload 16 + iconst 20 + if_icmple LABEL345 + jump LABEL350 +LABEL345: + iconst 40 + iconst 4 + istore 20 + istore 19 + jump LABEL360 +LABEL350: + iconst 4 + iconst 7 + iload 16 + iconst 8 + add + iconst 9 + div + invoke 1046 + invoke 1045 + istore 20 +LABEL360: + iconst 0 + iconst 5 + iconst 7 + iload 19 + scale + iload 11 + iload 19 + iload 20 + multiply + sub + iload 20 + iconst 1 + sub + div + invoke 1046 + invoke 1045 + istore 23 + iconst 1 + iload 16 + iload 20 + iconst 1 + sub + add + iload 20 + div + invoke 1045 + istore 21 + iload 21 + iconst 2 + if_icmpge LABEL391 + jump LABEL405 +LABEL391: + iconst 0 + iload 23 + iload 12 + iload 19 + iload 21 + multiply + sub + iload 21 + iconst 1 + sub + div + invoke 1046 + invoke 1045 + istore 22 +LABEL405: + iload 21 + iload 19 + multiply + iload 21 + iconst 1 + sub + iload 22 + multiply + add + istore 24 + iconst 0 + iconst 0 + iconst 1 + iconst 1 + iload 0 + if_setposition + jump LABEL577 +LABEL422: + get_varbit 6718 + iconst 1 + if_icmpeq LABEL426 + jump LABEL498 +LABEL426: + get_varbit 4070 + switch + 1: LABEL443 + 2: LABEL458 + 3: LABEL473 + iconst 7 + iconst 10 + iconst 0 + iconst 0 + istore 22 + istore 23 + istore 21 + istore 20 + iconst 1 + iconst 15 + iconst 1 + iconst 0 + iload 0 + if_setposition + jump LABEL487 +LABEL443: + iconst 4 + iconst 7 + iconst 20 + iconst 4 + istore 22 + istore 23 + istore 21 + istore 20 + iconst 2 + iconst 8 + iconst 1 + iconst 0 + iload 0 + if_setposition + jump LABEL487 +LABEL458: + iconst 6 + iconst 8 + iconst 6 + iconst 5 + istore 22 + istore 23 + istore 21 + istore 20 + iconst 0 + iconst 8 + iconst 1 + iconst 0 + iload 0 + if_setposition + jump LABEL487 +LABEL473: + iconst 4 + iconst 9 + iconst 21 + iconst 5 + istore 22 + istore 23 + istore 21 + istore 20 + iconst 0 + iconst 3 + iconst 1 + iconst 0 + iload 0 + if_setposition +LABEL487: + iload 21 + iload 19 + multiply + iload 21 + iconst 1 + sub + iload 22 + multiply + add + istore 24 + jump LABEL577 +LABEL498: + iload 16 + iconst 28 + if_icmple LABEL502 + jump LABEL505 +LABEL502: + iconst 4 + istore 20 + jump LABEL515 +LABEL505: + iconst 4 + iconst 7 + iload 16 + iconst 8 + add + iconst 9 + div + invoke 1046 + invoke 1045 + istore 20 +LABEL515: + iconst 0 + iload 19 + iload 11 + iload 19 + iload 20 + multiply + sub + iload 20 + iconst 1 + sub + div + invoke 1046 + invoke 1045 + istore 23 + iconst 1 + iload 16 + iload 20 + iconst 1 + sub + add + iload 20 + div + invoke 1045 + istore 21 + iload 21 + iconst 2 + if_icmpge LABEL543 + jump LABEL557 +LABEL543: + iconst 0 + iload 23 + iload 12 + iload 19 + iload 21 + multiply + sub + iload 21 + iconst 1 + sub + div + invoke 1046 + invoke 1045 + istore 22 +LABEL557: + iload 21 + iload 19 + multiply + iload 21 + iconst 1 + sub + iload 22 + multiply + add + iload 12 + iconst 30 + sub + invoke 1045 + istore 24 + iconst 0 + iconst 0 + iconst 1 + iconst 1 + iload 0 + if_setposition +LABEL577: + iload 20 + iload 19 + multiply + iload 20 + iconst 1 + sub + iload 23 + multiply + add ; start of the label until here calcs total width + iload 24 ; total height + sconst "setSpellAreaSize" + runelite_callback + iconst 0 + iconst 0 + iload 0 + if_setsize + iconst -1 + istore 25 + iload 19 + iload 23 + add + istore 26 + iload 19 + iload 22 + add + istore 27 + iconst 0 + istore 28 + iconst 0 + istore 29 + iconst 0 + istore 18 +LABEL607: + iload 18 + iload 16 + if_icmplt LABEL611 + jump LABEL741 +LABEL611: + iconst 105 + iconst 111 + iload 14 + iload 18 + get_array_int + enum + istore 17 + iload 17 + iconst 596 + oc_param + istore 25 + iload 19 + iload 19 + iload 25 + sconst "resizeIndividualSpells" + runelite_callback + pop_int + iconst 0 + iconst 0 + iload 25 + if_setsize + iload 18 + iload 20 + mod + iload 26 + multiply + iload 18 + iload 20 + div + iload 27 + multiply + istore 29 + istore 28 + iload 28 + iload 29 + iconst 0 + iconst 0 + iload 25 + sconst "setSpellPosition" + runelite_callback + if_setposition + iload 17 + iload 25 + invoke 2614 + iconst 1 + if_icmpeq LABEL652 + jump LABEL668 +LABEL652: + iload 19 + iconst 40 + if_icmpge LABEL656 + jump LABEL662 +LABEL656: + iload 17 + iconst 599 + oc_param + iload 25 + if_setgraphic + jump LABEL667 +LABEL662: + iload 17 + iconst 597 + oc_param + iload 25 + if_setgraphic +LABEL667: + jump LABEL683 +LABEL668: + iload 19 + iconst 40 + if_icmpge LABEL672 + jump LABEL678 +LABEL672: + iload 17 + iconst 600 + oc_param + iload 25 + if_setgraphic + jump LABEL683 +LABEL678: + iload 17 + iconst 598 + oc_param + iload 25 + if_setgraphic +LABEL683: + iload 25 + invoke 2615 + iload 10 + iconst 1 + if_icmpeq LABEL689 + jump LABEL716 +LABEL689: + iload 1 + iconst 5 + iload 18 + cc_create + iload 19 + iload 19 + iconst 0 + iconst 0 + cc_setsize + iload 28 + iload 29 + iconst 0 + iconst 0 + cc_setposition + iload 17 + iconst 1 + cc_setobject + iconst 255 + cc_settrans + iconst 2612 + iload 17 + iload 1 + iload 2 + iload 12 + sconst "oIIi" + cc_setonclick + jump LABEL736 +LABEL716: + iconst 2622 + iconst 1 + iload 17 + iconst -2147483645 + iconst -1 + iload 2 + iload 12 + sconst "1oIiIi" + iload 25 + if_setonmouserepeat + iconst 2622 + iconst 0 + iload 17 + iconst -2147483645 + iconst -1 + iload 2 + iload 12 + sconst "1oIiIi" + iload 25 + if_setonmouseleave +LABEL736: + iload 18 + iconst 1 + add + istore 18 + jump LABEL607 +LABEL741: + return diff --git a/runelite-client/src/main/scripts/OpenBankSearchInput.hash b/RuneLitePlus/src/main/scripts/OpenBankSearchInput.hash similarity index 100% rename from runelite-client/src/main/scripts/OpenBankSearchInput.hash rename to RuneLitePlus/src/main/scripts/OpenBankSearchInput.hash diff --git a/runelite-client/src/main/scripts/OpenBankSearchInput.rs2asm b/RuneLitePlus/src/main/scripts/OpenBankSearchInput.rs2asm similarity index 100% rename from runelite-client/src/main/scripts/OpenBankSearchInput.rs2asm rename to RuneLitePlus/src/main/scripts/OpenBankSearchInput.rs2asm diff --git a/runelite-client/src/main/scripts/OptionsPanelRebuilder.hash b/RuneLitePlus/src/main/scripts/OptionsPanelRebuilder.hash similarity index 100% rename from runelite-client/src/main/scripts/OptionsPanelRebuilder.hash rename to RuneLitePlus/src/main/scripts/OptionsPanelRebuilder.hash diff --git a/runelite-client/src/main/scripts/OptionsPanelRebuilder.rs2asm b/RuneLitePlus/src/main/scripts/OptionsPanelRebuilder.rs2asm similarity index 100% rename from runelite-client/src/main/scripts/OptionsPanelRebuilder.rs2asm rename to RuneLitePlus/src/main/scripts/OptionsPanelRebuilder.rs2asm diff --git a/runelite-client/src/main/scripts/OptionsPanelZoomMouseListener.hash b/RuneLitePlus/src/main/scripts/OptionsPanelZoomMouseListener.hash similarity index 100% rename from runelite-client/src/main/scripts/OptionsPanelZoomMouseListener.hash rename to RuneLitePlus/src/main/scripts/OptionsPanelZoomMouseListener.hash diff --git a/runelite-client/src/main/scripts/OptionsPanelZoomMouseListener.rs2asm b/RuneLitePlus/src/main/scripts/OptionsPanelZoomMouseListener.rs2asm similarity index 100% rename from runelite-client/src/main/scripts/OptionsPanelZoomMouseListener.rs2asm rename to RuneLitePlus/src/main/scripts/OptionsPanelZoomMouseListener.rs2asm diff --git a/runelite-client/src/main/scripts/OptionsPanelZoomUpdater.hash b/RuneLitePlus/src/main/scripts/OptionsPanelZoomUpdater.hash similarity index 100% rename from runelite-client/src/main/scripts/OptionsPanelZoomUpdater.hash rename to RuneLitePlus/src/main/scripts/OptionsPanelZoomUpdater.hash diff --git a/runelite-client/src/main/scripts/OptionsPanelZoomUpdater.rs2asm b/RuneLitePlus/src/main/scripts/OptionsPanelZoomUpdater.rs2asm similarity index 100% rename from runelite-client/src/main/scripts/OptionsPanelZoomUpdater.rs2asm rename to RuneLitePlus/src/main/scripts/OptionsPanelZoomUpdater.rs2asm diff --git a/runelite-client/src/main/scripts/PrivateMessage.hash b/RuneLitePlus/src/main/scripts/PrivateMessage.hash similarity index 100% rename from runelite-client/src/main/scripts/PrivateMessage.hash rename to RuneLitePlus/src/main/scripts/PrivateMessage.hash diff --git a/runelite-client/src/main/scripts/PrivateMessage.rs2asm b/RuneLitePlus/src/main/scripts/PrivateMessage.rs2asm similarity index 100% rename from runelite-client/src/main/scripts/PrivateMessage.rs2asm rename to RuneLitePlus/src/main/scripts/PrivateMessage.rs2asm diff --git a/runelite-client/src/main/scripts/PvpWidgetBuilder.hash b/RuneLitePlus/src/main/scripts/PvpWidgetBuilder.hash similarity index 100% rename from runelite-client/src/main/scripts/PvpWidgetBuilder.hash rename to RuneLitePlus/src/main/scripts/PvpWidgetBuilder.hash diff --git a/runelite-client/src/main/scripts/PvpWidgetBuilder.rs2asm b/RuneLitePlus/src/main/scripts/PvpWidgetBuilder.rs2asm similarity index 100% rename from runelite-client/src/main/scripts/PvpWidgetBuilder.rs2asm rename to RuneLitePlus/src/main/scripts/PvpWidgetBuilder.rs2asm diff --git a/runelite-client/src/main/scripts/QuestListShowProgress.hash b/RuneLitePlus/src/main/scripts/QuestListShowProgress.hash similarity index 100% rename from runelite-client/src/main/scripts/QuestListShowProgress.hash rename to RuneLitePlus/src/main/scripts/QuestListShowProgress.hash diff --git a/runelite-client/src/main/scripts/QuestListShowProgress.rs2asm b/RuneLitePlus/src/main/scripts/QuestListShowProgress.rs2asm similarity index 100% rename from runelite-client/src/main/scripts/QuestListShowProgress.rs2asm rename to RuneLitePlus/src/main/scripts/QuestListShowProgress.rs2asm diff --git a/runelite-client/src/main/scripts/ResetChatboxInput.hash b/RuneLitePlus/src/main/scripts/ResetChatboxInput.hash similarity index 100% rename from runelite-client/src/main/scripts/ResetChatboxInput.hash rename to RuneLitePlus/src/main/scripts/ResetChatboxInput.hash diff --git a/runelite-client/src/main/scripts/ResetChatboxInput.rs2asm b/RuneLitePlus/src/main/scripts/ResetChatboxInput.rs2asm similarity index 100% rename from runelite-client/src/main/scripts/ResetChatboxInput.rs2asm rename to RuneLitePlus/src/main/scripts/ResetChatboxInput.rs2asm diff --git a/runelite-client/src/main/scripts/ScrollWheelZoomHandler.hash b/RuneLitePlus/src/main/scripts/ScrollWheelZoomHandler.hash similarity index 100% rename from runelite-client/src/main/scripts/ScrollWheelZoomHandler.hash rename to RuneLitePlus/src/main/scripts/ScrollWheelZoomHandler.hash diff --git a/runelite-client/src/main/scripts/ScrollWheelZoomHandler.rs2asm b/RuneLitePlus/src/main/scripts/ScrollWheelZoomHandler.rs2asm similarity index 100% rename from runelite-client/src/main/scripts/ScrollWheelZoomHandler.rs2asm rename to RuneLitePlus/src/main/scripts/ScrollWheelZoomHandler.rs2asm diff --git a/runelite-client/src/main/scripts/SendPrivateMessage.rs2asm b/RuneLitePlus/src/main/scripts/SendPrivateMessage.rs2asm similarity index 100% rename from runelite-client/src/main/scripts/SendPrivateMessage.rs2asm rename to RuneLitePlus/src/main/scripts/SendPrivateMessage.rs2asm diff --git a/runelite-client/src/main/scripts/SkillTabBuilder.hash b/RuneLitePlus/src/main/scripts/SkillTabBuilder.hash similarity index 100% rename from runelite-client/src/main/scripts/SkillTabBuilder.hash rename to RuneLitePlus/src/main/scripts/SkillTabBuilder.hash diff --git a/runelite-client/src/main/scripts/SkillTabBuilder.rs2asm b/RuneLitePlus/src/main/scripts/SkillTabBuilder.rs2asm similarity index 100% rename from runelite-client/src/main/scripts/SkillTabBuilder.rs2asm rename to RuneLitePlus/src/main/scripts/SkillTabBuilder.rs2asm diff --git a/runelite-client/src/main/scripts/SkillTabTotalLevel.hash b/RuneLitePlus/src/main/scripts/SkillTabTotalLevel.hash similarity index 100% rename from runelite-client/src/main/scripts/SkillTabTotalLevel.hash rename to RuneLitePlus/src/main/scripts/SkillTabTotalLevel.hash diff --git a/runelite-client/src/main/scripts/SkillTabTotalLevel.rs2asm b/RuneLitePlus/src/main/scripts/SkillTabTotalLevel.rs2asm similarity index 100% rename from runelite-client/src/main/scripts/SkillTabTotalLevel.rs2asm rename to RuneLitePlus/src/main/scripts/SkillTabTotalLevel.rs2asm diff --git a/runelite-client/src/main/scripts/SpecbarRedraw.hash b/RuneLitePlus/src/main/scripts/SpecbarRedraw.hash similarity index 100% rename from runelite-client/src/main/scripts/SpecbarRedraw.hash rename to RuneLitePlus/src/main/scripts/SpecbarRedraw.hash diff --git a/runelite-client/src/main/scripts/SpecbarRedraw.rs2asm b/RuneLitePlus/src/main/scripts/SpecbarRedraw.rs2asm similarity index 100% rename from runelite-client/src/main/scripts/SpecbarRedraw.rs2asm rename to RuneLitePlus/src/main/scripts/SpecbarRedraw.rs2asm diff --git a/runelite-client/src/main/scripts/TriggerBankLayout.hash b/RuneLitePlus/src/main/scripts/TriggerBankLayout.hash similarity index 100% rename from runelite-client/src/main/scripts/TriggerBankLayout.hash rename to RuneLitePlus/src/main/scripts/TriggerBankLayout.hash diff --git a/runelite-client/src/main/scripts/TriggerBankLayout.rs2asm b/RuneLitePlus/src/main/scripts/TriggerBankLayout.rs2asm similarity index 100% rename from runelite-client/src/main/scripts/TriggerBankLayout.rs2asm rename to RuneLitePlus/src/main/scripts/TriggerBankLayout.rs2asm diff --git a/runelite-client/src/main/scripts/XpDropChanged.hash b/RuneLitePlus/src/main/scripts/XpDropChanged.hash similarity index 100% rename from runelite-client/src/main/scripts/XpDropChanged.hash rename to RuneLitePlus/src/main/scripts/XpDropChanged.hash diff --git a/runelite-client/src/main/scripts/XpDropChanged.rs2asm b/RuneLitePlus/src/main/scripts/XpDropChanged.rs2asm similarity index 100% rename from runelite-client/src/main/scripts/XpDropChanged.rs2asm rename to RuneLitePlus/src/main/scripts/XpDropChanged.rs2asm diff --git a/runelite-client/src/main/scripts/ZoomHandler.hash b/RuneLitePlus/src/main/scripts/ZoomHandler.hash similarity index 100% rename from runelite-client/src/main/scripts/ZoomHandler.hash rename to RuneLitePlus/src/main/scripts/ZoomHandler.hash diff --git a/runelite-client/src/main/scripts/ZoomHandler.rs2asm b/RuneLitePlus/src/main/scripts/ZoomHandler.rs2asm similarity index 100% rename from runelite-client/src/main/scripts/ZoomHandler.rs2asm rename to RuneLitePlus/src/main/scripts/ZoomHandler.rs2asm diff --git a/runelite-client/src/main/scripts/null.rs2asm b/RuneLitePlus/src/main/scripts/null.rs2asm similarity index 100% rename from runelite-client/src/main/scripts/null.rs2asm rename to RuneLitePlus/src/main/scripts/null.rs2asm diff --git a/runelite-api/pom.xml b/api/pom.xml similarity index 87% rename from runelite-api/pom.xml rename to api/pom.xml index de7b43c940..b8e3669a06 100644 --- a/runelite-api/pom.xml +++ b/api/pom.xml @@ -27,37 +27,37 @@ 4.0.0 - net.runelite - runelite-parent - 1.5.27-SNAPSHOT + com.runeswag + runeswag-parent + 1.0-SNAPSHOT - runelite-api - RuneLite API - - - 1.3.9 - + api + RuneSwag API org.slf4j slf4j-api + 1.7.25 org.projectlombok lombok + 1.18.6 provided com.google.code.findbugs jsr305 - ${jsr305.version} + 3.0.2 junit junit + 4.12 + test diff --git a/runelite-api/src/main/java/net/runelite/api/Actor.java b/api/src/main/java/api/Actor.java similarity index 90% rename from runelite-api/src/main/java/net/runelite/api/Actor.java rename to api/src/main/java/api/Actor.java index c4c39b1701..05ca187ab7 100644 --- a/runelite-api/src/main/java/net/runelite/api/Actor.java +++ b/api/src/main/java/api/Actor.java @@ -22,23 +22,21 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; +import api.coords.LocalPoint; +import api.coords.WorldArea; +import api.coords.WorldPoint; import java.awt.Graphics2D; import java.awt.Polygon; import java.awt.image.BufferedImage; import javax.annotation.Nullable; -import net.runelite.api.annotations.VisibleForDevtools; -import net.runelite.api.coords.LocalPoint; -import net.runelite.api.coords.WorldArea; -import net.runelite.api.coords.WorldPoint; /** * Represents a RuneScape actor/entity. */ public interface Actor extends Renderable { - /** * Gets the combat level of the actor. * @@ -101,17 +99,15 @@ public interface Actor extends Renderable */ LocalPoint getLocalLocation(); - @VisibleForDevtools void setIdlePoseAnimation(int animation); - @VisibleForDevtools void setPoseAnimation(int animation); /** * Gets the orientation of the actor. * * @return the orientation - * @see net.runelite.api.coords.Angle + * @see api.coords.Angle */ int getOrientation(); @@ -129,7 +125,6 @@ public interface Actor extends Renderable * @param animation the animation ID * @see AnimationID */ - @VisibleForDevtools void setAnimation(int animation); /** @@ -137,7 +132,6 @@ public interface Actor extends Renderable * * @param actionFrame the animation frame */ - @VisibleForDevtools void setActionFrame(int actionFrame); /** @@ -146,13 +140,11 @@ public interface Actor extends Renderable * @return the graphic of the actor * @see GraphicID */ - int getGraphic(); + int getSpotAnimation(); - @VisibleForDevtools - void setGraphic(int graphic); + void setSpotAnimation(int graphic); - @VisibleForDevtools - void setSpotAnimFrame(int spotAnimFrame); + void setSpotAnimationFrame(int spotAnimFrame); /** * Gets the canvas area of the current tile the actor is standing on. @@ -192,7 +184,7 @@ public interface Actor extends Renderable * @param zOffset the z-axis offset * @return the sprite drawing location */ - Point getCanvasSpriteLocation(SpritePixels sprite, int zOffset); + Point getCanvasSpriteLocation(Sprite sprite, int zOffset); /** * Gets a point on the canvas of where this actors mini-map indicator @@ -216,7 +208,7 @@ public interface Actor extends Renderable * Gets the convex hull of the actors model. * * @return the convex hull - * @see net.runelite.api.model.Jarvis + * @see api.model.Jarvis */ Polygon getConvexHull(); diff --git a/runelite-api/src/main/java/net/runelite/api/AnimationID.java b/api/src/main/java/api/AnimationID.java similarity index 99% rename from runelite-api/src/main/java/net/runelite/api/AnimationID.java rename to api/src/main/java/api/AnimationID.java index 5c5bfbffbd..1b215a7cbb 100644 --- a/runelite-api/src/main/java/net/runelite/api/AnimationID.java +++ b/api/src/main/java/api/AnimationID.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * Utility class used for mapping animation IDs. diff --git a/runelite-api/src/main/java/net/runelite/api/BufferProvider.java b/api/src/main/java/api/BufferProvider.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/BufferProvider.java rename to api/src/main/java/api/BufferProvider.java index 1caf77aa96..3560b6d661 100644 --- a/runelite-api/src/main/java/net/runelite/api/BufferProvider.java +++ b/api/src/main/java/api/BufferProvider.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * Represents an engine graphic buffer. diff --git a/runelite-api/src/main/java/net/runelite/api/ChatLineBuffer.java b/api/src/main/java/api/ChatLineBuffer.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/ChatLineBuffer.java rename to api/src/main/java/api/ChatLineBuffer.java index a1f8a7e056..6d21d166fc 100644 --- a/runelite-api/src/main/java/net/runelite/api/ChatLineBuffer.java +++ b/api/src/main/java/api/ChatLineBuffer.java @@ -24,7 +24,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * Represents the buffer containing all messages in the chatbox. diff --git a/runelite-api/src/main/java/net/runelite/api/ChatMessageType.java b/api/src/main/java/api/ChatMessageType.java similarity index 99% rename from runelite-api/src/main/java/net/runelite/api/ChatMessageType.java rename to api/src/main/java/api/ChatMessageType.java index b4659dfa18..b89756ec03 100644 --- a/runelite-api/src/main/java/net/runelite/api/ChatMessageType.java +++ b/api/src/main/java/api/ChatMessageType.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; import java.util.HashMap; import java.util.Map; diff --git a/runelite-api/src/main/java/net/runelite/api/ChatPlayer.java b/api/src/main/java/api/ChatPlayer.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/ChatPlayer.java rename to api/src/main/java/api/ChatPlayer.java index 389a950bcd..436fa7f951 100644 --- a/runelite-api/src/main/java/net/runelite/api/ChatPlayer.java +++ b/api/src/main/java/api/ChatPlayer.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * Represents a player in the chat. diff --git a/runelite-api/src/main/java/net/runelite/api/ClanMember.java b/api/src/main/java/api/ClanMember.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/ClanMember.java rename to api/src/main/java/api/ClanMember.java index b8082af3d9..30453fc807 100644 --- a/runelite-api/src/main/java/net/runelite/api/ClanMember.java +++ b/api/src/main/java/api/ClanMember.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * Represents a clan member. diff --git a/runelite-api/src/main/java/net/runelite/api/ClanMemberRank.java b/api/src/main/java/api/ClanMemberRank.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/ClanMemberRank.java rename to api/src/main/java/api/ClanMemberRank.java index c919e343c7..f89ab0de21 100644 --- a/runelite-api/src/main/java/net/runelite/api/ClanMemberRank.java +++ b/api/src/main/java/api/ClanMemberRank.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; import java.util.HashMap; import java.util.Map; diff --git a/runelite-api/src/main/java/net/runelite/api/Client.java b/api/src/main/java/api/Client.java similarity index 93% rename from runelite-api/src/main/java/net/runelite/api/Client.java rename to api/src/main/java/api/Client.java index f4fd96d338..1ab10fe887 100644 --- a/runelite-api/src/main/java/net/runelite/api/Client.java +++ b/api/src/main/java/api/Client.java @@ -22,28 +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.api; +package api; +import api.coords.LocalPoint; +import api.coords.WorldPoint; +import api.hooks.Callbacks; +import api.hooks.DrawCallbacks; +import api.vars.AccountType; +import api.widgets.Widget; +import api.widgets.WidgetInfo; import java.awt.Canvas; import java.awt.Dimension; import java.util.EnumSet; import java.util.List; import java.util.Map; import javax.annotation.Nullable; -import net.runelite.api.annotations.VisibleForDevtools; -import net.runelite.api.coords.LocalPoint; -import net.runelite.api.coords.WorldPoint; -import net.runelite.api.hooks.Callbacks; -import net.runelite.api.hooks.DrawCallbacks; -import net.runelite.api.vars.AccountType; -import net.runelite.api.widgets.Widget; -import net.runelite.api.widgets.WidgetInfo; import org.slf4j.Logger; /** * Represents the RuneScape client. */ -public interface Client extends GameEngine +public interface Client extends GameShell { /** * The client invokes these callbacks to communicate to @@ -60,8 +59,6 @@ public interface Client extends GameEngine */ Logger getLogger(); - String getBuildID(); - /** * Gets a list of all valid players from the player cache. * @@ -151,13 +148,6 @@ public interface Client extends GameEngine */ void setPassword(String password); - /** - * Sets the 6 digit pin used for authenticator on login screen. - * - * @param otp one time password - */ - void setOtp(String otp); - /** * Gets currently selected login field. 0 is username, and 1 is password. * @@ -165,13 +155,6 @@ public interface Client extends GameEngine */ int getCurrentLoginField(); - /** - * Gets index of current login state. 2 is username/password form, 4 is authenticator form - * - * @return current login state index - */ - int getLoginIndex(); - /** * Gets the account type of the logged in player. * @@ -346,7 +329,7 @@ public interface Client extends GameEngine * @return the corresponding item composition * @see ItemID */ - ItemComposition getItemDefinition(int id); + ItemDefinition getItemDefinition(int id); /** * Creates an item icon sprite with passed variables. @@ -360,7 +343,7 @@ public interface Client extends GameEngine * @param scale the scale of the sprite * @return the created sprite */ - SpritePixels createItemSprite(int itemId, int quantity, int border, int shadowColor, int stackable, boolean noted, int scale); + Sprite createItemSprite(int itemId, int quantity, int border, int shadowColor, int stackable, boolean noted, int scale); /** * Loads and creates the sprite images of the passed archive and file IDs. @@ -370,7 +353,7 @@ public interface Client extends GameEngine * @param fileId the sprites file ID * @return the sprite image of the file */ - SpritePixels[] getSprites(IndexDataBase source, int archiveId, int fileId); + Sprite[] getSprites(IndexDataBase source, int archiveId, int fileId); /** * Gets the sprite index. @@ -450,7 +433,7 @@ public interface Client extends GameEngine /** * Gets the widget that is being dragged on. *

- * The widget being dragged has the {@link net.runelite.api.widgets.WidgetConfig#DRAG_ON} + * The widget being dragged has the {@link api.widgets.WidgetConfig#DRAG_ON} * flag set, and is the widget currently under the dragged widget. * * @return the dragged on widget, null if not dragging any widget @@ -557,7 +540,7 @@ public interface Client extends GameEngine * @return world list */ World[] getWorldList(); - + /** * Gets an array of currently open right-click menu entries that can be * clicked and activated. @@ -569,7 +552,7 @@ public interface Client extends GameEngine /** * Sets the array of open menu entries. *

- * This method should typically be used in the context of the {@link net.runelite.api.events.MenuOpened} + * This method should typically be used in the context of the {@link api.events.MenuOpened} * event, since setting the menu entries will be overwritten the next frame * * @param entries new array of open menu entries @@ -652,13 +635,11 @@ public interface Client extends GameEngine * * @return local player variables */ - @VisibleForDevtools int[] getVarps(); /** * Gets an array of all client variables. */ - @VisibleForDevtools Map getVarcMap(); /** @@ -709,7 +690,6 @@ public interface Client extends GameEngine * @param varbit the variable * @param value the new value */ - @VisibleForDevtools void setSetting(Varbits varbit, int value); /** @@ -720,7 +700,6 @@ public interface Client extends GameEngine * @return the value * @see Varbits#id */ - @VisibleForDevtools int getVarbitValue(int[] varps, int varbitId); /** @@ -731,7 +710,6 @@ public interface Client extends GameEngine * @return the value * @see VarPlayer#id */ - @VisibleForDevtools int getVarpValue(int[] varps, int varpId); /** @@ -742,7 +720,6 @@ public interface Client extends GameEngine * @param value the value * @see VarPlayer#id */ - @VisibleForDevtools void setVarpValue(int[] varps, int varpId, int value); /** @@ -753,7 +730,6 @@ public interface Client extends GameEngine * @param value the value * @see Varbits#id */ - @VisibleForDevtools void setVarbitValue(int[] varps, int varbit, int value); /** @@ -851,7 +827,7 @@ public interface Client extends GameEngine * @return the corresponding object composition * @see ObjectID */ - ObjectComposition getObjectDefinition(int objectId); + ObjectDefinition getObjectDefinition(int objectId); /** * Gets the NPC composition corresponding to an NPCs ID. @@ -860,7 +836,7 @@ public interface Client extends GameEngine * @return the corresponding NPC composition * @see NpcID */ - NPCComposition getNpcDefinition(int npcId); + NPCDefinition getNpcDefinition(int npcId); /** * Gets an array of all world areas @@ -881,7 +857,7 @@ public interface Client extends GameEngine * * @return all mini-map dots */ - SpritePixels[] getMapDots(); + Sprite[] getMapDots(); /** * Gets the local clients game cycle. @@ -897,7 +873,7 @@ public interface Client extends GameEngine * * @return the map icons */ - SpritePixels[] getMapIcons(); + Sprite[] getMapIcons(); /** * Gets an array of mod icon sprites. @@ -929,7 +905,7 @@ public interface Client extends GameEngine * @param height the height * @return the sprite image */ - SpritePixels createSpritePixels(int[] pixels, int width, int height); + Sprite createSprite(int[] pixels, int width, int height); /** * Gets the location of the local player. @@ -944,7 +920,7 @@ public interface Client extends GameEngine * * @return all projectiles */ - List getProjectiles(); + java.util.List getProjectiles(); /** * Gets a list of all graphics objects currently drawn. @@ -1181,7 +1157,7 @@ public interface Client extends GameEngine * factors towards {@code zero} when stretching. * * @param state new integer scaling state - */ + */ void setStretchedIntegerScaling(boolean state); /** @@ -1243,7 +1219,7 @@ public interface Client extends GameEngine * @param z the plane * @return the map sprite */ - SpritePixels drawInstanceMap(int z); + Sprite drawInstanceMap(int z); /** * Executes a client script from the cache @@ -1366,13 +1342,6 @@ public interface Client extends GameEngine */ boolean isInInstancedRegion(); - /** - * Get the number of client ticks an item has been pressed - * - * @return the number of client ticks an item has been pressed - */ - int getItemPressedDuration(); - /** * Sets whether the client is hiding entities. *

@@ -1469,13 +1438,10 @@ public interface Client extends GameEngine @Nullable CollisionData[] getCollisionMaps(); - @VisibleForDevtools int[] getBoostedSkillLevels(); - @VisibleForDevtools int[] getRealSkillLevels(); - @VisibleForDevtools int[] getSkillExperiences(); void queueChangedSkill(Skill skill); @@ -1486,7 +1452,7 @@ public interface Client extends GameEngine * The key value in the map corresponds to the ID of the sprite, * and the value the sprite to replace it with. */ - Map getSpriteOverrides(); + Map getSpriteOverrides(); /** * Gets a mapping of widget sprites to override. @@ -1494,14 +1460,14 @@ public interface Client extends GameEngine * The key value in the map corresponds to the packed widget ID, * and the value the sprite to replace the widgets sprite with. */ - Map getWidgetSpriteOverrides(); + Map getWidgetSpriteOverrides(); /** * Sets the compass sprite. * - * @param spritePixels the new sprite + * @param Sprite the new sprite */ - void setCompass(SpritePixels spritePixels); + void setCompass(Sprite Sprite); /** * Returns widget sprite cache, to be used with {@link Client#getSpriteOverrides()} @@ -1619,19 +1585,6 @@ public interface Client extends GameEngine void checkClickbox(Model model, int orientation, int pitchSin, int pitchCos, int yawSin, int yawCos, int x, int y, int z, long hash); - /** - * Get the if1 widget whose item is being dragged - * - * @return - */ - Widget getIf1DraggedWidget(); - - /** - * Get the item index of the item being dragged on an if1 widget - * @return - */ - int getIf1DraggedItemIndex(); - /** * Sets if a widget is in target mode */ @@ -1640,15 +1593,15 @@ public interface Client extends GameEngine /** * Returns client item composition cache */ - NodeCache getItemCompositionCache(); + NodeCache getItemDefinitionCache(); - EnumComposition getEnum(int id); + EnumDefinition getEnum(int id); void draw2010Menu(); NodeCache getHealthBarCache(); - - void toggleRenderSelf(); + + void setRenderSelf(boolean enabled); /** * @@ -1662,9 +1615,9 @@ public interface Client extends GameEngine * @param canvasY Canvas Y Point */ void invokeMenuAction(int param0, int param1, int type, int id, String menuEntry, String targetString, int canvasX, int canvasY); - + MouseRecorder getMouseRecorder(); - + void setPrintMenuActions(boolean b); - + } diff --git a/runelite-api/src/main/java/net/runelite/api/CollisionData.java b/api/src/main/java/api/CollisionData.java similarity index 97% rename from runelite-api/src/main/java/net/runelite/api/CollisionData.java rename to api/src/main/java/api/CollisionData.java index e3840bcb62..deb1a11fd4 100644 --- a/runelite-api/src/main/java/net/runelite/api/CollisionData.java +++ b/api/src/main/java/api/CollisionData.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * Represents tile collision data for the scene @@ -40,7 +40,7 @@ public interface CollisionData * values can be obtained and used with the {@link CollisionDataFlag} class. * * @return all collision flags for the tiles in the scene - * @see Constants#SCENE_SIZE + * @see api.config.Constants#SCENE_SIZE */ int[][] getFlags(); } \ No newline at end of file diff --git a/runelite-api/src/main/java/net/runelite/api/CollisionDataFlag.java b/api/src/main/java/api/CollisionDataFlag.java similarity index 99% rename from runelite-api/src/main/java/net/runelite/api/CollisionDataFlag.java rename to api/src/main/java/api/CollisionDataFlag.java index b6deb09863..c7ef4a28cb 100644 --- a/runelite-api/src/main/java/net/runelite/api/CollisionDataFlag.java +++ b/api/src/main/java/api/CollisionDataFlag.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * A utility class containing collision data flags for tiles. diff --git a/runelite-api/src/main/java/net/runelite/api/Constants.java b/api/src/main/java/api/Constants.java similarity index 99% rename from runelite-api/src/main/java/net/runelite/api/Constants.java rename to api/src/main/java/api/Constants.java index 2d8ea3deed..8fff5d1c52 100644 --- a/runelite-api/src/main/java/net/runelite/api/Constants.java +++ b/api/src/main/java/api/Constants.java @@ -23,7 +23,7 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; import java.awt.Dimension; diff --git a/runelite-api/src/main/java/net/runelite/api/DecorativeObject.java b/api/src/main/java/api/DecorativeObject.java similarity index 96% rename from runelite-api/src/main/java/net/runelite/api/DecorativeObject.java rename to api/src/main/java/api/DecorativeObject.java index 145531fa5d..d4408361c2 100644 --- a/runelite-api/src/main/java/net/runelite/api/DecorativeObject.java +++ b/api/src/main/java/api/DecorativeObject.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; import java.awt.Polygon; @@ -35,7 +35,7 @@ public interface DecorativeObject extends TileObject * Gets the convex hull of the objects model. * * @return the convex hull - * @see net.runelite.api.model.Jarvis + * @see api.model.Jarvis */ Polygon getConvexHull(); Polygon getConvexHull2(); diff --git a/runelite-api/src/main/java/net/runelite/api/EnumComposition.java b/api/src/main/java/api/EnumDefinition.java similarity index 96% rename from runelite-api/src/main/java/net/runelite/api/EnumComposition.java rename to api/src/main/java/api/EnumDefinition.java index 00f8c30814..6793a150a3 100644 --- a/runelite-api/src/main/java/net/runelite/api/EnumComposition.java +++ b/api/src/main/java/api/EnumDefinition.java @@ -22,9 +22,9 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; -public interface EnumComposition +public interface EnumDefinition { int[] getKeys(); diff --git a/runelite-api/src/main/java/net/runelite/api/EnumID.java b/api/src/main/java/api/EnumID.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/EnumID.java rename to api/src/main/java/api/EnumID.java index bb4ec6fa7b..2c969fdc0d 100644 --- a/runelite-api/src/main/java/net/runelite/api/EnumID.java +++ b/api/src/main/java/api/EnumID.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * Utility class used for mapping enum IDs. diff --git a/runelite-api/src/main/java/net/runelite/api/EquipmentInventorySlot.java b/api/src/main/java/api/EquipmentInventorySlot.java similarity index 95% rename from runelite-api/src/main/java/net/runelite/api/EquipmentInventorySlot.java rename to api/src/main/java/api/EquipmentInventorySlot.java index 6c4064549d..3db1a16926 100644 --- a/runelite-api/src/main/java/net/runelite/api/EquipmentInventorySlot.java +++ b/api/src/main/java/api/EquipmentInventorySlot.java @@ -22,14 +22,14 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * An enumeration of equipment slots in the inventory {@link ItemContainer}. *

* These values are intended for use with the local players equipment * {@link ItemContainer} corresponding. For obtaining information about equipment - * in the {@link PlayerComposition}, use {@link net.runelite.api.kit.KitType}. + * in the {@link PlayerAppearance}, use {@link api.kit.KitType}. * * @see Client#getItemContainer(InventoryID) * @see InventoryID#EQUIPMENT diff --git a/runelite-api/src/main/java/net/runelite/api/Experience.java b/api/src/main/java/api/Experience.java similarity index 99% rename from runelite-api/src/main/java/net/runelite/api/Experience.java rename to api/src/main/java/api/Experience.java index d83a61c97b..e8cb2f6b25 100644 --- a/runelite-api/src/main/java/net/runelite/api/Experience.java +++ b/api/src/main/java/api/Experience.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * A utility class used for calculating experience related values. diff --git a/runelite-api/src/main/java/net/runelite/api/Favour.java b/api/src/main/java/api/Favour.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/Favour.java rename to api/src/main/java/api/Favour.java index 38904257b1..a1c5569970 100644 --- a/runelite-api/src/main/java/net/runelite/api/Favour.java +++ b/api/src/main/java/api/Favour.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/runelite-api/src/main/java/net/runelite/api/FontID.java b/api/src/main/java/api/FontID.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/FontID.java rename to api/src/main/java/api/FontID.java index 6f9c391e3c..0126d9dad8 100644 --- a/runelite-api/src/main/java/net/runelite/api/FontID.java +++ b/api/src/main/java/api/FontID.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * IDs of fonts in the cache diff --git a/runelite-api/src/main/java/net/runelite/api/FontTypeFace.java b/api/src/main/java/api/FontTypeFace.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/FontTypeFace.java rename to api/src/main/java/api/FontTypeFace.java index 59241300b3..096a659584 100644 --- a/runelite-api/src/main/java/net/runelite/api/FontTypeFace.java +++ b/api/src/main/java/api/FontTypeFace.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * A bitmap Font in Jagex's format diff --git a/runelite-api/src/main/java/net/runelite/api/Friend.java b/api/src/main/java/api/Friend.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/Friend.java rename to api/src/main/java/api/Friend.java index 7b28e18a67..a3fc135b3e 100644 --- a/runelite-api/src/main/java/net/runelite/api/Friend.java +++ b/api/src/main/java/api/Friend.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * Represents a player in the friends list. diff --git a/runelite-api/src/main/java/net/runelite/api/FriendManager.java b/api/src/main/java/api/FriendManager.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/FriendManager.java rename to api/src/main/java/api/FriendManager.java index 4bdd5a496f..2ab01a92d4 100644 --- a/runelite-api/src/main/java/net/runelite/api/FriendManager.java +++ b/api/src/main/java/api/FriendManager.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * Represents the friend and ignore list manager. diff --git a/runelite-api/src/main/java/net/runelite/api/GameObject.java b/api/src/main/java/api/GameObject.java similarity index 95% rename from runelite-api/src/main/java/net/runelite/api/GameObject.java rename to api/src/main/java/api/GameObject.java index c721f35067..9ed942d75f 100644 --- a/runelite-api/src/main/java/net/runelite/api/GameObject.java +++ b/api/src/main/java/api/GameObject.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.api; +package api; +import api.coords.Angle; import java.awt.Polygon; -import net.runelite.api.coords.Angle; /** * Represents a game object. @@ -57,7 +57,7 @@ public interface GameObject extends TileObject * Gets the convex hull of the actors model. * * @return the convex hull - * @see net.runelite.api.model.Jarvis + * @see api.model.Jarvis */ Polygon getConvexHull(); diff --git a/runelite-api/src/main/java/net/runelite/api/GameEngine.java b/api/src/main/java/api/GameShell.java similarity index 94% rename from runelite-api/src/main/java/net/runelite/api/GameEngine.java rename to api/src/main/java/api/GameShell.java index 30faa9691d..7df74c7d9c 100644 --- a/runelite-api/src/main/java/net/runelite/api/GameEngine.java +++ b/api/src/main/java/api/GameShell.java @@ -22,14 +22,15 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; +import api.hooks.DrawCallbacks; import java.awt.Canvas; /** * Represents the client game engine. */ -public interface GameEngine +public interface GameShell { /** * Gets the canvas that contains everything. @@ -52,5 +53,7 @@ public interface GameEngine */ boolean isClientThread(); + DrawCallbacks getDrawCallbacks(); + void resizeCanvas(); } diff --git a/runelite-api/src/main/java/net/runelite/api/GameState.java b/api/src/main/java/api/GameState.java similarity index 94% rename from runelite-api/src/main/java/net/runelite/api/GameState.java rename to api/src/main/java/api/GameState.java index 5f9083f9ca..f6c5bd7e18 100644 --- a/runelite-api/src/main/java/net/runelite/api/GameState.java +++ b/api/src/main/java/api/GameState.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * An enumeration of game states the client is in. @@ -41,10 +41,6 @@ public enum GameState * The client is at the login screen. */ LOGIN_SCREEN(10), - /** - * The client is at the login screen entering authenticator code. - */ - LOGIN_SCREEN_AUTHENTICATOR(11), /** * There is a player logging in. */ diff --git a/api/src/main/java/api/GrandExchangeOffer.java b/api/src/main/java/api/GrandExchangeOffer.java new file mode 100644 index 0000000000..c0a41dd515 --- /dev/null +++ b/api/src/main/java/api/GrandExchangeOffer.java @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000000..6d374dd7e6 --- /dev/null +++ b/api/src/main/java/api/GrandExchangeOfferState.java @@ -0,0 +1,36 @@ +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/runelite-api/src/main/java/net/runelite/api/GraphicID.java b/api/src/main/java/api/GraphicID.java similarity index 97% rename from runelite-api/src/main/java/net/runelite/api/GraphicID.java rename to api/src/main/java/api/GraphicID.java index 17b47c4224..3b34cb01b0 100644 --- a/runelite-api/src/main/java/net/runelite/api/GraphicID.java +++ b/api/src/main/java/api/GraphicID.java @@ -23,11 +23,10 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; public class GraphicID { - public static final int WINE_MAKE = 47; public static final int SPLASH = 85; public static final int GREY_BUBBLE_TELEPORT = 86; public static final int TELEPORT = 111; diff --git a/runelite-api/src/main/java/net/runelite/api/GraphicsObject.java b/api/src/main/java/api/GraphicsObject.java similarity index 96% rename from runelite-api/src/main/java/net/runelite/api/GraphicsObject.java rename to api/src/main/java/api/GraphicsObject.java index a9edebc90d..d66f1a0bfa 100644 --- a/runelite-api/src/main/java/net/runelite/api/GraphicsObject.java +++ b/api/src/main/java/api/GraphicsObject.java @@ -22,9 +22,9 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; -import net.runelite.api.coords.LocalPoint; +import api.coords.LocalPoint; /** * Represents a graphics object. diff --git a/runelite-api/src/main/java/net/runelite/api/GroundObject.java b/api/src/main/java/api/GroundObject.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/GroundObject.java rename to api/src/main/java/api/GroundObject.java index 8a974cd752..9c1ad358d5 100644 --- a/runelite-api/src/main/java/net/runelite/api/GroundObject.java +++ b/api/src/main/java/api/GroundObject.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * Represents an object on the ground of a tile. diff --git a/api/src/main/java/api/HashTable.java b/api/src/main/java/api/HashTable.java new file mode 100644 index 0000000000..fe2dd3f1a6 --- /dev/null +++ b/api/src/main/java/api/HashTable.java @@ -0,0 +1,25 @@ +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/runelite-api/src/main/java/net/runelite/api/HeadIcon.java b/api/src/main/java/api/HeadIcon.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/HeadIcon.java rename to api/src/main/java/api/HeadIcon.java index 6f70220ba9..9b071c6e51 100644 --- a/runelite-api/src/main/java/net/runelite/api/HeadIcon.java +++ b/api/src/main/java/api/HeadIcon.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * An enumeration of prayer icons above the head. diff --git a/runelite-api/src/main/java/net/runelite/api/HealthBar.java b/api/src/main/java/api/HealthBar.java similarity index 93% rename from runelite-api/src/main/java/net/runelite/api/HealthBar.java rename to api/src/main/java/api/HealthBar.java index 2ffeedca28..129d5426c3 100644 --- a/runelite-api/src/main/java/net/runelite/api/HealthBar.java +++ b/api/src/main/java/api/HealthBar.java @@ -22,13 +22,13 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; public interface HealthBar { - SpritePixels getHealthBarFrontSprite(); + Sprite getHealthBarFrontSprite(); - SpritePixels getHealthBarBackSprite(); + Sprite getHealthBarBackSprite(); void setPadding(int padding); } diff --git a/runelite-api/src/main/java/net/runelite/api/HealthBarOverride.java b/api/src/main/java/api/HealthBarOverride.java similarity index 88% rename from runelite-api/src/main/java/net/runelite/api/HealthBarOverride.java rename to api/src/main/java/api/HealthBarOverride.java index b53b480518..8df07ca4d9 100644 --- a/runelite-api/src/main/java/net/runelite/api/HealthBarOverride.java +++ b/api/src/main/java/api/HealthBarOverride.java @@ -23,15 +23,15 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; import lombok.Data; @Data public class HealthBarOverride { - public final SpritePixels frontSprite; - public final SpritePixels backSprite; - public final SpritePixels frontSpriteLarge; - public final SpritePixels backSpriteLarge; + public final Sprite frontSprite; + public final Sprite backSprite; + public final Sprite frontSpriteLarge; + public final Sprite backSpriteLarge; } diff --git a/runelite-api/src/main/java/net/runelite/api/HintArrowType.java b/api/src/main/java/api/HintArrowType.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/HintArrowType.java rename to api/src/main/java/api/HintArrowType.java index 8aae44cef3..b846d2b880 100644 --- a/runelite-api/src/main/java/net/runelite/api/HintArrowType.java +++ b/api/src/main/java/api/HintArrowType.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/runelite-api/src/main/java/net/runelite/api/Hitsplat.java b/api/src/main/java/api/Hitsplat.java similarity index 99% rename from runelite-api/src/main/java/net/runelite/api/Hitsplat.java rename to api/src/main/java/api/Hitsplat.java index cb8290d56f..31f01d5c1d 100644 --- a/runelite-api/src/main/java/net/runelite/api/Hitsplat.java +++ b/api/src/main/java/api/Hitsplat.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; import lombok.Getter; diff --git a/runelite-api/src/main/java/net/runelite/api/IconID.java b/api/src/main/java/api/IconID.java similarity index 95% rename from runelite-api/src/main/java/net/runelite/api/IconID.java rename to api/src/main/java/api/IconID.java index 7874179a3f..01d9ba7d4a 100644 --- a/runelite-api/src/main/java/net/runelite/api/IconID.java +++ b/api/src/main/java/api/IconID.java @@ -1,58 +1,58 @@ -/* - * Copyright (c) 2018, Hydrox6 - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package net.runelite.api; - -import lombok.Getter; -import lombok.RequiredArgsConstructor; - -/** - * Enum of all official icons that Jagex uses in chat. - */ -@RequiredArgsConstructor -@Getter -public enum IconID -{ - PLAYER_MODERATOR(0), - JAGEX_MODERATOR(1), - IRONMAN(2), - ULTIMATE_IRONMAN(3), - DMM_SKULL_5_KEYS(4), - DMM_SKULL_4_KEYS(5), - DMM_SKULL_3_KEYS(6), - DMM_SKULL_2_KEYS(7), - DMM_SKULL_1_KEYS(8), - SKULL(9), - HARDCORE_IRONMAN(10), - NO_ENTRY(11), - CHAIN_LINK(12); - - private final int index; - - @Override - public String toString() - { - return ""; - } -} +/* + * Copyright (c) 2018, Hydrox6 + * 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 api; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +/** + * Enum of all official icons that Jagex uses in chat. + */ +@RequiredArgsConstructor +@Getter +public enum IconID +{ + PLAYER_MODERATOR(0), + JAGEX_MODERATOR(1), + IRONMAN(2), + ULTIMATE_IRONMAN(3), + DMM_SKULL_5_KEYS(4), + DMM_SKULL_4_KEYS(5), + DMM_SKULL_3_KEYS(6), + DMM_SKULL_2_KEYS(7), + DMM_SKULL_1_KEYS(8), + SKULL(9), + HARDCORE_IRONMAN(10), + NO_ENTRY(11), + CHAIN_LINK(12); + + private final int index; + + @Override + public String toString() + { + return ""; + } +} diff --git a/runelite-api/src/main/java/net/runelite/api/Ignore.java b/api/src/main/java/api/Ignore.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/Ignore.java rename to api/src/main/java/api/Ignore.java index 52f42e0aaa..2a24897689 100644 --- a/runelite-api/src/main/java/net/runelite/api/Ignore.java +++ b/api/src/main/java/api/Ignore.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * An entry on the ignore list. diff --git a/api/src/main/java/api/IndexDataBase.java b/api/src/main/java/api/IndexDataBase.java new file mode 100644 index 0000000000..731eeffed7 --- /dev/null +++ b/api/src/main/java/api/IndexDataBase.java @@ -0,0 +1,12 @@ +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/runelite-api/src/main/java/net/runelite/api/IndexedSprite.java b/api/src/main/java/api/IndexedSprite.java similarity index 99% rename from runelite-api/src/main/java/net/runelite/api/IndexedSprite.java rename to api/src/main/java/api/IndexedSprite.java index b033ef61e9..817d55ecc8 100644 --- a/runelite-api/src/main/java/net/runelite/api/IndexedSprite.java +++ b/api/src/main/java/api/IndexedSprite.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * Represents an indexed sprite. diff --git a/runelite-api/src/main/java/net/runelite/api/InstanceTemplates.java b/api/src/main/java/api/InstanceTemplates.java similarity index 99% rename from runelite-api/src/main/java/net/runelite/api/InstanceTemplates.java rename to api/src/main/java/api/InstanceTemplates.java index fe9d50a651..ac3fe4572d 100644 --- a/runelite-api/src/main/java/net/runelite/api/InstanceTemplates.java +++ b/api/src/main/java/api/InstanceTemplates.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/runelite-api/src/main/java/net/runelite/api/IntegerNode.java b/api/src/main/java/api/IntegerNode.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/IntegerNode.java rename to api/src/main/java/api/IntegerNode.java index 839301ec5a..84d84729e9 100644 --- a/runelite-api/src/main/java/net/runelite/api/IntegerNode.java +++ b/api/src/main/java/api/IntegerNode.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * Represents an integer typically in a {@link HashTable}. diff --git a/runelite-api/src/main/java/net/runelite/api/InventoryID.java b/api/src/main/java/api/InventoryID.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/InventoryID.java rename to api/src/main/java/api/InventoryID.java index df3f995df9..1122304a57 100644 --- a/runelite-api/src/main/java/net/runelite/api/InventoryID.java +++ b/api/src/main/java/api/InventoryID.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * An enumeration of possible inventory types. diff --git a/runelite-api/src/main/java/net/runelite/api/Item.java b/api/src/main/java/api/Item.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/Item.java rename to api/src/main/java/api/Item.java index 811b02b0a4..81e4ae0373 100644 --- a/runelite-api/src/main/java/net/runelite/api/Item.java +++ b/api/src/main/java/api/Item.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * Represents an item inside an {@link ItemContainer}. diff --git a/runelite-api/src/main/java/net/runelite/api/ItemContainer.java b/api/src/main/java/api/ItemContainer.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/ItemContainer.java rename to api/src/main/java/api/ItemContainer.java index e547ca03f8..9c73bb255d 100644 --- a/runelite-api/src/main/java/net/runelite/api/ItemContainer.java +++ b/api/src/main/java/api/ItemContainer.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * Represents an inventory that contains items. diff --git a/runelite-api/src/main/java/net/runelite/api/ItemComposition.java b/api/src/main/java/api/ItemDefinition.java similarity index 64% rename from runelite-api/src/main/java/net/runelite/api/ItemComposition.java rename to api/src/main/java/api/ItemDefinition.java index eaaed4e2aa..4d89a0b618 100644 --- a/runelite-api/src/main/java/net/runelite/api/ItemComposition.java +++ b/api/src/main/java/api/ItemDefinition.java @@ -1,33 +1,9 @@ -/* - * 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.api; +package api; /** * Represents the template of a specific item type. */ -public interface ItemComposition +public interface ItemDefinition { /** * Gets the items name. diff --git a/runelite-api/src/main/java/net/runelite/api/ItemID.java b/api/src/main/java/api/ItemID.java similarity index 99% rename from runelite-api/src/main/java/net/runelite/api/ItemID.java rename to api/src/main/java/api/ItemID.java index 517d093058..d534c0e379 100644 --- a/runelite-api/src/main/java/net/runelite/api/ItemID.java +++ b/api/src/main/java/api/ItemID.java @@ -1,5 +1,5 @@ /* This file is automatically generated. Do not edit. */ -package net.runelite.api; +package api; public final class ItemID { @@ -6618,7 +6618,6 @@ public final class ItemID public static final int NO_EGGS = 10563; public static final int GRANITE_BODY = 10564; public static final int FIRE_CAPE_10566 = 10566; - public static final int HEALER_ICON_10567 = 10567; public static final int KERIS = 10581; public static final int KERISP = 10582; public static final int KERISP_10583 = 10583; @@ -9484,7 +9483,6 @@ public final class ItemID public static final int KINDLING_20799 = 20799; public static final int EMPTY_GOURD_VIAL = 20800; public static final int WATERFILLED_GOURD_VIAL = 20801; - public static final int HEALER_ICON_20802 = 20802; public static final int SNOW_GLOBE = 20832; public static final int SACK_OF_PRESENTS = 20834; public static final int GIANT_PRESENT = 20836; @@ -10307,14 +10305,6 @@ public final class ItemID public static final int ANCIENT_MEDALLION = 22299; public static final int ANCIENT_EFFIGY = 22302; public static final int ANCIENT_RELIC = 22305; - public static final int HEALER_ICON_22308 = 22308; - public static final int HEALER_ICON_22309 = 22309; - public static final int HEALER_ICON_22310 = 22310; - public static final int HEALER_ICON_22311 = 22311; - public static final int COLLECTOR_ICON_22312 = 22312; - public static final int COLLECTOR_ICON_22313 = 22313; - public static final int COLLECTOR_ICON_22314 = 22314; - public static final int COLLECTOR_ICON_22315 = 22315; public static final int PROP_SWORD = 22316; public static final int PET_CORPOREAL_CRITTER = 22318; public static final int TZREKZUK = 22319; @@ -10331,19 +10321,6 @@ public final class ItemID public static final int STARTER_SWORD = 22331; public static final int STARTER_BOW = 22333; public static final int STARTER_STAFF = 22335; - public static final int COLLECTOR_ICON_22337 = 22337; - public static final int COLLECTOR_ICON_22338 = 22338; - public static final int COLLECTOR_ICON_22339 = 22339; - public static final int DEFENDER_ICON_22340 = 22340; - public static final int DEFENDER_ICON_22341 = 22341; - public static final int DEFENDER_ICON_22342 = 22342; - public static final int DEFENDER_ICON_22343 = 22343; - public static final int DEFENDER_ICON_22344 = 22344; - public static final int DEFENDER_ICON_22345 = 22345; - public static final int ATTACKER_ICON_22346 = 22346; - public static final int ATTACKER_ICON_22347 = 22347; - public static final int ATTACKER_ICON_22348 = 22348; - public static final int ATTACKER_ICON_22349 = 22349; public static final int EGGSHELL_PLATEBODY = 22351; public static final int EGGSHELL_PLATELEGS = 22353; public static final int HOLY_HANDEGG = 22355; @@ -10510,16 +10487,6 @@ public final class ItemID public static final int TREE_TOP = 22715; public static final int TREE_SKIRT = 22717; public static final int CANDY_CANE = 22719; - public static final int ATTACKER_ICON_22721 = 22721; - public static final int ATTACKER_ICON_22722 = 22722; - public static final int ATTACKER_ICON_22723 = 22723; - public static final int COLLECTOR_ICON_22724 = 22724; - public static final int DEFENDER_ICON_22725 = 22725; - public static final int DEFENDER_ICON_22726 = 22726; - public static final int DEFENDER_ICON_22727 = 22727; - public static final int DEFENDER_ICON_22728 = 22728; - public static final int ATTACKER_ICON_22729 = 22729; - public static final int ATTACKER_ICON_22730 = 22730; public static final int DRAGON_HASTA = 22731; public static final int DRAGON_HASTAP = 22734; public static final int DRAGON_HASTAP_22737 = 22737; @@ -10824,33 +10791,5 @@ public final class ItemID public static final int TORMENTED_BRACELET_OR = 23444; public static final int GIANT_EASTER_EGG = 23446; public static final int BUNNYMAN_MASK = 23448; - public static final int ENCHANTED_LYREI = 23458; - public static final int ATTACKER_ICON_23460 = 23460; - public static final int ATTACKER_ICON_23461 = 23461; - public static final int ATTACKER_ICON_23462 = 23462; - public static final int ATTACKER_ICON_23463 = 23463; - public static final int ATTACKER_ICON_23464 = 23464; - public static final int ATTACKER_ICON_23465 = 23465; - public static final int DEFENDER_ICON_23466 = 23466; - public static final int DEFENDER_ICON_23467 = 23467; - public static final int DEFENDER_ICON_23468 = 23468; - public static final int DEFENDER_ICON_23469 = 23469; - public static final int DEFENDER_ICON_23470 = 23470; - public static final int COLLECTOR_ICON_23471 = 23471; - public static final int COLLECTOR_ICON_23472 = 23472; - public static final int COLLECTOR_ICON_23473 = 23473; - public static final int COLLECTOR_ICON_23474 = 23474; - public static final int COLLECTOR_ICON_23475 = 23475; - public static final int COLLECTOR_ICON_23476 = 23476; - public static final int COLLECTOR_ICON_23477 = 23477; - public static final int HEALER_ICON_23478 = 23478; - public static final int HEALER_ICON_23479 = 23479; - public static final int HEALER_ICON_23480 = 23480; - public static final int HEALER_ICON_23481 = 23481; - public static final int HEALER_ICON_23482 = 23482; - public static final int HEALER_ICON_23483 = 23483; - public static final int HEALER_ICON_23484 = 23484; - public static final int HEALER_ICON_23485 = 23485; - public static final int HEALER_ICON_23486 = 23486; /* This file is automatically generated. Do not edit. */ } diff --git a/runelite-api/src/main/java/net/runelite/api/ItemLayer.java b/api/src/main/java/api/ItemLayer.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/ItemLayer.java rename to api/src/main/java/api/ItemLayer.java index 7be0b4b20b..b288b757f8 100644 --- a/runelite-api/src/main/java/net/runelite/api/ItemLayer.java +++ b/api/src/main/java/api/ItemLayer.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * Represents a pile of items held by a tile. diff --git a/runelite-api/src/main/java/net/runelite/api/IterableHashTable.java b/api/src/main/java/api/IterableHashTable.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/IterableHashTable.java rename to api/src/main/java/api/IterableHashTable.java index bc8c23ccd9..a527f5c0b7 100644 --- a/runelite-api/src/main/java/net/runelite/api/IterableHashTable.java +++ b/api/src/main/java/api/IterableHashTable.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; public interface IterableHashTable extends Iterable { diff --git a/runelite-api/src/main/java/net/runelite/api/KeyFocusListener.java b/api/src/main/java/api/KeyFocusListener.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/KeyFocusListener.java rename to api/src/main/java/api/KeyFocusListener.java index 990c200086..dcd840ad4f 100644 --- a/runelite-api/src/main/java/net/runelite/api/KeyFocusListener.java +++ b/api/src/main/java/api/KeyFocusListener.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * Detects when the window is focused or unfocused. diff --git a/runelite-api/src/main/java/net/runelite/api/MainBufferProvider.java b/api/src/main/java/api/MainBufferProvider.java similarity index 97% rename from runelite-api/src/main/java/net/runelite/api/MainBufferProvider.java rename to api/src/main/java/api/MainBufferProvider.java index 33b3fea3f0..5a9342480d 100644 --- a/runelite-api/src/main/java/net/runelite/api/MainBufferProvider.java +++ b/api/src/main/java/api/MainBufferProvider.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; import java.awt.Image; @@ -36,5 +36,5 @@ public interface MainBufferProvider * * @return the loaded image */ - Image getImage(); + Image getImage(); //TODO } diff --git a/runelite-api/src/main/java/net/runelite/api/MapElementConfig.java b/api/src/main/java/api/MapElementConfig.java similarity index 95% rename from runelite-api/src/main/java/net/runelite/api/MapElementConfig.java rename to api/src/main/java/api/MapElementConfig.java index 5ed46e25b9..0d403ca525 100644 --- a/runelite-api/src/main/java/net/runelite/api/MapElementConfig.java +++ b/api/src/main/java/api/MapElementConfig.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * Represents an area in the world. @@ -35,5 +35,5 @@ public interface MapElementConfig * @param unused unused value * @return the sprite icon to display on the world map */ - SpritePixels getMapIcon(boolean unused); + Sprite getMapIcon(boolean unused); } diff --git a/runelite-api/src/main/java/net/runelite/api/MenuAction.java b/api/src/main/java/api/MenuAction.java similarity index 99% rename from runelite-api/src/main/java/net/runelite/api/MenuAction.java rename to api/src/main/java/api/MenuAction.java index cafbbe7706..138c48eaac 100644 --- a/runelite-api/src/main/java/net/runelite/api/MenuAction.java +++ b/api/src/main/java/api/MenuAction.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; import java.util.HashMap; import java.util.Map; diff --git a/runelite-api/src/main/java/net/runelite/api/MenuEntry.java b/api/src/main/java/api/MenuEntry.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/MenuEntry.java rename to api/src/main/java/api/MenuEntry.java index 6d9cc751f4..eb063560a6 100644 --- a/runelite-api/src/main/java/net/runelite/api/MenuEntry.java +++ b/api/src/main/java/api/MenuEntry.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; import lombok.Data; diff --git a/runelite-api/src/main/java/net/runelite/api/MessageNode.java b/api/src/main/java/api/MessageNode.java similarity index 99% rename from runelite-api/src/main/java/net/runelite/api/MessageNode.java rename to api/src/main/java/api/MessageNode.java index 3419d955ac..35257cc0d4 100644 --- a/runelite-api/src/main/java/net/runelite/api/MessageNode.java +++ b/api/src/main/java/api/MessageNode.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * Represents a message in the chatbox. diff --git a/runelite-api/src/main/java/net/runelite/api/Model.java b/api/src/main/java/api/Model.java similarity index 96% rename from runelite-api/src/main/java/net/runelite/api/Model.java rename to api/src/main/java/api/Model.java index c287b2afd1..41bba14b4c 100644 --- a/runelite-api/src/main/java/net/runelite/api/Model.java +++ b/api/src/main/java/api/Model.java @@ -22,11 +22,11 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; +import api.model.Triangle; +import api.model.Vertex; import java.util.List; -import net.runelite.api.model.Triangle; -import net.runelite.api.model.Vertex; /** * Represents the model of an object. diff --git a/runelite-api/src/main/java/net/runelite/api/MouseRecorder.java b/api/src/main/java/api/MouseRecorder.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/MouseRecorder.java rename to api/src/main/java/api/MouseRecorder.java index 663a4d85c9..a5210d7027 100644 --- a/runelite-api/src/main/java/net/runelite/api/MouseRecorder.java +++ b/api/src/main/java/api/MouseRecorder.java @@ -23,7 +23,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; public interface MouseRecorder { diff --git a/runelite-api/src/main/java/net/runelite/api/NPC.java b/api/src/main/java/api/NPC.java similarity index 91% rename from runelite-api/src/main/java/net/runelite/api/NPC.java rename to api/src/main/java/api/NPC.java index d0647604b7..22073e92ba 100644 --- a/runelite-api/src/main/java/net/runelite/api/NPC.java +++ b/api/src/main/java/api/NPC.java @@ -22,9 +22,10 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; import javax.annotation.Nullable; +import rs.api.RSNPCDefinition; /** * Represents a non-player character in the game. @@ -35,7 +36,7 @@ public interface NPC extends Actor * Gets the ID of the NPC. * * @return the ID of the NPC - * @see NpcID + * //@see NpcID */ int getId(); @@ -59,7 +60,7 @@ public interface NPC extends Actor * * @return the composition */ - NPCComposition getComposition(); + NPCDefinition getDefinition(); /** * Get the composition for this NPC and transform it if required @@ -67,7 +68,7 @@ public interface NPC extends Actor * @return the transformed NPC */ @Nullable - NPCComposition getTransformedComposition(); + NPCDefinition getTransformedDefinition(); /** * Returns true if this NPC has died @@ -75,4 +76,6 @@ public interface NPC extends Actor * @return */ boolean isDead(); + + void onDefinitionChanged(RSNPCDefinition composition); } diff --git a/api/src/main/java/api/NPCDefinition.java b/api/src/main/java/api/NPCDefinition.java new file mode 100644 index 0000000000..15d0b19ca2 --- /dev/null +++ b/api/src/main/java/api/NPCDefinition.java @@ -0,0 +1,90 @@ +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/runelite-api/src/main/java/net/runelite/api/Nameable.java b/api/src/main/java/api/Nameable.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/Nameable.java rename to api/src/main/java/api/Nameable.java index 081074594e..13c83650fa 100644 --- a/runelite-api/src/main/java/net/runelite/api/Nameable.java +++ b/api/src/main/java/api/Nameable.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * Represents a chat entity that has a name. diff --git a/runelite-api/src/main/java/net/runelite/api/Node.java b/api/src/main/java/api/Node.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/Node.java rename to api/src/main/java/api/Node.java index 56d2755e74..dfadcf484f 100644 --- a/runelite-api/src/main/java/net/runelite/api/Node.java +++ b/api/src/main/java/api/Node.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * Represents a doubly linked node. diff --git a/runelite-api/src/main/java/net/runelite/api/NodeCache.java b/api/src/main/java/api/NodeCache.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/NodeCache.java rename to api/src/main/java/api/NodeCache.java index e6d8f8208b..6bb3a08813 100644 --- a/runelite-api/src/main/java/net/runelite/api/NodeCache.java +++ b/api/src/main/java/api/NodeCache.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * Represents a doubly linked node cache. diff --git a/runelite-api/src/main/java/net/runelite/api/NpcID.java b/api/src/main/java/api/NpcID.java similarity index 99% rename from runelite-api/src/main/java/net/runelite/api/NpcID.java rename to api/src/main/java/api/NpcID.java index 1ab55200fd..b492b81a0b 100644 --- a/runelite-api/src/main/java/net/runelite/api/NpcID.java +++ b/api/src/main/java/api/NpcID.java @@ -1,5 +1,5 @@ /* This file is automatically generated. Do not edit. */ -package net.runelite.api; +package api; public final class NpcID { diff --git a/runelite-api/src/main/java/net/runelite/api/NullItemID.java b/api/src/main/java/api/NullItemID.java similarity index 99% rename from runelite-api/src/main/java/net/runelite/api/NullItemID.java rename to api/src/main/java/api/NullItemID.java index 9007300837..e974930440 100644 --- a/runelite-api/src/main/java/net/runelite/api/NullItemID.java +++ b/api/src/main/java/api/NullItemID.java @@ -1,5 +1,5 @@ /* This file is automatically generated. Do not edit. */ -package net.runelite.api; +package api; public final class NullItemID { @@ -3834,6 +3834,7 @@ public final class NullItemID public static final int NULL_10509 = 10509; public static final int NULL_10511 = 10511; public static final int NULL_10565 = 10565; + public static final int NULL_10567 = 10567; public static final int NULL_10568 = 10568; public static final int NULL_10569 = 10569; public static final int NULL_10570 = 10570; @@ -11131,6 +11132,7 @@ public final class NullItemID public static final int NULL_20793 = 20793; public static final int NULL_20795 = 20795; public static final int NULL_20797 = 20797; + public static final int NULL_20802 = 20802; public static final int NULL_20803 = 20803; public static final int NULL_20804 = 20804; public static final int NULL_20805 = 20805; @@ -11814,11 +11816,32 @@ public final class NullItemID public static final int NULL_22304 = 22304; public static final int NULL_22306 = 22306; public static final int NULL_22307 = 22307; + public static final int NULL_22308 = 22308; + public static final int NULL_22309 = 22309; + public static final int NULL_22310 = 22310; + public static final int NULL_22311 = 22311; + public static final int NULL_22312 = 22312; + public static final int NULL_22313 = 22313; + public static final int NULL_22314 = 22314; + public static final int NULL_22315 = 22315; public static final int NULL_22317 = 22317; public static final int NULL_22329 = 22329; public static final int NULL_22332 = 22332; public static final int NULL_22334 = 22334; public static final int NULL_22336 = 22336; + public static final int NULL_22337 = 22337; + public static final int NULL_22338 = 22338; + public static final int NULL_22339 = 22339; + public static final int NULL_22340 = 22340; + public static final int NULL_22341 = 22341; + public static final int NULL_22342 = 22342; + public static final int NULL_22343 = 22343; + public static final int NULL_22344 = 22344; + public static final int NULL_22345 = 22345; + public static final int NULL_22346 = 22346; + public static final int NULL_22347 = 22347; + public static final int NULL_22348 = 22348; + public static final int NULL_22349 = 22349; public static final int NULL_22350 = 22350; public static final int NULL_22352 = 22352; public static final int NULL_22354 = 22354; @@ -12024,6 +12047,16 @@ public final class NullItemID public static final int NULL_22716 = 22716; public static final int NULL_22718 = 22718; public static final int NULL_22720 = 22720; + public static final int NULL_22721 = 22721; + public static final int NULL_22722 = 22722; + public static final int NULL_22723 = 22723; + public static final int NULL_22724 = 22724; + public static final int NULL_22725 = 22725; + public static final int NULL_22726 = 22726; + public static final int NULL_22727 = 22727; + public static final int NULL_22728 = 22728; + public static final int NULL_22729 = 22729; + public static final int NULL_22730 = 22730; public static final int NULL_22732 = 22732; public static final int NULL_22733 = 22733; public static final int NULL_22735 = 22735; @@ -12423,6 +12456,5 @@ public final class NullItemID public static final int NULL_23455 = 23455; public static final int NULL_23456 = 23456; public static final int NULL_23457 = 23457; - public static final int NULL_23459 = 23459; /* This file is automatically generated. Do not edit. */ } diff --git a/runelite-api/src/main/java/net/runelite/api/NullObjectID.java b/api/src/main/java/api/NullObjectID.java similarity index 99% rename from runelite-api/src/main/java/net/runelite/api/NullObjectID.java rename to api/src/main/java/api/NullObjectID.java index 279f795689..20dfa2e99a 100644 --- a/runelite-api/src/main/java/net/runelite/api/NullObjectID.java +++ b/api/src/main/java/api/NullObjectID.java @@ -1,5 +1,5 @@ /* This file is automatically generated. Do not edit. */ -package net.runelite.api; +package api; public final class NullObjectID { diff --git a/runelite-api/src/main/java/net/runelite/api/ObjectComposition.java b/api/src/main/java/api/ObjectDefinition.java similarity index 95% rename from runelite-api/src/main/java/net/runelite/api/ObjectComposition.java rename to api/src/main/java/api/ObjectDefinition.java index 3b90539c19..7c252f68bc 100644 --- a/runelite-api/src/main/java/net/runelite/api/ObjectComposition.java +++ b/api/src/main/java/api/ObjectDefinition.java @@ -22,12 +22,12 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * Represents the template of a specific object. */ -public interface ObjectComposition +public interface ObjectDefinition { /** * Gets ID for the object. @@ -78,5 +78,5 @@ public interface ObjectComposition * * @return the impostor */ - ObjectComposition getImpostor(); + ObjectDefinition getImpostor(); } diff --git a/runelite-api/src/main/java/net/runelite/api/ObjectID.java b/api/src/main/java/api/ObjectID.java similarity index 99% rename from runelite-api/src/main/java/net/runelite/api/ObjectID.java rename to api/src/main/java/api/ObjectID.java index e31bd024d8..d74b085827 100644 --- a/runelite-api/src/main/java/net/runelite/api/ObjectID.java +++ b/api/src/main/java/api/ObjectID.java @@ -1,5 +1,5 @@ /* This file is automatically generated. Do not edit. */ -package net.runelite.api; +package api; public final class ObjectID { diff --git a/runelite-api/src/main/java/net/runelite/api/Opcodes.java b/api/src/main/java/api/Opcodes.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/Opcodes.java rename to api/src/main/java/api/Opcodes.java index 1ee96df082..79f90c7398 100644 --- a/runelite-api/src/main/java/net/runelite/api/Opcodes.java +++ b/api/src/main/java/api/Opcodes.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * Utility class containing ASM opcodes used by the RuneLite client. diff --git a/runelite-api/src/main/java/net/runelite/api/PacketBuffer.java b/api/src/main/java/api/PacketBuffer.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/PacketBuffer.java rename to api/src/main/java/api/PacketBuffer.java index a44f4c9ac9..db693575f2 100644 --- a/runelite-api/src/main/java/net/runelite/api/PacketBuffer.java +++ b/api/src/main/java/api/PacketBuffer.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; public interface PacketBuffer { diff --git a/runelite-api/src/main/java/net/runelite/api/Perspective.java b/api/src/main/java/api/Perspective.java similarity index 97% rename from runelite-api/src/main/java/net/runelite/api/Perspective.java rename to api/src/main/java/api/Perspective.java index 45469cc00c..c8f91a17bf 100644 --- a/runelite-api/src/main/java/net/runelite/api/Perspective.java +++ b/api/src/main/java/api/Perspective.java @@ -22,8 +22,16 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; +import api.config.Constants; +import static api.config.Constants.TILE_FLAG_BRIDGE; +import api.coords.LocalPoint; +import api.model.Jarvis; +import api.model.Triangle; +import api.model.Vertex; +import api.widgets.Widget; +import api.widgets.WidgetInfo; import java.awt.FontMetrics; import java.awt.Graphics2D; import java.awt.Polygon; @@ -36,13 +44,6 @@ import java.util.List; import java.util.stream.Collectors; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import static net.runelite.api.Constants.TILE_FLAG_BRIDGE; -import net.runelite.api.coords.LocalPoint; -import net.runelite.api.model.Jarvis; -import net.runelite.api.model.Triangle; -import net.runelite.api.model.Vertex; -import net.runelite.api.widgets.Widget; -import net.runelite.api.widgets.WidgetInfo; /** * A utility class containing methods to help with conversion between @@ -471,7 +472,7 @@ public class Perspective public static Point getCanvasSpriteLocation( @Nonnull Client client, @Nonnull LocalPoint localLocation, - @Nonnull SpritePixels sprite, + @Nonnull Sprite sprite, int zOffset) { int plane = client.getPlane(); @@ -490,7 +491,7 @@ public class Perspective } /** - * You don't want this. Use {@link TileObject#getClickbox()} instead. + * You don't want this. Use {@link //TileObject#getClickbox()} instead. *

* Get the on-screen clickable area of {@code model} as though it's for the * object on the tile at ({@code localX}, {@code localY}) and rotated to @@ -555,7 +556,7 @@ public class Perspective for (Triangle triangle : triangles) { - Vertex _a = triangle.getA(); + api.model.Vertex _a = triangle.getA(); Point a = localToCanvas(client, point.getX() - _a.getX(), point.getY() - _a.getZ(), diff --git a/runelite-api/src/main/java/net/runelite/api/Player.java b/api/src/main/java/api/Player.java similarity index 95% rename from runelite-api/src/main/java/net/runelite/api/Player.java rename to api/src/main/java/api/Player.java index 2e844c6ab6..1aac622930 100644 --- a/runelite-api/src/main/java/net/runelite/api/Player.java +++ b/api/src/main/java/api/Player.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; import java.awt.Polygon; import javax.annotation.Nullable; @@ -34,7 +34,7 @@ public interface Player extends Actor { @Override int getCombatLevel(); - + int getPlayerId(); /** @@ -42,7 +42,7 @@ public interface Player extends Actor * * @return the composition */ - PlayerComposition getPlayerComposition(); + PlayerAppearance getPlayerAppearance(); /** * Gets the polygons that make up the players model. @@ -79,10 +79,9 @@ public interface Player extends Actor * @return the overhead icon */ HeadIcon getOverheadIcon(); - + /** * Gets the displayed skull icon of the player. - * Only works on the local player. * * @return the skull icon */ diff --git a/runelite-api/src/main/java/net/runelite/api/PlayerComposition.java b/api/src/main/java/api/PlayerAppearance.java similarity index 91% rename from runelite-api/src/main/java/net/runelite/api/PlayerComposition.java rename to api/src/main/java/api/PlayerAppearance.java index 20ac41b6cb..b188d6be4e 100644 --- a/runelite-api/src/main/java/net/runelite/api/PlayerComposition.java +++ b/api/src/main/java/api/PlayerAppearance.java @@ -22,15 +22,14 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; -import net.runelite.api.annotations.VisibleForDevtools; -import net.runelite.api.kit.KitType; +import api.kit.KitType; /** * Represents the template of a player. */ -public interface PlayerComposition +public interface PlayerAppearance { /** * Gets an array of IDs related to equipment slots. @@ -63,9 +62,7 @@ public interface PlayerComposition * Update the cached hash value for player equipment * Used to cache the player models based on equipment. */ - @VisibleForDevtools void setHash(); - @VisibleForDevtools void setTransformedNpcId(int id); } diff --git a/runelite-api/src/main/java/net/runelite/api/Point.java b/api/src/main/java/api/Point.java similarity index 99% rename from runelite-api/src/main/java/net/runelite/api/Point.java rename to api/src/main/java/api/Point.java index 1c97a43666..e88d14409d 100644 --- a/runelite-api/src/main/java/net/runelite/api/Point.java +++ b/api/src/main/java/api/Point.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * A two-dimensional coordinate on the canvas. diff --git a/runelite-api/src/main/java/net/runelite/api/Prayer.java b/api/src/main/java/api/Prayer.java similarity index 99% rename from runelite-api/src/main/java/net/runelite/api/Prayer.java rename to api/src/main/java/api/Prayer.java index 69d835a7c7..dbf1b63d30 100644 --- a/runelite-api/src/main/java/net/runelite/api/Prayer.java +++ b/api/src/main/java/api/Prayer.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * An enumeration of different prayer spells. diff --git a/runelite-api/src/main/java/net/runelite/api/Preferences.java b/api/src/main/java/api/Preferences.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/Preferences.java rename to api/src/main/java/api/Preferences.java index ec1fb0dad7..4a9aba913e 100644 --- a/runelite-api/src/main/java/net/runelite/api/Preferences.java +++ b/api/src/main/java/api/Preferences.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * Stores the clients persisting preferences. diff --git a/runelite-api/src/main/java/net/runelite/api/Projectile.java b/api/src/main/java/api/Projectile.java similarity index 99% rename from runelite-api/src/main/java/net/runelite/api/Projectile.java rename to api/src/main/java/api/Projectile.java index d298135af9..d01b2c65a6 100644 --- a/runelite-api/src/main/java/net/runelite/api/Projectile.java +++ b/api/src/main/java/api/Projectile.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * Represents a projectile entity (ie. cannonball, arrow). diff --git a/runelite-api/src/main/java/net/runelite/api/ProjectileID.java b/api/src/main/java/api/ProjectileID.java similarity index 99% rename from runelite-api/src/main/java/net/runelite/api/ProjectileID.java rename to api/src/main/java/api/ProjectileID.java index 5dff0bc450..66362a0b56 100644 --- a/runelite-api/src/main/java/net/runelite/api/ProjectileID.java +++ b/api/src/main/java/api/ProjectileID.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * Utility class used for mapping projectile IDs. diff --git a/runelite-api/src/main/java/net/runelite/api/Query.java b/api/src/main/java/api/Query.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/Query.java rename to api/src/main/java/api/Query.java index 12737f299a..0482e62ad8 100644 --- a/runelite-api/src/main/java/net/runelite/api/Query.java +++ b/api/src/main/java/api/Query.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; import java.util.function.Predicate; diff --git a/runelite-api/src/main/java/net/runelite/api/Quest.java b/api/src/main/java/api/Quest.java similarity index 99% rename from runelite-api/src/main/java/net/runelite/api/Quest.java rename to api/src/main/java/api/Quest.java index 2a2d5d13fd..1218c23da6 100644 --- a/runelite-api/src/main/java/net/runelite/api/Quest.java +++ b/api/src/main/java/api/Quest.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; import lombok.Getter; diff --git a/runelite-api/src/main/java/net/runelite/api/QuestState.java b/api/src/main/java/api/QuestState.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/QuestState.java rename to api/src/main/java/api/QuestState.java index 5738f3ec76..87d5a27979 100644 --- a/runelite-api/src/main/java/net/runelite/api/QuestState.java +++ b/api/src/main/java/api/QuestState.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; public enum QuestState { diff --git a/runelite-api/src/main/java/net/runelite/api/RenderOverview.java b/api/src/main/java/api/RenderOverview.java similarity index 97% rename from runelite-api/src/main/java/net/runelite/api/RenderOverview.java rename to api/src/main/java/api/RenderOverview.java index 0a7fe45885..2112e5d7d5 100644 --- a/runelite-api/src/main/java/net/runelite/api/RenderOverview.java +++ b/api/src/main/java/api/RenderOverview.java @@ -22,9 +22,9 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; -import net.runelite.api.coords.WorldPoint; +import api.coords.WorldPoint; /** * Represents an overview of the currently rendered world map. diff --git a/runelite-api/src/main/java/net/runelite/api/Renderable.java b/api/src/main/java/api/Renderable.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/Renderable.java rename to api/src/main/java/api/Renderable.java index d8d2114a8d..52f0cf64f4 100644 --- a/runelite-api/src/main/java/net/runelite/api/Renderable.java +++ b/api/src/main/java/api/Renderable.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * Represents an object that can be rendered. diff --git a/runelite-api/src/main/java/net/runelite/api/Scene.java b/api/src/main/java/api/Scene.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/Scene.java rename to api/src/main/java/api/Scene.java index 53cc8fcb15..d7df98982d 100644 --- a/runelite-api/src/main/java/net/runelite/api/Scene.java +++ b/api/src/main/java/api/Scene.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * Represents the entire 3D scene diff --git a/runelite-api/src/main/java/net/runelite/api/SceneTileModel.java b/api/src/main/java/api/SceneTileModel.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/SceneTileModel.java rename to api/src/main/java/api/SceneTileModel.java index b7abcab08f..10e7729ed0 100644 --- a/runelite-api/src/main/java/net/runelite/api/SceneTileModel.java +++ b/api/src/main/java/api/SceneTileModel.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * Represents the model of a tile in the current scene. diff --git a/runelite-api/src/main/java/net/runelite/api/SceneTilePaint.java b/api/src/main/java/api/SceneTilePaint.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/SceneTilePaint.java rename to api/src/main/java/api/SceneTilePaint.java index 0247c17e8f..1d3e6f2c8c 100644 --- a/runelite-api/src/main/java/net/runelite/api/SceneTilePaint.java +++ b/api/src/main/java/api/SceneTilePaint.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * Represents the paint of a tile in the current scene. diff --git a/runelite-api/src/main/java/net/runelite/api/Script.java b/api/src/main/java/api/Script.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/Script.java rename to api/src/main/java/api/Script.java index eefe0dd08a..9b5e7a6771 100644 --- a/runelite-api/src/main/java/net/runelite/api/Script.java +++ b/api/src/main/java/api/Script.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; public interface Script extends Node { diff --git a/runelite-api/src/main/java/net/runelite/api/ScriptEvent.java b/api/src/main/java/api/ScriptEvent.java similarity index 92% rename from runelite-api/src/main/java/net/runelite/api/ScriptEvent.java rename to api/src/main/java/api/ScriptEvent.java index 2af2c1bd92..3400f86735 100644 --- a/runelite-api/src/main/java/net/runelite/api/ScriptEvent.java +++ b/api/src/main/java/api/ScriptEvent.java @@ -22,9 +22,9 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; -import net.runelite.api.widgets.Widget; +import api.widgets.Widget; public interface ScriptEvent { @@ -43,7 +43,7 @@ public interface ScriptEvent * Gets the widget of the event. * * @return the widget - * @see net.runelite.api.widgets.Widget + * @see api.widgets.Widget */ Widget getSource(); @@ -58,7 +58,7 @@ public interface ScriptEvent * Gets the target of the menu option * * @return the target - * @see net.runelite.api.events.MenuOptionClicked + * @see api.events.MenuOptionClicked */ String getOpbase(); } diff --git a/runelite-api/src/main/java/net/runelite/api/ScriptID.java b/api/src/main/java/api/ScriptID.java similarity index 99% rename from runelite-api/src/main/java/net/runelite/api/ScriptID.java rename to api/src/main/java/api/ScriptID.java index 12774bf1b9..18149b7352 100644 --- a/runelite-api/src/main/java/net/runelite/api/ScriptID.java +++ b/api/src/main/java/api/ScriptID.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; public final class ScriptID { diff --git a/api/src/main/java/api/Skill.java b/api/src/main/java/api/Skill.java new file mode 100644 index 0000000000..484a0b2994 --- /dev/null +++ b/api/src/main/java/api/Skill.java @@ -0,0 +1,52 @@ +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/runelite-api/src/main/java/net/runelite/api/SkullIcon.java b/api/src/main/java/api/SkullIcon.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/SkullIcon.java rename to api/src/main/java/api/SkullIcon.java index f16cbc2ef9..686ed19597 100644 --- a/runelite-api/src/main/java/net/runelite/api/SkullIcon.java +++ b/api/src/main/java/api/SkullIcon.java @@ -23,7 +23,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * An enumeration of PK skulls. diff --git a/runelite-api/src/main/java/net/runelite/api/SoundEffectID.java b/api/src/main/java/api/SoundEffectID.java similarity index 99% rename from runelite-api/src/main/java/net/runelite/api/SoundEffectID.java rename to api/src/main/java/api/SoundEffectID.java index 6e794bab9b..7732d23090 100644 --- a/runelite-api/src/main/java/net/runelite/api/SoundEffectID.java +++ b/api/src/main/java/api/SoundEffectID.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * Utility class used for mapping sound effect IDs. diff --git a/runelite-api/src/main/java/net/runelite/api/SpritePixels.java b/api/src/main/java/api/Sprite.java similarity index 92% rename from runelite-api/src/main/java/net/runelite/api/SpritePixels.java rename to api/src/main/java/api/Sprite.java index 4ebdbdba1c..fb605e76ec 100644 --- a/runelite-api/src/main/java/net/runelite/api/SpritePixels.java +++ b/api/src/main/java/api/Sprite.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; import java.awt.Color; import java.awt.image.BufferedImage; @@ -30,7 +30,7 @@ import java.awt.image.BufferedImage; /** * Represents data about the pixels of a sprite image. */ -public interface SpritePixels +public interface Sprite { int DEFAULT_SHADOW_COLOR = 3153952; @@ -79,14 +79,14 @@ public interface SpritePixels void toBufferedImage(BufferedImage img) throws IllegalArgumentException; /** - * Writes the contents of the SpritePixels with chosen outline to the BufferedImage + * Writes the contents of the Sprite with chosen outline to the BufferedImage * * @param color target color */ BufferedImage toBufferedOutline(Color color); /** - * Writes the contents of the SpritePixels with chosen outline to the BufferedImage + * Writes the contents of the Sprite with chosen outline to the BufferedImage * * @param img target image * @param color target color diff --git a/runelite-api/src/main/java/net/runelite/api/SpriteID.java b/api/src/main/java/api/SpriteID.java similarity index 99% rename from runelite-api/src/main/java/net/runelite/api/SpriteID.java rename to api/src/main/java/api/SpriteID.java index e83c268535..b6290fe527 100644 --- a/runelite-api/src/main/java/net/runelite/api/SpriteID.java +++ b/api/src/main/java/api/SpriteID.java @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; // Note: This class won't always be complete: these sprites were manually gathered // through the cache and widget inspector. Please add new sprites as you happen to use them. diff --git a/runelite-api/src/main/java/net/runelite/api/Texture.java b/api/src/main/java/api/Texture.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/Texture.java rename to api/src/main/java/api/Texture.java index 80a4d1a45a..979aac064e 100644 --- a/runelite-api/src/main/java/net/runelite/api/Texture.java +++ b/api/src/main/java/api/Texture.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; public interface Texture extends Node { diff --git a/runelite-api/src/main/java/net/runelite/api/TextureProvider.java b/api/src/main/java/api/TextureProvider.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/TextureProvider.java rename to api/src/main/java/api/TextureProvider.java index b7df733438..751f3ab804 100644 --- a/runelite-api/src/main/java/net/runelite/api/TextureProvider.java +++ b/api/src/main/java/api/TextureProvider.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; public interface TextureProvider { diff --git a/runelite-api/src/main/java/net/runelite/api/Tile.java b/api/src/main/java/api/Tile.java similarity index 96% rename from runelite-api/src/main/java/net/runelite/api/Tile.java rename to api/src/main/java/api/Tile.java index 0911c17de1..e0e4394ee7 100644 --- a/runelite-api/src/main/java/net/runelite/api/Tile.java +++ b/api/src/main/java/api/Tile.java @@ -22,11 +22,11 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; +import api.coords.LocalPoint; +import api.coords.WorldPoint; import java.util.List; -import net.runelite.api.coords.LocalPoint; -import net.runelite.api.coords.WorldPoint; /** * Represents a tile in the game. @@ -134,8 +134,6 @@ public interface Tile /** * Return the tile under this one, if this tile is a bridge - * - * @return */ Tile getBridge(); } diff --git a/runelite-api/src/main/java/net/runelite/api/TileObject.java b/api/src/main/java/api/TileObject.java similarity index 96% rename from runelite-api/src/main/java/net/runelite/api/TileObject.java rename to api/src/main/java/api/TileObject.java index e9012d29e4..b89c3bd174 100644 --- a/runelite-api/src/main/java/net/runelite/api/TileObject.java +++ b/api/src/main/java/api/TileObject.java @@ -22,14 +22,14 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; +import api.coords.LocalPoint; +import api.coords.WorldPoint; import java.awt.Graphics2D; import java.awt.Polygon; import java.awt.geom.Area; import javax.annotation.Nullable; -import net.runelite.api.coords.LocalPoint; -import net.runelite.api.coords.WorldPoint; /** * Represents an object that a tile holds. diff --git a/runelite-api/src/main/java/net/runelite/api/VarClientInt.java b/api/src/main/java/api/VarClientInt.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/VarClientInt.java rename to api/src/main/java/api/VarClientInt.java index 27df154f62..b10c1c1729 100644 --- a/runelite-api/src/main/java/net/runelite/api/VarClientInt.java +++ b/api/src/main/java/api/VarClientInt.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/runelite-api/src/main/java/net/runelite/api/VarClientStr.java b/api/src/main/java/api/VarClientStr.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/VarClientStr.java rename to api/src/main/java/api/VarClientStr.java index 79cfe1982b..56f6dae5f3 100644 --- a/runelite-api/src/main/java/net/runelite/api/VarClientStr.java +++ b/api/src/main/java/api/VarClientStr.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/runelite-api/src/main/java/net/runelite/api/VarPlayer.java b/api/src/main/java/api/VarPlayer.java similarity index 99% rename from runelite-api/src/main/java/net/runelite/api/VarPlayer.java rename to api/src/main/java/api/VarPlayer.java index 72c361c27b..0eb1e6a744 100644 --- a/runelite-api/src/main/java/net/runelite/api/VarPlayer.java +++ b/api/src/main/java/api/VarPlayer.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; import lombok.AllArgsConstructor; import lombok.Getter; @@ -260,5 +260,5 @@ public enum VarPlayer - private final int id; + public final int id; } diff --git a/runelite-api/src/main/java/net/runelite/api/Varbits.java b/api/src/main/java/api/Varbits.java similarity index 99% rename from runelite-api/src/main/java/net/runelite/api/Varbits.java rename to api/src/main/java/api/Varbits.java index ec3d36114b..7ca45356d6 100644 --- a/runelite-api/src/main/java/net/runelite/api/Varbits.java +++ b/api/src/main/java/api/Varbits.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/runelite-api/src/main/java/net/runelite/api/WallObject.java b/api/src/main/java/api/WallObject.java similarity index 76% rename from runelite-api/src/main/java/net/runelite/api/WallObject.java rename to api/src/main/java/api/WallObject.java index ddc4a734cd..e9942dd987 100644 --- a/runelite-api/src/main/java/net/runelite/api/WallObject.java +++ b/api/src/main/java/api/WallObject.java @@ -22,36 +22,31 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** - * Represents one or two walls on a tile + * Represents the wall of a tile, which is an un-passable boundary. */ public interface WallObject extends TileObject { /** - * A bitfield with the orientation of a wall - * 1 = East - * 2 = North - * 4 = West - * 8 = South + * Gets the first orientation of the wall. + * + * @return the first orientation, 0-2048 where 0 is north */ int getOrientationA(); /** - * A bitfield containing the orientation of the second wall on this tile, - * or 0 if there is no second wall. - * @see #getOrientationA + * Gets the second orientation value of the wall. + * + * @return the second orientation, 0-2048 where 0 is north */ int getOrientationB(); /** - * A bitfield containing various flags: - *

{@code
-	 * object type id = bits & 0x20
-	 * orientation (0-3) = bits >>> 6 & 3
-	 * supports items = bits >>> 8 & 1
-	 * }
+ * Gets the boundary configuration of the wall. + * + * @return the boundary configuration */ int getConfig(); diff --git a/api/src/main/java/api/WidgetNode.java b/api/src/main/java/api/WidgetNode.java new file mode 100644 index 0000000000..03ab3885a4 --- /dev/null +++ b/api/src/main/java/api/WidgetNode.java @@ -0,0 +1,15 @@ +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/runelite-api/src/main/java/net/runelite/api/World.java b/api/src/main/java/api/World.java similarity index 54% rename from runelite-api/src/main/java/net/runelite/api/World.java rename to api/src/main/java/api/World.java index df26615843..2d5e69f59a 100644 --- a/runelite-api/src/main/java/net/runelite/api/World.java +++ b/api/src/main/java/api/World.java @@ -1,29 +1,4 @@ -/* - * Copyright (c) 2018, Tomas Slusny - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package net.runelite.api; - +package api; import java.util.EnumSet; /** diff --git a/runelite-api/src/main/java/net/runelite/api/WorldMapData.java b/api/src/main/java/api/WorldMapData.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/WorldMapData.java rename to api/src/main/java/api/WorldMapData.java index d3370a4ac2..693213016b 100644 --- a/runelite-api/src/main/java/net/runelite/api/WorldMapData.java +++ b/api/src/main/java/api/WorldMapData.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * Represents data on the world map. diff --git a/runelite-api/src/main/java/net/runelite/api/WorldMapManager.java b/api/src/main/java/api/WorldMapManager.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/WorldMapManager.java rename to api/src/main/java/api/WorldMapManager.java index 67abc42795..e0c8db9917 100644 --- a/runelite-api/src/main/java/net/runelite/api/WorldMapManager.java +++ b/api/src/main/java/api/WorldMapManager.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api; +package api; /** * Manages the world map. diff --git a/runelite-api/src/main/java/net/runelite/api/WorldType.java b/api/src/main/java/api/WorldType.java similarity index 59% rename from runelite-api/src/main/java/net/runelite/api/WorldType.java rename to api/src/main/java/api/WorldType.java index 0ecfd1ed94..b778ad30c3 100644 --- a/runelite-api/src/main/java/net/runelite/api/WorldType.java +++ b/api/src/main/java/api/WorldType.java @@ -1,28 +1,4 @@ -/* - * Copyright (c) 2018, Tomas Slusny - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package net.runelite.api; +package api; import java.util.Collection; import java.util.EnumSet; diff --git a/runelite-api/src/main/java/net/runelite/api/annotations/VisibleForDevtools.java b/api/src/main/java/api/annotations/VisibleForDevtools.java similarity index 97% rename from runelite-api/src/main/java/net/runelite/api/annotations/VisibleForDevtools.java rename to api/src/main/java/api/annotations/VisibleForDevtools.java index 9357969d16..f9e2d32711 100644 --- a/runelite-api/src/main/java/net/runelite/api/annotations/VisibleForDevtools.java +++ b/api/src/main/java/api/annotations/VisibleForDevtools.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.annotations; +package api.annotations; import java.lang.annotation.Documented; import java.lang.annotation.Retention; diff --git a/api/src/main/java/api/config/Constants.java b/api/src/main/java/api/config/Constants.java new file mode 100644 index 0000000000..e995a3232b --- /dev/null +++ b/api/src/main/java/api/config/Constants.java @@ -0,0 +1,105 @@ +/* + * 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.config; + +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/runelite-api/src/main/java/net/runelite/api/coords/Angle.java b/api/src/main/java/api/coords/Angle.java similarity index 90% rename from runelite-api/src/main/java/net/runelite/api/coords/Angle.java rename to api/src/main/java/api/coords/Angle.java index 93b830a2fe..f92f2f032a 100644 --- a/runelite-api/src/main/java/net/runelite/api/coords/Angle.java +++ b/api/src/main/java/api/coords/Angle.java @@ -22,13 +22,13 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.coords; +package api.coords; +import static api.coords.Direction.EAST; +import static api.coords.Direction.NORTH; +import static api.coords.Direction.SOUTH; +import static api.coords.Direction.WEST; import lombok.Value; -import static net.runelite.api.coords.Direction.EAST; -import static net.runelite.api.coords.Direction.NORTH; -import static net.runelite.api.coords.Direction.SOUTH; -import static net.runelite.api.coords.Direction.WEST; /** * Represents an in-game orientation that uses fixed point arithmetic. diff --git a/runelite-api/src/main/java/net/runelite/api/coords/Direction.java b/api/src/main/java/api/coords/Direction.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/coords/Direction.java rename to api/src/main/java/api/coords/Direction.java index de8447389f..96d9fb11da 100644 --- a/runelite-api/src/main/java/net/runelite/api/coords/Direction.java +++ b/api/src/main/java/api/coords/Direction.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.coords; +package api.coords; /** * Represents the four main cardinal points. diff --git a/runelite-api/src/main/java/net/runelite/api/coords/LocalPoint.java b/api/src/main/java/api/coords/LocalPoint.java similarity index 97% rename from runelite-api/src/main/java/net/runelite/api/coords/LocalPoint.java rename to api/src/main/java/api/coords/LocalPoint.java index e8df3e9d7d..d34460608b 100644 --- a/runelite-api/src/main/java/net/runelite/api/coords/LocalPoint.java +++ b/api/src/main/java/api/coords/LocalPoint.java @@ -23,12 +23,12 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.coords; +package api.coords; +import api.Client; +import api.Perspective; import javax.annotation.Nullable; import lombok.Value; -import net.runelite.api.Client; -import net.runelite.api.Perspective; /** * A two-dimensional point in the local coordinate space. diff --git a/runelite-api/src/main/java/net/runelite/api/coords/WorldArea.java b/api/src/main/java/api/coords/WorldArea.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/coords/WorldArea.java rename to api/src/main/java/api/coords/WorldArea.java index 9abb3aeac8..9062d29343 100644 --- a/runelite-api/src/main/java/net/runelite/api/coords/WorldArea.java +++ b/api/src/main/java/api/coords/WorldArea.java @@ -22,18 +22,18 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.coords; +package api.coords; +import api.Client; +import api.CollisionData; +import api.CollisionDataFlag; +import api.Point; +import api.Tile; +import api.config.Constants; import java.util.ArrayList; import java.util.List; import java.util.function.Predicate; import lombok.Getter; -import net.runelite.api.Client; -import net.runelite.api.CollisionData; -import net.runelite.api.CollisionDataFlag; -import net.runelite.api.Constants; -import net.runelite.api.Point; -import net.runelite.api.Tile; /** * Represents an area on the world. @@ -208,7 +208,7 @@ public class WorldArea * Note that this method does not consider other actors as * a collision, but most non-boss NPCs do check for collision * with some actors. For actor collision checking, use the - * {@link #canTravelInDirection(Client, int, int, Predicate)} method. + * {@link #canTravelInDirection(Client, int, int, java.util.function.Predicate)} method. * * @param client the client to test in * @param dx the x-axis direction to travel (-1, 0, or 1) diff --git a/runelite-api/src/main/java/net/runelite/api/coords/WorldPoint.java b/api/src/main/java/api/coords/WorldPoint.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/coords/WorldPoint.java rename to api/src/main/java/api/coords/WorldPoint.java index ee7c67b20b..851a000eff 100644 --- a/runelite-api/src/main/java/net/runelite/api/coords/WorldPoint.java +++ b/api/src/main/java/api/coords/WorldPoint.java @@ -23,16 +23,16 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.coords; +package api.coords; +import api.Client; +import api.Perspective; +import static api.config.Constants.CHUNK_SIZE; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; import lombok.Value; -import net.runelite.api.Client; -import static net.runelite.api.Constants.CHUNK_SIZE; -import net.runelite.api.Perspective; /** * A three-dimensional point representing the coordinate of a Tile. diff --git a/api/src/main/java/api/events/AnimationChanged.java b/api/src/main/java/api/events/AnimationChanged.java new file mode 100644 index 0000000000..ccfed921fe --- /dev/null +++ b/api/src/main/java/api/events/AnimationChanged.java @@ -0,0 +1,26 @@ +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/runelite-api/src/main/java/net/runelite/api/events/BeforeMenuRender.java b/api/src/main/java/api/events/BeforeMenuRender.java similarity index 97% rename from runelite-api/src/main/java/net/runelite/api/events/BeforeMenuRender.java rename to api/src/main/java/api/events/BeforeMenuRender.java index 5d1e10994b..4387e06cee 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/BeforeMenuRender.java +++ b/api/src/main/java/api/events/BeforeMenuRender.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; import lombok.Data; diff --git a/runelite-api/src/main/java/net/runelite/api/events/BeforeRender.java b/api/src/main/java/api/events/BeforeRender.java similarity index 97% rename from runelite-api/src/main/java/net/runelite/api/events/BeforeRender.java rename to api/src/main/java/api/events/BeforeRender.java index 741041e1e0..3c1167437f 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/BeforeRender.java +++ b/api/src/main/java/api/events/BeforeRender.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; /** * Posted at the start of every frame diff --git a/runelite-api/src/main/java/net/runelite/api/events/BoostedLevelChanged.java b/api/src/main/java/api/events/BoostedLevelChanged.java similarity index 91% rename from runelite-api/src/main/java/net/runelite/api/events/BoostedLevelChanged.java rename to api/src/main/java/api/events/BoostedLevelChanged.java index 0c7adee98f..6262bdce8b 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/BoostedLevelChanged.java +++ b/api/src/main/java/api/events/BoostedLevelChanged.java @@ -1,51 +1,51 @@ -/* - * 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.api.events; - -import lombok.Data; -import net.runelite.api.Skill; - -/** - * An event where a players skill level has been temporarily modified. - *

- * Examples of when this event may trigger include: - *

    - *
  • Prayer points draining or being restored at an altar or restoration pool
  • - *
  • Positive and negative effects gained from potions (ie. Saradomin brew)
  • - *
  • Earning skill points towards a skill
  • - *
  • Levelling up a skill
  • - *
- *

- * Use {@link net.runelite.api.Client#getBoostedSkillLevel(Skill)} in order to - * retrieve the newly boosted skill level. - */ -@Data -public class BoostedLevelChanged -{ - /** - * The skill that has had its level modified. - */ - private Skill skill; -} +/* + * 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 api.events; + +import api.Skill; +import lombok.Data; + +/** + * An event where a players skill level has been temporarily modified. + *

+ * Examples of when this event may trigger include: + *

    + *
  • Prayer points draining or being restored at an altar or restoration pool
  • + *
  • Positive and negative effects gained from potions (ie. Saradomin brew)
  • + *
  • Earning skill points towards a skill
  • + *
  • Levelling up a skill
  • + *
+ *

+ * Use {@link api.Client#getBoostedSkillLevel(Skill)} in order to + * retrieve the newly boosted skill level. + */ +@Data +public class BoostedLevelChanged +{ + /** + * The skill that has had its level modified. + */ + private Skill skill; +} diff --git a/runelite-api/src/main/java/net/runelite/api/events/CannonballFired.java b/api/src/main/java/api/events/CannonballFired.java similarity index 97% rename from runelite-api/src/main/java/net/runelite/api/events/CannonballFired.java rename to api/src/main/java/api/events/CannonballFired.java index 077a88096d..e030e8e727 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/CannonballFired.java +++ b/api/src/main/java/api/events/CannonballFired.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; /** * an event posted when a cannonball is fired diff --git a/runelite-api/src/main/java/net/runelite/api/events/CanvasSizeChanged.java b/api/src/main/java/api/events/CanvasSizeChanged.java similarity index 97% rename from runelite-api/src/main/java/net/runelite/api/events/CanvasSizeChanged.java rename to api/src/main/java/api/events/CanvasSizeChanged.java index e76e82dd6d..b417ed8559 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/CanvasSizeChanged.java +++ b/api/src/main/java/api/events/CanvasSizeChanged.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; /** * An event posted when the canvas size might have changed. diff --git a/runelite-api/src/main/java/net/runelite/api/events/ChatMessage.java b/api/src/main/java/api/events/ChatMessage.java similarity index 95% rename from runelite-api/src/main/java/net/runelite/api/events/ChatMessage.java rename to api/src/main/java/api/events/ChatMessage.java index 0f5182e22b..94698ff25b 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/ChatMessage.java +++ b/api/src/main/java/api/events/ChatMessage.java @@ -22,13 +22,13 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; +import api.ChatMessageType; +import api.MessageNode; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; -import net.runelite.api.ChatMessageType; -import net.runelite.api.MessageNode; /** * An event where a new chat message is received. diff --git a/runelite-api/src/main/java/net/runelite/api/events/ClanChanged.java b/api/src/main/java/api/events/ClanChanged.java similarity index 97% rename from runelite-api/src/main/java/net/runelite/api/events/ClanChanged.java rename to api/src/main/java/api/events/ClanChanged.java index e39dbc400e..c83dffa61c 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/ClanChanged.java +++ b/api/src/main/java/api/events/ClanChanged.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; import lombok.Value; diff --git a/runelite-api/src/main/java/net/runelite/api/events/ClanMemberJoined.java b/api/src/main/java/api/events/ClanMemberJoined.java similarity index 95% rename from runelite-api/src/main/java/net/runelite/api/events/ClanMemberJoined.java rename to api/src/main/java/api/events/ClanMemberJoined.java index ff2a373c4b..446471a8ca 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/ClanMemberJoined.java +++ b/api/src/main/java/api/events/ClanMemberJoined.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.api.events; +package api.events; +import api.ClanMember; import lombok.Value; -import net.runelite.api.ClanMember; @Value public class ClanMemberJoined diff --git a/runelite-api/src/main/java/net/runelite/api/events/ClanMemberLeft.java b/api/src/main/java/api/events/ClanMemberLeft.java similarity index 95% rename from runelite-api/src/main/java/net/runelite/api/events/ClanMemberLeft.java rename to api/src/main/java/api/events/ClanMemberLeft.java index 24bc58f960..ca6683f427 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/ClanMemberLeft.java +++ b/api/src/main/java/api/events/ClanMemberLeft.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.api.events; +package api.events; +import api.ClanMember; import lombok.Value; -import net.runelite.api.ClanMember; @Value public class ClanMemberLeft diff --git a/runelite-api/src/main/java/net/runelite/api/events/ClientTick.java b/api/src/main/java/api/events/ClientTick.java similarity index 97% rename from runelite-api/src/main/java/net/runelite/api/events/ClientTick.java rename to api/src/main/java/api/events/ClientTick.java index 369ff7982a..d102e42072 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/ClientTick.java +++ b/api/src/main/java/api/events/ClientTick.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; /** * Posted every client tick diff --git a/runelite-api/src/main/java/net/runelite/api/events/CommandExecuted.java b/api/src/main/java/api/events/CommandExecuted.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/events/CommandExecuted.java rename to api/src/main/java/api/events/CommandExecuted.java index d0dfae5ff2..71e747e350 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/CommandExecuted.java +++ b/api/src/main/java/api/events/CommandExecuted.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; import lombok.Value; diff --git a/runelite-api/src/main/java/net/runelite/api/events/ConfigChanged.java b/api/src/main/java/api/events/ConfigChanged.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/events/ConfigChanged.java rename to api/src/main/java/api/events/ConfigChanged.java index f27f4819cb..7b346a66c2 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/ConfigChanged.java +++ b/api/src/main/java/api/events/ConfigChanged.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; import lombok.Data; diff --git a/runelite-api/src/main/java/net/runelite/api/events/DecorativeObjectChanged.java b/api/src/main/java/api/events/DecorativeObjectChanged.java similarity index 94% rename from runelite-api/src/main/java/net/runelite/api/events/DecorativeObjectChanged.java rename to api/src/main/java/api/events/DecorativeObjectChanged.java index 661711e566..c5969d5377 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/DecorativeObjectChanged.java +++ b/api/src/main/java/api/events/DecorativeObjectChanged.java @@ -22,11 +22,11 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; +import api.DecorativeObject; +import api.Tile; import lombok.Data; -import net.runelite.api.DecorativeObject; -import net.runelite.api.Tile; /** * An event where the {@link DecorativeObject} attached to a {@link Tile} diff --git a/runelite-api/src/main/java/net/runelite/api/events/DecorativeObjectDespawned.java b/api/src/main/java/api/events/DecorativeObjectDespawned.java similarity index 94% rename from runelite-api/src/main/java/net/runelite/api/events/DecorativeObjectDespawned.java rename to api/src/main/java/api/events/DecorativeObjectDespawned.java index 77152ec9c6..3c5d524f0f 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/DecorativeObjectDespawned.java +++ b/api/src/main/java/api/events/DecorativeObjectDespawned.java @@ -22,11 +22,11 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; +import api.DecorativeObject; +import api.Tile; import lombok.Data; -import net.runelite.api.DecorativeObject; -import net.runelite.api.Tile; /** * An event where the {@link DecorativeObject} attached to a {@link Tile} diff --git a/runelite-api/src/main/java/net/runelite/api/events/DecorativeObjectSpawned.java b/api/src/main/java/api/events/DecorativeObjectSpawned.java similarity index 94% rename from runelite-api/src/main/java/net/runelite/api/events/DecorativeObjectSpawned.java rename to api/src/main/java/api/events/DecorativeObjectSpawned.java index b89806418e..529398d02f 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/DecorativeObjectSpawned.java +++ b/api/src/main/java/api/events/DecorativeObjectSpawned.java @@ -22,11 +22,11 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; +import api.DecorativeObject; +import api.Tile; import lombok.Data; -import net.runelite.api.DecorativeObject; -import net.runelite.api.Tile; /** * An event where a {@link DecorativeObject} is attached to a {@link Tile}. diff --git a/runelite-api/src/main/java/net/runelite/api/events/DraggingWidgetChanged.java b/api/src/main/java/api/events/DraggingWidgetChanged.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/events/DraggingWidgetChanged.java rename to api/src/main/java/api/events/DraggingWidgetChanged.java index 8aef02d570..54a365cabe 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/DraggingWidgetChanged.java +++ b/api/src/main/java/api/events/DraggingWidgetChanged.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; import lombok.Data; diff --git a/runelite-api/src/main/java/net/runelite/api/events/ExperienceChanged.java b/api/src/main/java/api/events/ExperienceChanged.java similarity index 96% rename from runelite-api/src/main/java/net/runelite/api/events/ExperienceChanged.java rename to api/src/main/java/api/events/ExperienceChanged.java index 0a1a276cfb..85981fc51e 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/ExperienceChanged.java +++ b/api/src/main/java/api/events/ExperienceChanged.java @@ -23,10 +23,10 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; +import api.Skill; import lombok.Data; -import net.runelite.api.Skill; /** * An event where the experience level of a {@link Skill} has been modified. diff --git a/runelite-api/src/main/java/net/runelite/api/events/FocusChanged.java b/api/src/main/java/api/events/FocusChanged.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/events/FocusChanged.java rename to api/src/main/java/api/events/FocusChanged.java index fd9fcb6466..da12f9929d 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/FocusChanged.java +++ b/api/src/main/java/api/events/FocusChanged.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; import lombok.Data; diff --git a/runelite-api/src/main/java/net/runelite/api/events/GameObjectChanged.java b/api/src/main/java/api/events/GameObjectChanged.java similarity index 94% rename from runelite-api/src/main/java/net/runelite/api/events/GameObjectChanged.java rename to api/src/main/java/api/events/GameObjectChanged.java index 117ad81f60..fd558d1720 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/GameObjectChanged.java +++ b/api/src/main/java/api/events/GameObjectChanged.java @@ -22,11 +22,11 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; +import api.GameObject; +import api.Tile; import lombok.Data; -import net.runelite.api.GameObject; -import net.runelite.api.Tile; /** * An event where a {@link GameObject} on a {@link Tile} has been replaced. diff --git a/runelite-api/src/main/java/net/runelite/api/events/GameObjectDespawned.java b/api/src/main/java/api/events/GameObjectDespawned.java similarity index 94% rename from runelite-api/src/main/java/net/runelite/api/events/GameObjectDespawned.java rename to api/src/main/java/api/events/GameObjectDespawned.java index ed4280918a..7e334698b5 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/GameObjectDespawned.java +++ b/api/src/main/java/api/events/GameObjectDespawned.java @@ -22,11 +22,11 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; +import api.GameObject; +import api.Tile; import lombok.Data; -import net.runelite.api.GameObject; -import net.runelite.api.Tile; /** * An event where a {@link GameObject} on a {@link Tile} is removed. diff --git a/runelite-api/src/main/java/net/runelite/api/events/GameObjectSpawned.java b/api/src/main/java/api/events/GameObjectSpawned.java similarity index 94% rename from runelite-api/src/main/java/net/runelite/api/events/GameObjectSpawned.java rename to api/src/main/java/api/events/GameObjectSpawned.java index a8b09298a5..04bcc4697e 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/GameObjectSpawned.java +++ b/api/src/main/java/api/events/GameObjectSpawned.java @@ -22,11 +22,11 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; +import api.GameObject; +import api.Tile; import lombok.Data; -import net.runelite.api.GameObject; -import net.runelite.api.Tile; /** * An event where a {@link GameObject} is added to a {@link Tile}. diff --git a/runelite-api/src/main/java/net/runelite/api/events/GameStateChanged.java b/api/src/main/java/api/events/GameStateChanged.java similarity index 95% rename from runelite-api/src/main/java/net/runelite/api/events/GameStateChanged.java rename to api/src/main/java/api/events/GameStateChanged.java index f62ee5547e..f59d35e003 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/GameStateChanged.java +++ b/api/src/main/java/api/events/GameStateChanged.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.api.events; +package api.events; +import api.GameState; import lombok.Data; -import net.runelite.api.GameState; /** * An event where the clients game state has changed. diff --git a/runelite-api/src/main/java/net/runelite/api/events/GameTick.java b/api/src/main/java/api/events/GameTick.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/events/GameTick.java rename to api/src/main/java/api/events/GameTick.java index aefa7fc3e4..e150cb6c30 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/GameTick.java +++ b/api/src/main/java/api/events/GameTick.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; import lombok.Data; diff --git a/runelite-api/src/main/java/net/runelite/api/events/GrandExchangeOfferChanged.java b/api/src/main/java/api/events/GrandExchangeOfferChanged.java similarity index 94% rename from runelite-api/src/main/java/net/runelite/api/events/GrandExchangeOfferChanged.java rename to api/src/main/java/api/events/GrandExchangeOfferChanged.java index 8a7ff3ffc0..025e3c44cf 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/GrandExchangeOfferChanged.java +++ b/api/src/main/java/api/events/GrandExchangeOfferChanged.java @@ -22,11 +22,11 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; +import api.GrandExchangeOffer; +import api.GrandExchangeOfferState; import lombok.Data; -import net.runelite.api.GrandExchangeOffer; -import net.runelite.api.GrandExchangeOfferState; /** * An event where a {@link GrandExchangeOffer} has been updated with diff --git a/runelite-api/src/main/java/net/runelite/api/events/GraphicsObjectCreated.java b/api/src/main/java/api/events/GraphicsObjectCreated.java similarity index 95% rename from runelite-api/src/main/java/net/runelite/api/events/GraphicsObjectCreated.java rename to api/src/main/java/api/events/GraphicsObjectCreated.java index 5af54e0660..9f8341cf2f 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/GraphicsObjectCreated.java +++ b/api/src/main/java/api/events/GraphicsObjectCreated.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.api.events; +package api.events; +import api.GraphicsObject; import lombok.Value; -import net.runelite.api.GraphicsObject; /** * An event where a new {@link GraphicsObject} has been created. diff --git a/runelite-api/src/main/java/net/runelite/api/events/GroundObjectChanged.java b/api/src/main/java/api/events/GroundObjectChanged.java similarity index 94% rename from runelite-api/src/main/java/net/runelite/api/events/GroundObjectChanged.java rename to api/src/main/java/api/events/GroundObjectChanged.java index 093948306b..8d45ba0cbe 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/GroundObjectChanged.java +++ b/api/src/main/java/api/events/GroundObjectChanged.java @@ -22,11 +22,11 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; +import api.GroundObject; +import api.Tile; import lombok.Data; -import net.runelite.api.GroundObject; -import net.runelite.api.Tile; /** * An event where the {@link GroundObject} on a {@link Tile} has been changed. diff --git a/runelite-api/src/main/java/net/runelite/api/events/GroundObjectDespawned.java b/api/src/main/java/api/events/GroundObjectDespawned.java similarity index 94% rename from runelite-api/src/main/java/net/runelite/api/events/GroundObjectDespawned.java rename to api/src/main/java/api/events/GroundObjectDespawned.java index b77d1bf579..a480f2f763 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/GroundObjectDespawned.java +++ b/api/src/main/java/api/events/GroundObjectDespawned.java @@ -22,11 +22,11 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; +import api.GroundObject; +import api.Tile; import lombok.Data; -import net.runelite.api.GroundObject; -import net.runelite.api.Tile; /** * An event where a {@link GroundObject} on a {@link Tile} has been removed. diff --git a/runelite-api/src/main/java/net/runelite/api/events/GroundObjectSpawned.java b/api/src/main/java/api/events/GroundObjectSpawned.java similarity index 94% rename from runelite-api/src/main/java/net/runelite/api/events/GroundObjectSpawned.java rename to api/src/main/java/api/events/GroundObjectSpawned.java index 1e3d6597ff..a271befde5 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/GroundObjectSpawned.java +++ b/api/src/main/java/api/events/GroundObjectSpawned.java @@ -22,11 +22,11 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; +import api.GroundObject; +import api.Tile; import lombok.Data; -import net.runelite.api.GroundObject; -import net.runelite.api.Tile; /** * An event where a {@link GroundObject} is added to a {@link Tile}. diff --git a/runelite-api/src/main/java/net/runelite/api/events/HitsplatApplied.java b/api/src/main/java/api/events/HitsplatApplied.java similarity index 94% rename from runelite-api/src/main/java/net/runelite/api/events/HitsplatApplied.java rename to api/src/main/java/api/events/HitsplatApplied.java index 705667ae32..06c369d334 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/HitsplatApplied.java +++ b/api/src/main/java/api/events/HitsplatApplied.java @@ -22,11 +22,11 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; +import api.Actor; +import api.Hitsplat; import lombok.Data; -import net.runelite.api.Actor; -import net.runelite.api.Hitsplat; /** * An event called when a {@link Hitsplat} is processed on an {@link Actor}. diff --git a/runelite-api/src/main/java/net/runelite/api/events/InteractChanged.java b/api/src/main/java/api/events/InteractChanged.java similarity index 95% rename from runelite-api/src/main/java/net/runelite/api/events/InteractChanged.java rename to api/src/main/java/api/events/InteractChanged.java index d9de9eddb1..89bcd12252 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/InteractChanged.java +++ b/api/src/main/java/api/events/InteractChanged.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.api.events; +package api.events; +import api.Actor; import lombok.Data; -import net.runelite.api.Actor; @Data public class InteractChanged diff --git a/api/src/main/java/api/events/InteractingChanged.java b/api/src/main/java/api/events/InteractingChanged.java new file mode 100644 index 0000000000..3b2855e591 --- /dev/null +++ b/api/src/main/java/api/events/InteractingChanged.java @@ -0,0 +1,18 @@ +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/runelite-api/src/main/java/net/runelite/api/events/ItemContainerChanged.java b/api/src/main/java/api/events/ItemContainerChanged.java similarity index 92% rename from runelite-api/src/main/java/net/runelite/api/events/ItemContainerChanged.java rename to api/src/main/java/api/events/ItemContainerChanged.java index f4c5d8163f..d0166754e5 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/ItemContainerChanged.java +++ b/api/src/main/java/api/events/ItemContainerChanged.java @@ -22,13 +22,13 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; +import api.ItemContainer; import lombok.Value; -import net.runelite.api.ItemContainer; /** - * An event called whenever the stack size of an {@link net.runelite.api.Item} + * An event called whenever the stack size of an {@link api.Item} * in an {@link ItemContainer} is modified. *

* Examples of when this event may trigger include: diff --git a/runelite-api/src/main/java/net/runelite/api/events/ItemDespawned.java b/api/src/main/java/api/events/ItemDespawned.java similarity index 94% rename from runelite-api/src/main/java/net/runelite/api/events/ItemDespawned.java rename to api/src/main/java/api/events/ItemDespawned.java index 4e60837d9d..9b3bd87f3b 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/ItemDespawned.java +++ b/api/src/main/java/api/events/ItemDespawned.java @@ -22,11 +22,11 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; +import api.Item; +import api.Tile; import lombok.Value; -import net.runelite.api.Item; -import net.runelite.api.Tile; /** * Called when an item pile despawns from the ground. When the client loads a new scene, diff --git a/runelite-api/src/main/java/net/runelite/api/events/ItemQuantityChanged.java b/api/src/main/java/api/events/ItemQuantityChanged.java similarity index 94% rename from runelite-api/src/main/java/net/runelite/api/events/ItemQuantityChanged.java rename to api/src/main/java/api/events/ItemQuantityChanged.java index fb6b4f37ae..125d9bda65 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/ItemQuantityChanged.java +++ b/api/src/main/java/api/events/ItemQuantityChanged.java @@ -22,11 +22,11 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; +import api.Item; +import api.Tile; import lombok.Value; -import net.runelite.api.Item; -import net.runelite.api.Tile; /** * Called when the quantity of an item pile changes. diff --git a/runelite-api/src/main/java/net/runelite/api/events/ItemSpawned.java b/api/src/main/java/api/events/ItemSpawned.java similarity index 94% rename from runelite-api/src/main/java/net/runelite/api/events/ItemSpawned.java rename to api/src/main/java/api/events/ItemSpawned.java index e02d927cfc..5b53c2438a 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/ItemSpawned.java +++ b/api/src/main/java/api/events/ItemSpawned.java @@ -22,11 +22,11 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; +import api.Item; +import api.Tile; import lombok.Value; -import net.runelite.api.Item; -import net.runelite.api.Tile; /** * Called when an item pile spawns on the ground. When the client loads a new scene, diff --git a/runelite-api/src/main/java/net/runelite/api/events/LocalPlayerDeath.java b/api/src/main/java/api/events/LocalPlayerDeath.java similarity index 97% rename from runelite-api/src/main/java/net/runelite/api/events/LocalPlayerDeath.java rename to api/src/main/java/api/events/LocalPlayerDeath.java index e46b815f49..70b7a00405 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/LocalPlayerDeath.java +++ b/api/src/main/java/api/events/LocalPlayerDeath.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; /** * An event when the local player dies. diff --git a/runelite-api/src/main/java/net/runelite/api/events/MenuEntryAdded.java b/api/src/main/java/api/events/MenuEntryAdded.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/events/MenuEntryAdded.java rename to api/src/main/java/api/events/MenuEntryAdded.java index e6aa08b600..10d96d8ed4 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/MenuEntryAdded.java +++ b/api/src/main/java/api/events/MenuEntryAdded.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/runelite-api/src/main/java/net/runelite/api/events/MenuOpened.java b/api/src/main/java/api/events/MenuOpened.java similarity index 96% rename from runelite-api/src/main/java/net/runelite/api/events/MenuOpened.java rename to api/src/main/java/api/events/MenuOpened.java index 6572adfa1b..d0127adf73 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/MenuOpened.java +++ b/api/src/main/java/api/events/MenuOpened.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.api.events; +package api.events; +import api.MenuEntry; import lombok.Data; -import net.runelite.api.MenuEntry; /** * An event where a menu has been opened. diff --git a/runelite-api/src/main/java/net/runelite/api/events/MenuOptionClicked.java b/api/src/main/java/api/events/MenuOptionClicked.java similarity index 96% rename from runelite-api/src/main/java/net/runelite/api/events/MenuOptionClicked.java rename to api/src/main/java/api/events/MenuOptionClicked.java index 8eb4707ae8..ef1b899002 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/MenuOptionClicked.java +++ b/api/src/main/java/api/events/MenuOptionClicked.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.api.events; +package api.events; +import api.MenuAction; import lombok.Data; -import net.runelite.api.MenuAction; /** * An event where a menu option has been clicked. @@ -64,7 +64,7 @@ public class MenuOptionClicked /** * The ID of the widget where the menu was clicked. * - * @see net.runelite.api.widgets.WidgetID + * @see api.WidgetID */ private int widgetId; /** diff --git a/runelite-api/src/main/java/net/runelite/api/events/MenuShouldLeftClick.java b/api/src/main/java/api/events/MenuShouldLeftClick.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/events/MenuShouldLeftClick.java rename to api/src/main/java/api/events/MenuShouldLeftClick.java index c36372ff2c..78e67e350a 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/MenuShouldLeftClick.java +++ b/api/src/main/java/api/events/MenuShouldLeftClick.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; import lombok.Data; diff --git a/runelite-api/src/main/java/net/runelite/api/events/NameableNameChanged.java b/api/src/main/java/api/events/NameableNameChanged.java similarity index 95% rename from runelite-api/src/main/java/net/runelite/api/events/NameableNameChanged.java rename to api/src/main/java/api/events/NameableNameChanged.java index 501a1b7931..c943157f6a 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/NameableNameChanged.java +++ b/api/src/main/java/api/events/NameableNameChanged.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.api.events; +package api.events; +import api.Nameable; import lombok.Value; -import net.runelite.api.Nameable; /** * An event where a {@link Nameable} has had their name changed. diff --git a/runelite-api/src/main/java/net/runelite/api/events/NpcActionChanged.java b/api/src/main/java/api/events/NpcActionChanged.java similarity index 89% rename from runelite-api/src/main/java/net/runelite/api/events/NpcActionChanged.java rename to api/src/main/java/api/events/NpcActionChanged.java index 7539821167..f2b2bdf593 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/NpcActionChanged.java +++ b/api/src/main/java/api/events/NpcActionChanged.java @@ -22,13 +22,13 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; +import api.NPCDefinition; import lombok.Data; -import net.runelite.api.NPCComposition; /** - * An event where an action of an {@link NPCComposition} has changed. + * An event where an action of an {@link NPCDefinition} has changed. */ @Data public class NpcActionChanged @@ -36,7 +36,7 @@ public class NpcActionChanged /** * The NPC composition that has been changed. */ - private NPCComposition npcComposition; + private NPCDefinition npcDefinition; /** * The raw index of the modified action. */ diff --git a/runelite-api/src/main/java/net/runelite/api/events/NpcDespawned.java b/api/src/main/java/api/events/NpcDespawned.java similarity index 94% rename from runelite-api/src/main/java/net/runelite/api/events/NpcDespawned.java rename to api/src/main/java/api/events/NpcDespawned.java index 0f6399fa4a..9fb85d9707 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/NpcDespawned.java +++ b/api/src/main/java/api/events/NpcDespawned.java @@ -22,11 +22,11 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; +import api.Actor; +import api.NPC; import lombok.Value; -import net.runelite.api.Actor; -import net.runelite.api.NPC; /** * An event where an {@link NPC} has despawned. diff --git a/runelite-api/src/main/java/net/runelite/api/events/NpcSpawned.java b/api/src/main/java/api/events/NpcSpawned.java similarity index 94% rename from runelite-api/src/main/java/net/runelite/api/events/NpcSpawned.java rename to api/src/main/java/api/events/NpcSpawned.java index 2101bdd4fb..d0faab4afd 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/NpcSpawned.java +++ b/api/src/main/java/api/events/NpcSpawned.java @@ -22,11 +22,11 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; +import api.Actor; +import api.NPC; import lombok.Value; -import net.runelite.api.Actor; -import net.runelite.api.NPC; /** * An event where an {@link NPC} has spawned. diff --git a/api/src/main/java/api/events/OverheadTextChanged.java b/api/src/main/java/api/events/OverheadTextChanged.java new file mode 100644 index 0000000000..298ba82aee --- /dev/null +++ b/api/src/main/java/api/events/OverheadTextChanged.java @@ -0,0 +1,12 @@ +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/runelite-api/src/main/java/net/runelite/api/events/PlayerDespawned.java b/api/src/main/java/api/events/PlayerDespawned.java similarity index 94% rename from runelite-api/src/main/java/net/runelite/api/events/PlayerDespawned.java rename to api/src/main/java/api/events/PlayerDespawned.java index 9e38311069..c038abe94f 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/PlayerDespawned.java +++ b/api/src/main/java/api/events/PlayerDespawned.java @@ -22,11 +22,11 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; +import api.Actor; +import api.Player; import lombok.Value; -import net.runelite.api.Actor; -import net.runelite.api.Player; /** * An event where a {@link Player} has despawned. diff --git a/runelite-api/src/main/java/net/runelite/api/events/PlayerMenuOptionClicked.java b/api/src/main/java/api/events/PlayerMenuOptionClicked.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/events/PlayerMenuOptionClicked.java rename to api/src/main/java/api/events/PlayerMenuOptionClicked.java index dcfb0421ca..4480d14510 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/PlayerMenuOptionClicked.java +++ b/api/src/main/java/api/events/PlayerMenuOptionClicked.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; import lombok.Data; diff --git a/runelite-api/src/main/java/net/runelite/api/events/PlayerMenuOptionsChanged.java b/api/src/main/java/api/events/PlayerMenuOptionsChanged.java similarity index 97% rename from runelite-api/src/main/java/net/runelite/api/events/PlayerMenuOptionsChanged.java rename to api/src/main/java/api/events/PlayerMenuOptionsChanged.java index d33aa4d06c..1d2e97d60f 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/PlayerMenuOptionsChanged.java +++ b/api/src/main/java/api/events/PlayerMenuOptionsChanged.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; import lombok.Data; diff --git a/runelite-api/src/main/java/net/runelite/api/events/PlayerSpawned.java b/api/src/main/java/api/events/PlayerSpawned.java similarity index 94% rename from runelite-api/src/main/java/net/runelite/api/events/PlayerSpawned.java rename to api/src/main/java/api/events/PlayerSpawned.java index f730a0b652..61d326db1b 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/PlayerSpawned.java +++ b/api/src/main/java/api/events/PlayerSpawned.java @@ -22,11 +22,11 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; +import api.Actor; +import api.Player; import lombok.Value; -import net.runelite.api.Actor; -import net.runelite.api.Player; /** * An event where a {@link Player} has spawned. diff --git a/runelite-api/src/main/java/net/runelite/api/events/PostHealthBar.java b/api/src/main/java/api/events/PostHealthBar.java similarity index 95% rename from runelite-api/src/main/java/net/runelite/api/events/PostHealthBar.java rename to api/src/main/java/api/events/PostHealthBar.java index 01085f05bb..6d475ef24a 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/PostHealthBar.java +++ b/api/src/main/java/api/events/PostHealthBar.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.api.events; +package api.events; +import api.HealthBar; import lombok.Data; -import net.runelite.api.HealthBar; @Data public class PostHealthBar diff --git a/runelite-api/src/main/java/net/runelite/api/events/PostItemComposition.java b/api/src/main/java/api/events/PostItemDefinition.java similarity index 87% rename from runelite-api/src/main/java/net/runelite/api/events/PostItemComposition.java rename to api/src/main/java/api/events/PostItemDefinition.java index 1e9000cfd1..f7bf675912 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/PostItemComposition.java +++ b/api/src/main/java/api/events/PostItemDefinition.java @@ -22,20 +22,20 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; +import api.ItemDefinition; import lombok.Data; -import net.runelite.api.ItemComposition; /** - * An event called after a new {@link ItemComposition} is created and + * An event called after a new {@link ItemDefinition} is created and * its data is initialized. */ @Data -public class PostItemComposition +public class PostItemDefinition { /** * The newly created item. */ - private ItemComposition itemComposition; + private ItemDefinition itemDefinition; } diff --git a/runelite-api/src/main/java/net/runelite/api/events/ProjectileMoved.java b/api/src/main/java/api/events/ProjectileMoved.java similarity index 94% rename from runelite-api/src/main/java/net/runelite/api/events/ProjectileMoved.java rename to api/src/main/java/api/events/ProjectileMoved.java index 6d9a1c281f..67203f7949 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/ProjectileMoved.java +++ b/api/src/main/java/api/events/ProjectileMoved.java @@ -22,11 +22,11 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; +import api.Projectile; +import api.coords.LocalPoint; import lombok.Data; -import net.runelite.api.Projectile; -import net.runelite.api.coords.LocalPoint; /** * An event called whenever a {@link Projectile} has moved towards a point. diff --git a/runelite-api/src/main/java/net/runelite/api/events/RemovedFriend.java b/api/src/main/java/api/events/RemovedFriend.java similarity index 97% rename from runelite-api/src/main/java/net/runelite/api/events/RemovedFriend.java rename to api/src/main/java/api/events/RemovedFriend.java index c60cd13c33..40916a3de4 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/RemovedFriend.java +++ b/api/src/main/java/api/events/RemovedFriend.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; import lombok.Value; diff --git a/runelite-api/src/main/java/net/runelite/api/events/ResizeableChanged.java b/api/src/main/java/api/events/ResizeableChanged.java similarity index 97% rename from runelite-api/src/main/java/net/runelite/api/events/ResizeableChanged.java rename to api/src/main/java/api/events/ResizeableChanged.java index 146f92ac38..e1fd504cfe 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/ResizeableChanged.java +++ b/api/src/main/java/api/events/ResizeableChanged.java @@ -24,7 +24,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; import lombok.Data; diff --git a/runelite-api/src/main/java/net/runelite/api/events/ScriptCallbackEvent.java b/api/src/main/java/api/events/ScriptCallbackEvent.java similarity index 96% rename from runelite-api/src/main/java/net/runelite/api/events/ScriptCallbackEvent.java rename to api/src/main/java/api/events/ScriptCallbackEvent.java index d78269be44..d591ac4571 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/ScriptCallbackEvent.java +++ b/api/src/main/java/api/events/ScriptCallbackEvent.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.api.events; +package api.events; +import api.Script; import lombok.Data; -import net.runelite.api.Script; /** * A callback from a runelite_callback opcode in a cs2 diff --git a/api/src/main/java/api/events/SpotAnimationChanged.java b/api/src/main/java/api/events/SpotAnimationChanged.java new file mode 100644 index 0000000000..938ebc761b --- /dev/null +++ b/api/src/main/java/api/events/SpotAnimationChanged.java @@ -0,0 +1,28 @@ +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/runelite-api/src/main/java/net/runelite/api/events/UsernameChanged.java b/api/src/main/java/api/events/UsernameChanged.java similarity index 97% rename from runelite-api/src/main/java/net/runelite/api/events/UsernameChanged.java rename to api/src/main/java/api/events/UsernameChanged.java index 91bed8a304..a9ef1f437e 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/UsernameChanged.java +++ b/api/src/main/java/api/events/UsernameChanged.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; /** * An event where the username the client will log in with has changed. diff --git a/runelite-api/src/main/java/net/runelite/api/events/VarClientIntChanged.java b/api/src/main/java/api/events/VarClientIntChanged.java similarity index 97% rename from runelite-api/src/main/java/net/runelite/api/events/VarClientIntChanged.java rename to api/src/main/java/api/events/VarClientIntChanged.java index 82c2c404d4..edff23d6fd 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/VarClientIntChanged.java +++ b/api/src/main/java/api/events/VarClientIntChanged.java @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; import lombok.Value; diff --git a/runelite-api/src/main/java/net/runelite/api/events/VarClientStrChanged.java b/api/src/main/java/api/events/VarClientStrChanged.java similarity index 97% rename from runelite-api/src/main/java/net/runelite/api/events/VarClientStrChanged.java rename to api/src/main/java/api/events/VarClientStrChanged.java index e1d7da6ffa..1b6bf8ab75 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/VarClientStrChanged.java +++ b/api/src/main/java/api/events/VarClientStrChanged.java @@ -23,7 +23,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; import lombok.Value; diff --git a/runelite-api/src/main/java/net/runelite/api/events/VarbitChanged.java b/api/src/main/java/api/events/VarbitChanged.java similarity index 97% rename from runelite-api/src/main/java/net/runelite/api/events/VarbitChanged.java rename to api/src/main/java/api/events/VarbitChanged.java index 9680e54ac4..4ca53018c5 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/VarbitChanged.java +++ b/api/src/main/java/api/events/VarbitChanged.java @@ -24,7 +24,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; import lombok.Data; diff --git a/runelite-api/src/main/java/net/runelite/api/events/WallObjectChanged.java b/api/src/main/java/api/events/WallObjectChanged.java similarity index 94% rename from runelite-api/src/main/java/net/runelite/api/events/WallObjectChanged.java rename to api/src/main/java/api/events/WallObjectChanged.java index 9d20cf3b11..0abb6fb0e3 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/WallObjectChanged.java +++ b/api/src/main/java/api/events/WallObjectChanged.java @@ -22,11 +22,11 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; +import api.Tile; +import api.WallObject; import lombok.Data; -import net.runelite.api.Tile; -import net.runelite.api.WallObject; /** * An event where the {@link WallObject} of a {@link Tile} has been changed. diff --git a/runelite-api/src/main/java/net/runelite/api/events/WallObjectDespawned.java b/api/src/main/java/api/events/WallObjectDespawned.java similarity index 94% rename from runelite-api/src/main/java/net/runelite/api/events/WallObjectDespawned.java rename to api/src/main/java/api/events/WallObjectDespawned.java index b6a6a69b96..16ceed1d2e 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/WallObjectDespawned.java +++ b/api/src/main/java/api/events/WallObjectDespawned.java @@ -22,11 +22,11 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; +import api.Tile; +import api.WallObject; import lombok.Data; -import net.runelite.api.Tile; -import net.runelite.api.WallObject; /** * An event where a {@link WallObject} on a {@link Tile} has been removed. diff --git a/runelite-api/src/main/java/net/runelite/api/events/WallObjectSpawned.java b/api/src/main/java/api/events/WallObjectSpawned.java similarity index 94% rename from runelite-api/src/main/java/net/runelite/api/events/WallObjectSpawned.java rename to api/src/main/java/api/events/WallObjectSpawned.java index 0a2feaa1d3..5d20a23cac 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/WallObjectSpawned.java +++ b/api/src/main/java/api/events/WallObjectSpawned.java @@ -22,11 +22,11 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; +import api.Tile; +import api.WallObject; import lombok.Data; -import net.runelite.api.Tile; -import net.runelite.api.WallObject; /** * An event where a {@link WallObject} is added to a {@link Tile}. diff --git a/runelite-api/src/main/java/net/runelite/api/events/WidgetHiddenChanged.java b/api/src/main/java/api/events/WidgetHiddenChanged.java similarity index 95% rename from runelite-api/src/main/java/net/runelite/api/events/WidgetHiddenChanged.java rename to api/src/main/java/api/events/WidgetHiddenChanged.java index f3b3eb580e..8d8bc35d60 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/WidgetHiddenChanged.java +++ b/api/src/main/java/api/events/WidgetHiddenChanged.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.api.events; +package api.events; +import api.widgets.Widget; import lombok.Data; -import net.runelite.api.widgets.Widget; /** * An event where the hidden state of a {@link Widget} has been modified. diff --git a/runelite-api/src/main/java/net/runelite/api/events/WidgetLoaded.java b/api/src/main/java/api/events/WidgetLoaded.java similarity index 93% rename from runelite-api/src/main/java/net/runelite/api/events/WidgetLoaded.java rename to api/src/main/java/api/events/WidgetLoaded.java index c71bc41634..2573028973 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/WidgetLoaded.java +++ b/api/src/main/java/api/events/WidgetLoaded.java @@ -22,12 +22,12 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; import lombok.Data; /** - * An event where a {@link net.runelite.api.widgets.Widget} has been loaded. + * An event where a {@link api.widgets.Widget} has been loaded. */ @Data public class WidgetLoaded diff --git a/runelite-api/src/main/java/net/runelite/api/events/WidgetMenuOptionClicked.java b/api/src/main/java/api/events/WidgetMenuOptionClicked.java similarity index 90% rename from runelite-api/src/main/java/net/runelite/api/events/WidgetMenuOptionClicked.java rename to api/src/main/java/api/events/WidgetMenuOptionClicked.java index 9662a98ee8..3b111bc3b0 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/WidgetMenuOptionClicked.java +++ b/api/src/main/java/api/events/WidgetMenuOptionClicked.java @@ -22,13 +22,13 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; +import api.widgets.WidgetInfo; import lombok.Data; -import net.runelite.api.widgets.WidgetInfo; /** - * An event where an option has been clicked in a {@link net.runelite.api.widgets.Widget}s menu. + * An event where an option has been clicked in a {@link api.widgets.Widget}s menu. */ @Data public class WidgetMenuOptionClicked diff --git a/runelite-api/src/main/java/net/runelite/api/events/WidgetPositioned.java b/api/src/main/java/api/events/WidgetPositioned.java similarity index 93% rename from runelite-api/src/main/java/net/runelite/api/events/WidgetPositioned.java rename to api/src/main/java/api/events/WidgetPositioned.java index d5479e3485..6920efa03e 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/WidgetPositioned.java +++ b/api/src/main/java/api/events/WidgetPositioned.java @@ -22,12 +22,12 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.events; +package api.events; import lombok.Value; /** - * An event where the position of a {@link net.runelite.api.widgets.Widget} + * An event where the position of a {@link api.widgets.Widget} * relative to its parent has changed. */ @Value diff --git a/runelite-api/src/main/java/net/runelite/api/events/WorldListLoad.java b/api/src/main/java/api/events/WorldListLoad.java similarity index 93% rename from runelite-api/src/main/java/net/runelite/api/events/WorldListLoad.java rename to api/src/main/java/api/events/WorldListLoad.java index f7cc8e243f..892952aef1 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/WorldListLoad.java +++ b/api/src/main/java/api/events/WorldListLoad.java @@ -1,37 +1,37 @@ -/* - * 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.api.events; - -import lombok.Value; -import net.runelite.api.World; - -/** - * Event when the world list is loaded for the world switcher - */ -@Value -public class WorldListLoad -{ - private final World[] worlds; -} +/* + * 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 api.events; + +import api.World; +import lombok.Value; + +/** + * Event when the world list is loaded for the world switcher + */ +@Value +public class WorldListLoad +{ + private final World[] worlds; +} diff --git a/runelite-api/src/main/java/net/runelite/api/geometry/Geometry.java b/api/src/main/java/api/geometry/Geometry.java similarity index 99% rename from runelite-api/src/main/java/net/runelite/api/geometry/Geometry.java rename to api/src/main/java/api/geometry/Geometry.java index 39efa74afa..7b042fbdf4 100644 --- a/runelite-api/src/main/java/net/runelite/api/geometry/Geometry.java +++ b/api/src/main/java/api/geometry/Geometry.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.geometry; +package api.geometry; import java.awt.Shape; import java.awt.geom.AffineTransform; diff --git a/runelite-api/src/main/java/net/runelite/api/hooks/Callbacks.java b/api/src/main/java/api/hooks/Callbacks.java similarity index 96% rename from runelite-api/src/main/java/net/runelite/api/hooks/Callbacks.java rename to api/src/main/java/api/hooks/Callbacks.java index b6960d761f..aa8e263579 100644 --- a/runelite-api/src/main/java/net/runelite/api/hooks/Callbacks.java +++ b/api/src/main/java/api/hooks/Callbacks.java @@ -22,14 +22,14 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.hooks; +package api.hooks; +import api.MainBufferProvider; +import api.widgets.WidgetItem; import java.awt.Graphics; import java.awt.event.KeyEvent; import java.awt.event.MouseEvent; import java.awt.event.MouseWheelEvent; -import net.runelite.api.MainBufferProvider; -import net.runelite.api.widgets.WidgetItem; /** * Interface of callbacks the injected client uses to send events @@ -37,7 +37,7 @@ import net.runelite.api.widgets.WidgetItem; public interface Callbacks { /** - * Post an event. See the events in net.runelite.api.events. + * Post an event. See the events in api.events. * * @param event the event */ diff --git a/runelite-api/src/main/java/net/runelite/api/hooks/DrawCallbacks.java b/api/src/main/java/api/hooks/DrawCallbacks.java similarity index 92% rename from runelite-api/src/main/java/net/runelite/api/hooks/DrawCallbacks.java rename to api/src/main/java/api/hooks/DrawCallbacks.java index b76caecd44..46b6fdada7 100644 --- a/runelite-api/src/main/java/net/runelite/api/hooks/DrawCallbacks.java +++ b/api/src/main/java/api/hooks/DrawCallbacks.java @@ -22,12 +22,12 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.hooks; +package api.hooks; -import net.runelite.api.Renderable; -import net.runelite.api.SceneTileModel; -import net.runelite.api.SceneTilePaint; -import net.runelite.api.Texture; +import api.Renderable; +import api.SceneTileModel; +import api.SceneTilePaint; +import api.Texture; public interface DrawCallbacks { diff --git a/runelite-api/src/main/java/net/runelite/api/kit/KitType.java b/api/src/main/java/api/kit/KitType.java similarity index 84% rename from runelite-api/src/main/java/net/runelite/api/kit/KitType.java rename to api/src/main/java/api/kit/KitType.java index a808f2e899..e35167abba 100644 --- a/runelite-api/src/main/java/net/runelite/api/kit/KitType.java +++ b/api/src/main/java/api/kit/KitType.java @@ -22,17 +22,17 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.kit; +package api.kit; -import net.runelite.api.PlayerComposition; +import api.PlayerAppearance; /** * Represents an equipment slot in a players composition. *

- * These values are intended for use with {@link PlayerComposition} equipment + * These values are intended for use with {@link PlayerAppearance} equipment * slots. For obtaining information about equipment in the local players - * equipment {@link net.runelite.api.ItemContainer}, use - * {@link net.runelite.api.EquipmentInventorySlot}. + * equipment {@link api.ItemContainer}, use + * {@link api.EquipmentInventorySlot}. */ public enum KitType { @@ -61,7 +61,7 @@ public enum KitType } /** - * Gets the raw equipment index for use in {@link PlayerComposition#getEquipmentIds()}. + * Gets the raw equipment index for use in {@link PlayerAppearance#getEquipmentIds()}. * * @return raw equipment index */ diff --git a/runelite-api/src/main/java/net/runelite/api/model/Jarvis.java b/api/src/main/java/api/model/Jarvis.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/model/Jarvis.java rename to api/src/main/java/api/model/Jarvis.java index ba29c86b6d..49ea7684ff 100644 --- a/runelite-api/src/main/java/net/runelite/api/model/Jarvis.java +++ b/api/src/main/java/api/model/Jarvis.java @@ -22,11 +22,11 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.model; +package api.model; +import api.Point; import java.util.ArrayList; import java.util.List; -import net.runelite.api.Point; /** * Provides utility methods for computing the convex hull of a list of diff --git a/runelite-api/src/main/java/net/runelite/api/model/Triangle.java b/api/src/main/java/api/model/Triangle.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/model/Triangle.java rename to api/src/main/java/api/model/Triangle.java index daf59c2489..372135a878 100644 --- a/runelite-api/src/main/java/net/runelite/api/model/Triangle.java +++ b/api/src/main/java/api/model/Triangle.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.model; +package api.model; import lombok.Value; diff --git a/runelite-api/src/main/java/net/runelite/api/model/Vertex.java b/api/src/main/java/api/model/Vertex.java similarity index 96% rename from runelite-api/src/main/java/net/runelite/api/model/Vertex.java rename to api/src/main/java/api/model/Vertex.java index b59a7d7891..827f20ea61 100644 --- a/runelite-api/src/main/java/net/runelite/api/model/Vertex.java +++ b/api/src/main/java/api/model/Vertex.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.api.model; +package api.model; +import api.Perspective; import lombok.Value; -import net.runelite.api.Perspective; /** * Represents a point in a three-dimensional space. diff --git a/runelite-api/src/main/java/net/runelite/api/overlay/OverlayIndex.java b/api/src/main/java/api/overlay/OverlayIndex.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/overlay/OverlayIndex.java rename to api/src/main/java/api/overlay/OverlayIndex.java index 6aec875181..b588aa0d33 100644 --- a/runelite-api/src/main/java/net/runelite/api/overlay/OverlayIndex.java +++ b/api/src/main/java/api/overlay/OverlayIndex.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.overlay; +package api.overlay; import java.io.DataInputStream; import java.io.IOException; diff --git a/api/src/main/java/api/vars/AccountType.java b/api/src/main/java/api/vars/AccountType.java new file mode 100644 index 0000000000..6e8c2de5b6 --- /dev/null +++ b/api/src/main/java/api/vars/AccountType.java @@ -0,0 +1,35 @@ +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/runelite-api/src/main/java/net/runelite/api/vars/Autoweed.java b/api/src/main/java/api/vars/Autoweed.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/vars/Autoweed.java rename to api/src/main/java/api/vars/Autoweed.java index e4da031363..276033ffd1 100644 --- a/runelite-api/src/main/java/net/runelite/api/vars/Autoweed.java +++ b/api/src/main/java/api/vars/Autoweed.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.vars; +package api.vars; /** * An enumeration of possible autoweed settings. diff --git a/runelite-api/src/main/java/net/runelite/api/vars/InputType.java b/api/src/main/java/api/vars/InputType.java similarity index 96% rename from runelite-api/src/main/java/net/runelite/api/vars/InputType.java rename to api/src/main/java/api/vars/InputType.java index c94ccd79ef..ed5b48f731 100644 --- a/runelite-api/src/main/java/net/runelite/api/vars/InputType.java +++ b/api/src/main/java/api/vars/InputType.java @@ -22,11 +22,11 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.vars; +package api.vars; +import api.VarClientInt; import lombok.Getter; import lombok.RequiredArgsConstructor; -import net.runelite.api.VarClientInt; /** * An enumeration of input types for {@link VarClientInt#INPUT_TYPE}. diff --git a/runelite-api/src/main/java/net/runelite/api/vars/SlayerUnlock.java b/api/src/main/java/api/vars/SlayerUnlock.java similarity index 96% rename from runelite-api/src/main/java/net/runelite/api/vars/SlayerUnlock.java rename to api/src/main/java/api/vars/SlayerUnlock.java index 72733d768d..7b8c4c9727 100644 --- a/runelite-api/src/main/java/net/runelite/api/vars/SlayerUnlock.java +++ b/api/src/main/java/api/vars/SlayerUnlock.java @@ -22,11 +22,11 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.vars; +package api.vars; -import net.runelite.api.Client; -import net.runelite.api.VarPlayer; -import net.runelite.api.Varbits; +import api.Client; +import api.VarPlayer; +import api.Varbits; /** * Unlockables in the slayer interface diff --git a/runelite-api/src/main/java/net/runelite/api/widgets/ItemQuantityMode.java b/api/src/main/java/api/widgets/ItemQuantityMode.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/widgets/ItemQuantityMode.java rename to api/src/main/java/api/widgets/ItemQuantityMode.java index 501da0671f..91523bb252 100644 --- a/runelite-api/src/main/java/net/runelite/api/widgets/ItemQuantityMode.java +++ b/api/src/main/java/api/widgets/ItemQuantityMode.java @@ -23,7 +23,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.widgets; +package api.widgets; /** * Utility class mapping Widget ItemQuantityMode values diff --git a/runelite-api/src/main/java/net/runelite/api/widgets/JavaScriptCallback.java b/api/src/main/java/api/widgets/JavaScriptCallback.java similarity index 95% rename from runelite-api/src/main/java/net/runelite/api/widgets/JavaScriptCallback.java rename to api/src/main/java/api/widgets/JavaScriptCallback.java index 01786beccf..af4b2df640 100644 --- a/runelite-api/src/main/java/net/runelite/api/widgets/JavaScriptCallback.java +++ b/api/src/main/java/api/widgets/JavaScriptCallback.java @@ -22,9 +22,9 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.widgets; +package api.widgets; -import net.runelite.api.ScriptEvent; +import api.ScriptEvent; @FunctionalInterface public interface JavaScriptCallback diff --git a/runelite-api/src/main/java/net/runelite/api/widgets/Widget.java b/api/src/main/java/api/widgets/Widget.java similarity index 97% rename from runelite-api/src/main/java/net/runelite/api/widgets/Widget.java rename to api/src/main/java/api/widgets/Widget.java index 41b843f417..71b76725bb 100644 --- a/runelite-api/src/main/java/net/runelite/api/widgets/Widget.java +++ b/api/src/main/java/api/widgets/Widget.java @@ -22,12 +22,13 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.widgets; +package api.widgets; +import api.FontTypeFace; +import api.Point; +import api.SpriteID; import java.awt.Rectangle; import java.util.Collection; -import net.runelite.api.FontTypeFace; -import net.runelite.api.Point; /** * Represents an on-screen UI element that is drawn on the canvas. @@ -252,7 +253,7 @@ public interface Widget * Gets the sprite ID displayed in the widget. * * @return the sprite ID - * @see net.runelite.api.SpriteID + * @see SpriteID */ int getSpriteId(); @@ -260,7 +261,7 @@ public interface Widget * Sets the sprite ID displayed in the widget. * * @param spriteId the sprite ID - * @see net.runelite.api.SpriteID + * @see SpriteID */ void setSpriteId(int spriteId); @@ -306,7 +307,7 @@ public interface Widget /** * Gets the width of the widget. *

- * If this widget is storing any {@link WidgetItem}s, this value is + * If this widget is storing any {@link // WidgetItem}s, this value is * used to store the number of item slot columns. * * @return the width @@ -625,14 +626,14 @@ public interface Widget /** * Returns the archive id of the font used * - * @see net.runelite.api.FontID + * @see api.FontID */ int getFontId(); /** * Sets the archive id of the font * - * @see net.runelite.api.FontID + * @see api.FontID */ void setFontId(int id); @@ -680,12 +681,12 @@ public interface Widget void setDragDeadTime(int deadTime); /** - * Returns widget {@link net.runelite.api.widgets.ItemQuantityMode}. + * Returns widget {@link api.widgets.ItemQuantityMode}. */ int getItemQuantityMode(); /** - * Sets the widget {@link net.runelite.api.widgets.ItemQuantityMode} + * Sets the widget {@link api.widgets.ItemQuantityMode} */ void setItemQuantityMode(int itemQuantityMode); diff --git a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetConfig.java b/api/src/main/java/api/widgets/WidgetConfig.java similarity index 96% rename from runelite-api/src/main/java/net/runelite/api/widgets/WidgetConfig.java rename to api/src/main/java/api/widgets/WidgetConfig.java index 31829b5417..6768446983 100644 --- a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetConfig.java +++ b/api/src/main/java/api/widgets/WidgetConfig.java @@ -22,9 +22,8 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.widgets; +package api.widgets; -import net.runelite.api.MenuAction; /** * Utility class used for defining options to be used on the click mask @@ -92,7 +91,7 @@ public class WidgetConfig /** * Add a USE option * - * @see MenuAction#ITEM_USE + * @see// MenuAction#ITEM_USE */ public static final int ITEM_USE_OP = 1 << 31; } diff --git a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java b/api/src/main/java/api/widgets/WidgetID.java similarity index 99% rename from runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java rename to api/src/main/java/api/widgets/WidgetID.java index 2bb4fbe3d9..729c630f7a 100644 --- a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java +++ b/api/src/main/java/api/widgets/WidgetID.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.widgets; +package api.widgets; /** * Utility class mapping widget IDs to global constants. diff --git a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java b/api/src/main/java/api/widgets/WidgetInfo.java similarity index 99% rename from runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java rename to api/src/main/java/api/widgets/WidgetInfo.java index 4ae996c3d4..e0f565a26d 100644 --- a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java +++ b/api/src/main/java/api/widgets/WidgetInfo.java @@ -22,12 +22,12 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.widgets; +package api.widgets; /** * Represents a group-child {@link Widget} relationship. *

- * For getting a specific widget from the client, see {@link net.runelite.api.Client#getWidget(WidgetInfo)}. + * For getting a specific widget from the client, see {@link api.Client#getWidget(WidgetInfo)}. */ public enum WidgetInfo { diff --git a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetItem.java b/api/src/main/java/api/widgets/WidgetItem.java similarity index 96% rename from runelite-api/src/main/java/net/runelite/api/widgets/WidgetItem.java rename to api/src/main/java/api/widgets/WidgetItem.java index c39e961f81..359943d8e8 100644 --- a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetItem.java +++ b/api/src/main/java/api/widgets/WidgetItem.java @@ -22,13 +22,13 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.widgets; +package api.widgets; +import api.Point; import java.awt.Rectangle; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.ToString; -import net.runelite.api.Point; /** * An item that is being represented in a {@link Widget}. @@ -41,7 +41,7 @@ public class WidgetItem /** * The ID of the item represented. * - * @see net.runelite.api.ItemID + * @see api.ItemID */ private final int id; /** diff --git a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetPositionMode.java b/api/src/main/java/api/widgets/WidgetPositionMode.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/widgets/WidgetPositionMode.java rename to api/src/main/java/api/widgets/WidgetPositionMode.java index 7ebfdf3c61..142162aefb 100644 --- a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetPositionMode.java +++ b/api/src/main/java/api/widgets/WidgetPositionMode.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.widgets; +package api.widgets; public final class WidgetPositionMode { diff --git a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetSizeMode.java b/api/src/main/java/api/widgets/WidgetSizeMode.java similarity index 97% rename from runelite-api/src/main/java/net/runelite/api/widgets/WidgetSizeMode.java rename to api/src/main/java/api/widgets/WidgetSizeMode.java index f468491d81..7ce7d6db11 100644 --- a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetSizeMode.java +++ b/api/src/main/java/api/widgets/WidgetSizeMode.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.widgets; +package api.widgets; public final class WidgetSizeMode { diff --git a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetTextAlignment.java b/api/src/main/java/api/widgets/WidgetTextAlignment.java similarity index 97% rename from runelite-api/src/main/java/net/runelite/api/widgets/WidgetTextAlignment.java rename to api/src/main/java/api/widgets/WidgetTextAlignment.java index 1b47301f02..68266014a4 100644 --- a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetTextAlignment.java +++ b/api/src/main/java/api/widgets/WidgetTextAlignment.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.widgets; +package api.widgets; public final class WidgetTextAlignment { diff --git a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetType.java b/api/src/main/java/api/widgets/WidgetType.java similarity index 98% rename from runelite-api/src/main/java/net/runelite/api/widgets/WidgetType.java rename to api/src/main/java/api/widgets/WidgetType.java index 9d140c3cd0..c039ed18bf 100644 --- a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetType.java +++ b/api/src/main/java/api/widgets/WidgetType.java @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.api.widgets; +package api.widgets; public final class WidgetType { diff --git a/runescape-api/src/main/java/net/runelite/mapping/Construct.java b/api/src/main/java/mapping/Construct.java similarity index 100% rename from runescape-api/src/main/java/net/runelite/mapping/Construct.java rename to api/src/main/java/mapping/Construct.java diff --git a/api/src/main/java/mapping/Export.java b/api/src/main/java/mapping/Export.java new file mode 100644 index 0000000000..cd789618cd --- /dev/null +++ b/api/src/main/java/mapping/Export.java @@ -0,0 +1,40 @@ +/* + * 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.FIELD, ElementType.METHOD +}) +public @interface Export +{ + String value(); +} diff --git a/cache/src/main/java/net/runelite/cache/script/assembler/LookupSwitch.java b/api/src/main/java/mapping/Hook.java similarity index 77% rename from cache/src/main/java/net/runelite/cache/script/assembler/LookupSwitch.java rename to api/src/main/java/mapping/Hook.java index e1d305d40e..6fa13fb8d5 100644 --- a/cache/src/main/java/net/runelite/cache/script/assembler/LookupSwitch.java +++ b/api/src/main/java/mapping/Hook.java @@ -22,17 +22,23 @@ * (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.script.assembler; +package net.runelite.mapping; -import java.util.ArrayList; -import java.util.List; +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; -public class LookupSwitch -{ - private final List cases = new ArrayList<>(); - - public List getCases() +@Retention(RetentionPolicy.RUNTIME) +@Target( { - return cases; - } + ElementType.METHOD, ElementType.CONSTRUCTOR + }) +@Documented +public @interface Hook +{ + String value(); + + boolean end() default false; } diff --git a/cache-client/src/main/java/net/runelite/cache/client/DownloadWatcher.java b/api/src/main/java/mapping/Implements.java similarity index 82% rename from cache-client/src/main/java/net/runelite/cache/client/DownloadWatcher.java rename to api/src/main/java/mapping/Implements.java index 3924c74541..4c19074e10 100644 --- a/cache-client/src/main/java/net/runelite/cache/client/DownloadWatcher.java +++ b/api/src/main/java/mapping/Implements.java @@ -22,12 +22,16 @@ * (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.mapping; -import net.runelite.cache.fs.Archive; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; -@FunctionalInterface -public interface DownloadWatcher +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +public @interface Implements { - void downloadComplete(Archive archive, byte[] data); + String value(); } diff --git a/runescape-api/src/main/java/net/runelite/mapping/Import.java b/api/src/main/java/mapping/Import.java similarity index 100% rename from runescape-api/src/main/java/net/runelite/mapping/Import.java rename to api/src/main/java/mapping/Import.java diff --git a/api/src/main/java/mapping/ObfuscatedGetter.java b/api/src/main/java/mapping/ObfuscatedGetter.java new file mode 100644 index 0000000000..b8e2873006 --- /dev/null +++ b/api/src/main/java/mapping/ObfuscatedGetter.java @@ -0,0 +1,39 @@ +/* + * 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.FIELD) +public @interface ObfuscatedGetter +{ + int intValue() default 0; + + long longValue() default 0L; +} diff --git a/runelite-client/src/test/java/net/runelite/client/RuneLiteModuleTest.java b/api/src/main/java/mapping/ObfuscatedName.java similarity index 80% rename from runelite-client/src/test/java/net/runelite/client/RuneLiteModuleTest.java rename to api/src/main/java/mapping/ObfuscatedName.java index fbfdf9fbac..10ccf9ecd4 100644 --- a/runelite-client/src/test/java/net/runelite/client/RuneLiteModuleTest.java +++ b/api/src/main/java/mapping/ObfuscatedName.java @@ -1,38 +1,40 @@ -/* - * 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.client; - -import com.google.inject.Guice; -import net.runelite.client.rs.ClientUpdateCheckMode; -import org.junit.Test; - -public class RuneLiteModuleTest -{ - @Test - public void testConfigure() - { - Guice.createInjector(new RuneLiteModule(ClientUpdateCheckMode.AUTO, true)); - } -} +/* + * 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.FIELD, ElementType.METHOD, ElementType.TYPE + }) +public @interface ObfuscatedName +{ + String value(); +} diff --git a/api/src/main/java/mapping/ObfuscatedSignature.java b/api/src/main/java/mapping/ObfuscatedSignature.java new file mode 100644 index 0000000000..1c0bf31b35 --- /dev/null +++ b/api/src/main/java/mapping/ObfuscatedSignature.java @@ -0,0 +1,42 @@ +/* + * 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/http-api/src/main/java/net/runelite/http/api/feed/FeedItem.java b/api/src/main/java/mapping/Protect.java similarity index 75% rename from http-api/src/main/java/net/runelite/http/api/feed/FeedItem.java rename to api/src/main/java/mapping/Protect.java index 620f639d15..a5c780a94d 100644 --- a/http-api/src/main/java/net/runelite/http/api/feed/FeedItem.java +++ b/api/src/main/java/mapping/Protect.java @@ -22,21 +22,19 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.http.api.feed; +package net.runelite.mapping; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.RequiredArgsConstructor; +import java.lang.annotation.Documented; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; -@Data -@RequiredArgsConstructor -@AllArgsConstructor -public class FeedItem +/** + * Used to indicate a method can only be called from within mixins. + * Calling methods annotated with this annotation outside mixins results in a AbstractMethodError. + * Only works in net.runelite.rs.api.* + */ +@Documented +@Retention(RetentionPolicy.RUNTIME) +public @interface Protect { - private final FeedItemType type; - private String avatar; - private final String title; - private final String content; - private final String url; - private final long timestamp; } diff --git a/api/src/main/java/rs/api/RSAbstractFont.java b/api/src/main/java/rs/api/RSAbstractFont.java new file mode 100644 index 0000000000..337dbdc604 --- /dev/null +++ b/api/src/main/java/rs/api/RSAbstractFont.java @@ -0,0 +1,18 @@ +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 new file mode 100644 index 0000000000..793c87f69e --- /dev/null +++ b/api/src/main/java/rs/api/RSAbstractIndexCache.java @@ -0,0 +1,10 @@ +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/http-service/src/main/java/net/runelite/http/service/util/HiscoreEndpointEditor.java b/api/src/main/java/rs/api/RSAbstractRasterProvider.java similarity index 76% rename from http-service/src/main/java/net/runelite/http/service/util/HiscoreEndpointEditor.java rename to api/src/main/java/rs/api/RSAbstractRasterProvider.java index 816981f99a..98cbc79094 100644 --- a/http-service/src/main/java/net/runelite/http/service/util/HiscoreEndpointEditor.java +++ b/api/src/main/java/rs/api/RSAbstractRasterProvider.java @@ -1,5 +1,7 @@ /* - * Copyright (c) 2017, Adam + * BSD 2-Clause License + * + * Copyright (c) 2019, ThatGamerBlue * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -24,17 +26,25 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.http.service.util; +package rs.api; -import net.runelite.http.api.hiscore.HiscoreEndpoint; +import api.BufferProvider; +import net.runelite.mapping.Import; -import java.beans.PropertyEditorSupport; - -public class HiscoreEndpointEditor extends PropertyEditorSupport +public interface RSAbstractRasterProvider extends BufferProvider { + @Import("pixels") @Override - public void setAsText(String text) throws IllegalArgumentException - { - setValue(HiscoreEndpoint.valueOf(text.toUpperCase())); - } + int[] getPixels(); + + @Import("width") + @Override + int getWidth(); + + @Import("height") + @Override + int getHeight(); + + @Import("apply") + void setRaster(); } diff --git a/runescape-api/src/main/java/net/runelite/rs/api/RSActor.java b/api/src/main/java/rs/api/RSActor.java similarity index 67% rename from runescape-api/src/main/java/net/runelite/rs/api/RSActor.java rename to api/src/main/java/rs/api/RSActor.java index 801cf4413a..cd46144323 100644 --- a/runescape-api/src/main/java/net/runelite/rs/api/RSActor.java +++ b/api/src/main/java/rs/api/RSActor.java @@ -22,24 +22,28 @@ * (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.rs.api; +package rs.api; -import net.runelite.api.Actor; +import api.Actor; import net.runelite.mapping.Import; -public interface RSActor extends RSRenderable, Actor +public interface RSActor extends RSEntity, Actor { - @Import("interacting") + @Import("targetIndex") int getRSInteracting(); - @Import("overhead") + // Overhead text + + @Import("overheadText") @Override String getOverheadText(); - @Import("overhead") + @Import("overheadText") @Override void setOverheadText(String overheadText); + // Coord stuff + @Import("x") int getX(); @@ -52,76 +56,88 @@ public interface RSActor extends RSRenderable, Actor @Import("pathY") int[] getPathY(); - @Import("animation") + // Animation + + @Import("sequence") @Override int getAnimation(); - @Import("animation") + @Import("sequence") @Override void setAnimation(int animation); - @Import("graphic") + @Import("sequenceFrame") @Override - int getGraphic(); + int getActionFrame(); - @Import("graphic") + @Import("sequenceFrame") @Override - void setGraphic(int graphic); + void setActionFrame(int frame); - @Import("combatInfoList") - RSCombatInfoList getCombatInfoList(); + @Import("sequenceFrameCycle") + @Override + int getActionFrameCycle(); + + // Spot animation (aka graphic) + + @Import("spotAnimation") + @Override + int getSpotAnimation(); + + @Import("spotAnimation") + @Override + void setSpotAnimation(int id); + + @Import("spotAnimationFrame") + int getSpotAnimationFrame(); + + @Import("spotAnimationFrame") + @Override + void setSpotAnimationFrame(int id); + + @Import("spotAnimationFrameCycle") + int getSpotAnimationFrameCycle(); + + // Idle animation + + @Import("idleSequence") + @Override + void setIdlePoseAnimation(int animation); + + // Movement animation (aka poseAnimation) + + @Import("movementSequence") + @Override + void setPoseAnimation(int animation); + + @Import("movementFrame") + int getPoseFrame(); + + @Import("movementFrame") + void setPoseFrame(int frame); + + @Import("movementFrameCycle") + int getPoseFrameCycle(); + + @Import("defaultHeight") + @Override + int getLogicalHeight(); @Import("orientation") @Override int getOrientation(); - @Import("logicalHeight") - @Override - int getLogicalHeight(); + // Health stuff - @Import("idlePoseAnimation") - @Override - void setIdlePoseAnimation(int animation); + @Import("healthBars") + RSIterableNodeDeque getHealthBars(); - @Import("poseAnimation") - @Override - void setPoseAnimation(int animation); - - @Import("actionFrame") - int getActionFrame(); - - @Import("actionFrame") - @Override - void setActionFrame(int frame); - - @Import("actionFrameCycle") - int getActionFrameCycle(); - - @Import("poseFrame") - int getPoseFrame(); - - @Import("poseFrame") - void setPoseFrame(int frame); - - @Import("poseFrameCycle") - int getPoseFrameCycle(); - - @Import("spotAnimFrame") - int getSpotAnimFrame(); - - @Import("spotAnimFrame") - @Override - void setSpotAnimFrame(int frame); - - @Import("spotAnimFrameCycle") - int getSpotAnimFrameCycle(); - - @Import("hitsplatValues") + @Import("hitSplatValues") int[] getHitsplatValues(); - @Import("hitsplatTypes") + @Import("hitSplatTypes") int[] getHitsplatTypes(); - @Import("hitsplatCycles") + @Import("hitSplatCycles") int[] getHitsplatCycles(); } diff --git a/runescape-api/src/main/java/net/runelite/rs/api/RSFrame.java b/api/src/main/java/rs/api/RSAnimation.java similarity index 87% rename from runescape-api/src/main/java/net/runelite/rs/api/RSFrame.java rename to api/src/main/java/rs/api/RSAnimation.java index 6169518500..1a53a19304 100644 --- a/runescape-api/src/main/java/net/runelite/rs/api/RSFrame.java +++ b/api/src/main/java/rs/api/RSAnimation.java @@ -22,30 +22,30 @@ * (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.rs.api; +package rs.api; import net.runelite.mapping.Import; -public interface RSFrame +public interface RSAnimation { - @Import("skin") - RSFrameMap getSkin(); + @Import("skeleton") + RSSkeleton getSkin(); @Import("transformCount") int getTransformCount(); - @Import("transformTypes") + @Import("transformSkeletonLabels") int[] getTransformTypes(); - @Import("translator_x") + @Import("transformXs") int[] getTranslatorX(); - @Import("translator_y") + @Import("transformYs") int[] getTranslatorY(); - @Import("translator_z") + @Import("transformZs") int[] getTranslatorZ(); - @Import("showing") + @Import("hasAlphaTransform") boolean isShowing(); } diff --git a/api/src/main/java/rs/api/RSBoundaryObject.java b/api/src/main/java/rs/api/RSBoundaryObject.java new file mode 100644 index 0000000000..fd93d3183c --- /dev/null +++ b/api/src/main/java/rs/api/RSBoundaryObject.java @@ -0,0 +1,41 @@ +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 new file mode 100644 index 0000000000..45cb0b3b0f --- /dev/null +++ b/api/src/main/java/rs/api/RSBuddy.java @@ -0,0 +1,14 @@ +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 new file mode 100644 index 0000000000..365272e06d --- /dev/null +++ b/api/src/main/java/rs/api/RSBuffer.java @@ -0,0 +1,12 @@ +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 new file mode 100644 index 0000000000..28d37bc0b4 --- /dev/null +++ b/api/src/main/java/rs/api/RSCanvas.java @@ -0,0 +1,5 @@ +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 new file mode 100644 index 0000000000..91bc1a9fbe --- /dev/null +++ b/api/src/main/java/rs/api/RSChatChannel.java @@ -0,0 +1,18 @@ +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 new file mode 100644 index 0000000000..dab7c5f895 --- /dev/null +++ b/api/src/main/java/rs/api/RSClanChat.java @@ -0,0 +1,12 @@ +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 new file mode 100644 index 0000000000..362d7a8904 --- /dev/null +++ b/api/src/main/java/rs/api/RSClanMate.java @@ -0,0 +1,7 @@ +package rs.api; + +import api.ClanMember; + +public interface RSClanMate extends RSBuddy, ClanMember +{ +} diff --git a/runescape-api/src/main/java/net/runelite/rs/api/RSClient.java b/api/src/main/java/rs/api/RSClient.java similarity index 58% rename from runescape-api/src/main/java/net/runelite/rs/api/RSClient.java rename to api/src/main/java/rs/api/RSClient.java index f5e9d4c139..8868825de5 100644 --- a/runescape-api/src/main/java/net/runelite/rs/api/RSClient.java +++ b/api/src/main/java/rs/api/RSClient.java @@ -1,60 +1,64 @@ /* - * Copyright (c) 2016-2017, Adam + * BSD 2-Clause License + * + * Copyright (c) 2019, ThatGamerBlue * 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. + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. * - * 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. + * 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.rs.api; +package rs.api; + +import api.Client; +import api.Sprite; +import api.World; +import api.widgets.Widget; import java.util.Map; -import net.runelite.api.Client; -import net.runelite.api.SpritePixels; -import net.runelite.api.World; -import net.runelite.api.widgets.Widget; import net.runelite.mapping.Construct; import net.runelite.mapping.Import; -public interface RSClient extends RSGameEngine, Client +public interface RSClient extends RSGameShell, Client { @Import("cameraX") @Override int getCameraX(); - @Import("cameraY") + @Import("cameraZ") // <--- This is correct! @Override int getCameraY(); - @Import("cameraZ") + @Import("cameraY") // <--- This is correct! @Override int getCameraZ(); - @Import("cameraX2") + @Import("Scene_cameraX") @Override int getCameraX2(); - @Import("cameraY2") + @Import("Scene_cameraY") @Override int getCameraY2(); - @Import("cameraZ2") + @Import("Scene_cameraZ") @Override int getCameraZ2(); @@ -73,33 +77,33 @@ public interface RSClient extends RSGameEngine, Client @Override int getCameraYaw(); - @Import("world") + @Import("worldId") int getWorld(); - @Import("FPS") + @Import("fps") @Override int getFPS(); - @Import("mapAngle") + @Import("minimapOrientation") @Override int getMapAngle(); - @Import("tileHeights") + @Import("Tiles_heights") @Override int[][][] getTileHeights(); - @Import("tileSettings") + @Import("Tiles_renderFlags") @Override byte[][][] getTileSettings(); - @Import("clientVarps") + @Import("Varps_main") @Override int[] getVarps(); @Import("varcs") RSVarcs getVarcs(); - @Import("energy") + @Import("runEnergy") @Override int getEnergy(); @@ -115,15 +119,15 @@ public interface RSClient extends RSGameEngine, Client @Override int getBaseY(); - @Import("boostedSkillLevels") + @Import("currentLevels") @Override int[] getBoostedSkillLevels(); - @Import("realSkillLevels") + @Import("levels") @Override int[] getRealSkillLevels(); - @Import("skillExperiences") + @Import("experience") @Override int[] getSkillExperiences(); @@ -143,33 +147,33 @@ public interface RSClient extends RSGameEngine, Client @Override void setCheckClick(boolean checkClick); - @Import("mouseX2") + @Import("Scene_selectedScreenX") void setMouseCanvasHoverPositionX(int x); - @Import("mouseY2") + @Import("Scene_selectedScreenY") void setMouseCanvasHoverPositionY(int y); - @Import("mouseCurrentButton") + @Import("MouseHandler_currentButton") @Override int getMouseCurrentButton(); - @Import("selectedSceneTileX") + @Import("Scene_selectedX") int getSelectedSceneTileX(); - @Import("selectedSceneTileX") + @Import("Scene_selectedX") void setSelectedSceneTileX(int selectedSceneTileX); - @Import("selectedSceneTileY") + @Import("Scene_selectedY") int getSelectedSceneTileY(); - @Import("selectedSceneTileY") + @Import("Scene_selectedY") void setSelectedSceneTileY(int selectedSceneTileY); - @Import("draggingWidget") + @Import("isDraggingWidget") @Override boolean isDraggingWidget(); - @Import("draggedWidget") + @Import("clickedWidget") @Override RSWidget getDraggedWidget(); @@ -189,7 +193,7 @@ public interface RSClient extends RSGameEngine, Client * * @param groupId the group ID * @return the widget group - * @see net.runelite.api.widgets.WidgetID + * @see api.widgets.WidgetID */ RSWidget[] getGroup(int groupId); @@ -201,66 +205,58 @@ public interface RSClient extends RSGameEngine, Client @Override RSPlayer getLocalPlayer(); - @Import("npcIndexesCount") + @Import("npcCount") int getNpcIndexesCount(); @Import("npcIndices") int[] getNpcIndices(); - @Import("cachedNPCs") + @Import("npcs") @Override RSNPC[] getCachedNPCs(); @Import("collisionMaps") - RSCollisionData[] getCollisionMaps(); + RSCollisionMap[] getCollisionMaps(); - @Import("playerIndexesCount") + @Import("Players_count") int getPlayerIndexesCount(); - @Import("playerIndices") + @Import("Players_indices") int[] getPlayerIndices(); - @Import("cachedPlayers") + @Import("players") @Override RSPlayer[] getCachedPlayers(); - @Import("localInteractingIndex") + @Import("combatTargetPlayerIndex") int getLocalInteractingIndex(); - @Import("groundItemDeque") - RSDeque[][][] getGroundItemDeque(); + @Import("groundItems") + RSNodeDeque[][][] getGroundItemDeque(); @Import("projectiles") - RSDeque getProjectilesDeque(); + RSNodeDeque getProjectilesDeque(); - @Import("graphicsObjectDeque") - RSDeque getGraphicsObjectDeque(); + @Import("graphicsObjects") + RSNodeDeque getGraphicsObjectDeque(); - @Import("username") + @Import("Login_username") @Override String getUsername(); - @Import("username") + @Import("Login_username") @Override void setUsername(String username); - @Import("password") + @Import("Login_password") @Override void setPassword(String password); - @Import("otp") - @Override - void setOtp(String otp); - @Import("currentLoginField") @Override int getCurrentLoginField(); - @Import("loginIndex") - @Override - int getLoginIndex(); - - @Import("playerOptions") + @Import("playerMenuActions") @Override String[] getPlayerOptions(); @@ -268,20 +264,20 @@ public interface RSClient extends RSGameEngine, Client @Override boolean[] getPlayerOptionsPriorities(); - @Import("playerMenuTypes") + @Import("playerMenuOpcodes") @Override int[] getPlayerMenuTypes(); - @Import("mouseX") + @Import("MouseHandler_x0") int getMouseX(); - @Import("mouseY") + @Import("MouseHandler_y0") int getMouseY(); - @Import("mouseX2") + @Import("Scene_selectedScreenX") int getMouseX2(); - @Import("mouseY2") + @Import("Scene_selectedScreenY") int getMouseY2(); @Import("containsBounds") @@ -290,34 +286,34 @@ public interface RSClient extends RSGameEngine, Client @Import("checkClick") boolean isCheckClick(); - @Import("menuOptionCount") + @Import("menuOptionsCount") int getMenuOptionCount(); - @Import("menuOptionCount") + @Import("menuOptionsCount") void setMenuOptionCount(int menuOptionCount); - @Import("menuOptions") + @Import("menuActions") String[] getMenuOptions(); - @Import("menuTargets") + @Import("menuTargetNames") String[] getMenuTargets(); - @Import("menuIdentifiers") + @Import("menuArguments0") int[] getMenuIdentifiers(); - @Import("menuTypes") + @Import("menuOpcodes") int[] getMenuTypes(); - @Import("menuActionParams0") + @Import("menuArguments1") int[] getMenuActionParams0(); - @Import("menuActionParams1") + @Import("menuArguments2") int[] getMenuActionParams1(); - @Import("menuForceLeftClick") + @Import("menuShiftClick") boolean[] getMenuForceLeftClick(); - @Import("worldList") + @Import("worlds") @Override RSWorld[] getWorldList(); @@ -326,13 +322,13 @@ public interface RSClient extends RSGameEngine, Client @Override @Import("getObjectDefinition") - RSObjectComposition getObjectDefinition(int objectId); + RSObjectDefinition getObjectDefinition(int objectId); @Override @Import("getNpcDefinition") - RSNPCComposition getNpcDefinition(int npcId); + RSNPCDefinition getNpcDefinition(int npcId); - @Import("scale") + @Import("viewportZoom") @Override int getScale(); @@ -352,36 +348,37 @@ public interface RSClient extends RSGameEngine, Client @Override int getViewportWidth(); - @Import("Viewport_xOffset") + @Import("viewportOffsetX") @Override int getViewportXOffset(); - @Import("Viewport_yOffset") + @Import("viewportOffsetY") @Override int getViewportYOffset(); - @Import("isResized") + @Import("isResizable") @Override boolean isResized(); - @Import("widgetPositionX") + @Import("rootWidgetXs") @Override int[] getWidgetPositionsX(); - @Import("widgetPositionY") + @Import("rootWidgetYs") @Override int[] getWidgetPositionsY(); @Import("itemContainers") - RSHashTable getItemContainers(); + RSNodeHashTable getItemContainers(); @Import("getItemDefinition") @Override - RSItemComposition getItemDefinition(int itemId); + RSItemDefinition getItemDefinition(int itemId); - @Import("createSprite") - RSSpritePixels createItemSprite(int itemId, int quantity, int thickness, int borderColor, int stackable, boolean noted); + @Import("getItemSprite") + RSSprite createItemSprite(int itemId, int quantity, int thickness, int borderColor, int stackable, boolean noted); + @Import("menuAction") @Override void invokeMenuAction(int n2, int n3, int n4, int n5, String string, String string2, int n6, int n7); @@ -409,11 +406,11 @@ public interface RSClient extends RSGameEngine, Client @Import("indexedSpriteOffsetYs") void setIndexedSpriteOffsetYs(int[] indexedSpriteOffsetYs); - @Import("indexSpriteWidths") - int[] getIndexSpriteWidths(); + @Import("indexedSpriteWidths") + int[] getIndexedSpriteWidths(); - @Import("indexSpriteWidths") - void setIndexSpriteWidths(int[] indexSpriteWidths); + @Import("indexedSpriteWidths") + void setIndexedSpriteWidths(int[] indexedSpriteWidths); @Import("indexedSpriteHeights") int[] getIndexedSpriteHeights(); @@ -431,23 +428,23 @@ public interface RSClient extends RSGameEngine, Client int[] getIndexedSpritePalette(); @Import("indexedSpritePalette") - void setIndexSpritePalette(int[] indexSpritePalette); + void setIndexedSpritePalette(int[] indexedSpritePalette); - @Import("indexSprites") + @Import("indexCache8") @Override - RSIndexDataBase getIndexSprites(); + RSAbstractIndexCache getIndexSprites(); - @Import("indexScripts") + @Import("indexCache12") @Override - RSIndexDataBase getIndexScripts(); + RSAbstractIndexCache getIndexScripts(); - @Import("widgetFlags") + @Import("widgetClickMasks") @Override - RSHashTable getWidgetFlags(); + RSNodeHashTable getWidgetFlags(); - @Import("componentTable") + @Import("widgetGroupParents") @Override - RSHashTable getComponentTable(); + RSNodeHashTable getComponentTable(); @Import("grandExchangeOffers") RSGrandExchangeOffer[] getGrandExchangeOffers(); @@ -456,30 +453,31 @@ public interface RSClient extends RSGameEngine, Client @Override boolean isMenuOpen(); - @Import("gameCycle") + @Import("cycle") @Override int getGameCycle(); - @Import("packetHandler") - void packetHandler(); + // unused + //@Import("packetHandler") + //void packetHandler(); - @Import("chatLineMap") + @Import("Messages_channels") @Override Map getChatLineMap(); - @Import("messages") + @Import("Messages_hashTable") @Override - RSIterableHashTable getMessages(); + RSIterableNodeHashTable getMessages(); @Import("revision") @Override int getRevision(); - @Import("mapRegions") + @Import("regions") @Override int[] getMapRegions(); - @Import("instanceTemplateChunks") + @Import("instanceChunkTemplates") @Override int[][][] getInstanceTemplateChunks(); @@ -507,29 +505,29 @@ public interface RSClient extends RSGameEngine, Client * * @return */ - @Import("widgetRoot") + @Import("rootWidgetGroup") int getWidgetRoot(); - @Import("mapElementConfigs") + @Import("WorldMapElement_cached") @Override - RSMapElementConfig[] getMapElementConfigs(); + RSWorldMapElement[] getMapElementConfigs(); - @Import("mapscene") + @Import("mapSceneSprites") @Override RSIndexedSprite[] getMapScene(); @Import("mapIcons") @Override - RSSpritePixels[] getMapIcons(); + RSSprite[] getMapIcons(); - @Import("mapDots") - RSSpritePixels[] getMapDots(); + @Import("mapDotSprites") + RSSprite[] getMapDots(); - @Import("modIcons") + @Import("modIconSprites") @Override RSIndexedSprite[] getModIcons(); - @Import("modIcons") + @Import("modIconSprites") void setRSModIcons(RSIndexedSprite[] modIcons); @Construct @@ -538,7 +536,7 @@ public interface RSClient extends RSGameEngine, Client @Construct @Override - RSSpritePixels createSpritePixels(int[] pixels, int width, int height); + RSSprite createSprite(int[] pixels, int width, int height); @Import("destinationX") int getDestinationX(); @@ -546,10 +544,10 @@ public interface RSClient extends RSGameEngine, Client @Import("destinationY") int getDestinationY(); - @Import("audioEffects") + @Import("soundEffects") RSSoundEffect[] getAudioEffects(); - @Import("queuedSoundEffectIDs") + @Import("soundEffectIds") int[] getQueuedSoundEffectIDs(); @Import("soundLocations") @@ -561,88 +559,88 @@ public interface RSClient extends RSGameEngine, Client @Import("queuedSoundEffectDelays") int[] getQueuedSoundEffectDelays(); - @Import("queuedSoundEffectCount") + @Import("soundEffectCount") int getQueuedSoundEffectCount(); - @Import("queuedSoundEffectCount") + @Import("soundEffectCount") void setQueuedSoundEffectCount(int queuedSoundEffectCount); @Import("rasterProvider") @Override - RSBufferProvider getBufferProvider(); + RSAbstractRasterProvider getBufferProvider(); - @Import("mouseIdleTicks") + @Import("MouseHandler_idleCycles") @Override int getMouseIdleTicks(); - @Import("mouseLastPressedTimeMillis") + @Import("MouseHandler_lastPressedTimeMillis") @Override long getMouseLastPressedMillis(); - @Import("keyboardIdleTicks") + @Import("KeyHandler_idleCycles") @Override int getKeyboardIdleTicks(); - @Import("lowMemory") + @Import("isLowDetail") void setLowMemory(boolean lowMemory); - @Import("sceneLowMemory") + @Import("Scene_isLowDetail") void setSceneLowMemory(boolean lowMemory); - @Import("audioHighMemory") + @Import("isStereo") void setAudioHighMemory(boolean highMemory); - @Import("objectCompositionLowDetail") - void setObjectCompositionLowDetail(boolean lowDetail); + @Import("ObjectDefinition_isLowDetail") + void setObjectDefinitionLowDetail(boolean lowDetail); @Construct - RSItem createItem(); + RSGroundItem createItem(); - @Import("intStackSize") + @Import("Interpreter_intStackSize") @Override int getIntStackSize(); - @Import("intStackSize") + @Import("Interpreter_intStackSize") @Override void setIntStackSize(int stackSize); - @Import("intStack") + @Import("Interpreter_intStack") @Override int[] getIntStack(); - @Import("scriptStringStackSize") + @Import("Interpreter_stringStackSize") @Override int getStringStackSize(); - @Import("scriptStringStackSize") + @Import("Interpreter_stringStackSize") @Override void setStringStackSize(int stackSize); - @Import("scriptStringStack") + @Import("Interpreter_stringStack") @Override String[] getStringStack(); - @Import("friendManager") - RSFriendManager getFriendManager(); + @Import("friendSystem") + RSFriendSystem getFriendManager(); - @Import("clanMemberManager") - RSClanMemberManager getClanMemberManager(); + @Import("clanChat") + RSClanChat getClanMemberManager(); @Import("loginType") - RSJagexLoginType getLoginType(); + RSLoginType getLoginType(); @Construct - RSName createName(String name, RSJagexLoginType type); + RSUsername createName(String name, RSLoginType type); @Import("getVarbit") int getVarbit(int varbitId); - @Import("varbits") - RSNodeCache getVarbitCache(); + @Import("VarbitDefinition_cached") + RSEvictingDualNodeHashTable getVarbitCache(); - @Import("preferences") + @Import("clientPreferences") @Override - RSPreferences getPreferences(); + RSClientPreferences getPreferences(); /** * This is the pitch the user has set the camera to. @@ -658,16 +656,16 @@ public interface RSClient extends RSGameEngine, Client @Import("cameraPitchTarget") void setCameraPitchTarget(int pitch); - @Import("pitchSin") + @Import("Scene_cameraPitchSine") void setPitchSin(int v); - @Import("pitchCos") + @Import("Scene_cameraPitchCosine") void setPitchCos(int v); - @Import("yawSin") + @Import("Scene_cameraYawSine") void setYawSin(int v); - @Import("yawCos") + @Import("Scene_cameraYawCosine") void setYawCos(int v); @Import("Rasterizer3D_zoom") @@ -693,16 +691,16 @@ public interface RSClient extends RSGameEngine, Client @Override int getRasterizer3D_clipMidY2(); - @Import("centerX") + @Import("Rasterizer3D_clipMidX") @Override int getCenterX(); - @Import("centerY") + @Import("Rasterizer3D_clipMidY") @Override int getCenterY(); - @Import("renderOverview") - RSRenderOverview getRenderOverview(); + @Import("worldMap0") + RSWorldMap getRenderOverview(); @Import("changeWorld") @Override @@ -712,23 +710,23 @@ public interface RSClient extends RSGameEngine, Client @Override RSWorld createWorld(); - @Import("animOffsetX") + @Import("Model_transformTempX") void setAnimOffsetX(int animOffsetX); - @Import("animOffsetY") + @Import("Model_transformTempY") void setAnimOffsetY(int animOffsetY); - @Import("animOffsetZ") + @Import("Model_transformTempZ") void setAnimOffsetZ(int animOffsetZ); @Import("getFrames") RSFrames getFrames(int frameId); - @Import("minimapSprite") - RSSpritePixels getMinimapSprite(); + @Import("sceneMinimapSprite") + RSSprite getMinimapSprite(); - @Import("minimapSprite") - void setMinimapSprite(SpritePixels spritePixels); + @Import("sceneMinimapSprite") + void setMinimapSprite(Sprite spritePixels); @Import("drawObject") void drawObject(int z, int x, int y, int randomColor1, int randomColor2); @@ -736,13 +734,13 @@ public interface RSClient extends RSGameEngine, Client @Construct RSScriptEvent createScriptEvent(); - @Import("runScript") + @Import("runScript0") void runScript(RSScriptEvent ev, int ex); - @Import("hintArrowTargetType") + @Import("hintArrowType") void setHintArrowTargetType(int value); - @Import("hintArrowTargetType") + @Import("hintArrowType") int getHintArrowTargetType(); @Import("hintArrowX") @@ -757,48 +755,47 @@ public interface RSClient extends RSGameEngine, Client @Import("hintArrowY") int getHintArrowY(); - @Import("hintArrowOffsetX") + @Import("hintArrowSubX") void setHintArrowOffsetX(int value); - @Import("hintArrowOffsetY") + @Import("hintArrowSubY") void setHintArrowOffsetY(int value); - @Import("hintArrowNpcTargetIdx") + @Import("hintArrowNpcIndex") void setHintArrowNpcTargetIdx(int value); - @Import("hintArrowNpcTargetIdx") + @Import("hintArrowNpcIndex") int getHintArrowNpcTargetIdx(); - @Import("hintArrowPlayerTargetIdx") + @Import("hintArrowPlayerIndex") void setHintArrowPlayerTargetIdx(int value); - @Import("hintArrowPlayerTargetIdx") + @Import("hintArrowPlayerIndex") int getHintArrowPlayerTargetIdx(); - @Import("isDynamicRegion") + @Import("isInInstance") @Override boolean isInInstancedRegion(); - @Import("itemPressedDuration") - @Override + @Import("itemDragDuration") int getItemPressedDuration(); - @Import("itemPressedDuration") + @Import("itemDragDuration") void setItemPressedDuration(int duration); - @Import("flags") + @Import("worldProperties") int getFlags(); @Import("compass") - void setCompass(SpritePixels spritePixels); + void setCompass(Sprite spritePixels); @Import("widgetSpriteCache") @Override - RSNodeCache getWidgetSpriteCache(); + RSEvictingDualNodeHashTable getWidgetSpriteCache(); - @Import("items") + @Import("ItemDefinition_cached") @Override - RSNodeCache getItemCompositionCache(); + RSEvictingDualNodeHashTable getItemDefinitionCache(); @Import("oculusOrbState") @Override @@ -812,96 +809,93 @@ public interface RSClient extends RSGameEngine, Client @Override void setOculusOrbNormalSpeed(int state); - @Import("lookingAtX") + @Import("oculusOrbFocalPointX") @Override int getOculusOrbFocalPointX(); - @Import("lookingAtY") + @Import("oculusOrbFocalPointY") @Override int getOculusOrbFocalPointY(); - RSItem getLastItemDespawn(); + RSGroundItem getLastItemDespawn(); - void setLastItemDespawn(RSItem lastItemDespawn); + void setLastItemDespawn(RSGroundItem lastItemDespawn); @Construct RSWidget createWidget(); - @Import("revalidateWidget") + @Import("alignWidget") void revalidateWidget(Widget w); @Import("revalidateWidgetScroll") void revalidateWidgetScroll(Widget[] group, Widget w, boolean postEvent); - @Import("menuAction") - void menuAction(int var0, int var1, int var2, int var3, String var4, String var5, int var6, int var7); - - @Import("Viewport_entityCountAtMouse") + @Import("ViewportMouse_entityCount") int getEntitiesAtMouseCount(); - @Import("Viewport_entityCountAtMouse") + @Import("ViewportMouse_entityCount") void setEntitiesAtMouseCount(int i); - @Import("Viewport_entitiesAtMouse") + @Import("ViewportMouse_entityTags") long[] getEntitiesAtMouse(); - @Import("Viewport_mouseX") + @Import("ViewportMouse_x") int getViewportMouseX(); - @Import("Viewport_mouseY") + @Import("ViewportMouse_y") int getViewportMouseY(); @Import("textureProvider") @Override RSTextureProvider getTextureProvider(); - @Import("occupiedTilesTick") + @Import("tileLastDrawnActor") int[][] getOccupiedTilesTick(); - @Import("cachedModels2") - RSNodeCache getCachedModels2(); + @Import("ObjectDefinition_cachedModels") + RSEvictingDualNodeHashTable getCachedModels2(); - @Import("cycle") + @Import("Scene_drawnCount") int getCycle(); - @Import("cycle") + @Import("Scene_drawnCount") void setCycle(int cycle); - @Import("visibilityMaps") + @Import("visibilityMap") boolean[][][][] getVisibilityMaps(); - @Import("renderArea") + @Import("visibleTiles") void setRenderArea(boolean[][] renderArea); - @Import("cameraX2") + @Import("Scene_cameraX") void setCameraX2(int cameraX2); - @Import("cameraY2") + @Import("Scene_cameraY") void setCameraY2(int cameraY2); - @Import("cameraZ2") + @Import("Scene_cameraZ") void setCameraZ2(int cameraZ2); - @Import("screenCenterX") + @Import("Scene_cameraXTile") void setScreenCenterX(int screenCenterX); - @Import("screenCenterZ") - void setScreenCenterZ(int screenCenterZ); + @Import("Scene_cameraYTile") + void setScreenCenterZ(int screenCenterZ); // <-- This is correct! @Import("Scene_plane") void setScenePlane(int scenePlane); - @Import("minTileX") + @Import("Scene_cameraXTileMin") void setMinTileX(int i); - @Import("minTileZ") - void setMinTileZ(int i); + @Import("Scene_cameraYTileMin") + void setMinTileZ(int i); // <-- This is correct! - @Import("maxTileX") + @Import("Scene_cameraXTileMax") void setMaxTileX(int i); - @Import("maxTileZ") - void setMaxTileZ(int i); + @Import("Scene_cameraYTileMax") + void setMaxTileZ(int i); // <-- This is correct! @Import("tileUpdateCount") int getTileUpdateCount(); @@ -909,47 +903,39 @@ public interface RSClient extends RSGameEngine, Client @Import("tileUpdateCount") void setTileUpdateCount(int tileUpdateCount); - @Import("Viewport_containsMouse") + @Import("ViewportMouse_isInViewport") boolean getViewportContainsMouse(); - @Import("graphicsPixels") + @Import("Rasterizer2D_pixels") int[] getGraphicsPixels(); - @Import("graphicsPixelsWidth") + @Import("Rasterizer2D_width") int getGraphicsPixelsWidth(); - @Import("graphicsPixelsHeight") + @Import("Rasterizer2D_height") int getGraphicsPixelsHeight(); - @Import("fillRectangle") - void RasterizerFillRectangle(int x, int y, int w, int h, int rgb); + @Import("Rasterizer2D_fillRectangle") + void rasterizerFillRectangle(int x, int y, int w, int h, int rgb); - @Import("startX") + @Import("Rasterizer2D_xClipStart") int getStartX(); - @Import("startY") + @Import("Rasterizer2D_yClipStart") int getStartY(); - @Import("endX") + @Import("Rasterizer2D_xClipEnd") int getEndX(); - @Import("endY") + @Import("Rasterizer2D_yClipEnd") int getEndY(); - @Import("if1DraggedWidget") - @Override - RSWidget getIf1DraggedWidget(); - - @Import("if1DraggedItemIndex") - @Override - int getIf1DraggedItemIndex(); - - @Import("spellSelected") + @Import("isSpellSelected") @Override void setSpellSelected(boolean selected); @Import("getEnum") - RSEnum getRsEnum(int id); + RSEnumDefinition getRsEnum(int id); @Import("menuX") int getMenuX(); @@ -966,35 +952,31 @@ public interface RSClient extends RSGameEngine, Client @Import("fontBold12") RSFont getFontBold12(); - @Import("drawHorizontalLine") - void RasterizerDrawHorizontalLine(int x, int y, int w, int rgb); + @Import("Rasterizer2D_drawHorizontalLine") + void rasterizerDrawHorizontalLine(int x, int y, int w, int rgb); - @Import("drawVerticalLine") - void RasterizerDrawVerticalLine(int x, int y, int h, int rgb); + @Import("Rasterizer2D_drawVerticalLine") + void rasterizerDrawVerticalLine(int x, int y, int h, int rgb); @Import("drawGradient") - void RasterizerDrawGradient(int x, int y, int w, int h, int rgbTop, int rgbBottom); + void rasterizerDrawGradient(int x, int y, int w, int h, int rgbTop, int rgbBottom); - @Import("fillRectangleAlpha") - void RasterizerFillRectangleAlpha(int x, int y, int w, int h, int rgb, int a); + @Import("Rasterizer2D_drawRectangleAlpha") + void rasterizerFillRectangleAlpha(int x, int y, int w, int h, int rgb, int a); - @Import("drawRectangle") - void RasterizerDrawRectangle(int x, int y, int w, int h, int rgb); + @Import("Rasterizer2D_drawRectangle") + void rasterizerDrawRectangle(int x, int y, int w, int h, int rgb); @Import("drawCircle") - void RasterizerDrawCircle(int x, int y, int r, int rgb); + void rasterizerDrawCircle(int x, int y, int r, int rgb); - @Import("healthbarCache") + @Import("HealthBarDefinition_cached") @Override - RSNodeCache getHealthBarCache(); - + RSEvictingDualNodeHashTable getHealthBarCache(); + @Import("renderSelf") - void toggleRenderSelf(); - + void setRenderSelf(boolean enabled); + @Import("mouseRecorder") RSMouseRecorder getMouseRecorder(); - - @Import("printMenuActions") - void setPrintMenuActions(boolean b); - } diff --git a/api/src/main/java/rs/api/RSClientPreferences.java b/api/src/main/java/rs/api/RSClientPreferences.java new file mode 100644 index 0000000000..5faf552236 --- /dev/null +++ b/api/src/main/java/rs/api/RSClientPreferences.java @@ -0,0 +1,15 @@ +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 new file mode 100644 index 0000000000..c5202c120d --- /dev/null +++ b/api/src/main/java/rs/api/RSCollisionMap.java @@ -0,0 +1,10 @@ +package rs.api; + +import api.CollisionData; +import net.runelite.mapping.Import; + +public interface RSCollisionMap extends CollisionData +{ + @Import("flags") + int[][] getFlags(); +} diff --git a/runescape-api/src/main/java/net/runelite/rs/api/RSCacheableNode.java b/api/src/main/java/rs/api/RSDualNode.java similarity index 93% rename from runescape-api/src/main/java/net/runelite/rs/api/RSCacheableNode.java rename to api/src/main/java/rs/api/RSDualNode.java index 44d7b876cc..89ef847bac 100644 --- a/runescape-api/src/main/java/net/runelite/rs/api/RSCacheableNode.java +++ b/api/src/main/java/rs/api/RSDualNode.java @@ -22,12 +22,12 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.rs.api; +package rs.api; import net.runelite.mapping.Import; -public interface RSCacheableNode extends RSNode +public interface RSDualNode extends RSNode { - @Import("unlinkDual") + @Import("removeDual") void unlinkDual(); } diff --git a/api/src/main/java/rs/api/RSDynamicObject.java b/api/src/main/java/rs/api/RSDynamicObject.java new file mode 100644 index 0000000000..ee582d4c45 --- /dev/null +++ b/api/src/main/java/rs/api/RSDynamicObject.java @@ -0,0 +1,19 @@ +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/runescape-api/src/main/java/net/runelite/rs/api/RSRenderable.java b/api/src/main/java/rs/api/RSEntity.java similarity index 89% rename from runescape-api/src/main/java/net/runelite/rs/api/RSRenderable.java rename to api/src/main/java/rs/api/RSEntity.java index 398c68088a..a6e135ad08 100644 --- a/runescape-api/src/main/java/net/runelite/rs/api/RSRenderable.java +++ b/api/src/main/java/rs/api/RSEntity.java @@ -22,17 +22,17 @@ * (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.rs.api; +package rs.api; -import net.runelite.api.Renderable; +import api.Renderable; import net.runelite.mapping.Import; -public interface RSRenderable extends RSNode, Renderable +public interface RSEntity extends RSNode, Renderable { - @Import("modelHeight") + @Import("height") int getModelHeight(); - @Import("modelHeight") + @Import("height") @Override void setModelHeight(int modelHeight); @@ -40,7 +40,7 @@ public interface RSRenderable extends RSNode, Renderable @Override RSModel getModel(); - @Import("draw") + @Import("renderDraw") @Override void draw(int orientation, int pitchSin, int pitchCos, int yawSin, int yawCos, int x, int y, int z, long hash); } diff --git a/api/src/main/java/rs/api/RSEnumDefinition.java b/api/src/main/java/rs/api/RSEnumDefinition.java new file mode 100644 index 0000000000..22c0ebe3c6 --- /dev/null +++ b/api/src/main/java/rs/api/RSEnumDefinition.java @@ -0,0 +1,25 @@ +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 new file mode 100644 index 0000000000..b9a1563305 --- /dev/null +++ b/api/src/main/java/rs/api/RSEvictingDualNodeHashTable.java @@ -0,0 +1,22 @@ +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 new file mode 100644 index 0000000000..315064b4f7 --- /dev/null +++ b/api/src/main/java/rs/api/RSFileOnDisk.java @@ -0,0 +1,16 @@ +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 new file mode 100644 index 0000000000..0c8c5b65ac --- /dev/null +++ b/api/src/main/java/rs/api/RSFloorDecoration.java @@ -0,0 +1,23 @@ +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 new file mode 100644 index 0000000000..7b12a9d543 --- /dev/null +++ b/api/src/main/java/rs/api/RSFont.java @@ -0,0 +1,5 @@ +package rs.api; + +public interface RSFont extends RSAbstractFont +{ +} diff --git a/runescape-api/src/main/java/net/runelite/rs/api/RSFrames.java b/api/src/main/java/rs/api/RSFrames.java similarity index 91% rename from runescape-api/src/main/java/net/runelite/rs/api/RSFrames.java rename to api/src/main/java/rs/api/RSFrames.java index 947549248d..45509475ad 100644 --- a/runescape-api/src/main/java/net/runelite/rs/api/RSFrames.java +++ b/api/src/main/java/rs/api/RSFrames.java @@ -22,12 +22,12 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.rs.api; +package rs.api; import net.runelite.mapping.Import; -public interface RSFrames extends RSCacheableNode +public interface RSFrames extends RSDualNode { - @Import("skeletons") - RSFrame[] getFrames(); + @Import("frames") + RSAnimation[] getFrames(); } diff --git a/api/src/main/java/rs/api/RSFriend.java b/api/src/main/java/rs/api/RSFriend.java new file mode 100644 index 0000000000..4c5b799d9a --- /dev/null +++ b/api/src/main/java/rs/api/RSFriend.java @@ -0,0 +1,7 @@ +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 new file mode 100644 index 0000000000..1d01b23183 --- /dev/null +++ b/api/src/main/java/rs/api/RSFriendSystem.java @@ -0,0 +1,16 @@ +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 new file mode 100644 index 0000000000..ef36674350 --- /dev/null +++ b/api/src/main/java/rs/api/RSFriendsList.java @@ -0,0 +1,5 @@ +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 new file mode 100644 index 0000000000..e649b310dc --- /dev/null +++ b/api/src/main/java/rs/api/RSGameObject.java @@ -0,0 +1,46 @@ +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/runescape-api/src/main/java/net/runelite/rs/api/RSGameEngine.java b/api/src/main/java/rs/api/RSGameShell.java similarity index 91% rename from runescape-api/src/main/java/net/runelite/rs/api/RSGameEngine.java rename to api/src/main/java/rs/api/RSGameShell.java index 87bc24ca15..a9647d544a 100644 --- a/runescape-api/src/main/java/net/runelite/rs/api/RSGameEngine.java +++ b/api/src/main/java/rs/api/RSGameShell.java @@ -22,13 +22,13 @@ * (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.rs.api; +package rs.api; +import api.GameShell; import java.awt.Canvas; -import net.runelite.api.GameEngine; import net.runelite.mapping.Import; -public interface RSGameEngine extends GameEngine +public interface RSGameShell extends GameShell { @Import("canvas") Canvas getCanvas(); @@ -46,10 +46,10 @@ public interface RSGameEngine extends GameEngine @Import("resizeCanvasNextFrame") void setResizeCanvasNextFrame(boolean resize); - @Import("replaceCanvasNextFrame") + @Import("isCanvasInvalid") boolean isReplaceCanvasNextFrame(); - @Import("replaceCanvasNextFrame") + @Import("isCanvasInvalid") void setReplaceCanvasNextFrame(boolean replace); @Import("maxCanvasWidth") diff --git a/api/src/main/java/rs/api/RSGrandExchangeOffer.java b/api/src/main/java/rs/api/RSGrandExchangeOffer.java new file mode 100644 index 0000000000..9bffb96730 --- /dev/null +++ b/api/src/main/java/rs/api/RSGrandExchangeOffer.java @@ -0,0 +1,30 @@ +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 new file mode 100644 index 0000000000..2471d7de4d --- /dev/null +++ b/api/src/main/java/rs/api/RSGraphicsObject.java @@ -0,0 +1,29 @@ +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 new file mode 100644 index 0000000000..f23800fe84 --- /dev/null +++ b/api/src/main/java/rs/api/RSGroundItem.java @@ -0,0 +1,36 @@ +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 new file mode 100644 index 0000000000..3fc5742d90 --- /dev/null +++ b/api/src/main/java/rs/api/RSGroundItemPile.java @@ -0,0 +1,34 @@ +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 new file mode 100644 index 0000000000..13b8871a47 --- /dev/null +++ b/api/src/main/java/rs/api/RSHealthBar.java @@ -0,0 +1,12 @@ +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 new file mode 100644 index 0000000000..d688530a85 --- /dev/null +++ b/api/src/main/java/rs/api/RSHealthBarDefinition.java @@ -0,0 +1,20 @@ +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 new file mode 100644 index 0000000000..9b2f9ee5d4 --- /dev/null +++ b/api/src/main/java/rs/api/RSHealthBarUpdate.java @@ -0,0 +1,12 @@ +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 new file mode 100644 index 0000000000..aa53114779 --- /dev/null +++ b/api/src/main/java/rs/api/RSIgnoreList.java @@ -0,0 +1,5 @@ +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 new file mode 100644 index 0000000000..1e17d128d1 --- /dev/null +++ b/api/src/main/java/rs/api/RSIgnored.java @@ -0,0 +1,7 @@ +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 new file mode 100644 index 0000000000..18be69a891 --- /dev/null +++ b/api/src/main/java/rs/api/RSIndexCache.java @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000000..4af8e04a37 --- /dev/null +++ b/api/src/main/java/rs/api/RSIndexedSprite.java @@ -0,0 +1,71 @@ +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 new file mode 100644 index 0000000000..3d2d2f819f --- /dev/null +++ b/api/src/main/java/rs/api/RSIntegerNode.java @@ -0,0 +1,15 @@ +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 new file mode 100644 index 0000000000..964bd545fc --- /dev/null +++ b/api/src/main/java/rs/api/RSItemContainer.java @@ -0,0 +1,13 @@ +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 new file mode 100644 index 0000000000..2c624b3dc7 --- /dev/null +++ b/api/src/main/java/rs/api/RSItemDefinition.java @@ -0,0 +1,63 @@ +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 new file mode 100644 index 0000000000..17ba1b7a32 --- /dev/null +++ b/api/src/main/java/rs/api/RSIterableNodeDeque.java @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000000..ed732da8d9 --- /dev/null +++ b/api/src/main/java/rs/api/RSIterableNodeHashTable.java @@ -0,0 +1,11 @@ +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 new file mode 100644 index 0000000000..886b285419 --- /dev/null +++ b/api/src/main/java/rs/api/RSKeyHandler.java @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000000..ffb1c207eb --- /dev/null +++ b/api/src/main/java/rs/api/RSLoginType.java @@ -0,0 +1,5 @@ +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 new file mode 100644 index 0000000000..7c7b90a6db --- /dev/null +++ b/api/src/main/java/rs/api/RSMessage.java @@ -0,0 +1,38 @@ +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/runescape-api/src/main/java/net/runelite/rs/api/RSModel.java b/api/src/main/java/rs/api/RSModel.java similarity index 86% rename from runescape-api/src/main/java/net/runelite/rs/api/RSModel.java rename to api/src/main/java/rs/api/RSModel.java index a447b080c1..39fd248cee 100644 --- a/runescape-api/src/main/java/net/runelite/rs/api/RSModel.java +++ b/api/src/main/java/rs/api/RSModel.java @@ -22,13 +22,13 @@ * (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.rs.api; +package rs.api; +import api.Model; import java.awt.Polygon; -import net.runelite.api.Model; import net.runelite.mapping.Import; -public interface RSModel extends RSRenderable, Model +public interface RSModel extends RSEntity, Model { @Import("verticesCount") @Override @@ -74,7 +74,7 @@ public interface RSModel extends RSRenderable, Model @Override int[] getFaceColors3(); - @Import("triangleTransparencies") + @Import("faceAlphas") @Override byte[] getTriangleTransparencies(); @@ -82,70 +82,70 @@ public interface RSModel extends RSRenderable, Model @Override byte[] getFaceRenderPriorities(); - @Import("vertexGroups") + @Import("vertexLabels") int[][] getVertexGroups(); - @Import("modelHeight") + @Import("height") @Override int getModelHeight(); - @Import("animate") + @Import("transform") void animate(int type, int[] list, int x, int y, int z); @Import("calculateBoundsCylinder") @Override void calculateBoundsCylinder(); - @Import("calculateExtreme") + @Import("calculateBoundingBox") @Override void calculateExtreme(int orientation); @Import("resetBounds") void resetBounds(); - @Import("toSharedModel") + @Import("toSharedSequenceModel") RSModel toSharedModel(boolean b); - @Import("toSharedSpotAnimModel") + @Import("toSharedSpotAnimationModel") RSModel toSharedSpotAnimModel(boolean b); @Import("rotateY90Ccw") void rotateY90Ccw(); - @Import("rotateY180Ccw") + @Import("rotateY180") void rotateY180Ccw(); @Import("rotateY270Ccw") void rotateY270Ccw(); - @Import("isClickable") - boolean isClickable(); + @Import("isSingleTile") + boolean isSingleTile(); @Import("radius") @Override int getRadius(); - @Import("centerX") + @Import("xMid") @Override int getCenterX(); - @Import("centerY") + @Import("yMid") @Override int getCenterY(); - @Import("centerZ") + @Import("zMid") @Override int getCenterZ(); - @Import("extremeX") + @Import("xMidOffset") @Override int getExtremeX(); - @Import("extremeY") + @Import("yMidOffset") @Override int getExtremeY(); - @Import("extremeZ") + @Import("zMidOffset") @Override int getExtremeZ(); @@ -153,12 +153,12 @@ public interface RSModel extends RSRenderable, Model @Override short[] getFaceTextures(); - @Import("XYZMag") + @Import("xzRadius") @Override int getXYZMag(); void interpolateFrames(RSFrames frames, int frameId, RSFrames nextFrames, int nextFrameId, int interval, - int intervalCount); + int intervalCount); /** * Compute the convex hull of this model diff --git a/api/src/main/java/rs/api/RSModelData.java b/api/src/main/java/rs/api/RSModelData.java new file mode 100644 index 0000000000..7dc6c4798f --- /dev/null +++ b/api/src/main/java/rs/api/RSModelData.java @@ -0,0 +1,45 @@ +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 new file mode 100644 index 0000000000..853716f7db --- /dev/null +++ b/api/src/main/java/rs/api/RSMouseHandler.java @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000000..9427606814 --- /dev/null +++ b/api/src/main/java/rs/api/RSMouseRecorder.java @@ -0,0 +1,19 @@ +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 new file mode 100644 index 0000000000..4d49700d5d --- /dev/null +++ b/api/src/main/java/rs/api/RSMouseWheelHandler.java @@ -0,0 +1,7 @@ +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 new file mode 100644 index 0000000000..b32f8e4c74 --- /dev/null +++ b/api/src/main/java/rs/api/RSNPC.java @@ -0,0 +1,18 @@ +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 new file mode 100644 index 0000000000..c34073e54d --- /dev/null +++ b/api/src/main/java/rs/api/RSNPCDefinition.java @@ -0,0 +1,54 @@ +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/runescape-api/src/main/java/net/runelite/rs/api/RSNode.java b/api/src/main/java/rs/api/RSNode.java similarity index 94% rename from runescape-api/src/main/java/net/runelite/rs/api/RSNode.java rename to api/src/main/java/rs/api/RSNode.java index ab24b70dda..c159177e68 100644 --- a/runescape-api/src/main/java/net/runelite/rs/api/RSNode.java +++ b/api/src/main/java/rs/api/RSNode.java @@ -22,9 +22,9 @@ * (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.rs.api; +package rs.api; -import net.runelite.api.Node; +import api.Node; import net.runelite.mapping.Import; public interface RSNode extends Node @@ -33,7 +33,7 @@ public interface RSNode extends Node @Override RSNode getNext(); - @Import("hash") + @Import("key") @Override long getHash(); @@ -41,7 +41,7 @@ public interface RSNode extends Node @Override RSNode getPrevious(); - @Import("unlink") + @Import("remove") void unlink(); /** diff --git a/api/src/main/java/rs/api/RSNodeDeque.java b/api/src/main/java/rs/api/RSNodeDeque.java new file mode 100644 index 0000000000..1d19ecab80 --- /dev/null +++ b/api/src/main/java/rs/api/RSNodeDeque.java @@ -0,0 +1,12 @@ +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 new file mode 100644 index 0000000000..fc18df3b3b --- /dev/null +++ b/api/src/main/java/rs/api/RSNodeHashTable.java @@ -0,0 +1,17 @@ +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 new file mode 100644 index 0000000000..feeb0922ae --- /dev/null +++ b/api/src/main/java/rs/api/RSObjectDefinition.java @@ -0,0 +1,35 @@ +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 new file mode 100644 index 0000000000..f9dbfac32e --- /dev/null +++ b/api/src/main/java/rs/api/RSPacketBuffer.java @@ -0,0 +1,7 @@ +package rs.api; + +import api.PacketBuffer; + +public interface RSPacketBuffer extends PacketBuffer +{ +} diff --git a/runescape-api/src/main/java/net/runelite/rs/api/RSPlayer.java b/api/src/main/java/rs/api/RSPlayer.java similarity index 87% rename from runescape-api/src/main/java/net/runelite/rs/api/RSPlayer.java rename to api/src/main/java/rs/api/RSPlayer.java index ec8db1f005..6211560c92 100644 --- a/runescape-api/src/main/java/net/runelite/rs/api/RSPlayer.java +++ b/api/src/main/java/rs/api/RSPlayer.java @@ -22,28 +22,28 @@ * (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.rs.api; +package rs.api; -import net.runelite.api.Player; +import api.Player; import net.runelite.mapping.Import; public interface RSPlayer extends RSActor, Player { - @Import("name") - RSName getRsName(); + @Import("username") + RSUsername getRsName(); - @Import("playerId") + @Import("index") int getPlayerId(); - @Import("composition") + @Import("appearance") @Override - RSPlayerComposition getPlayerComposition(); + RSPlayerAppearance getPlayerAppearance(); @Import("combatLevel") @Override int getCombatLevel(); - @Import("totalLevel") + @Import("skillLevel") int getTotalLevel(); @Import("team") @@ -58,9 +58,9 @@ public interface RSPlayer extends RSActor, Player @Override boolean isFriend(); - @Import("overheadIcon") + @Import("headIconPrayer") int getRsOverheadIcon(); - @Import("skullIcon") + @Import("headIconPk") int getRsSkullIcon(); } diff --git a/api/src/main/java/rs/api/RSPlayerAppearance.java b/api/src/main/java/rs/api/RSPlayerAppearance.java new file mode 100644 index 0000000000..b1bf272845 --- /dev/null +++ b/api/src/main/java/rs/api/RSPlayerAppearance.java @@ -0,0 +1,25 @@ +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/cache-updater/src/main/java/net/runelite/cache/updater/InstantConverter.java b/api/src/main/java/rs/api/RSProjectile.java similarity index 55% rename from cache-updater/src/main/java/net/runelite/cache/updater/InstantConverter.java rename to api/src/main/java/rs/api/RSProjectile.java index 953fe9bd3a..e2c8b16a53 100644 --- a/cache-updater/src/main/java/net/runelite/cache/updater/InstantConverter.java +++ b/api/src/main/java/rs/api/RSProjectile.java @@ -1,5 +1,7 @@ /* - * Copyright (c) 2017, Adam + * BSD 2-Clause License + * + * Copyright (c) 2019, ThatGamerBlue * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -23,26 +25,82 @@ * 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.sql.Timestamp; -import java.time.Instant; -import org.sql2o.converters.Converter; -import org.sql2o.converters.ConverterException; +package rs.api; -public class InstantConverter implements Converter +import api.Projectile; +import net.runelite.mapping.Import; + +public interface RSProjectile extends RSEntity, Projectile { + @Import("id") @Override - public Instant convert(Object val) throws ConverterException - { - Timestamp ts = (Timestamp) val; - return ts.toInstant(); - } + int getId(); + @Import("targetIndex") + int getRsInteracting(); + + @Import("sourceZ") @Override - public Object toDatabaseParam(Instant val) - { - return Timestamp.from(val); - } + int getHeight(); + @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/http-service/src/main/java/net/runelite/http/service/util/exception/NotFoundException.java b/api/src/main/java/rs/api/RSRasterProvider.java similarity index 74% rename from http-service/src/main/java/net/runelite/http/service/util/exception/NotFoundException.java rename to api/src/main/java/rs/api/RSRasterProvider.java index 83e04ceca6..83f8d33640 100644 --- a/http-service/src/main/java/net/runelite/http/service/util/exception/NotFoundException.java +++ b/api/src/main/java/rs/api/RSRasterProvider.java @@ -1,5 +1,7 @@ /* - * Copyright (c) 2017, Adam + * BSD 2-Clause License + * + * Copyright (c) 2019, ThatGamerBlue * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -23,13 +25,23 @@ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.http.service.util.exception; -import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.ResponseStatus; +package rs.api; -@ResponseStatus(code = HttpStatus.NOT_FOUND, reason = "Not found") -public class NotFoundException extends RuntimeException +import api.MainBufferProvider; +import java.awt.Component; +import java.awt.Image; +import net.runelite.mapping.Import; + +public interface RSRasterProvider extends RSAbstractRasterProvider, MainBufferProvider { + @Import("image") + @Override + Image getImage(); + @Import("image") + void setImage(Image image); + + @Import("component0") + Component getCanvas(); } diff --git a/api/src/main/java/rs/api/RSReflectionCheck.java b/api/src/main/java/rs/api/RSReflectionCheck.java new file mode 100644 index 0000000000..5de9c99b1e --- /dev/null +++ b/api/src/main/java/rs/api/RSReflectionCheck.java @@ -0,0 +1,17 @@ +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 new file mode 100644 index 0000000000..acdd484585 --- /dev/null +++ b/api/src/main/java/rs/api/RSRunException.java @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000000..9df00300fc --- /dev/null +++ b/api/src/main/java/rs/api/RSScene.java @@ -0,0 +1,39 @@ +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 new file mode 100644 index 0000000000..eb76b24058 --- /dev/null +++ b/api/src/main/java/rs/api/RSScript.java @@ -0,0 +1,15 @@ +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 new file mode 100644 index 0000000000..885879cd1d --- /dev/null +++ b/api/src/main/java/rs/api/RSScriptEvent.java @@ -0,0 +1,23 @@ +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 new file mode 100644 index 0000000000..591e535a01 --- /dev/null +++ b/api/src/main/java/rs/api/RSSequenceDefinition.java @@ -0,0 +1,27 @@ +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/runescape-api/src/main/java/net/runelite/rs/api/RSFrameMap.java b/api/src/main/java/rs/api/RSSkeleton.java similarity index 93% rename from runescape-api/src/main/java/net/runelite/rs/api/RSFrameMap.java rename to api/src/main/java/rs/api/RSSkeleton.java index 215f3be17b..85428bbd29 100644 --- a/runescape-api/src/main/java/net/runelite/rs/api/RSFrameMap.java +++ b/api/src/main/java/rs/api/RSSkeleton.java @@ -22,18 +22,18 @@ * (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.rs.api; +package rs.api; import net.runelite.mapping.Import; -public interface RSFrameMap extends RSNode +public interface RSSkeleton extends RSNode { @Import("count") int getCount(); - @Import("types") + @Import("transformTypes") int[] getTypes(); - @Import("list") + @Import("labels") int[][] getList(); } diff --git a/api/src/main/java/rs/api/RSSoundEffect.java b/api/src/main/java/rs/api/RSSoundEffect.java new file mode 100644 index 0000000000..7c7fd22ffe --- /dev/null +++ b/api/src/main/java/rs/api/RSSoundEffect.java @@ -0,0 +1,5 @@ +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 new file mode 100644 index 0000000000..98425e05b2 --- /dev/null +++ b/api/src/main/java/rs/api/RSSprite.java @@ -0,0 +1,38 @@ +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 new file mode 100644 index 0000000000..aa525f793c --- /dev/null +++ b/api/src/main/java/rs/api/RSTexture.java @@ -0,0 +1,23 @@ +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 new file mode 100644 index 0000000000..30306c1a4f --- /dev/null +++ b/api/src/main/java/rs/api/RSTextureProvider.java @@ -0,0 +1,29 @@ +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 new file mode 100644 index 0000000000..eb0ff71378 --- /dev/null +++ b/api/src/main/java/rs/api/RSTile.java @@ -0,0 +1,84 @@ +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 new file mode 100644 index 0000000000..1863e8b61f --- /dev/null +++ b/api/src/main/java/rs/api/RSTileModel.java @@ -0,0 +1,63 @@ +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 new file mode 100644 index 0000000000..9e1d4355e6 --- /dev/null +++ b/api/src/main/java/rs/api/RSTilePaint.java @@ -0,0 +1,31 @@ +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 new file mode 100644 index 0000000000..9a57f8f3f6 --- /dev/null +++ b/api/src/main/java/rs/api/RSUser.java @@ -0,0 +1,13 @@ +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 new file mode 100644 index 0000000000..4542b5ef30 --- /dev/null +++ b/api/src/main/java/rs/api/RSUserList.java @@ -0,0 +1,31 @@ +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/runescape-api/src/main/java/net/runelite/rs/api/RSName.java b/api/src/main/java/rs/api/RSUsername.java similarity index 94% rename from runescape-api/src/main/java/net/runelite/rs/api/RSName.java rename to api/src/main/java/rs/api/RSUsername.java index 4b2c83abfe..9183b83cdb 100644 --- a/runescape-api/src/main/java/net/runelite/rs/api/RSName.java +++ b/api/src/main/java/rs/api/RSUsername.java @@ -22,12 +22,12 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.rs.api; +package rs.api; import net.runelite.mapping.Import; -public interface RSName extends Comparable +public interface RSUsername extends Comparable { - @Import("name") + @Import("getName") String getName(); } diff --git a/api/src/main/java/rs/api/RSVarbitDefinition.java b/api/src/main/java/rs/api/RSVarbitDefinition.java new file mode 100644 index 0000000000..d3328a7d38 --- /dev/null +++ b/api/src/main/java/rs/api/RSVarbitDefinition.java @@ -0,0 +1,15 @@ +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 new file mode 100644 index 0000000000..93f0ad15b1 --- /dev/null +++ b/api/src/main/java/rs/api/RSVarcs.java @@ -0,0 +1,10 @@ +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 new file mode 100644 index 0000000000..f671202a9d --- /dev/null +++ b/api/src/main/java/rs/api/RSWallDecoration.java @@ -0,0 +1,36 @@ +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/runescape-api/src/main/java/net/runelite/rs/api/RSWidget.java b/api/src/main/java/rs/api/RSWidget.java similarity index 69% rename from runescape-api/src/main/java/net/runelite/rs/api/RSWidget.java rename to api/src/main/java/rs/api/RSWidget.java index 0dd5b24d4f..947c3443dc 100644 --- a/runescape-api/src/main/java/net/runelite/rs/api/RSWidget.java +++ b/api/src/main/java/rs/api/RSWidget.java @@ -1,30 +1,34 @@ /* - * Copyright (c) 2016-2017, Adam + * BSD 2-Clause License + * + * Copyright (c) 2019, ThatGamerBlue * 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. + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. * - * 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. + * 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.rs.api; -import net.runelite.api.widgets.Widget; +package rs.api; + +import api.widgets.Widget; import net.runelite.mapping.Import; public interface RSWidget extends Widget @@ -62,8 +66,8 @@ public interface RSWidget extends Widget @Import("clickMask") void setClickMask(int mask); - @Import("boundsIndex") - int getBoundsIndex(); + //@Import("boundsIndex") -- unused for now + //int getBoundsIndex(); @Import("modelId") @Override @@ -85,45 +89,45 @@ public interface RSWidget extends Widget @Import("text") String getRSText(); - @Import("name") + @Import("dataText") String getRSName(); - @Import("name") + @Import("dataText") void setRSName(String name); @Import("text") @Override void setText(String text); - @Import("textColor") + @Import("color") @Override int getTextColor(); - @Import("textColor") + @Import("color") @Override void setTextColor(int textColor); - @Import("opacity") + @Import("transparency") @Override int getOpacity(); - @Import("opacity") + @Import("transparency") @Override void setOpacity(int opacity); - @Import("relativeX") + @Import("x") @Override int getRelativeX(); - @Import("relativeX") + @Import("x") @Override void setRelativeX(int x); - @Import("relativeY") + @Import("y") @Override int getRelativeY(); - @Import("relativeY") + @Import("y") @Override void setRelativeY(int y); @@ -150,20 +154,20 @@ public interface RSWidget extends Widget @Import("isHidden") void setHidden(boolean hidden); - @Import("index") + @Import("childIndex") int getIndex(); - @Import("index") + @Import("childIndex") void setIndex(int index); - @Import("rotationX") - int getRotationX(); + //@Import("rotationX") + //int getRotationX(); - @Import("rotationY") - int getRotationY(); + //@Import("rotationY") --- All unused + //int getRotationY(); - @Import("rotationZ") - int getRotationZ(); + //@Import("rotationZ") + //int getRotationZ(); @Import("contentType") @Override @@ -221,11 +225,11 @@ public interface RSWidget extends Widget @Override void setSpriteId(int spriteId); - @Import("borderType") + @Import("outline") @Override int getBorderType(); - @Import("borderType") + @Import("outline") @Override void setBorderType(int type); @@ -245,47 +249,47 @@ public interface RSWidget extends Widget @Override void setItemQuantity(int quantity); - @Import("originalX") + @Import("rawX") @Override int getOriginalX(); - @Import("originalX") + @Import("rawX") @Override void setOriginalX(int originalX); - @Import("originalY") + @Import("rawY") @Override int getOriginalY(); - @Import("originalY") + @Import("rawY") @Override void setOriginalY(int originalY); - @Import("originalHeight") + @Import("rawHeight") @Override int getOriginalHeight(); - @Import("originalHeight") + @Import("rawHeight") @Override void setOriginalHeight(int originalHeight); - @Import("originalWidth") + @Import("rawWidth") @Override int getOriginalWidth(); - @Import("originalWidth") + @Import("rawWidth") @Override void setOriginalWidth(int originalWidth); - @Import("xPitch") + @Import("paddingX") int getXPitch(); - @Import("yPitch") + @Import("paddingY") int getYPitch(); void broadcastHidden(boolean hidden); - @Import("onOpListener") + @Import("onOp") @Override void setOnOpListener(Object... args); @@ -312,7 +316,7 @@ public interface RSWidget extends Widget @Override Object[] getOnKeyListener(); - @Import("onLoadListener") + @Import("onLoad") @Override Object[] getOnLoadListener(); @@ -324,27 +328,27 @@ public interface RSWidget extends Widget @Override void setOnKeyListener(Object... args); - @Import("onMouseOverListener") + @Import("onMouseOver") @Override void setOnMouseOverListener(Object... args); - @Import("onMouseRepeatListener") + @Import("onMouseRepeat") @Override void setOnMouseRepeatListener(Object... args); - @Import("onMouseLeaveListener") + @Import("onMouseLeave") @Override void setOnMouseLeaveListener(Object... args); - @Import("onTimerListener") + @Import("onTimer") @Override void setOnTimerListener(Object... args); - @Import("onTargetEnterListener") + @Import("onTargetEnter") @Override void setOnTargetEnterListener(Object... args); - @Import("onTargetLeaveListener") + @Import("onTargetLeave") @Override void setOnTargetLeaveListener(Object... args); @@ -364,19 +368,19 @@ public interface RSWidget extends Widget @Override void setTextShadowed(boolean shadowed); - @Import("dragDeadZone") + @Import("dragZoneSize") @Override int getDragDeadZone(); - @Import("dragDeadZone") + @Import("dragZoneSize") @Override void setDragDeadZone(int deadZone); - @Import("dragDeadTime") + @Import("dragThreshold") @Override int getDragDeadTime(); - @Import("dragDeadTime") + @Import("dragThreshold") @Override void setDragDeadTime(int deadTime); @@ -388,71 +392,71 @@ public interface RSWidget extends Widget @Override void setItemQuantityMode(int itemQuantityMode); - @Import("xPositionMode") + @Import("xAlignment") @Override int getXPositionMode(); - @Import("xPositionMode") + @Import("xAlignment") @Override void setXPositionMode(int xpm); - @Import("yPositionMode") + @Import("yAlignment") @Override int getYPositionMode(); - @Import("yPositionMode") + @Import("yAlignment") @Override void setYPositionMode(int ypm); - @Import("xTextAlignment") + @Import("textXAlignment") @Override int getXTextAlignment(); - @Import("xTextAlignment") + @Import("textXAlignment") @Override void setXTextAlignment(int xta); - @Import("yTextAlignment") + @Import("textYAlignment") @Override int getYTextAlignment(); - @Import("yTextAlignment") + @Import("textYAlignment") @Override void setYTextAlignment(int yta); - @Import("widthMode") + @Import("widthAlignment") @Override int getWidthMode(); - @Import("widthMode") + @Import("widthAlignment") @Override void setWidthMode(int widthMode); - - @Import("heightMode") + + @Import("heightAlignment") @Override int getHeightMode(); - @Import("heightMode") + @Import("heightAlignment") @Override void setHeightMode(int heightMode); @Import("getFont") @Override - RSFontTypeFace getFont(); + RSAbstractFont getFont(); - @Import("filled") + @Import("fill") @Override boolean isFilled(); - @Import("filled") + @Import("fill") @Override void setFilled(boolean filled); - @Import("targetVerb") + @Import("spellActionName") @Override String getTargetVerb(); - @Import("targetVerb") + @Import("spellActionName") @Override void setTargetVerb(String targetVerb); diff --git a/api/src/main/java/rs/api/RSWidgetGroupParent.java b/api/src/main/java/rs/api/RSWidgetGroupParent.java new file mode 100644 index 0000000000..b3e1f9c4be --- /dev/null +++ b/api/src/main/java/rs/api/RSWidgetGroupParent.java @@ -0,0 +1,11 @@ +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 new file mode 100644 index 0000000000..d176873c8f --- /dev/null +++ b/api/src/main/java/rs/api/RSWorld.java @@ -0,0 +1,61 @@ +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 new file mode 100644 index 0000000000..fe74a34d86 --- /dev/null +++ b/api/src/main/java/rs/api/RSWorldMap.java @@ -0,0 +1,53 @@ +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 new file mode 100644 index 0000000000..6035b64b51 --- /dev/null +++ b/api/src/main/java/rs/api/RSWorldMapArea.java @@ -0,0 +1,10 @@ +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 new file mode 100644 index 0000000000..6957121a56 --- /dev/null +++ b/api/src/main/java/rs/api/RSWorldMapElement.java @@ -0,0 +1,11 @@ +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 new file mode 100644 index 0000000000..1c1a74fa55 --- /dev/null +++ b/api/src/main/java/rs/api/RSWorldMapManager.java @@ -0,0 +1,20 @@ +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/cache-client/src/main/java/net/runelite/cache/client/CacheClient.java b/cache-client/src/main/java/net/runelite/cache/client/CacheClient.java deleted file mode 100644 index 273da5d5fa..0000000000 --- a/cache-client/src/main/java/net/runelite/cache/client/CacheClient.java +++ /dev/null @@ -1,459 +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.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/HandshakeResponseHandler.java b/cache-client/src/main/java/net/runelite/cache/client/HandshakeResponseHandler.java deleted file mode 100644 index bcbb01bafb..0000000000 --- a/cache-client/src/main/java/net/runelite/cache/client/HandshakeResponseHandler.java +++ /dev/null @@ -1,81 +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.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/cache-client/src/test/java/net/runelite/cache/client/CacheClientTest.java b/cache-client/src/test/java/net/runelite/cache/client/CacheClientTest.java deleted file mode 100644 index f5ba5d6824..0000000000 --- a/cache-client/src/test/java/net/runelite/cache/client/CacheClientTest.java +++ /dev/null @@ -1,74 +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.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 deleted file mode 100644 index eec033bd29..0000000000 --- a/cache-updater/pom.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - 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 deleted file mode 100644 index a4e063e1a6..0000000000 --- a/cache-updater/schema.sql +++ /dev/null @@ -1,118 +0,0 @@ --- 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 deleted file mode 100644 index 229ea1d268..0000000000 --- a/cache-updater/src/main/java/net/runelite/cache/updater/CacheConfiguration.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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 deleted file mode 100644 index 2834e5bb1e..0000000000 --- a/cache-updater/src/main/java/net/runelite/cache/updater/CacheDAO.java +++ /dev/null @@ -1,177 +0,0 @@ -/* - * 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 deleted file mode 100644 index cac605da09..0000000000 --- a/cache-updater/src/main/java/net/runelite/cache/updater/CacheStorage.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * 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 deleted file mode 100644 index 1a8f81c5ec..0000000000 --- a/cache-updater/src/main/java/net/runelite/cache/updater/CacheUpdater.java +++ /dev/null @@ -1,173 +0,0 @@ -/* - * 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 deleted file mode 100644 index ed685a9034..0000000000 --- a/cache-updater/src/main/java/net/runelite/cache/updater/CacheUploader.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * 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/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 deleted file mode 100644 index 9bacab75b8..0000000000 --- a/cache-updater/src/main/java/net/runelite/cache/updater/beans/ArchiveEntry.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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 deleted file mode 100644 index c9081cd883..0000000000 --- a/cache-updater/src/main/java/net/runelite/cache/updater/beans/CacheEntry.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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 deleted file mode 100644 index bb43c2a189..0000000000 --- a/cache-updater/src/main/java/net/runelite/cache/updater/beans/FileEntry.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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 deleted file mode 100644 index a5a0748f18..0000000000 --- a/cache-updater/src/main/java/net/runelite/cache/updater/beans/IndexEntry.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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 deleted file mode 100644 index df290d680f..0000000000 --- a/cache-updater/src/main/resources/application.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -# 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 deleted file mode 100644 index 6fd5d36c0f..0000000000 --- a/cache/pom.xml +++ /dev/null @@ -1,168 +0,0 @@ - - - - 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 deleted file mode 100644 index f8b33e8676..0000000000 --- a/cache/src/main/antlr4/net/runelite/cache/script/assembler/rs2asm.g4 +++ /dev/null @@ -1,66 +0,0 @@ -/* - * 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 deleted file mode 100644 index 96967b84b6..0000000000 --- a/cache/src/main/java/net/runelite/cache/AreaManager.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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 deleted file mode 100644 index 0f2c2d36b1..0000000000 --- a/cache/src/main/java/net/runelite/cache/Cache.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - * 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/HeightMapDumper.java b/cache/src/main/java/net/runelite/cache/HeightMapDumper.java deleted file mode 100644 index 5db30815ff..0000000000 --- a/cache/src/main/java/net/runelite/cache/HeightMapDumper.java +++ /dev/null @@ -1,149 +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.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/cache/src/main/java/net/runelite/cache/InterfaceManager.java b/cache/src/main/java/net/runelite/cache/InterfaceManager.java deleted file mode 100644 index ccfcfedd3b..0000000000 --- a/cache/src/main/java/net/runelite/cache/InterfaceManager.java +++ /dev/null @@ -1,176 +0,0 @@ -/* - * 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/cache/src/main/java/net/runelite/cache/ItemManager.java b/cache/src/main/java/net/runelite/cache/ItemManager.java deleted file mode 100644 index b3449a51a4..0000000000 --- a/cache/src/main/java/net/runelite/cache/ItemManager.java +++ /dev/null @@ -1,123 +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.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 deleted file mode 100644 index 5235d97fb6..0000000000 --- a/cache/src/main/java/net/runelite/cache/MapImageDumper.java +++ /dev/null @@ -1,987 +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.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 deleted file mode 100644 index 3124eb455f..0000000000 --- a/cache/src/main/java/net/runelite/cache/NpcManager.java +++ /dev/null @@ -1,111 +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.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 deleted file mode 100644 index cb1372ed65..0000000000 --- a/cache/src/main/java/net/runelite/cache/ObjectManager.java +++ /dev/null @@ -1,116 +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.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 deleted file mode 100644 index 6940227c0f..0000000000 --- a/cache/src/main/java/net/runelite/cache/OverlayManager.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * 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 deleted file mode 100644 index a18dd4f6ba..0000000000 --- a/cache/src/main/java/net/runelite/cache/SpriteManager.java +++ /dev/null @@ -1,118 +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.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 deleted file mode 100644 index bd816a4abb..0000000000 --- a/cache/src/main/java/net/runelite/cache/StructManager.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * 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/cache/src/main/java/net/runelite/cache/TextureManager.java b/cache/src/main/java/net/runelite/cache/TextureManager.java deleted file mode 100644 index 9eeb3504f2..0000000000 --- a/cache/src/main/java/net/runelite/cache/TextureManager.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * 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.ArrayList; -import java.util.List; -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 TextureManager implements TextureProvider -{ - private final Store store; - private final List textures = new ArrayList<>(); - - public TextureManager(Store store) - { - this.store = store; - } - - public void load() throws IOException - { - Storage storage = store.getStorage(); - Index index = store.getIndex(IndexType.TEXTURES); - Archive archive = index.getArchive(0); - - byte[] archiveData = storage.loadArchive(archive); - ArchiveFiles files = archive.getFiles(archiveData); - - TextureLoader loader = new TextureLoader(); - - for (FSFile file : files.getFiles()) - { - TextureDefinition texture = loader.load(file.getFileId(), file.getContents()); - textures.add(texture); - } - } - - public List getTextures() - { - return textures; - } - - public TextureDefinition findTexture(int id) - { - for (TextureDefinition td : textures) - { - if (td.getId() == id) - { - return td; - } - } - 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 deleted file mode 100644 index 3bba2230a4..0000000000 --- a/cache/src/main/java/net/runelite/cache/UnderlayManager.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * 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 deleted file mode 100644 index 7abdbdfddd..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/AreaDefinition.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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 deleted file mode 100644 index b56c0a42d1..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/ClientScript1Instruction.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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/cache/src/main/java/net/runelite/cache/definitions/EnumDefinition.java b/cache/src/main/java/net/runelite/cache/definitions/EnumDefinition.java deleted file mode 100644 index e9f1c11b02..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/EnumDefinition.java +++ /dev/null @@ -1,43 +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.cache.definitions; - -import lombok.Data; -import net.runelite.cache.util.ScriptVarType; - -@Data -public class EnumDefinition -{ - 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 deleted file mode 100644 index c31f0330ac..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/FrameDefinition.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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 deleted file mode 100644 index 00669d6690..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/FramemapDefinition.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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 deleted file mode 100644 index aede6d6d7b..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/InterfaceDefinition.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * 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 deleted file mode 100644 index 5239f5c093..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/InventoryDefinition.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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 deleted file mode 100644 index 8f67622b24..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/ItemDefinition.java +++ /dev/null @@ -1,123 +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.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 deleted file mode 100644 index bd2ee535f5..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/KitDefinition.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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/MapDefinition.java b/cache/src/main/java/net/runelite/cache/definitions/MapDefinition.java deleted file mode 100644 index b695b24cbe..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/MapDefinition.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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 deleted file mode 100644 index 2259026a4d..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/ModelDefinition.java +++ /dev/null @@ -1,635 +0,0 @@ -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/cache/src/main/java/net/runelite/cache/definitions/NpcDefinition.java b/cache/src/main/java/net/runelite/cache/definitions/NpcDefinition.java deleted file mode 100644 index 8ba160c97a..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/NpcDefinition.java +++ /dev/null @@ -1,68 +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.cache.definitions; - -import java.util.Map; -import lombok.Data; - -@Data -public class NpcDefinition -{ - - public final int id; - public short[] recolorToFind; - public int rotation = 32; - public String name = "null"; - public short[] recolorToReplace; - public int[] models; - public int[] models_2; - public int stanceAnimation = -1; - public int anInt2165 = -1; - public int tileSpacesOccupied = 1; - public int walkAnimation = -1; - public short[] retextureToReplace; - public int rotate90RightAnimation = -1; - public boolean aBool2170 = true; - public int resizeX = 128; - public int contrast = 0; - public int rotate180Animation = -1; - public int varbitIndex = -1; - public String[] options = new String[5]; - public boolean renderOnMinimap = true; - public int combatLevel = -1; - public int rotate90LeftAnimation = -1; - public int resizeY = 128; - public boolean hasRenderPriority = false; - public int ambient = 0; - public int headIcon = -1; - public int[] configs; - public short[] retextureToFind; - public int varpIndex = -1; - public boolean isClickable = true; - public int anInt2189 = -1; - public boolean aBool2190 = false; - public Map params = null; -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/ObjectDefinition.java b/cache/src/main/java/net/runelite/cache/definitions/ObjectDefinition.java deleted file mode 100644 index 007c9e2ebf..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/ObjectDefinition.java +++ /dev/null @@ -1,78 +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.cache.definitions; - -import java.util.Map; -import lombok.Data; - -@Data -public class ObjectDefinition -{ - private int id; - private short[] retextureToFind; - private int anInt2069 = 16; - private boolean isSolid = false; - private String name = "null"; - private int[] objectModels; - private int[] objectTypes; - private short[] recolorToFind; - private int mapAreaId = -1; - private short[] textureToReplace; - private int sizeX = 1; - private int sizeY = 1; - private int anInt2083 = 0; - private int[] anIntArray2084; - private int offsetX = 0; - private boolean nonFlatShading = false; - private int anInt2088 = -1; - private int animationID = -1; - private int varbitID = -1; - private int ambient = 0; - private int contrast = 0; - private String[] actions = new String[5]; - private int interactType = 2; - private int mapSceneID = -1; - private short[] recolorToReplace; - private boolean aBool2097 = true; - private int modelSizeX = 128; - private int modelSizeHeight = 128; - private int modelSizeY = 128; - private int objectID; - private int offsetHeight = 0; - private int offsetY = 0; - private boolean aBool2104 = false; - private int anInt2105 = -1; - private int anInt2106 = -1; - private int[] configChangeDest; - private boolean isRotated = false; - private int varpID = -1; - private int anInt2110 = -1; - private boolean aBool2111 = false; - private int anInt2112 = 0; - private int anInt2113 = 0; - private boolean blocksProjectile = true; - private Map params = null; -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/OverlayDefinition.java b/cache/src/main/java/net/runelite/cache/definitions/OverlayDefinition.java deleted file mode 100644 index 3846e99364..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/OverlayDefinition.java +++ /dev/null @@ -1,139 +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.cache.definitions; - -import lombok.Data; - -@Data -public class OverlayDefinition -{ - private int id; - private int rgbColor = 0; - private int texture = -1; - private int secondaryRgbColor = -1; - private boolean hideUnderlay = true; - - private transient int hue; - private transient int saturation; - private transient int lightness; - - private transient int otherHue; - private transient int otherSaturation; - private transient int otherLightness; - - public void calculateHsl() - { - if (secondaryRgbColor != -1) - { - calculateHsl(secondaryRgbColor); - otherHue = hue; - otherSaturation = saturation; - otherLightness = lightness; - } - - calculateHsl(rgbColor); - } - - private void calculateHsl(int var1) - { - double var2 = (double) (var1 >> 16 & 255) / 256.0D; - double var4 = (double) (var1 >> 8 & 255) / 256.0D; - double var6 = (double) (var1 & 255) / 256.0D; - double var8 = var2; - if (var4 < var2) - { - var8 = var4; - } - - if (var6 < var8) - { - var8 = var6; - } - - double var10 = var2; - if (var4 > var2) - { - var10 = var4; - } - - if (var6 > var10) - { - var10 = var6; - } - - double var12 = 0.0D; - double var14 = 0.0D; - double var16 = (var8 + var10) / 2.0D; - if (var10 != var8) - { - if (var16 < 0.5D) - { - var14 = (var10 - var8) / (var10 + var8); - } - - if (var16 >= 0.5D) - { - var14 = (var10 - var8) / (2.0D - var10 - var8); - } - - if (var2 == var10) - { - var12 = (var4 - var6) / (var10 - var8); - } - else if (var4 == var10) - { - var12 = 2.0D + (var6 - var2) / (var10 - var8); - } - else if (var10 == var6) - { - var12 = 4.0D + (var2 - var4) / (var10 - var8); - } - } - - var12 /= 6.0D; - this.hue = (int) (256.0D * var12); - this.saturation = (int) (var14 * 256.0D); - this.lightness = (int) (var16 * 256.0D); - if (this.saturation < 0) - { - this.saturation = 0; - } - else if (this.saturation > 255) - { - this.saturation = 255; - } - - if (this.lightness < 0) - { - this.lightness = 0; - } - else if (this.lightness > 255) - { - this.lightness = 255; - } - - } -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/SequenceDefinition.java b/cache/src/main/java/net/runelite/cache/definitions/SequenceDefinition.java deleted file mode 100644 index 3f280f31c2..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/SequenceDefinition.java +++ /dev/null @@ -1,47 +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.cache.definitions; - -import lombok.Data; - -@Data -public class SequenceDefinition -{ - private final int id; - public int[] frameIDs; // top 16 bits are FrameDefinition ids - public int[] field3048; - public int[] frameLenghts; - public int rightHandItem = -1; - public int[] interleaveLeave; - public boolean stretches = false; - public int forcedPriority = 5; - public int maxLoops = 99; - public int[] field3056; - public int precedenceAnimating = -1; - public int leftHandItem = -1; - public int replyMode = 2; - public int frameStep = -1; - public int priority = -1; -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/SpotAnimDefinition.java b/cache/src/main/java/net/runelite/cache/definitions/SpotAnimDefinition.java deleted file mode 100644 index e85b3918e2..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/SpotAnimDefinition.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 SpotAnimDefinition -{ - public int rotaton = 0; - public short[] textureToReplace; - public int id; - public short[] textureToFind; - public int resizeY = 128; - public int animationId = -1; - public short[] recolorToFind; - public short[] recolorToReplace; - public int resizeX = 128; - public int modelId; - public int ambient = 0; - public int contrast = 0; -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/SpriteDefinition.java b/cache/src/main/java/net/runelite/cache/definitions/SpriteDefinition.java deleted file mode 100644 index 632ea1e4e3..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/SpriteDefinition.java +++ /dev/null @@ -1,67 +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.cache.definitions; - -import lombok.Data; - -@Data -public class SpriteDefinition -{ - private int id; - private int frame; - private int offsetX; - private int offsetY; - private int width; - private int height; - private int[] pixels; - private int maxWidth; - private int maxHeight; - - public transient byte[] pixelIdx; - public transient int[] palette; - - public void normalize() - { - if (this.width != this.maxWidth || this.height != this.maxHeight) - { - byte[] var1 = new byte[this.maxWidth * this.maxHeight]; - int var2 = 0; - - for (int var3 = 0; var3 < this.height; ++var3) - { - for (int var4 = 0; var4 < this.width; ++var4) - { - var1[var4 + (var3 + this.offsetY) * this.maxWidth + this.offsetX] = this.pixelIdx[var2++]; - } - } - - this.pixelIdx = var1; - this.width = this.maxWidth; - this.height = this.maxHeight; - this.offsetX = 0; - this.offsetY = 0; - } - } -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/StructDefinition.java b/cache/src/main/java/net/runelite/cache/definitions/StructDefinition.java deleted file mode 100644 index 455ce9ea5e..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/StructDefinition.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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.definitions; - -import java.util.Map; -import lombok.Data; - -@Data -public class StructDefinition -{ - public final int id; - public Map params = null; -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/TextureDefinition.java b/cache/src/main/java/net/runelite/cache/definitions/TextureDefinition.java deleted file mode 100644 index d34bc5678a..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/TextureDefinition.java +++ /dev/null @@ -1,150 +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.cache.definitions; - -import lombok.Data; -import net.runelite.cache.definitions.providers.SpriteProvider; - -@Data -public class TextureDefinition -{ - public int field1777; - public boolean field1778; - private int id; - private int[] fileIds; - public int[] field1780; - public int[] field1781; - public int[] field1786; - public int field1782; - public int field1783; - - public transient int[] pixels; - - public boolean method2680(double var1, int var3, SpriteProvider spriteProvider) - { - int var5 = var3 * var3; - this.pixels = new int[var5]; - - for (int var6 = 0; var6 < this.fileIds.length; ++var6) - { - SpriteDefinition var7 = spriteProvider.provide(fileIds[var6], 0); - var7.normalize(); - byte[] var8 = var7.pixelIdx; - int[] var9 = var7.palette; - int var10 = this.field1786[var6]; - - int var11; - int var12; - int var13; - int var14; - if ((var10 & -16777216) == 50331648) - { - var11 = var10 & 16711935; - var12 = var10 >> 8 & 255; - - for (var13 = 0; var13 < var9.length; ++var13) - { - var14 = var9[var13]; - if (var14 >> 8 == (var14 & 65535)) - { - var14 &= 255; - var9[var13] = var11 * var14 >> 8 & 16711935 | var12 * var14 & 65280; - } - } - } - - for (var11 = 0; var11 < var9.length; ++var11) - { - var9[var11] = adjustRGB(var9[var11], var1); - } - - if (var6 == 0) - { - var11 = 0; - } - else - { - var11 = this.field1780[var6 - 1]; - } - - if (var11 == 0) - { - if (var3 == var7.getMaxWidth()) - { - for (var12 = 0; var12 < var5; ++var12) - { - this.pixels[var12] = var9[var8[var12] & 255]; - } - } - else if (var7.getMaxWidth() == 64 && var3 == 128) - { - var12 = 0; - - for (var13 = 0; var13 < var3; ++var13) - { - for (var14 = 0; var14 < var3; ++var14) - { - this.pixels[var12++] = var9[var8[(var13 >> 1 << 6) + (var14 >> 1)] & 255]; - } - } - } - else - { - if (var7.getMaxWidth() != 128 || var3 != 64) - { - throw new RuntimeException(); - } - - var12 = 0; - - for (var13 = 0; var13 < var3; ++var13) - { - for (var14 = 0; var14 < var3; ++var14) - { - this.pixels[var12++] = var9[var8[(var14 << 1) + (var13 << 1 << 7)] & 255]; - } - } - } - } - } - - return true; - } - - static int adjustRGB(int var0, double var1) - { - double var3 = (double) (var0 >> 16) / 256.0D; - double var5 = (double) (var0 >> 8 & 255) / 256.0D; - double var7 = (double) (var0 & 255) / 256.0D; - var3 = Math.pow(var3, var1); - var5 = Math.pow(var5, var1); - var7 = Math.pow(var7, var1); - int var9 = (int) (var3 * 256.0D); - int var10 = (int) (var5 * 256.0D); - int var11 = (int) (var7 * 256.0D); - return var11 + (var10 << 8) + (var9 << 16); - } -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/TrackDefinition.java b/cache/src/main/java/net/runelite/cache/definitions/TrackDefinition.java deleted file mode 100644 index 136070e8f9..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/TrackDefinition.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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 TrackDefinition -{ - public byte[] midi; // midi file contents -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/UnderlayDefinition.java b/cache/src/main/java/net/runelite/cache/definitions/UnderlayDefinition.java deleted file mode 100644 index 7d3d8c2a47..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/UnderlayDefinition.java +++ /dev/null @@ -1,134 +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.cache.definitions; - -import lombok.Data; - -@Data -public class UnderlayDefinition -{ - private int id; - private int color; - - private transient int hue; - private transient int saturation; - private transient int lightness; - private transient int hueMultiplier; - - public void calculateHsl() - { - int var1 = color; - double var2 = (double) (var1 >> 16 & 255) / 256.0D; - double var4 = (double) (var1 >> 8 & 255) / 256.0D; - double var6 = (double) (var1 & 255) / 256.0D; - double var8 = var2; - if (var4 < var2) - { - var8 = var4; - } - - if (var6 < var8) - { - var8 = var6; - } - - double var10 = var2; - if (var4 > var2) - { - var10 = var4; - } - - if (var6 > var10) - { - var10 = var6; - } - - double var12 = 0.0D; - double var14 = 0.0D; - double var16 = (var10 + var8) / 2.0D; - if (var8 != var10) - { - if (var16 < 0.5D) - { - var14 = (var10 - var8) / (var8 + var10); - } - - if (var16 >= 0.5D) - { - var14 = (var10 - var8) / (2.0D - var10 - var8); - } - - if (var2 == var10) - { - var12 = (var4 - var6) / (var10 - var8); - } - else if (var10 == var4) - { - var12 = 2.0D + (var6 - var2) / (var10 - var8); - } - else if (var10 == var6) - { - var12 = 4.0D + (var2 - var4) / (var10 - var8); - } - } - - var12 /= 6.0D; - this.saturation = (int) (var14 * 256.0D); - this.lightness = (int) (var16 * 256.0D); - if (this.saturation < 0) - { - this.saturation = 0; - } - else if (this.saturation > 255) - { - this.saturation = 255; - } - - if (this.lightness < 0) - { - this.lightness = 0; - } - else if (this.lightness > 255) - { - this.lightness = 255; - } - - if (var16 > 0.5D) - { - this.hueMultiplier = (int) (var14 * (1.0D - var16) * 512.0D); - } - else - { - this.hueMultiplier = (int) (var14 * var16 * 512.0D); - } - - if (this.hueMultiplier < 1) - { - this.hueMultiplier = 1; - } - - this.hue = (int) ((double) this.hueMultiplier * var12); - } -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/VarbitDefinition.java b/cache/src/main/java/net/runelite/cache/definitions/VarbitDefinition.java deleted file mode 100644 index f50ae2ddf1..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/VarbitDefinition.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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 VarbitDefinition -{ - private int id; - private int index; - private int leastSignificantBit; - private int mostSignificantBit; -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/WorldMapDefinition.java b/cache/src/main/java/net/runelite/cache/definitions/WorldMapDefinition.java deleted file mode 100644 index a8333263e5..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/WorldMapDefinition.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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.List; -import lombok.Data; -import net.runelite.cache.region.Position; - -@Data -public class WorldMapDefinition -{ - public String name; - public int field450; - public int field451; - public int fileId; - public int field453; - public int field454; - public int field456; - public boolean field457; - public List field458; - public String safeName; - public Position position; - public int field463; -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/WorldMapType0.java b/cache/src/main/java/net/runelite/cache/definitions/WorldMapType0.java deleted file mode 100644 index 1294d0eb4d..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/WorldMapType0.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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 WorldMapType0 implements WorldMapTypeBase -{ - public int field600; - public int field601; - public int field602; - public int field603; - public int field604; - public int field605; - public int field606; - public int field607; - public int field608; - public int field609; -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/WorldMapType1.java b/cache/src/main/java/net/runelite/cache/definitions/WorldMapType1.java deleted file mode 100644 index 15a4f3e28d..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/WorldMapType1.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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 WorldMapType1 implements WorldMapTypeBase -{ - public int field424; - public int field425; - public int field426; - public int field427; - public int field428; - public int field429; - public int field431; - public int field433; - public int field434; - public int field435; -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/WorldMapType2.java b/cache/src/main/java/net/runelite/cache/definitions/WorldMapType2.java deleted file mode 100644 index 7b5326814d..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/WorldMapType2.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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 WorldMapType2 implements WorldMapTypeBase -{ - public int field510; - public int field511; - public int field512; - public int field514; - public int field515; - public int field519; -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/WorldMapType3.java b/cache/src/main/java/net/runelite/cache/definitions/WorldMapType3.java deleted file mode 100644 index 433c8a17fa..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/WorldMapType3.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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 WorldMapType3 implements WorldMapTypeBase -{ - public int field376; - public int field377; - public int field378; - public int field379; - public int field380; - public int field381; - public int field382; - public int field383; - public int field384; - public int field385; - public int field386; - public int field387; - public int field388; - public int field389; -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/WorldMapTypeBase.java b/cache/src/main/java/net/runelite/cache/definitions/WorldMapTypeBase.java deleted file mode 100644 index d24d6d63f3..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/WorldMapTypeBase.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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; - -public interface WorldMapTypeBase -{ - -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/exporters/InterfaceExporter.java b/cache/src/main/java/net/runelite/cache/definitions/exporters/InterfaceExporter.java deleted file mode 100644 index b1020b9a59..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/exporters/InterfaceExporter.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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.exporters; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import net.runelite.cache.definitions.InterfaceDefinition; - -public class InterfaceExporter -{ - private final InterfaceDefinition item; - private final Gson gson; - - public InterfaceExporter(InterfaceDefinition item) - { - this.item = item; - - GsonBuilder builder = new GsonBuilder() - .setPrettyPrinting(); - gson = builder.create(); - } - - public String export() - { - return gson.toJson(item); - } - - public void exportTo(File file) throws IOException - { - try (FileWriter fw = new FileWriter(file)) - { - fw.write(export()); - } - } -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/exporters/ItemExporter.java b/cache/src/main/java/net/runelite/cache/definitions/exporters/ItemExporter.java deleted file mode 100644 index 5dddff97ee..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/exporters/ItemExporter.java +++ /dev/null @@ -1,60 +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.cache.definitions.exporters; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import net.runelite.cache.definitions.ItemDefinition; - -public class ItemExporter -{ - private final ItemDefinition item; - private final Gson gson; - - public ItemExporter(ItemDefinition item) - { - this.item = item; - - GsonBuilder builder = new GsonBuilder() - .setPrettyPrinting(); - gson = builder.create(); - } - - public String export() - { - return gson.toJson(item); - } - - public void exportTo(File file) throws IOException - { - try (FileWriter fw = new FileWriter(file)) - { - fw.write(export()); - } - } -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/exporters/SpriteExporter.java b/cache/src/main/java/net/runelite/cache/definitions/exporters/SpriteExporter.java deleted file mode 100644 index 9c073d5e3a..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/exporters/SpriteExporter.java +++ /dev/null @@ -1,54 +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.cache.definitions.exporters; - -import java.awt.image.BufferedImage; -import java.io.File; -import java.io.IOException; -import javax.imageio.ImageIO; -import net.runelite.cache.definitions.SpriteDefinition; - -public class SpriteExporter -{ - private final SpriteDefinition sprite; - - public SpriteExporter(SpriteDefinition sprite) - { - this.sprite = sprite; - } - - public BufferedImage export() - { - BufferedImage bi = new BufferedImage(sprite.getWidth(), sprite.getHeight(), BufferedImage.TYPE_INT_ARGB); - bi.setRGB(0, 0, sprite.getWidth(), sprite.getHeight(), sprite.getPixels(), 0, sprite.getWidth()); - return bi; - } - - public void exportTo(File file) throws IOException - { - BufferedImage image = export(); - ImageIO.write(image, "png", file); - } -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/loaders/AreaLoader.java b/cache/src/main/java/net/runelite/cache/definitions/loaders/AreaLoader.java deleted file mode 100644 index 7b47358678..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/loaders/AreaLoader.java +++ /dev/null @@ -1,190 +0,0 @@ -/* - * 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.loaders; - -import net.runelite.cache.definitions.AreaDefinition; -import net.runelite.cache.io.InputStream; - -public class AreaLoader -{ - public AreaDefinition load(byte[] b, int id) - { - InputStream in = new InputStream(b); - AreaDefinition def = new AreaDefinition(); - def.id = id; - - for (;;) - { - int opcode = in.readUnsignedByte(); - if (opcode == 0) - { - break; - } - - processOpcode(def, in, opcode); - } - - return def; - } - - private void processOpcode(AreaDefinition def, InputStream in, int opcode) - { - if (opcode == 1) - { - def.spriteId = in.readBigSmart2(); - } - else if (opcode == 2) - { - def.field3294 = in.readBigSmart2(); - } - else if (opcode == 3) - { - def.name = in.readString(); - } - else if (opcode == 4) - { - def.field3296 = in.read24BitInt(); - } - else if (opcode == 5) - { - in.read24BitInt(); - } - else if (opcode == 6) - { - def.field3310 = in.readUnsignedByte(); - } - else if (opcode == 7) - { - int var3 = in.readUnsignedByte(); - if ((var3 & 1) == 0) - { - ; - } - - if ((var3 & 2) == 2) - { - ; - } - } - else if (opcode == 8) - { - in.readUnsignedByte(); - } - else if (opcode >= 10 && opcode <= 14) - { - def.field3298[opcode - 10] = in.readString(); - } - else if (opcode == 15) - { - int var3 = in.readUnsignedByte(); - def.field3300 = new int[var3 * 2]; - - int var4; - for (var4 = 0; var4 < var3 * 2; ++var4) - { - def.field3300[var4] = in.readShort(); - } - - in.readInt(); - var4 = in.readUnsignedByte(); - def.field3292 = new int[var4]; - - int var5; - for (var5 = 0; var5 < def.field3292.length; ++var5) - { - def.field3292[var5] = in.readInt(); - } - - def.field3309 = new byte[var3]; - - for (var5 = 0; var5 < var3; ++var5) - { - def.field3309[var5] = in.readByte(); - } - } - else if (opcode == 16) - { - - } - else if (opcode == 17) - { - def.field3308 = in.readString(); - } - else if (opcode == 18) - { - in.readBigSmart2(); - } - else if (opcode == 19) - { - def.field3297 = in.readUnsignedShort(); - } - else if (opcode == 21) - { - in.readInt(); - } - else if (opcode == 22) - { - in.readInt(); - } - else if (opcode == 23) - { - in.readUnsignedByte(); - in.readUnsignedByte(); - in.readUnsignedByte(); - } - else if (opcode == 24) - { - in.readShort(); - in.readShort(); - } - else if (opcode == 25) - { - in.readBigSmart2(); - } - else if (opcode == 28) - { - in.readUnsignedByte(); - } - else if (opcode == 29) - { - in.skip(1); -// class257[] var6 = new class257[] -// { -// class257.field3538, class257.field3539, class257.field3540 -// }; -// this.field3299 = (class257) Item.method1751(var6, var1.readUnsignedByte()); - } - else if (opcode == 30) - { - in.skip(1); -// class239[] var7 = new class239[] -// { -// class239.field3273, class239.field3275, class239.field3271 -// }; -// this.field3306 = (class239) Item.method1751(var7, var1.readUnsignedByte()); - } - - } -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/loaders/EnumLoader.java b/cache/src/main/java/net/runelite/cache/definitions/loaders/EnumLoader.java deleted file mode 100644 index 83542c4fed..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/loaders/EnumLoader.java +++ /dev/null @@ -1,114 +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.cache.definitions.loaders; - -import net.runelite.cache.definitions.EnumDefinition; -import net.runelite.cache.io.InputStream; -import net.runelite.cache.util.ScriptVarType; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class EnumLoader -{ - private static final Logger logger = LoggerFactory.getLogger(EnumLoader.class); - - public EnumDefinition load(int id, byte[] b) - { - if (b.length == 1 && b[0] == 0) - { - return null; - } - - EnumDefinition def = new EnumDefinition(); - InputStream is = new InputStream(b); - - def.setId(id); - - for (;;) - { - int opcode = is.readUnsignedByte(); - if (opcode == 0) - { - break; - } - - processOp(opcode, def, is); - } - - return def; - } - - private void processOp(int opcode, EnumDefinition def, InputStream is) - { - switch (opcode) - { - case 1: - def.setKeyType(ScriptVarType.forCharKey((char) is.readUnsignedByte())); - break; - case 2: - def.setValType(ScriptVarType.forCharKey((char) is.readUnsignedByte())); - break; - case 3: - def.setDefaultString(is.readString()); - break; - case 4: - def.setDefaultInt(is.readInt()); - break; - case 5: - { - int size = is.readUnsignedShort(); - int[] keys = new int[size]; - String[] stringVals = new String[size]; - for (int index = 0; index < size; ++index) - { - keys[index] = is.readInt(); - stringVals[index] = is.readString(); - } - def.setSize(size); - def.setKeys(keys); - def.setStringVals(stringVals); - break; - } - case 6: - { - int size = is.readUnsignedShort(); - int[] keys = new int[size]; - int[] intVals = new int[size]; - for (int index = 0; index < size; ++index) - { - keys[index] = is.readInt(); - intVals[index] = is.readInt(); - } - def.setSize(size); - def.setKeys(keys); - def.setIntVals(intVals); - break; - } - default: - logger.warn("Unrecognized opcode {}", opcode); - break; - } - } -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/loaders/FrameLoader.java b/cache/src/main/java/net/runelite/cache/definitions/loaders/FrameLoader.java deleted file mode 100644 index 5ec512d62f..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/loaders/FrameLoader.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * 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.loaders; - -import net.runelite.cache.definitions.FrameDefinition; -import net.runelite.cache.definitions.FramemapDefinition; -import net.runelite.cache.io.InputStream; - -public class FrameLoader -{ - public FrameDefinition load(FramemapDefinition framemap, int id, byte[] b) - { - FrameDefinition def = new FrameDefinition(); - InputStream in = new InputStream(b); - InputStream data = new InputStream(b); - - def.id = id; - def.framemap = framemap; - - int framemapArchiveIndex = in.readUnsignedShort(); - int length = in.readUnsignedByte(); - - data.skip(3 + length); // framemapArchiveIndex + length + data - - int[] indexFrameIds = new int[500]; - int[] scratchTranslatorX = new int[500]; - int[] scratchTranslatorY = new int[500]; - int[] scratchTranslatorZ = new int[500]; - - int lastI = -1; - int index = 0; - for (int i = 0; i < length; ++i) - { - int var9 = in.readUnsignedByte(); - - if (var9 <= 0) - { - continue; - } - - if (def.framemap.types[i] != 0) - { - for (int var10 = i - 1; var10 > lastI; --var10) - { - if (def.framemap.types[var10] == 0) - { - indexFrameIds[index] = var10; - scratchTranslatorX[index] = 0; - scratchTranslatorY[index] = 0; - scratchTranslatorZ[index] = 0; - ++index; - break; - } - } - } - - indexFrameIds[index] = i; - short var11 = 0; - if (def.framemap.types[i] == 3) - { - var11 = 128; - } - - if ((var9 & 1) != 0) - { - scratchTranslatorX[index] = data.readShortSmart(); - } - else - { - scratchTranslatorX[index] = var11; - } - - if ((var9 & 2) != 0) - { - scratchTranslatorY[index] = data.readShortSmart(); - } - else - { - scratchTranslatorY[index] = var11; - } - - if ((var9 & 4) != 0) - { - scratchTranslatorZ[index] = data.readShortSmart(); - } - else - { - scratchTranslatorZ[index] = var11; - } - - lastI = i; - ++index; - if (def.framemap.types[i] == 5) - { - def.showing = true; - } - } - - if (data.getOffset() != b.length) - { - throw new RuntimeException(); - } - - def.translatorCount = index; - def.indexFrameIds = new int[index]; - def.translator_x = new int[index]; - def.translator_y = new int[index]; - def.translator_z = new int[index]; - - for (int i = 0; i < index; ++i) - { - def.indexFrameIds[i] = indexFrameIds[i]; - def.translator_x[i] = scratchTranslatorX[i]; - def.translator_y[i] = scratchTranslatorY[i]; - def.translator_z[i] = scratchTranslatorZ[i]; - } - - return def; - } -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/loaders/FramemapLoader.java b/cache/src/main/java/net/runelite/cache/definitions/loaders/FramemapLoader.java deleted file mode 100644 index b649af8e47..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/loaders/FramemapLoader.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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.loaders; - -import net.runelite.cache.definitions.FramemapDefinition; -import net.runelite.cache.io.InputStream; - -public class FramemapLoader -{ - public FramemapDefinition load(int id, byte[] b) - { - FramemapDefinition def = new FramemapDefinition(); - InputStream in = new InputStream(b); - - def.id = id; - - def.length = in.readUnsignedByte(); - def.types = new int[def.length]; - def.frameMaps = new int[def.length][]; - - for (int i = 0; i < def.length; ++i) - { - def.types[i] = in.readUnsignedByte(); - } - - for (int i = 0; i < def.length; ++i) - { - def.frameMaps[i] = new int[in.readUnsignedByte()]; - } - - for (int i = 0; i < def.length; ++i) - { - for (int j = 0; j < def.frameMaps[i].length; ++j) - { - def.frameMaps[i][j] = in.readUnsignedByte(); - } - } - - return def; - } -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/loaders/InterfaceLoader.java b/cache/src/main/java/net/runelite/cache/definitions/loaders/InterfaceLoader.java deleted file mode 100644 index 69db420f9f..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/loaders/InterfaceLoader.java +++ /dev/null @@ -1,572 +0,0 @@ -/* - * 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.loaders; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import net.runelite.cache.definitions.ClientScript1Instruction; -import net.runelite.cache.definitions.InterfaceDefinition; -import net.runelite.cache.io.InputStream; - -public class InterfaceLoader -{ - public InterfaceDefinition load(int id, byte[] b) - { - InterfaceDefinition iface = new InterfaceDefinition(); - iface.id = id; - if (b[0] == -1) - { - decodeIf3(iface, new InputStream(b)); - } - else - { - decodeIf1(iface, new InputStream(b)); - } - - return iface; - } - - private void decodeIf1(InterfaceDefinition iface, InputStream var1) - { - iface.isIf3 = false; - iface.type = var1.readUnsignedByte(); - iface.menuType = var1.readUnsignedByte(); - iface.contentType = var1.readUnsignedShort(); - iface.originalX = var1.readShort(); - iface.originalY = var1.readShort(); - iface.originalWidth = var1.readUnsignedShort(); - iface.originalHeight = var1.readUnsignedShort(); - iface.opacity = var1.readUnsignedByte(); - iface.parentId = var1.readUnsignedShort(); - if (iface.parentId == 0xFFFF) - { - iface.parentId = -1; - } - else - { - iface.parentId += iface.id & ~0xFFFF; - } - - iface.hoveredSiblingId = var1.readUnsignedShort(); - if (iface.hoveredSiblingId == 0xFFFF) - { - iface.hoveredSiblingId = -1; - } - - int var2 = var1.readUnsignedByte(); - int var3; - if (var2 > 0) - { - iface.alternateOperators = new int[var2]; - iface.alternateRhs = new int[var2]; - - for (var3 = 0; var3 < var2; ++var3) - { - iface.alternateOperators[var3] = var1.readUnsignedByte(); - iface.alternateRhs[var3] = var1.readUnsignedShort(); - } - } - - var3 = var1.readUnsignedByte(); - int var4; - int var5; - int var6; - if (var3 > 0) - { - iface.clientScripts = new ClientScript1Instruction[var3][]; - - for (var4 = 0; var4 < var3; ++var4) - { - var5 = var1.readUnsignedShort(); - int[] bytecode = new int[var5]; - - for (var6 = 0; var6 < var5; ++var6) - { - bytecode[var6] = var1.readUnsignedShort(); - if (bytecode[var6] == 0xFFFF) - { - bytecode[var6] = -1; - } - - List instructions = new ArrayList<>(); - for (int i = 0; i < bytecode.length;) - { - ClientScript1Instruction ins = new ClientScript1Instruction(); - - ins.opcode = ClientScript1Instruction.Opcode.values()[bytecode[i++]]; - - int ac = ins.opcode.argumentCount; - ins.operands = Arrays.copyOfRange(bytecode, i, i + ac); - - instructions.add(ins); - i += ac; - } - iface.clientScripts[var4] = instructions.toArray(new ClientScript1Instruction[0]); - } - } - } - - if (iface.type == 0) - { - iface.scrollHeight = var1.readUnsignedShort(); - iface.isHidden = var1.readUnsignedByte() == 1; - } - - if (iface.type == 1) - { - var1.readUnsignedShort(); - var1.readUnsignedByte(); - } - - if (iface.type == 2) - { - iface.itemIds = new int[iface.originalWidth * iface.originalHeight]; - iface.itemQuantities = new int[iface.originalHeight * iface.originalWidth]; - var4 = var1.readUnsignedByte(); - if (var4 == 1) - { - iface.clickMask |= 268435456; - } - - var5 = var1.readUnsignedByte(); - if (var5 == 1) - { - iface.clickMask |= 1073741824; - } - - var6 = var1.readUnsignedByte(); - if (var6 == 1) - { - iface.clickMask |= Integer.MIN_VALUE; - } - - int var7 = var1.readUnsignedByte(); - if (var7 == 1) - { - iface.clickMask |= 536870912; - } - - iface.xPitch = var1.readUnsignedByte(); - iface.yPitch = var1.readUnsignedByte(); - iface.xOffsets = new int[20]; - iface.yOffsets = new int[20]; - iface.sprites = new int[20]; - - int var8; - for (var8 = 0; var8 < 20; ++var8) - { - int var9 = var1.readUnsignedByte(); - if (var9 == 1) - { - iface.xOffsets[var8] = var1.readShort(); - iface.yOffsets[var8] = var1.readShort(); - iface.sprites[var8] = var1.readInt(); - } - else - { - iface.sprites[var8] = -1; - } - } - - iface.configActions = new String[5]; - - for (var8 = 0; var8 < 5; ++var8) - { - String var11 = var1.readString(); - if (var11.length() > 0) - { - iface.configActions[var8] = var11; - iface.clickMask |= 1 << var8 + 23; - } - } - } - - if (iface.type == 3) - { - iface.filled = var1.readUnsignedByte() == 1; - } - - if (iface.type == 4 || iface.type == 1) - { - iface.xTextAlignment = var1.readUnsignedByte(); - iface.yTextAlignment = var1.readUnsignedByte(); - iface.lineHeight = var1.readUnsignedByte(); - iface.fontId = var1.readUnsignedShort(); - if (iface.fontId == 0xFFFF) - { - iface.fontId = -1; - } - - iface.textShadowed = var1.readUnsignedByte() == 1; - } - - if (iface.type == 4) - { - iface.text = var1.readString(); - iface.alternateText = var1.readString(); - } - - if (iface.type == 1 || iface.type == 3 || iface.type == 4) - { - iface.textColor = var1.readInt(); - } - - if (iface.type == 3 || iface.type == 4) - { - iface.alternateTextColor = var1.readInt(); - iface.hoveredTextColor = var1.readInt(); - iface.alternateHoveredTextColor = var1.readInt(); - } - - if (iface.type == 5) - { - iface.spriteId = var1.readInt(); - iface.alternateSpriteId = var1.readInt(); - } - - if (iface.type == 6) - { - iface.modelType = 1; - iface.modelId = var1.readUnsignedShort(); - if (iface.modelId == 0xFFFF) - { - iface.modelId = -1; - } - - iface.alternateModelId = var1.readUnsignedShort(); - if (iface.alternateModelId == 0xFFFF) - { - iface.alternateModelId = -1; - } - - iface.animation = var1.readUnsignedShort(); - if (iface.animation == 0xFFFF) - { - iface.animation = -1; - } - - iface.alternateAnimation = var1.readUnsignedShort(); - if (iface.alternateAnimation == 0xFFFF) - { - iface.alternateAnimation = -1; - } - - iface.modelZoom = var1.readUnsignedShort(); - iface.rotationX = var1.readUnsignedShort(); - iface.rotationZ = var1.readUnsignedShort(); - } - - if (iface.type == 7) - { - iface.itemIds = new int[iface.originalWidth * iface.originalHeight]; - iface.itemQuantities = new int[iface.originalWidth * iface.originalHeight]; - iface.xTextAlignment = var1.readUnsignedByte(); - iface.fontId = var1.readUnsignedShort(); - if (iface.fontId == 0xFFFF) - { - iface.fontId = -1; - } - - iface.textShadowed = var1.readUnsignedByte() == 1; - iface.textColor = var1.readInt(); - iface.xPitch = var1.readShort(); - iface.yPitch = var1.readShort(); - var4 = var1.readUnsignedByte(); - if (var4 == 1) - { - iface.clickMask |= 1073741824; - } - - iface.configActions = new String[5]; - - for (var5 = 0; var5 < 5; ++var5) - { - String var10 = var1.readString(); - if (var10.length() > 0) - { - iface.configActions[var5] = var10; - iface.clickMask |= 1 << var5 + 23; - } - } - } - - if (iface.type == 8) - { - iface.text = var1.readString(); - } - - if (iface.menuType == 2 || iface.type == 2) - { - iface.targetVerb = var1.readString(); - iface.spellName = var1.readString(); - var4 = var1.readUnsignedShort() & 63; - iface.clickMask |= var4 << 11; - } - - if (iface.menuType == 1 || iface.menuType == 4 || iface.menuType == 5 || iface.menuType == 6) - { - iface.tooltip = var1.readString(); - if (iface.tooltip.length() == 0) - { - if (iface.menuType == 1) - { - iface.tooltip = "Ok"; - } - - if (iface.menuType == 4) - { - iface.tooltip = "Select"; - } - - if (iface.menuType == 5) - { - iface.tooltip = "Select"; - } - - if (iface.menuType == 6) - { - iface.tooltip = "Continue"; - } - } - } - - if (iface.menuType == 1 || iface.menuType == 4 || iface.menuType == 5) - { - iface.clickMask |= 4194304; - } - - if (iface.menuType == 6) - { - iface.clickMask |= 1; - } - - } - - private void decodeIf3(InterfaceDefinition iface, InputStream var1) - { - var1.readUnsignedByte(); - iface.isIf3 = true; - iface.type = var1.readUnsignedByte(); - iface.contentType = var1.readUnsignedShort(); - iface.originalX = var1.readShort(); - iface.originalY = var1.readShort(); - iface.originalWidth = var1.readUnsignedShort(); - if (iface.type == 9) - { - iface.originalHeight = var1.readShort(); - } - else - { - iface.originalHeight = var1.readUnsignedShort(); - } - - iface.widthMode = var1.readByte(); - iface.heightMode = var1.readByte(); - iface.xPositionMode = var1.readByte(); - iface.yPositionMode = var1.readByte(); - iface.parentId = var1.readUnsignedShort(); - if (iface.parentId == 0xFFFF) - { - iface.parentId = -1; - } - else - { - iface.parentId += iface.id & ~0xFFFF; - } - - iface.isHidden = var1.readUnsignedByte() == 1; - if (iface.type == 0) - { - iface.scrollWidth = var1.readUnsignedShort(); - iface.scrollHeight = var1.readUnsignedShort(); - iface.noClickThrough = var1.readUnsignedByte() == 1; - } - - if (iface.type == 5) - { - iface.spriteId = var1.readInt(); - iface.textureId = var1.readUnsignedShort(); - iface.spriteTiling = var1.readUnsignedByte() == 1; - iface.opacity = var1.readUnsignedByte(); - iface.borderType = var1.readUnsignedByte(); - iface.shadowColor = var1.readInt(); - iface.flippedVertically = var1.readUnsignedByte() == 1; - iface.flippedHorizontally = var1.readUnsignedByte() == 1; - } - - if (iface.type == 6) - { - iface.modelType = 1; - iface.modelId = var1.readUnsignedShort(); - if (iface.modelId == 0xFFFF) - { - iface.modelId = -1; - } - - iface.offsetX2d = var1.readShort(); - iface.offsetY2d = var1.readShort(); - iface.rotationX = var1.readUnsignedShort(); - iface.rotationZ = var1.readUnsignedShort(); - iface.rotationY = var1.readUnsignedShort(); - iface.modelZoom = var1.readUnsignedShort(); - iface.animation = var1.readUnsignedShort(); - if (iface.animation == 0xFFFF) - { - iface.animation = -1; - } - - iface.orthogonal = var1.readUnsignedByte() == 1; - var1.readUnsignedShort(); - if (iface.widthMode != 0) - { - iface.modelHeightOverride = var1.readUnsignedShort(); - } - - if (iface.heightMode != 0) - { - var1.readUnsignedShort(); - } - } - - if (iface.type == 4) - { - iface.fontId = var1.readUnsignedShort(); - if (iface.fontId == 0xFFFF) - { - iface.fontId = -1; - } - - iface.text = var1.readString(); - iface.lineHeight = var1.readUnsignedByte(); - iface.xTextAlignment = var1.readUnsignedByte(); - iface.yTextAlignment = var1.readUnsignedByte(); - iface.textShadowed = var1.readUnsignedByte() == 1; - iface.textColor = var1.readInt(); - } - - if (iface.type == 3) - { - iface.textColor = var1.readInt(); - iface.filled = var1.readUnsignedByte() == 1; - iface.opacity = var1.readUnsignedByte(); - } - - if (iface.type == 9) - { - iface.lineWidth = var1.readUnsignedByte(); - iface.textColor = var1.readInt(); - iface.lineDirection = var1.readUnsignedByte() == 1; - } - - iface.clickMask = var1.read24BitInt(); - iface.name = var1.readString(); - int var2 = var1.readUnsignedByte(); - if (var2 > 0) - { - iface.actions = new String[var2]; - - for (int var3 = 0; var3 < var2; ++var3) - { - iface.actions[var3] = var1.readString(); - } - } - - iface.dragDeadZone = var1.readUnsignedByte(); - iface.dragDeadTime = var1.readUnsignedByte(); - iface.dragRenderBehavior = var1.readUnsignedByte() == 1; - iface.targetVerb = var1.readString(); - iface.onLoadListener = this.decodeListener(iface, var1); - iface.onMouseOverListener = this.decodeListener(iface, var1); - iface.onMouseLeaveListener = this.decodeListener(iface, var1); - iface.onTargetLeaveListener = this.decodeListener(iface, var1); - iface.onTargetEnterListener = this.decodeListener(iface, var1); - iface.onVarTransmitListener = this.decodeListener(iface, var1); - iface.onInvTransmitListener = this.decodeListener(iface, var1); - iface.onStatTransmitListener = this.decodeListener(iface, var1); - iface.onTimerListener = this.decodeListener(iface, var1); - iface.onOpListener = this.decodeListener(iface, var1); - iface.onMouseRepeatListener = this.decodeListener(iface, var1); - iface.onClickListener = this.decodeListener(iface, var1); - iface.onClickRepeatListener = this.decodeListener(iface, var1); - iface.onReleaseListener = this.decodeListener(iface, var1); - iface.onHoldListener = this.decodeListener(iface, var1); - iface.onDragListener = this.decodeListener(iface, var1); - iface.onDragCompleteListener = this.decodeListener(iface, var1); - iface.onScrollWheelListener = this.decodeListener(iface, var1); - iface.varTransmitTriggers = this.decodeTriggers(var1); - iface.invTransmitTriggers = this.decodeTriggers(var1); - iface.statTransmitTriggers = this.decodeTriggers(var1); - } - - private Object[] decodeListener(InterfaceDefinition iface, InputStream var1) - { - int var2 = var1.readUnsignedByte(); - if (var2 == 0) - { - return null; - } - else - { - Object[] var3 = new Object[var2]; - - for (int var4 = 0; var4 < var2; ++var4) - { - int var5 = var1.readUnsignedByte(); - if (var5 == 0) - { - var3[var4] = new Integer(var1.readInt()); - } - else if (var5 == 1) - { - var3[var4] = var1.readString(); - } - } - - iface.hasListener = true; - return var3; - } - } - - private int[] decodeTriggers(InputStream var1) - { - int var2 = var1.readUnsignedByte(); - if (var2 == 0) - { - return null; - } - else - { - int[] var3 = new int[var2]; - - for (int var4 = 0; var4 < var2; ++var4) - { - var3[var4] = var1.readInt(); - } - - return var3; - } - } -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/loaders/InventoryLoader.java b/cache/src/main/java/net/runelite/cache/definitions/loaders/InventoryLoader.java deleted file mode 100644 index b93cac48c0..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/loaders/InventoryLoader.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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.loaders; - -import net.runelite.cache.definitions.InventoryDefinition; -import net.runelite.cache.io.InputStream; - -public class InventoryLoader -{ - public InventoryDefinition load(int id, byte[] b) - { - InventoryDefinition def = new InventoryDefinition(); - def.id = id; - InputStream is = new InputStream(b); - - while (true) - { - int opcode = is.readUnsignedByte(); - if (opcode == 0) - { - break; - } - - if (opcode == 2) - { - def.size = is.readUnsignedShort(); - } - } - - return def; - } -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/loaders/ItemLoader.java b/cache/src/main/java/net/runelite/cache/definitions/loaders/ItemLoader.java deleted file mode 100644 index 6cb6c9bd41..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/loaders/ItemLoader.java +++ /dev/null @@ -1,289 +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.cache.definitions.loaders; - -import net.runelite.cache.definitions.ItemDefinition; -import net.runelite.cache.io.InputStream; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.HashMap; - -public class ItemLoader -{ - private static final Logger logger = LoggerFactory.getLogger(ItemLoader.class); - - public ItemDefinition load(int id, byte[] b) - { - ItemDefinition def = new ItemDefinition(id); - InputStream is = new InputStream(b); - - while (true) - { - int opcode = is.readUnsignedByte(); - if (opcode == 0) - { - break; - } - - this.decodeValues(opcode, def, is); - } - - return def; - } - - private void decodeValues(int opcode, ItemDefinition def, InputStream stream) - { - if (opcode == 1) - { - def.inventoryModel = stream.readUnsignedShort(); - } - else if (opcode == 2) - { - def.name = stream.readString(); - } - else if (opcode == 4) - { - def.zoom2d = stream.readUnsignedShort(); - } - else if (opcode == 5) - { - def.xan2d = stream.readUnsignedShort(); - } - else if (opcode == 6) - { - def.yan2d = stream.readUnsignedShort(); - } - else if (opcode == 7) - { - def.xOffset2d = stream.readUnsignedShort(); - if (def.xOffset2d > 32767) - { - def.xOffset2d -= 65536; - } - } - else if (opcode == 8) - { - def.yOffset2d = stream.readUnsignedShort(); - if (def.yOffset2d > 32767) - { - def.yOffset2d -= 65536; - } - } - else if (opcode == 11) - { - def.stackable = 1; - } - else if (opcode == 12) - { - def.cost = stream.readInt(); - } - else if (opcode == 16) - { - def.members = true; - } - else if (opcode == 23) - { - def.maleModel0 = stream.readUnsignedShort(); - def.maleOffset = stream.readUnsignedByte(); - } - else if (opcode == 24) - { - def.maleModel1 = stream.readUnsignedShort(); - } - else if (opcode == 25) - { - def.femaleModel0 = stream.readUnsignedShort(); - def.femaleOffset = stream.readUnsignedByte(); - } - else if (opcode == 26) - { - def.femaleModel1 = stream.readUnsignedShort(); - } - else if (opcode >= 30 && opcode < 35) - { - def.options[opcode - 30] = stream.readString(); - if (def.options[opcode - 30].equalsIgnoreCase("Hidden")) - { - def.options[opcode - 30] = null; - } - } - else if (opcode >= 35 && opcode < 40) - { - def.interfaceOptions[opcode - 35] = stream.readString(); - } - else if (opcode == 40) - { - int var5 = stream.readUnsignedByte(); - def.colorFind = new short[var5]; - def.colorReplace = new short[var5]; - - for (int var4 = 0; var4 < var5; ++var4) - { - def.colorFind[var4] = (short) stream.readUnsignedShort(); - def.colorReplace[var4] = (short) stream.readUnsignedShort(); - } - - } - else if (opcode == 41) - { - int var5 = stream.readUnsignedByte(); - def.textureFind = new short[var5]; - def.textureReplace = new short[var5]; - - for (int var4 = 0; var4 < var5; ++var4) - { - def.textureFind[var4] = (short) stream.readUnsignedShort(); - def.textureReplace[var4] = (short) stream.readUnsignedShort(); - } - - } - else if (opcode == 42) - { - def.shiftClickDropIndex = stream.readByte(); - } - else if (opcode == 65) - { - def.isTradeable = true; - } - else if (opcode == 78) - { - def.maleModel2 = stream.readUnsignedShort(); - } - else if (opcode == 79) - { - def.femaleModel2 = stream.readUnsignedShort(); - } - else if (opcode == 90) - { - def.maleHeadModel = stream.readUnsignedShort(); - } - else if (opcode == 91) - { - def.femaleHeadModel = stream.readUnsignedShort(); - } - else if (opcode == 92) - { - def.maleHeadModel2 = stream.readUnsignedShort(); - } - else if (opcode == 93) - { - def.femaleHeadModel2 = stream.readUnsignedShort(); - } - else if (opcode == 95) - { - def.zan2d = stream.readUnsignedShort(); - } - else if (opcode == 97) - { - def.notedID = stream.readUnsignedShort(); - } - else if (opcode == 98) - { - def.notedTemplate = stream.readUnsignedShort(); - } - else if (opcode >= 100 && opcode < 110) - { - if (def.countObj == null) - { - def.countObj = new int[10]; - def.countCo = new int[10]; - } - - def.countObj[opcode - 100] = stream.readUnsignedShort(); - def.countCo[opcode - 100] = stream.readUnsignedShort(); - } - else if (opcode == 110) - { - def.resizeX = stream.readUnsignedShort(); - } - else if (opcode == 111) - { - def.resizeY = stream.readUnsignedShort(); - } - else if (opcode == 112) - { - def.resizeZ = stream.readUnsignedShort(); - } - else if (opcode == 113) - { - def.ambient = stream.readByte(); - } - else if (opcode == 114) - { - def.contrast = stream.readByte(); - } - else if (opcode == 115) - { - def.team = stream.readUnsignedByte(); - } - else if (opcode == 139) - { - def.boughtId = stream.readUnsignedShort(); - } - else if (opcode == 140) - { - def.boughtTemplateId = stream.readUnsignedShort(); - } - else if (opcode == 148) - { - def.placeholderId = stream.readUnsignedShort(); - } - else if (opcode == 149) - { - def.placeholderTemplateId = stream.readUnsignedShort(); - } - else if (opcode == 249) - { - int length = stream.readUnsignedByte(); - - def.params = new HashMap<>(length); - - for (int i = 0; i < length; i++) - { - boolean isString = stream.readUnsignedByte() == 1; - int key = stream.read24BitInt(); - Object value; - - if (isString) - { - value = stream.readString(); - } - - else - { - value = stream.readInt(); - } - - def.params.put(key, value); - } - } - else - { - logger.warn("Unrecognized opcode {}", opcode); - } - } -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/loaders/KitLoader.java b/cache/src/main/java/net/runelite/cache/definitions/loaders/KitLoader.java deleted file mode 100644 index 9bd3f89a2f..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/loaders/KitLoader.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * 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.loaders; - -import net.runelite.cache.definitions.KitDefinition; -import net.runelite.cache.io.InputStream; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class KitLoader -{ - private static final Logger logger = LoggerFactory.getLogger(KitLoader.class); - - public KitDefinition load(int id, byte[] b) - { - KitDefinition def = new KitDefinition(id); - InputStream is = new InputStream(b); - - for (;;) - { - int opcode = is.readUnsignedByte(); - if (opcode == 0) - { - break; - } - - if (opcode == 1) - { - def.bodyPartId = is.readUnsignedByte(); - } - else if (opcode == 2) - { - int length = is.readUnsignedByte(); - def.modelIds = new int[length]; - - for (int index = 0; index < length; ++index) - { - def.modelIds[index] = is.readUnsignedShort(); - } - } - else if (opcode == 3) - { - def.nonSelectable = true; - } - else if (opcode == 40) - { - int length = is.readUnsignedByte(); - def.recolorToFind = new short[length]; - def.recolorToReplace = new short[length]; - - for (int index = 0; index < length; ++index) - { - def.recolorToFind[index] = is.readShort(); - def.recolorToReplace[index] = is.readShort(); - } - } - else if (opcode == 41) - { - int length = is.readUnsignedByte(); - def.retextureToFind = new short[length]; - def.retextureToReplace = new short[length]; - - for (int index = 0; index < length; ++index) - { - def.retextureToFind[index] = is.readShort(); - def.retextureToReplace[index] = is.readShort(); - } - } - else if (opcode >= 60 && opcode < 70) - { - def.models[opcode - 60] = is.readShort(); - } - } - - return def; - } -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/loaders/LocationsLoader.java b/cache/src/main/java/net/runelite/cache/definitions/loaders/LocationsLoader.java deleted file mode 100644 index 4dab72cf77..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/loaders/LocationsLoader.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * 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.loaders; - -import net.runelite.cache.definitions.LocationsDefinition; -import net.runelite.cache.io.InputStream; -import net.runelite.cache.region.Location; -import net.runelite.cache.region.Position; - -public class LocationsLoader -{ - public LocationsDefinition load(int regionX, int regionY, byte[] b) - { - LocationsDefinition loc = new LocationsDefinition(); - loc.setRegionX(regionX); - loc.setRegionY(regionY); - loadLocations(loc, b); - return loc; - } - - private void loadLocations(LocationsDefinition loc, byte[] b) - { - InputStream buf = new InputStream(b); - - int id = -1; - int idOffset; - - while ((idOffset = buf.readUnsignedIntSmartShortCompat()) != 0) - { - id += idOffset; - - int position = 0; - int positionOffset; - - while ((positionOffset = buf.readUnsignedShortSmart()) != 0) - { - position += positionOffset - 1; - - int localY = position & 0x3F; - int localX = position >> 6 & 0x3F; - int height = position >> 12 & 0x3; - - int attributes = buf.readUnsignedByte(); - int type = attributes >> 2; - int orientation = attributes & 0x3; - - loc.getLocations().add(new Location(id, type, orientation, new Position(localX, localY, height))); - } - } - } -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/loaders/MapLoader.java b/cache/src/main/java/net/runelite/cache/definitions/loaders/MapLoader.java deleted file mode 100644 index 3224536388..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/loaders/MapLoader.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * 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.loaders; - -import net.runelite.cache.definitions.MapDefinition; -import net.runelite.cache.definitions.MapDefinition.Tile; -import net.runelite.cache.io.InputStream; -import static net.runelite.cache.region.Region.X; -import static net.runelite.cache.region.Region.Y; -import static net.runelite.cache.region.Region.Z; - -public class MapLoader -{ - public MapDefinition load(int regionX, int regionY, byte[] b) - { - MapDefinition map = new MapDefinition(); - map.setRegionX(regionX); - map.setRegionY(regionY); - loadTerrain(map, b); - return map; - } - - private void loadTerrain(MapDefinition map, byte[] buf) - { - Tile[][][] tiles = map.getTiles(); - - InputStream in = new InputStream(buf); - - for (int z = 0; z < Z; z++) - { - for (int x = 0; x < X; x++) - { - for (int y = 0; y < Y; y++) - { - Tile tile = tiles[z][x][y] = new Tile(); - while (true) - { - int attribute = in.readUnsignedByte(); - if (attribute == 0) - { - break; - } - else if (attribute == 1) - { - int height = in.readUnsignedByte(); - tile.height = height; - break; - } - else if (attribute <= 49) - { - tile.attrOpcode = attribute; - tile.overlayId = in.readByte(); - tile.overlayPath = (byte) ((attribute - 2) / 4); - tile.overlayRotation = (byte) (attribute - 2 & 3); - } - else if (attribute <= 81) - { - tile.settings = (byte) (attribute - 49); - } - else - { - tile.underlayId = (byte) (attribute - 81); - } - } - } - } - } - } -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/loaders/ModelLoader.java b/cache/src/main/java/net/runelite/cache/definitions/loaders/ModelLoader.java deleted file mode 100644 index 4529f8a069..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/loaders/ModelLoader.java +++ /dev/null @@ -1,750 +0,0 @@ -package net.runelite.cache.definitions.loaders; - -import net.runelite.cache.definitions.ModelDefinition; -import net.runelite.cache.io.InputStream; - -public class ModelLoader -{ - public ModelDefinition load(int modelId, byte[] b) - { - ModelDefinition def = new ModelDefinition(); - def.id = modelId; - - if (b[b.length - 1] == -1 && b[b.length - 2] == -1) - { - this.load1(def, b); - } - else - { - this.load2(def, b); - } - - def.computeNormals(); - def.computeTextureUVCoordinates(); - def.computeAnimationTables(); - - return def; - } - - private void load1(ModelDefinition model, byte[] var1) - { - InputStream var2 = new InputStream(var1); - InputStream var24 = new InputStream(var1); - InputStream var3 = new InputStream(var1); - InputStream var28 = new InputStream(var1); - InputStream var6 = new InputStream(var1); - InputStream var55 = new InputStream(var1); - InputStream var51 = new InputStream(var1); - var2.setOffset(var1.length - 23); - int verticeCount = var2.readUnsignedShort(); - int triangleCount = var2.readUnsignedShort(); - int textureTriangleCount = var2.readUnsignedByte(); - int var13 = var2.readUnsignedByte(); - int modelPriority = var2.readUnsignedByte(); - int var50 = var2.readUnsignedByte(); - int var17 = var2.readUnsignedByte(); - int modelTexture = var2.readUnsignedByte(); - int modelVertexSkins = var2.readUnsignedByte(); - int var20 = var2.readUnsignedShort(); - int var21 = var2.readUnsignedShort(); - int var42 = var2.readUnsignedShort(); - int var22 = var2.readUnsignedShort(); - int var38 = var2.readUnsignedShort(); - int textureAmount = 0; - int var7 = 0; - int var29 = 0; - int position; - if (textureTriangleCount > 0) - { - model.textureRenderTypes = new byte[textureTriangleCount]; - var2.setOffset(0); - - for (position = 0; position < textureTriangleCount; ++position) - { - byte renderType = model.textureRenderTypes[position] = var2.readByte(); - if (renderType == 0) - { - ++textureAmount; - } - - if (renderType >= 1 && renderType <= 3) - { - ++var7; - } - - if (renderType == 2) - { - ++var29; - } - } - } - - position = textureTriangleCount + verticeCount; - int renderTypePos = position; - if (var13 == 1) - { - position += triangleCount; - } - - int var49 = position; - position += triangleCount; - int priorityPos = position; - if (modelPriority == 255) - { - position += triangleCount; - } - - int triangleSkinPos = position; - if (var17 == 1) - { - position += triangleCount; - } - - int var35 = position; - if (modelVertexSkins == 1) - { - position += verticeCount; - } - - int alphaPos = position; - if (var50 == 1) - { - position += triangleCount; - } - - int var11 = position; - position += var22; - int texturePos = position; - if (modelTexture == 1) - { - position += triangleCount * 2; - } - - int textureCoordPos = position; - position += var38; - int colorPos = position; - position += triangleCount * 2; - int var40 = position; - position += var20; - int var41 = position; - position += var21; - int var8 = position; - position += var42; - int var43 = position; - position += textureAmount * 6; - int var37 = position; - position += var7 * 6; - int var48 = position; - position += var7 * 6; - int var56 = position; - position += var7 * 2; - int var45 = position; - position += var7; - int var46 = position; - position += var7 * 2 + var29 * 2; - model.vertexCount = verticeCount; - model.faceCount = triangleCount; - model.textureTriangleCount = textureTriangleCount; - model.vertexPositionsX = new int[verticeCount]; - model.vertexPositionsY = new int[verticeCount]; - model.vertexPositionsZ = new int[verticeCount]; - model.faceVertexIndices1 = new int[triangleCount]; - model.faceVertexIndices2 = new int[triangleCount]; - model.faceVertexIndices3 = new int[triangleCount]; - if (modelVertexSkins == 1) - { - model.vertexSkins = new int[verticeCount]; - } - - if (var13 == 1) - { - model.faceRenderTypes = new byte[triangleCount]; - } - - if (modelPriority == 255) - { - model.faceRenderPriorities = new byte[triangleCount]; - } - else - { - model.priority = (byte) modelPriority; - } - - if (var50 == 1) - { - model.faceAlphas = new byte[triangleCount]; - } - - if (var17 == 1) - { - model.faceSkins = new int[triangleCount]; - } - - if (modelTexture == 1) - { - model.faceTextures = new short[triangleCount]; - } - - if (modelTexture == 1 && textureTriangleCount > 0) - { - model.textureCoordinates = new byte[triangleCount]; - } - - model.faceColors = new short[triangleCount]; - if (textureTriangleCount > 0) - { - model.textureTriangleVertexIndices1 = new short[textureTriangleCount]; - model.textureTriangleVertexIndices2 = new short[textureTriangleCount]; - model.textureTriangleVertexIndices3 = new short[textureTriangleCount]; - if (var7 > 0) - { - model.aShortArray2574 = new short[var7]; - model.aShortArray2575 = new short[var7]; - model.aShortArray2586 = new short[var7]; - model.aShortArray2577 = new short[var7]; - model.aByteArray2580 = new byte[var7]; - model.aShortArray2578 = new short[var7]; - } - - if (var29 > 0) - { - model.texturePrimaryColors = new short[var29]; - } - } - - var2.setOffset(textureTriangleCount); - var24.setOffset(var40); - var3.setOffset(var41); - var28.setOffset(var8); - var6.setOffset(var35); - int vX = 0; - int vY = 0; - int vZ = 0; - - int vertexZOffset; - int var10; - int vertexYOffset; - int var15; - int point; - for (point = 0; point < verticeCount; ++point) - { - int vertexFlags = var2.readUnsignedByte(); - int vertexXOffset = 0; - if ((vertexFlags & 1) != 0) - { - vertexXOffset = var24.readShortSmart(); - } - - vertexYOffset = 0; - if ((vertexFlags & 2) != 0) - { - vertexYOffset = var3.readShortSmart(); - } - - vertexZOffset = 0; - if ((vertexFlags & 4) != 0) - { - vertexZOffset = var28.readShortSmart(); - } - - model.vertexPositionsX[point] = vX + vertexXOffset; - model.vertexPositionsY[point] = vY + vertexYOffset; - model.vertexPositionsZ[point] = vZ + vertexZOffset; - vX = model.vertexPositionsX[point]; - vY = model.vertexPositionsY[point]; - vZ = model.vertexPositionsZ[point]; - if (modelVertexSkins == 1) - { - model.vertexSkins[point] = var6.readUnsignedByte(); - } - } - - var2.setOffset(colorPos); - var24.setOffset(renderTypePos); - var3.setOffset(priorityPos); - var28.setOffset(alphaPos); - var6.setOffset(triangleSkinPos); - var55.setOffset(texturePos); - var51.setOffset(textureCoordPos); - - for (point = 0; point < triangleCount; ++point) - { - model.faceColors[point] = (short) var2.readUnsignedShort(); - if (var13 == 1) - { - model.faceRenderTypes[point] = var24.readByte(); - } - - if (modelPriority == 255) - { - model.faceRenderPriorities[point] = var3.readByte(); - } - - if (var50 == 1) - { - model.faceAlphas[point] = var28.readByte(); - } - - if (var17 == 1) - { - model.faceSkins[point] = var6.readUnsignedByte(); - } - - if (modelTexture == 1) - { - model.faceTextures[point] = (short) (var55.readUnsignedShort() - 1); - } - - if (model.textureCoordinates != null && model.faceTextures[point] != -1) - { - model.textureCoordinates[point] = (byte) (var51.readUnsignedByte() - 1); - } - } - - var2.setOffset(var11); - var24.setOffset(var49); - int trianglePointX = 0; - int trianglePointY = 0; - int trianglePointZ = 0; - vertexYOffset = 0; - - int var16; - for (vertexZOffset = 0; vertexZOffset < triangleCount; ++vertexZOffset) - { - int numFaces = var24.readUnsignedByte(); - if (numFaces == 1) - { - trianglePointX = var2.readShortSmart() + vertexYOffset; - trianglePointY = var2.readShortSmart() + trianglePointX; - trianglePointZ = var2.readShortSmart() + trianglePointY; - vertexYOffset = trianglePointZ; - model.faceVertexIndices1[vertexZOffset] = trianglePointX; - model.faceVertexIndices2[vertexZOffset] = trianglePointY; - model.faceVertexIndices3[vertexZOffset] = trianglePointZ; - } - - if (numFaces == 2) - { - trianglePointY = trianglePointZ; - trianglePointZ = var2.readShortSmart() + vertexYOffset; - vertexYOffset = trianglePointZ; - model.faceVertexIndices1[vertexZOffset] = trianglePointX; - model.faceVertexIndices2[vertexZOffset] = trianglePointY; - model.faceVertexIndices3[vertexZOffset] = trianglePointZ; - } - - if (numFaces == 3) - { - trianglePointX = trianglePointZ; - trianglePointZ = var2.readShortSmart() + vertexYOffset; - vertexYOffset = trianglePointZ; - model.faceVertexIndices1[vertexZOffset] = trianglePointX; - model.faceVertexIndices2[vertexZOffset] = trianglePointY; - model.faceVertexIndices3[vertexZOffset] = trianglePointZ; - } - - if (numFaces == 4) - { - int var57 = trianglePointX; - trianglePointX = trianglePointY; - trianglePointY = var57; - trianglePointZ = var2.readShortSmart() + vertexYOffset; - vertexYOffset = trianglePointZ; - model.faceVertexIndices1[vertexZOffset] = trianglePointX; - model.faceVertexIndices2[vertexZOffset] = var57; - model.faceVertexIndices3[vertexZOffset] = trianglePointZ; - } - } - - var2.setOffset(var43); - var24.setOffset(var37); - var3.setOffset(var48); - var28.setOffset(var56); - var6.setOffset(var45); - var55.setOffset(var46); - - for (int texIndex = 0; texIndex < textureTriangleCount; ++texIndex) - { - int type = model.textureRenderTypes[texIndex] & 255; - if (type == 0) - { - model.textureTriangleVertexIndices1[texIndex] = (short) var2.readUnsignedShort(); - model.textureTriangleVertexIndices2[texIndex] = (short) var2.readUnsignedShort(); - model.textureTriangleVertexIndices3[texIndex] = (short) var2.readUnsignedShort(); - } - - if (type == 1) - { - model.textureTriangleVertexIndices1[texIndex] = (short) var24.readUnsignedShort(); - model.textureTriangleVertexIndices2[texIndex] = (short) var24.readUnsignedShort(); - model.textureTriangleVertexIndices3[texIndex] = (short) var24.readUnsignedShort(); - model.aShortArray2574[texIndex] = (short) var3.readUnsignedShort(); - model.aShortArray2575[texIndex] = (short) var3.readUnsignedShort(); - model.aShortArray2586[texIndex] = (short) var3.readUnsignedShort(); - model.aShortArray2577[texIndex] = (short) var28.readUnsignedShort(); - model.aByteArray2580[texIndex] = var6.readByte(); - model.aShortArray2578[texIndex] = (short) var55.readUnsignedShort(); - } - - if (type == 2) - { - model.textureTriangleVertexIndices1[texIndex] = (short) var24.readUnsignedShort(); - model.textureTriangleVertexIndices2[texIndex] = (short) var24.readUnsignedShort(); - model.textureTriangleVertexIndices3[texIndex] = (short) var24.readUnsignedShort(); - model.aShortArray2574[texIndex] = (short) var3.readUnsignedShort(); - model.aShortArray2575[texIndex] = (short) var3.readUnsignedShort(); - model.aShortArray2586[texIndex] = (short) var3.readUnsignedShort(); - model.aShortArray2577[texIndex] = (short) var28.readUnsignedShort(); - model.aByteArray2580[texIndex] = var6.readByte(); - model.aShortArray2578[texIndex] = (short) var55.readUnsignedShort(); - model.texturePrimaryColors[texIndex] = (short) var55.readUnsignedShort(); - } - - if (type == 3) - { - model.textureTriangleVertexIndices1[texIndex] = (short) var24.readUnsignedShort(); - model.textureTriangleVertexIndices2[texIndex] = (short) var24.readUnsignedShort(); - model.textureTriangleVertexIndices3[texIndex] = (short) var24.readUnsignedShort(); - model.aShortArray2574[texIndex] = (short) var3.readUnsignedShort(); - model.aShortArray2575[texIndex] = (short) var3.readUnsignedShort(); - model.aShortArray2586[texIndex] = (short) var3.readUnsignedShort(); - model.aShortArray2577[texIndex] = (short) var28.readUnsignedShort(); - model.aByteArray2580[texIndex] = var6.readByte(); - model.aShortArray2578[texIndex] = (short) var55.readUnsignedShort(); - } - } - - var2.setOffset(position); - vertexZOffset = var2.readUnsignedByte(); - if (vertexZOffset != 0) - { - //new Class41(); - var2.readUnsignedShort(); - var2.readUnsignedShort(); - var2.readUnsignedShort(); - var2.readInt(); - } - } - - private void load2(ModelDefinition model, byte[] var1) - { - boolean var2 = false; - boolean var43 = false; - InputStream var5 = new InputStream(var1); - InputStream var39 = new InputStream(var1); - InputStream var26 = new InputStream(var1); - InputStream var9 = new InputStream(var1); - InputStream var3 = new InputStream(var1); - var5.setOffset(var1.length - 18); - int var10 = var5.readUnsignedShort(); - int var11 = var5.readUnsignedShort(); - int var12 = var5.readUnsignedByte(); - int var13 = var5.readUnsignedByte(); - int var14 = var5.readUnsignedByte(); - int var30 = var5.readUnsignedByte(); - int var15 = var5.readUnsignedByte(); - int var28 = var5.readUnsignedByte(); - int var27 = var5.readUnsignedShort(); - int var20 = var5.readUnsignedShort(); - int var36 = var5.readUnsignedShort(); - int var23 = var5.readUnsignedShort(); - byte var16 = 0; - int var46 = var16 + var10; - int var24 = var46; - var46 += var11; - int var25 = var46; - if (var14 == 255) - { - var46 += var11; - } - - int var4 = var46; - if (var15 == 1) - { - var46 += var11; - } - - int var42 = var46; - if (var13 == 1) - { - var46 += var11; - } - - int var37 = var46; - if (var28 == 1) - { - var46 += var10; - } - - int var29 = var46; - if (var30 == 1) - { - var46 += var11; - } - - int var44 = var46; - var46 += var23; - int var17 = var46; - var46 += var11 * 2; - int var32 = var46; - var46 += var12 * 6; - int var34 = var46; - var46 += var27; - int var35 = var46; - var46 += var20; - int var10000 = var46 + var36; - model.vertexCount = var10; - model.faceCount = var11; - model.textureTriangleCount = var12; - model.vertexPositionsX = new int[var10]; - model.vertexPositionsY = new int[var10]; - model.vertexPositionsZ = new int[var10]; - model.faceVertexIndices1 = new int[var11]; - model.faceVertexIndices2 = new int[var11]; - model.faceVertexIndices3 = new int[var11]; - if (var12 > 0) - { - model.textureRenderTypes = new byte[var12]; - model.textureTriangleVertexIndices1 = new short[var12]; - model.textureTriangleVertexIndices2 = new short[var12]; - model.textureTriangleVertexIndices3 = new short[var12]; - } - - if (var28 == 1) - { - model.vertexSkins = new int[var10]; - } - - if (var13 == 1) - { - model.faceRenderTypes = new byte[var11]; - model.textureCoordinates = new byte[var11]; - model.faceTextures = new short[var11]; - } - - if (var14 == 255) - { - model.faceRenderPriorities = new byte[var11]; - } - else - { - model.priority = (byte) var14; - } - - if (var30 == 1) - { - model.faceAlphas = new byte[var11]; - } - - if (var15 == 1) - { - model.faceSkins = new int[var11]; - } - - model.faceColors = new short[var11]; - var5.setOffset(var16); - var39.setOffset(var34); - var26.setOffset(var35); - var9.setOffset(var46); - var3.setOffset(var37); - int var41 = 0; - int var33 = 0; - int var19 = 0; - - int var6; - int var7; - int var8; - int var18; - int var31; - for (var18 = 0; var18 < var10; ++var18) - { - var8 = var5.readUnsignedByte(); - var31 = 0; - if ((var8 & 1) != 0) - { - var31 = var39.readShortSmart(); - } - - var6 = 0; - if ((var8 & 2) != 0) - { - var6 = var26.readShortSmart(); - } - - var7 = 0; - if ((var8 & 4) != 0) - { - var7 = var9.readShortSmart(); - } - - model.vertexPositionsX[var18] = var41 + var31; - model.vertexPositionsY[var18] = var33 + var6; - model.vertexPositionsZ[var18] = var19 + var7; - var41 = model.vertexPositionsX[var18]; - var33 = model.vertexPositionsY[var18]; - var19 = model.vertexPositionsZ[var18]; - if (var28 == 1) - { - model.vertexSkins[var18] = var3.readUnsignedByte(); - } - } - - var5.setOffset(var17); - var39.setOffset(var42); - var26.setOffset(var25); - var9.setOffset(var29); - var3.setOffset(var4); - - for (var18 = 0; var18 < var11; ++var18) - { - model.faceColors[var18] = (short) var5.readUnsignedShort(); - if (var13 == 1) - { - var8 = var39.readUnsignedByte(); - if ((var8 & 1) == 1) - { - model.faceRenderTypes[var18] = 1; - var2 = true; - } - else - { - model.faceRenderTypes[var18] = 0; - } - - if ((var8 & 2) == 2) - { - model.textureCoordinates[var18] = (byte) (var8 >> 2); - model.faceTextures[var18] = model.faceColors[var18]; - model.faceColors[var18] = 127; - if (model.faceTextures[var18] != -1) - { - var43 = true; - } - } - else - { - model.textureCoordinates[var18] = -1; - model.faceTextures[var18] = -1; - } - } - - if (var14 == 255) - { - model.faceRenderPriorities[var18] = var26.readByte(); - } - - if (var30 == 1) - { - model.faceAlphas[var18] = var9.readByte(); - } - - if (var15 == 1) - { - model.faceSkins[var18] = var3.readUnsignedByte(); - } - } - - var5.setOffset(var44); - var39.setOffset(var24); - var18 = 0; - var8 = 0; - var31 = 0; - var6 = 0; - - int var21; - int var22; - for (var7 = 0; var7 < var11; ++var7) - { - var22 = var39.readUnsignedByte(); - if (var22 == 1) - { - var18 = var5.readShortSmart() + var6; - var8 = var5.readShortSmart() + var18; - var31 = var5.readShortSmart() + var8; - var6 = var31; - model.faceVertexIndices1[var7] = var18; - model.faceVertexIndices2[var7] = var8; - model.faceVertexIndices3[var7] = var31; - } - - if (var22 == 2) - { - var8 = var31; - var31 = var5.readShortSmart() + var6; - var6 = var31; - model.faceVertexIndices1[var7] = var18; - model.faceVertexIndices2[var7] = var8; - model.faceVertexIndices3[var7] = var31; - } - - if (var22 == 3) - { - var18 = var31; - var31 = var5.readShortSmart() + var6; - var6 = var31; - model.faceVertexIndices1[var7] = var18; - model.faceVertexIndices2[var7] = var8; - model.faceVertexIndices3[var7] = var31; - } - - if (var22 == 4) - { - var21 = var18; - var18 = var8; - var8 = var21; - var31 = var5.readShortSmart() + var6; - var6 = var31; - model.faceVertexIndices1[var7] = var18; - model.faceVertexIndices2[var7] = var21; - model.faceVertexIndices3[var7] = var31; - } - } - - var5.setOffset(var32); - - for (var7 = 0; var7 < var12; ++var7) - { - model.textureRenderTypes[var7] = 0; - model.textureTriangleVertexIndices1[var7] = (short) var5.readUnsignedShort(); - model.textureTriangleVertexIndices2[var7] = (short) var5.readUnsignedShort(); - model.textureTriangleVertexIndices3[var7] = (short) var5.readUnsignedShort(); - } - - if (model.textureCoordinates != null) - { - boolean var45 = false; - - for (var22 = 0; var22 < var11; ++var22) - { - var21 = model.textureCoordinates[var22] & 255; - if (var21 != 255) - { - if ((model.textureTriangleVertexIndices1[var21] & '\uffff') == model.faceVertexIndices1[var22] && (model.textureTriangleVertexIndices2[var21] & '\uffff') == model.faceVertexIndices2[var22] && (model.textureTriangleVertexIndices3[var21] & '\uffff') == model.faceVertexIndices3[var22]) - { - model.textureCoordinates[var22] = -1; - } - else - { - var45 = true; - } - } - } - - if (!var45) - { - model.textureCoordinates = null; - } - } - - if (!var43) - { - model.faceTextures = null; - } - - if (!var2) - { - model.faceRenderTypes = null; - } - } - -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/loaders/NpcLoader.java b/cache/src/main/java/net/runelite/cache/definitions/loaders/NpcLoader.java deleted file mode 100644 index 478ef2660a..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/loaders/NpcLoader.java +++ /dev/null @@ -1,289 +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.cache.definitions.loaders; - -import net.runelite.cache.definitions.NpcDefinition; -import net.runelite.cache.io.InputStream; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.HashMap; - -public class NpcLoader -{ - private static final Logger logger = LoggerFactory.getLogger(NpcLoader.class); - - public NpcDefinition load(int id, byte[] b) - { - NpcDefinition def = new NpcDefinition(id); - InputStream is = new InputStream(b); - - while (true) - { - int opcode = is.readUnsignedByte(); - if (opcode == 0) - { - break; - } - - this.decodeValues(opcode, def, is); - } - - return def; - } - - private void decodeValues(int opcode, NpcDefinition def, InputStream stream) - { - int length; - int index; - if (opcode == 1) - { - length = stream.readUnsignedByte(); - def.models = new int[length]; - - for (index = 0; index < length; ++index) - { - def.models[index] = stream.readUnsignedShort(); - } - - } - else if (opcode == 2) - { - def.name = stream.readString(); - } - else if (opcode == 12) - { - def.tileSpacesOccupied = stream.readUnsignedByte(); - } - else if (opcode == 13) - { - def.stanceAnimation = stream.readUnsignedShort(); - } - else if (opcode == 14) - { - def.walkAnimation = stream.readUnsignedShort(); - } - else if (opcode == 15) - { - def.anInt2165 = stream.readUnsignedShort(); - } - else if (opcode == 16) - { - def.anInt2189 = stream.readUnsignedShort(); - } - else if (opcode == 17) - { - def.walkAnimation = stream.readUnsignedShort(); - def.rotate180Animation = stream.readUnsignedShort(); - def.rotate90RightAnimation = stream.readUnsignedShort(); - def.rotate90LeftAnimation = stream.readUnsignedShort(); - } - else if (opcode >= 30 && opcode < 35) - { - def.options[opcode - 30] = stream.readString(); - if (def.options[opcode - 30].equalsIgnoreCase("Hidden")) - { - def.options[opcode - 30] = null; - } - } - else if (opcode == 40) - { - length = stream.readUnsignedByte(); - def.recolorToFind = new short[length]; - def.recolorToReplace = new short[length]; - - for (index = 0; index < length; ++index) - { - def.recolorToFind[index] = (short) stream.readUnsignedShort(); - def.recolorToReplace[index] = (short) stream.readUnsignedShort(); - } - - } - else if (opcode == 41) - { - length = stream.readUnsignedByte(); - def.retextureToFind = new short[length]; - def.retextureToReplace = new short[length]; - - for (index = 0; index < length; ++index) - { - def.retextureToFind[index] = (short) stream.readUnsignedShort(); - def.retextureToReplace[index] = (short) stream.readUnsignedShort(); - } - - } - else if (opcode == 60) - { - length = stream.readUnsignedByte(); - def.models_2 = new int[length]; - - for (index = 0; index < length; ++index) - { - def.models_2[index] = stream.readUnsignedShort(); - } - - } - else if (opcode == 93) - { - def.renderOnMinimap = false; - } - else if (opcode == 95) - { - def.combatLevel = stream.readUnsignedShort(); - } - else if (opcode == 97) - { - def.resizeX = stream.readUnsignedShort(); - } - else if (opcode == 98) - { - def.resizeY = stream.readUnsignedShort(); - } - else if (opcode == 99) - { - def.hasRenderPriority = true; - } - else if (opcode == 100) - { - def.ambient = stream.readByte(); - } - else if (opcode == 101) - { - def.contrast = stream.readByte(); - } - else if (opcode == 102) - { - def.headIcon = stream.readUnsignedShort(); - } - else if (opcode == 103) - { - def.rotation = stream.readUnsignedShort(); - } - else if (opcode == 106) - { - def.varbitIndex = stream.readUnsignedShort(); - if ('\uffff' == def.varbitIndex) - { - def.varbitIndex = -1; - } - - def.varpIndex = stream.readUnsignedShort(); - if ('\uffff' == def.varpIndex) - { - def.varpIndex = -1; - } - - length = stream.readUnsignedByte(); - def.configs = new int[length + 2]; - - for (index = 0; index <= length; ++index) - { - def.configs[index] = stream.readUnsignedShort(); - if (def.configs[index] == '\uffff') - { - def.configs[index] = -1; - } - } - - def.configs[length + 1] = -1; - - } - else if (opcode == 107) - { - def.isClickable = false; - } - else if (opcode == 109) - { - def.aBool2170 = false; - } - else if (opcode == 111) - { - def.aBool2190 = true; - } - else if (opcode == 118) - { - def.varbitIndex = stream.readUnsignedShort(); - if ('\uffff' == def.varbitIndex) - { - def.varbitIndex = -1; - } - - def.varpIndex = stream.readUnsignedShort(); - if ('\uffff' == def.varpIndex) - { - def.varpIndex = -1; - } - - int var = stream.readUnsignedShort(); - if (var == 0xFFFF) - { - var = -1; - } - - length = stream.readUnsignedByte(); - def.configs = new int[length + 2]; - - for (index = 0; index <= length; ++index) - { - def.configs[index] = stream.readUnsignedShort(); - if (def.configs[index] == '\uffff') - { - def.configs[index] = -1; - } - } - - def.configs[length + 1] = var; - } - else if (opcode == 249) - { - length = stream.readUnsignedByte(); - - def.params = new HashMap<>(length); - - for (int i = 0; i < length; i++) - { - boolean isString = stream.readUnsignedByte() == 1; - int key = stream.read24BitInt(); - Object value; - - if (isString) - { - value = stream.readString(); - } - - else - { - value = stream.readInt(); - } - - def.params.put(key, value); - } - } - else - { - logger.warn("Unrecognized opcode {}", opcode); - } - } -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/loaders/ObjectLoader.java b/cache/src/main/java/net/runelite/cache/definitions/loaders/ObjectLoader.java deleted file mode 100644 index 13a3eab754..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/loaders/ObjectLoader.java +++ /dev/null @@ -1,405 +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.cache.definitions.loaders; - -import java.util.HashMap; -import java.util.Map; -import net.runelite.cache.definitions.ObjectDefinition; -import net.runelite.cache.io.InputStream; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class ObjectLoader -{ - private static final Logger logger = LoggerFactory.getLogger(ObjectLoader.class); - - public ObjectDefinition load(int id, byte[] b) - { - ObjectDefinition def = new ObjectDefinition(); - InputStream is = new InputStream(b); - - def.setId(id); - - for (;;) - { - int opcode = is.readUnsignedByte(); - if (opcode == 0) - { - break; - } - - processOp(opcode, def, is); - } - - post(def); - - return def; - } - - private void processOp(int opcode, ObjectDefinition def, InputStream is) - { - if (opcode == 1) - { - int length = is.readUnsignedByte(); - if (length > 0) - { - int[] objectTypes = new int[length]; - int[] objectModels = new int[length]; - - for (int index = 0; index < length; ++index) - { - objectModels[index] = is.readUnsignedShort(); - objectTypes[index] = is.readUnsignedByte(); - } - - def.setObjectTypes(objectTypes); - def.setObjectModels(objectModels); - } - } - else if (opcode == 2) - { - def.setName(is.readString()); - } - else if (opcode == 5) - { - int length = is.readUnsignedByte(); - if (length > 0) - { - def.setObjectTypes(null); - int[] objectModels = new int[length]; - - for (int index = 0; index < length; ++index) - { - objectModels[index] = is.readUnsignedShort(); - } - - def.setObjectModels(objectModels); - } - } - else if (opcode == 14) - { - def.setSizeX(is.readUnsignedByte()); - } - else if (opcode == 15) - { - def.setSizeY(is.readUnsignedByte()); - } - else if (opcode == 17) - { - def.setInteractType(0); - def.setBlocksProjectile(false); - } - else if (opcode == 18) - { - def.setBlocksProjectile(false); - } - else if (opcode == 19) - { - def.setAnInt2088(is.readUnsignedByte()); - } - else if (opcode == 21) - { - def.setAnInt2105(0); - } - else if (opcode == 22) - { - def.setNonFlatShading(false); - } - else if (opcode == 23) - { - def.setABool2111(true); - } - else if (opcode == 24) - { - def.setAnimationID(is.readUnsignedShort()); - if (def.getAnimationID() == 0xFFFF) - { - def.setAnimationID(-1); - } - } - else if (opcode == 27) - { - def.setInteractType(1); - } - else if (opcode == 28) - { - def.setAnInt2069(is.readUnsignedByte()); - } - else if (opcode == 29) - { - def.setAmbient(is.readByte()); - } - else if (opcode == 39) - { - def.setContrast(is.readByte()); - } - else if (opcode >= 30 && opcode < 35) - { - String[] actions = def.getActions(); - actions[opcode - 30] = is.readString(); - if (actions[opcode - 30].equalsIgnoreCase("Hidden")) - { - actions[opcode - 30] = null; - } - } - else if (opcode == 40) - { - int length = is.readUnsignedByte(); - short[] recolorToFind = new short[length]; - short[] recolorToReplace = new short[length]; - - for (int index = 0; index < length; ++index) - { - recolorToFind[index] = is.readShort(); - recolorToReplace[index] = is.readShort(); - } - - def.setRecolorToFind(recolorToFind); - def.setRecolorToReplace(recolorToReplace); - } - else if (opcode == 41) - { - int length = is.readUnsignedByte(); - short[] retextureToFind = new short[length]; - short[] textureToReplace = new short[length]; - - for (int index = 0; index < length; ++index) - { - retextureToFind[index] = is.readShort(); - textureToReplace[index] = is.readShort(); - } - - def.setRetextureToFind(retextureToFind); - def.setTextureToReplace(textureToReplace); - } - else if (opcode == 62) - { - def.setRotated(true); - } - else if (opcode == 64) - { - def.setABool2097(false); - } - else if (opcode == 65) - { - def.setModelSizeX(is.readUnsignedShort()); - } - else if (opcode == 66) - { - def.setModelSizeHeight(is.readUnsignedShort()); - } - else if (opcode == 67) - { - def.setModelSizeY(is.readUnsignedShort()); - } - else if (opcode == 68) - { - def.setMapSceneID(is.readUnsignedShort()); - } - else if (opcode == 69) - { - is.readByte(); - } - else if (opcode == 70) - { - def.setOffsetX(is.readUnsignedShort()); - } - else if (opcode == 71) - { - def.setOffsetHeight(is.readUnsignedShort()); - } - else if (opcode == 72) - { - def.setOffsetY(is.readUnsignedShort()); - } - else if (opcode == 73) - { - def.setABool2104(true); - } - else if (opcode == 74) - { - def.setSolid(true); - } - else if (opcode == 75) - { - def.setAnInt2106(is.readUnsignedByte()); - } - else if (opcode == 77) - { - int varpID = is.readUnsignedShort(); - if (varpID == 0xFFFF) - { - varpID = -1; - } - def.setVarbitID(varpID); - - int configId = is.readUnsignedShort(); - if (configId == 0xFFFF) - { - configId = -1; - } - def.setVarpID(configId); - - int length = is.readUnsignedByte(); - int[] configChangeDest = new int[length + 2]; - - for (int index = 0; index <= length; ++index) - { - configChangeDest[index] = is.readUnsignedShort(); - if (0xFFFF == configChangeDest[index]) - { - configChangeDest[index] = -1; - } - } - - configChangeDest[length + 1] = -1; - - def.setConfigChangeDest(configChangeDest); - } - else if (opcode == 78) - { - def.setAnInt2110(is.readUnsignedShort()); - def.setAnInt2083(is.readUnsignedByte()); - } - else if (opcode == 79) - { - def.setAnInt2112(is.readUnsignedShort()); - def.setAnInt2113(is.readUnsignedShort()); - def.setAnInt2083(is.readUnsignedByte()); - int length = is.readUnsignedByte(); - int[] anIntArray2084 = new int[length]; - - for (int index = 0; index < length; ++index) - { - anIntArray2084[index] = is.readUnsignedShort(); - } - - def.setAnIntArray2084(anIntArray2084); - } - else if (opcode == 81) - { - def.setAnInt2105(is.readUnsignedByte() * 256); - } - else if (opcode == 82) - { - def.setMapAreaId(is.readUnsignedShort()); - } - else if (opcode == 92) - { - int varpID = is.readUnsignedShort(); - if (varpID == 0xFFFF) - { - varpID = -1; - } - def.setVarbitID(varpID); - - int configId = is.readUnsignedShort(); - if (configId == 0xFFFF) - { - configId = -1; - } - def.setVarpID(configId); - - - int var = is.readUnsignedShort(); - if (var == 0xFFFF) - { - var = -1; - } - - int length = is.readUnsignedByte(); - int[] configChangeDest = new int[length + 2]; - - for (int index = 0; index <= length; ++index) - { - configChangeDest[index] = is.readUnsignedShort(); - if (0xFFFF == configChangeDest[index]) - { - configChangeDest[index] = -1; - } - } - - configChangeDest[length + 1] = var; - - def.setConfigChangeDest(configChangeDest); - } - else if (opcode == 249) - { - int length = is.readUnsignedByte(); - - Map params = new HashMap<>(length); - for (int i = 0; i < length; i++) - { - boolean isString = is.readUnsignedByte() == 1; - int key = is.read24BitInt(); - Object value; - - if (isString) - { - value = is.readString(); - } - - else - { - value = is.readInt(); - } - - params.put(key, value); - } - - def.setParams(params); - } - else - { - logger.warn("Unrecognized opcode {}", opcode); - } - } - - - private void post(ObjectDefinition def) - { - if (def.getAnInt2088() == -1) - { - def.setAnInt2088(0); - if (def.getObjectModels() != null && (def.getObjectTypes() == null || def.getObjectTypes()[0] == 10)) - { - def.setAnInt2088(1); - } - - for (int var1 = 0; var1 < 5; ++var1) - { - if (def.getActions()[var1] != null) - { - def.setAnInt2088(1); - } - } - } - - if (def.getAnInt2106() == -1) - { - def.setAnInt2106(def.getInteractType() != 0 ? 1 : 0); - } - } -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/loaders/ScriptLoader.java b/cache/src/main/java/net/runelite/cache/definitions/loaders/ScriptLoader.java deleted file mode 100644 index e77964a5ca..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/loaders/ScriptLoader.java +++ /dev/null @@ -1,113 +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.cache.definitions.loaders; - -import java.util.HashMap; -import java.util.Map; -import net.runelite.cache.definitions.ScriptDefinition; -import net.runelite.cache.io.InputStream; -import static net.runelite.cache.script.Opcodes.SCONST; -import static net.runelite.cache.script.Opcodes.POP_INT; -import static net.runelite.cache.script.Opcodes.POP_STRING; -import static net.runelite.cache.script.Opcodes.RETURN; - -public class ScriptLoader -{ - public ScriptDefinition load(int id, byte[] b) - { - ScriptDefinition def = new ScriptDefinition(); - def.setId(id); - InputStream in = new InputStream(b); - - in.setOffset(in.getLength() - 2); - int switchLength = in.readUnsignedShort(); - - // 2 for switchLength + the switch data + 12 for the param/vars/stack data - int endIdx = in.getLength() - 2 - switchLength - 12; - in.setOffset(endIdx); - int numOpcodes = in.readInt(); - int localIntCount = in.readUnsignedShort(); - int localStringCount = in.readUnsignedShort(); - int intStackCount = in.readUnsignedShort(); - int stringStackCount = in.readUnsignedShort(); - - int numSwitches = in.readUnsignedByte(); - if (numSwitches > 0) - { - Map[] switches = new Map[numSwitches]; - def.setSwitches(switches); - - for (int i = 0; i < numSwitches; ++i) - { - switches[i] = new HashMap<>(); - - int count = in.readUnsignedShort(); - while (count-- > 0) - { - int key = in.readInt(); // int from stack is compared to this - int pcOffset = in.readInt(); // pc jumps by this - - switches[i].put(key, pcOffset); - } - } - } - - def.setLocalIntCount(localIntCount); - def.setLocalStringCount(localStringCount); - def.setIntStackCount(intStackCount); - def.setStringStackCount(stringStackCount); - - in.setOffset(0); - in.readStringOrNull(); - - int[] instructions = new int[numOpcodes]; - int[] intOperands = new int[numOpcodes]; - String[] stringOperands = new String[numOpcodes]; - - def.setInstructions(instructions); - def.setIntOperands(intOperands); - def.setStringOperands(stringOperands); - - int opcode; - for (int i = 0; in.getOffset() < endIdx; instructions[i++] = opcode) - { - opcode = in.readUnsignedShort(); - if (opcode == SCONST) - { - stringOperands[i] = in.readString(); - } - else if (opcode < 100 && opcode != RETURN && opcode != POP_INT && opcode != POP_STRING) - { - intOperands[i] = in.readInt(); - } - else - { - intOperands[i] = in.readUnsignedByte(); - } - } - - return def; - } -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/loaders/SequenceLoader.java b/cache/src/main/java/net/runelite/cache/definitions/loaders/SequenceLoader.java deleted file mode 100644 index 987cbd4204..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/loaders/SequenceLoader.java +++ /dev/null @@ -1,156 +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.cache.definitions.loaders; - -import net.runelite.cache.definitions.SequenceDefinition; -import net.runelite.cache.io.InputStream; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class SequenceLoader -{ - private static final Logger logger = LoggerFactory.getLogger(SequenceLoader.class); - - public SequenceDefinition load(int id, byte[] b) - { - SequenceDefinition def = new SequenceDefinition(id); - InputStream is = new InputStream(b); - - while (true) - { - int opcode = is.readUnsignedByte(); - if (opcode == 0) - { - break; - } - - this.decodeValues(opcode, def, is); - } - - return def; - } - - private void decodeValues(int opcode, SequenceDefinition def, InputStream stream) - { - int var3; - int var4; - if (opcode == 1) - { - var3 = stream.readUnsignedShort(); - def.frameLenghts = new int[var3]; - - for (var4 = 0; var4 < var3; ++var4) - { - def.frameLenghts[var4] = stream.readUnsignedShort(); - } - - def.frameIDs = new int[var3]; - - for (var4 = 0; var4 < var3; ++var4) - { - def.frameIDs[var4] = stream.readUnsignedShort(); - } - - for (var4 = 0; var4 < var3; ++var4) - { - def.frameIDs[var4] += stream.readUnsignedShort() << 16; - } - } - else if (opcode == 2) - { - def.frameStep = stream.readUnsignedShort(); - } - else if (opcode == 3) - { - var3 = stream.readUnsignedByte(); - def.interleaveLeave = new int[1 + var3]; - - for (var4 = 0; var4 < var3; ++var4) - { - def.interleaveLeave[var4] = stream.readUnsignedByte(); - } - - def.interleaveLeave[var3] = 9999999; - } - else if (opcode == 4) - { - def.stretches = true; - } - else if (opcode == 5) - { - def.forcedPriority = stream.readUnsignedByte(); - } - else if (opcode == 6) - { - def.leftHandItem = stream.readUnsignedShort(); - } - else if (opcode == 7) - { - def.rightHandItem = stream.readUnsignedShort(); - } - else if (opcode == 8) - { - def.maxLoops = stream.readUnsignedByte(); - } - else if (opcode == 9) - { - def.precedenceAnimating = stream.readUnsignedByte(); - } - else if (opcode == 10) - { - def.priority = stream.readUnsignedByte(); - } - else if (opcode == 11) - { - def.replyMode = stream.readUnsignedByte(); - } - else if (opcode == 12) - { - var3 = stream.readUnsignedByte(); - def.field3048 = new int[var3]; - - for (var4 = 0; var4 < var3; ++var4) - { - def.field3048[var4] = stream.readUnsignedShort(); - } - - for (var4 = 0; var4 < var3; ++var4) - { - def.field3048[var4] += stream.readUnsignedShort() << 16; - } - } - else if (opcode == 13) - { - var3 = stream.readUnsignedByte(); - def.field3056 = new int[var3]; - - for (var4 = 0; var4 < var3; ++var4) - { - def.field3056[var4] = stream.read24BitInt(); - } - } - - } -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/loaders/SpotAnimLoader.java b/cache/src/main/java/net/runelite/cache/definitions/loaders/SpotAnimLoader.java deleted file mode 100644 index 20f2be2d24..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/loaders/SpotAnimLoader.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * 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.loaders; - -import net.runelite.cache.definitions.SpotAnimDefinition; -import net.runelite.cache.io.InputStream; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class SpotAnimLoader -{ - private static final Logger logger = LoggerFactory.getLogger(SpotAnimLoader.class); - - public SpotAnimDefinition load(int id, byte[] b) - { - SpotAnimDefinition def = new SpotAnimDefinition(); - InputStream is = new InputStream(b); - def.id = id; - - while (true) - { - int opcode = is.readUnsignedByte(); - if (opcode == 0) - { - break; - } - - this.decodeValues(opcode, def, is); - } - - return def; - } - - private void decodeValues(int opcode, SpotAnimDefinition def, InputStream stream) - { - if (opcode == 1) - { - def.modelId = stream.readUnsignedShort(); - } - else if (opcode == 2) - { - def.animationId = stream.readUnsignedShort(); - } - else if (opcode == 4) - { - def.resizeX = stream.readUnsignedShort(); - } - else if (opcode == 5) - { - def.resizeY = stream.readUnsignedShort(); - } - else if (opcode == 6) - { - def.rotaton = stream.readUnsignedShort(); - } - else if (opcode == 7) - { - def.ambient = stream.readUnsignedByte(); - } - else if (opcode == 8) - { - def.contrast = stream.readUnsignedByte(); - } - else if (opcode == 40) - { - int var3 = stream.readUnsignedByte(); - def.recolorToFind = new short[var3]; - def.recolorToReplace = new short[var3]; - - for (int var4 = 0; var4 < var3; ++var4) - { - def.recolorToFind[var4] = (short) stream.readUnsignedShort(); - def.recolorToReplace[var4] = (short) stream.readUnsignedShort(); - } - } - else if (opcode == 41) - { - int var3 = stream.readUnsignedByte(); - def.textureToFind = new short[var3]; - def.textureToReplace = new short[var3]; - - for (int var4 = 0; var4 < var3; ++var4) - { - def.textureToFind[var4] = (short) stream.readUnsignedShort(); - def.textureToReplace[var4] = (short) stream.readUnsignedShort(); - } - } - } -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/loaders/SpriteLoader.java b/cache/src/main/java/net/runelite/cache/definitions/loaders/SpriteLoader.java deleted file mode 100644 index 9dc6e43e0f..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/loaders/SpriteLoader.java +++ /dev/null @@ -1,183 +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.cache.definitions.loaders; - -import net.runelite.cache.definitions.SpriteDefinition; -import net.runelite.cache.io.InputStream; - -public class SpriteLoader -{ - public static final int FLAG_VERTICAL = 0b01; - public static final int FLAG_ALPHA = 0b10; - - public SpriteDefinition[] load(int id, byte[] b) - { - InputStream is = new InputStream(b); - - is.setOffset(is.getLength() - 2); - int spriteCount = is.readUnsignedShort(); - - SpriteDefinition[] sprites = new SpriteDefinition[spriteCount]; - - // 2 for size - // 5 for width, height, palette length - // + 8 bytes per sprite for offset x/y, width, and height - is.setOffset(is.getLength() - 7 - spriteCount * 8); - - // max width and height - int width = is.readUnsignedShort(); - int height = is.readUnsignedShort(); - int paletteLength = is.readUnsignedByte() + 1; - - for (int i = 0; i < spriteCount; ++i) - { - sprites[i] = new SpriteDefinition(); - sprites[i].setId(id); - sprites[i].setFrame(i); - sprites[i].setMaxWidth(width); - sprites[i].setMaxHeight(height); - } - - for (int i = 0; i < spriteCount; ++i) - { - sprites[i].setOffsetX(is.readUnsignedShort()); - } - - for (int i = 0; i < spriteCount; ++i) - { - sprites[i].setOffsetY(is.readUnsignedShort()); - } - - for (int i = 0; i < spriteCount; ++i) - { - sprites[i].setWidth(is.readUnsignedShort()); - } - - for (int i = 0; i < spriteCount; ++i) - { - sprites[i].setHeight(is.readUnsignedShort()); - } - - // same as above + 3 bytes for each palette entry, except for the first one (which is transparent) - is.setOffset(is.getLength() - 7 - spriteCount * 8 - (paletteLength - 1) * 3); - int[] palette = new int[paletteLength]; - - for (int i = 1; i < paletteLength; ++i) - { - palette[i] = is.read24BitInt(); - - if (palette[i] == 0) - { - palette[i] = 1; - } - } - - is.setOffset(0); - - for (int i = 0; i < spriteCount; ++i) - { - SpriteDefinition def = sprites[i]; - int spriteWidth = def.getWidth(); - int spriteHeight = def.getHeight(); - int dimension = spriteWidth * spriteHeight; - byte[] pixelPaletteIndicies = new byte[dimension]; - byte[] pixelAlphas = new byte[dimension]; - def.pixelIdx = pixelPaletteIndicies; - def.palette = palette; - - int flags = is.readUnsignedByte(); - - if ((flags & FLAG_VERTICAL) == 0) - { - // read horizontally - for (int j = 0; j < dimension; ++j) - { - pixelPaletteIndicies[j] = is.readByte(); - } - } - else - { - // read vertically - for (int j = 0; j < spriteWidth; ++j) - { - for (int k = 0; k < spriteHeight; ++k) - { - pixelPaletteIndicies[spriteWidth * k + j] = is.readByte(); - } - } - } - - // read alphas - if ((flags & FLAG_ALPHA) != 0) - { - if ((flags & FLAG_VERTICAL) == 0) - { - // read horizontally - for (int j = 0; j < dimension; ++j) - { - pixelAlphas[j] = is.readByte(); - } - } - else - { - // read vertically - for (int j = 0; j < spriteWidth; ++j) - { - for (int k = 0; k < spriteHeight; ++k) - { - pixelAlphas[spriteWidth * k + j] = is.readByte(); - } - } - } - } - else - { - // everything non-zero is opaque - for (int j = 0; j < dimension; ++j) - { - int index = pixelPaletteIndicies[j]; - - if (index != 0) - pixelAlphas[j] = (byte) 0xFF; - } - } - - int[] pixels = new int[dimension]; - - // build argb pixels from palette/alphas - for (int j = 0; j < dimension; ++j) - { - int index = pixelPaletteIndicies[j] & 0xFF; - - pixels[j] = palette[index] | (pixelAlphas[j] << 24); - } - - def.setPixels(pixels); - } - - return sprites; - } -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/loaders/StructLoader.java b/cache/src/main/java/net/runelite/cache/definitions/loaders/StructLoader.java deleted file mode 100644 index 4137da8f37..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/loaders/StructLoader.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * 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.definitions.loaders; - -import java.util.HashMap; -import net.runelite.cache.definitions.StructDefinition; -import net.runelite.cache.io.InputStream; - -public class StructLoader -{ - public StructDefinition load(int id, byte[] b) - { - StructDefinition def = new StructDefinition(id); - InputStream is = new InputStream(b); - - while (true) - { - int opcode = is.readUnsignedByte(); - if (opcode == 0) - { - break; - } - - this.decodeValues(opcode, def, is); - } - - return def; - } - - private void decodeValues(int opcode, StructDefinition def, InputStream stream) - { - if (opcode == 249) - { - int length = stream.readUnsignedByte(); - - def.params = new HashMap<>(length); - - for (int i = 0; i < length; i++) - { - boolean isString = stream.readUnsignedByte() == 1; - int key = stream.read24BitInt(); - Object value; - - if (isString) - { - value = stream.readString(); - } - else - { - value = stream.readInt(); - } - - def.params.put(key, value); - } - } - } - -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/loaders/TrackLoader.java b/cache/src/main/java/net/runelite/cache/definitions/loaders/TrackLoader.java deleted file mode 100644 index 6911b9de27..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/loaders/TrackLoader.java +++ /dev/null @@ -1,506 +0,0 @@ -/* - * 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.loaders; - -import net.runelite.cache.definitions.TrackDefinition; -import net.runelite.cache.io.InputStream; -import net.runelite.cache.io.OutputStream; - -public class TrackLoader -{ - // Headers - private static final int MTHD_MAGIC = 1297377380; - private static final int MTRK_MAGIC = 1297379947; - - // Major MIDI Messages. Bottom 4 bits are the channel. - private static final int NOTE_ON = 0b1001_0000; - private static final int NOTE_OFF = 0b1000_0000; - private static final int CONTROL_CHANGE = 0b1011_0000; - private static final int PITCH_WHEEL_CHANGE = 0b1110_0000; - private static final int CHANNEL_PRESSURE = 0b1101_0000; - private static final int POLYPHONIC_KEY_PRESSURE = 0b1010_0000; - private static final int PROGRAM_CHANGE = 0b1100_0000; - - // Meta Events - private static final int META = 255; - private static final int END_OF_TRACK = 47; - private static final int TEMPO = 81; - - // Controller messages - private static final int CONTROLLER_BANK_SELECT = 0; - private static final int CONTROLLER_MODULATION_WHEEL = 1; - private static final int CONTROLLER_CHANNEL_VOLUME = 7; - private static final int CONTROLLER_PAN = 10; - private static final int CONTROLLER_BANK_SELECT_2 = 32; - private static final int CONTROLLER_MODULATION_WHEEL2 = 33; - private static final int CONTROLLER_CHANNEL_VOLUME_2 = 39; - private static final int CONTROLLER_PAN_2 = 42; - private static final int CONTROLLER_DAMPER_PEDAL = 64; - private static final int CONTROLLER_PORTAMENTO = 65; - private static final int CONTROLLER_NON_REGISTERED_PARAMETER_NUMBER_LSB = 98; - private static final int CONTROLLER_NON_REGISTERED_PARAMETER_NUMBER_MSB = 99; - private static final int CONTROLLER_REGISTERED_PARAMETER_NUMBER_LSB = 100; - private static final int CONTROLLER_REGISTERED_PARAMETER_NUMBER_MSB = 101; - private static final int CONTROLLER_ALL_SOUND_OFF = 120; - private static final int CONTROLLER_RESET_ALL_CONTROLLERS = 121; - private static final int CONTROLLER_ALL_NOTES_OFF = 123; - - private static final int JAG_NOTE_ON = 0; - private static final int JAG_NOTE_OFF = 1; - private static final int JAG_CONTROL_CHANGE = 2; - private static final int JAG_PITCH_BEND = 3; - private static final int JAG_CHANNEL_PRESSURE = 4; - private static final int JAG_POLY_PRESSURE = 5; - private static final int JAG_PROGRAM_CHANGE = 6; - private static final int JAG_END_OF_TRACK = 7; - private static final int JAG_TEMPO = 23; - - public TrackDefinition load(byte[] b) - { - TrackDefinition def = new TrackDefinition(); - load(def, new InputStream(b)); - return def; - } - - private void load(TrackDefinition def, InputStream var1) - { - // Some of the names are from https://www.rune-server.ee/runescape-development/rs-503-client-server/snippets/311669-rs-music-file-structure-conversion.html - var1.setOffset(var1.getLength() - 3); - int tracks = var1.readUnsignedByte(); - int division = var1.readUnsignedShort(); - int offset = 14 + tracks * 10; - var1.setOffset(0); - int tempoOpcodes = 0; - int ctrlChangeOpcodes = 0; - int noteOnOpcodes = 0; - int noteOffOpcodes = 0; - int wheelChangeOpcodes = 0; - int chnnlAfterTchOpcodes = 0; - int keyAfterTchOpcodes = 0; - int progmChangeOpcodes = 0; - - int var13; - int opcode; - int controlChangeIndex; - for (var13 = 0; var13 < tracks; ++var13) - { - opcode = -1; - - while (true) - { - controlChangeIndex = var1.readUnsignedByte(); - if (controlChangeIndex != opcode) - { - ++offset; - } - - opcode = controlChangeIndex & 15; - if (controlChangeIndex == JAG_END_OF_TRACK) - { - break; - } - - if (controlChangeIndex == JAG_TEMPO) - { - ++tempoOpcodes; - } - else if (opcode == JAG_NOTE_ON) - { - ++noteOnOpcodes; - } - else if (opcode == JAG_NOTE_OFF) - { - ++noteOffOpcodes; - } - else if (opcode == JAG_CONTROL_CHANGE) - { - ++ctrlChangeOpcodes; - } - else if (opcode == JAG_PITCH_BEND) - { - ++wheelChangeOpcodes; - } - else if (opcode == JAG_CHANNEL_PRESSURE) - { - ++chnnlAfterTchOpcodes; - } - else if (opcode == JAG_POLY_PRESSURE) - { - ++keyAfterTchOpcodes; - } - else if (opcode == JAG_PROGRAM_CHANGE) - { - ++progmChangeOpcodes; - } - else - { - throw new RuntimeException(); - } - } - } - - offset += 5 * tempoOpcodes; - offset += 2 * (noteOnOpcodes + noteOffOpcodes + ctrlChangeOpcodes + wheelChangeOpcodes + keyAfterTchOpcodes); - offset += chnnlAfterTchOpcodes + progmChangeOpcodes; - var13 = var1.getOffset(); - opcode = tracks + tempoOpcodes + ctrlChangeOpcodes + noteOnOpcodes + noteOffOpcodes + wheelChangeOpcodes + chnnlAfterTchOpcodes + keyAfterTchOpcodes + progmChangeOpcodes; - - for (controlChangeIndex = 0; controlChangeIndex < opcode; ++controlChangeIndex) - { - var1.readVarInt(); - } - - offset += var1.getOffset() - var13; - controlChangeIndex = var1.getOffset(); - int modulationWheelSize = 0; - int modulationWheel2Size = 0; - int channelVolumeSize = 0; - int channelVolume2Size = 0; - int panSize = 0; - int pan2Size = 0; - int nonRegisteredMsbSize = 0; - int nonRegisteredLsbSize = 0; - int registeredNumberMsb = 0; - int registeredLsbSize = 0; - int commandsSize = 0; - int otherSize = 0; - int controllerNumber = 0; - - int var29; - for (var29 = 0; var29 < ctrlChangeOpcodes; ++var29) - { - controllerNumber = controllerNumber + var1.readUnsignedByte() & 127; - if (controllerNumber == CONTROLLER_BANK_SELECT || controllerNumber == CONTROLLER_BANK_SELECT_2) - { - ++progmChangeOpcodes; - } - else if (controllerNumber == CONTROLLER_MODULATION_WHEEL) - { - ++modulationWheelSize; - } - else if (controllerNumber == CONTROLLER_MODULATION_WHEEL2) - { - ++modulationWheel2Size; - } - else if (controllerNumber == CONTROLLER_CHANNEL_VOLUME) - { - ++channelVolumeSize; - } - else if (controllerNumber == CONTROLLER_CHANNEL_VOLUME_2) - { - ++channelVolume2Size; - } - else if (controllerNumber == CONTROLLER_PAN) - { - ++panSize; - } - else if (controllerNumber == CONTROLLER_PAN_2) - { - ++pan2Size; - } - else if (controllerNumber == CONTROLLER_NON_REGISTERED_PARAMETER_NUMBER_MSB) - { - ++nonRegisteredMsbSize; - } - else if (controllerNumber == CONTROLLER_NON_REGISTERED_PARAMETER_NUMBER_LSB) - { - ++nonRegisteredLsbSize; - } - else if (controllerNumber == CONTROLLER_REGISTERED_PARAMETER_NUMBER_MSB) - { - ++registeredNumberMsb; - } - else if (controllerNumber == CONTROLLER_REGISTERED_PARAMETER_NUMBER_LSB) - { - ++registeredLsbSize; - } - else if (controllerNumber != CONTROLLER_DAMPER_PEDAL - && controllerNumber != CONTROLLER_PORTAMENTO - && controllerNumber != CONTROLLER_ALL_SOUND_OFF - && controllerNumber != CONTROLLER_RESET_ALL_CONTROLLERS - && controllerNumber != CONTROLLER_ALL_NOTES_OFF) - { - ++otherSize; - } - else - { - ++commandsSize; - } - } - - var29 = 0; - int commandsIndex = var1.getOffset(); - var1.skip(commandsSize); - int polyPressureIndex = var1.getOffset(); - var1.skip(keyAfterTchOpcodes); - int channelPressureIndex = var1.getOffset(); - var1.skip(chnnlAfterTchOpcodes); - int pitchWheelHighIndex = var1.getOffset(); - var1.skip(wheelChangeOpcodes); - int modulationWheelOffset = var1.getOffset(); - var1.skip(modulationWheelSize); - int channelVolumeOffset = var1.getOffset(); - var1.skip(channelVolumeSize); - int panOffset = var1.getOffset(); - var1.skip(panSize); - int notesIndex = var1.getOffset(); - var1.skip(noteOnOpcodes + noteOffOpcodes + keyAfterTchOpcodes); - int notesOnIndex = var1.getOffset(); - var1.skip(noteOnOpcodes); - int otherIndex = var1.getOffset(); - var1.skip(otherSize); - int notesOffIndex = var1.getOffset(); - var1.skip(noteOffOpcodes); - int modulationWheel2Offset = var1.getOffset(); - var1.skip(modulationWheel2Size); - int channelVolume2Offset = var1.getOffset(); - var1.skip(channelVolume2Size); - int pan2Offset = var1.getOffset(); - var1.skip(pan2Size); - int programChangeIndex = var1.getOffset(); - var1.skip(progmChangeOpcodes); - int pitchWheelLowIndex = var1.getOffset(); - var1.skip(wheelChangeOpcodes); - int nonRegisteredMsbIndex = var1.getOffset(); - var1.skip(nonRegisteredMsbSize); - int nonRegisteredLsbIndex = var1.getOffset(); - var1.skip(nonRegisteredLsbSize); - int registeredMsbIndex = var1.getOffset(); - var1.skip(registeredNumberMsb); - int registeredLsbIndex = var1.getOffset(); - var1.skip(registeredLsbSize); - int tempoOffset = var1.getOffset(); - var1.skip(tempoOpcodes * 3); - OutputStream var51 = new OutputStream(offset); - var51.writeInt(MTHD_MAGIC); // MThd header - var51.writeInt(6); // length of header - var51.writeShort(tracks > 1 ? 1 : 0); // format - var51.writeShort(tracks); // tracks - var51.writeShort(division); // division - var1.setOffset(var13); - int channel = 0; - int var53 = 0; - int var54 = 0; - int var55 = 0; - int var56 = 0; - int var57 = 0; - int var58 = 0; - int[] var59 = new int[128]; - controllerNumber = 0; - - label361: - for (int var60 = 0; var60 < tracks; ++var60) - { - var51.writeInt(MTRK_MAGIC); // MTrk - var51.skip(4); // length gets written here later - int var61 = var51.getOffset(); - int var62 = -1; - - while (true) - { - int deltaTick = var1.readVarInt(); - var51.writeVarInt(deltaTick); // delta time - int status = var1.getArray()[var29++] & 255; - boolean var65 = status != var62; - var62 = status & 15; - if (status == JAG_END_OF_TRACK) - { - //if (var65) -- client has this if, but it causes broken midi to be produced - { - var51.writeByte(META); - } - - var51.writeByte(END_OF_TRACK); // type - end of track - var51.writeByte(0); // length - var51.writeLengthFromMark(var51.getOffset() - var61); - continue label361; - } - - if (status == JAG_TEMPO) - { - //if (var65) -- client has this if, but it causes broken midi to be produced - { - var51.writeByte(META); // meta event FF - } - - var51.writeByte(TEMPO); // type - set tempo - var51.writeByte(3); // length - var51.writeByte(var1.getArray()[tempoOffset++]); - var51.writeByte(var1.getArray()[tempoOffset++]); - var51.writeByte(var1.getArray()[tempoOffset++]); - } - else - { - channel ^= status >> 4; - if (var62 == JAG_NOTE_ON) - { - if (var65) - { - var51.writeByte(NOTE_ON + channel); - } - - var53 += var1.getArray()[notesIndex++]; - var54 += var1.getArray()[notesOnIndex++]; - var51.writeByte(var53 & 127); - var51.writeByte(var54 & 127); - } - else if (var62 == JAG_NOTE_OFF) - { - if (var65) - { - var51.writeByte(NOTE_OFF + channel); - } - - var53 += var1.getArray()[notesIndex++]; - var55 += var1.getArray()[notesOffIndex++]; - var51.writeByte(var53 & 127); - var51.writeByte(var55 & 127); - } - else if (var62 == JAG_CONTROL_CHANGE) - { - if (var65) - { - var51.writeByte(CONTROL_CHANGE + channel); - } - - controllerNumber = controllerNumber + var1.getArray()[controlChangeIndex++] & 127; - var51.writeByte(controllerNumber); - byte var66; - if (controllerNumber == CONTROLLER_BANK_SELECT || controllerNumber == CONTROLLER_BANK_SELECT_2) - { - var66 = var1.getArray()[programChangeIndex++]; - } - else if (controllerNumber == CONTROLLER_MODULATION_WHEEL) - { - var66 = var1.getArray()[modulationWheelOffset++]; - } - else if (controllerNumber == CONTROLLER_MODULATION_WHEEL2) - { - var66 = var1.getArray()[modulationWheel2Offset++]; - } - else if (controllerNumber == CONTROLLER_CHANNEL_VOLUME) - { - var66 = var1.getArray()[channelVolumeOffset++]; - } - else if (controllerNumber == CONTROLLER_CHANNEL_VOLUME_2) - { - var66 = var1.getArray()[channelVolume2Offset++]; - } - else if (controllerNumber == CONTROLLER_PAN) - { - var66 = var1.getArray()[panOffset++]; - } - else if (controllerNumber == CONTROLLER_PAN_2) - { - var66 = var1.getArray()[pan2Offset++]; - } - else if (controllerNumber == CONTROLLER_NON_REGISTERED_PARAMETER_NUMBER_MSB) - { - var66 = var1.getArray()[nonRegisteredMsbIndex++]; - } - else if (controllerNumber == CONTROLLER_NON_REGISTERED_PARAMETER_NUMBER_LSB) - { - var66 = var1.getArray()[nonRegisteredLsbIndex++]; - } - else if (controllerNumber == CONTROLLER_REGISTERED_PARAMETER_NUMBER_MSB) - { - var66 = var1.getArray()[registeredMsbIndex++]; - } - else if (controllerNumber == CONTROLLER_REGISTERED_PARAMETER_NUMBER_LSB) - { - var66 = var1.getArray()[registeredLsbIndex++]; - } - else if (controllerNumber != CONTROLLER_DAMPER_PEDAL - && controllerNumber != CONTROLLER_PORTAMENTO - && controllerNumber != CONTROLLER_ALL_SOUND_OFF - && controllerNumber != CONTROLLER_RESET_ALL_CONTROLLERS - && controllerNumber != CONTROLLER_ALL_NOTES_OFF) - { - var66 = var1.getArray()[otherIndex++]; - } - else - { - var66 = var1.getArray()[commandsIndex++]; - } - - int var67 = var66 + var59[controllerNumber]; - var59[controllerNumber] = var67; - var51.writeByte(var67 & 127); - } - else if (var62 == JAG_PITCH_BEND) - { - if (var65) - { - var51.writeByte(PITCH_WHEEL_CHANGE + channel); - } - - var56 += var1.getArray()[pitchWheelLowIndex++]; - var56 += var1.getArray()[pitchWheelHighIndex++] << 7; - var51.writeByte(var56 & 127); - var51.writeByte(var56 >> 7 & 127); - } - else if (var62 == JAG_CHANNEL_PRESSURE) - { - if (var65) - { - var51.writeByte(CHANNEL_PRESSURE + channel); - } - - var57 += var1.getArray()[channelPressureIndex++]; - var51.writeByte(var57 & 127); - } - else if (var62 == JAG_POLY_PRESSURE) - { - if (var65) - { - var51.writeByte(POLYPHONIC_KEY_PRESSURE + channel); - } - - var53 += var1.getArray()[notesIndex++]; - var58 += var1.getArray()[polyPressureIndex++]; - var51.writeByte(var53 & 127); - var51.writeByte(var58 & 127); - } - else if (var62 == JAG_PROGRAM_CHANGE) - { - - if (var65) - { - var51.writeByte(PROGRAM_CHANGE + channel); - } - - var51.writeByte(var1.getArray()[programChangeIndex++]); - } - else - { - throw new RuntimeException(); - } - } - } - } - - def.midi = var51.flip(); - } -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/loaders/VarbitLoader.java b/cache/src/main/java/net/runelite/cache/definitions/loaders/VarbitLoader.java deleted file mode 100644 index 05d91afa90..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/loaders/VarbitLoader.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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.loaders; - -import net.runelite.cache.definitions.VarbitDefinition; -import net.runelite.cache.io.InputStream; - -public class VarbitLoader -{ - public VarbitDefinition load(int id, byte[] b) - { - VarbitDefinition def = new VarbitDefinition(); - InputStream is = new InputStream(b); - - def.setId(id); - - for (;;) - { - int opcode = is.readUnsignedByte(); - if (opcode == 0) - { - break; - } - - if (opcode == 1) - { - def.setIndex(is.readUnsignedShort()); - def.setLeastSignificantBit(is.readUnsignedByte()); - def.setMostSignificantBit(is.readUnsignedByte()); - } - } - - return def; - } -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/loaders/WorldMapLoader.java b/cache/src/main/java/net/runelite/cache/definitions/loaders/WorldMapLoader.java deleted file mode 100644 index 15ec975d6d..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/loaders/WorldMapLoader.java +++ /dev/null @@ -1,179 +0,0 @@ -/* - * 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.loaders; - -import java.util.LinkedList; -import net.runelite.cache.definitions.WorldMapDefinition; -import net.runelite.cache.definitions.WorldMapType0; -import net.runelite.cache.definitions.WorldMapType1; -import net.runelite.cache.definitions.WorldMapType2; -import net.runelite.cache.definitions.WorldMapType3; -import net.runelite.cache.definitions.WorldMapTypeBase; -import net.runelite.cache.io.InputStream; -import net.runelite.cache.region.Position; - -public class WorldMapLoader -{ - public WorldMapDefinition load(byte[] b, int fileId) - { - WorldMapDefinition def = new WorldMapDefinition(); - InputStream in = new InputStream(b); - - def.fileId = fileId; - def.safeName = in.readString(); - def.name = in.readString(); - - int packedPos = in.readInt(); - if (packedPos == -1) - { - def.position = new Position(-1, -1, -1); - } - else - { - int y = packedPos >> 28 & 3; - int x = packedPos >> 14 & 16383; - int z = packedPos & 16383; - def.position = new Position(x, y, z); - } - - def.field450 = in.readInt(); - in.readUnsignedByte(); - def.field457 = in.readUnsignedByte() == 1; - def.field451 = in.readUnsignedByte(); - int var3 = in.readUnsignedByte(); - def.field458 = new LinkedList(); - - for (int var4 = 0; var4 < var3; ++var4) - { - def.field458.add(this.loadType(in)); - } - - return def; - } - - private WorldMapTypeBase loadType(InputStream var1) - { - int var2 = var1.readUnsignedByte(); - // field397 = new class27(1, (byte)0); - // field390 = new class27(2, (byte)1); - // field399 = new class27(3, (byte)2); - // field393 = new class27(0, (byte)3); - WorldMapTypeBase base; - switch (var2) - { - case 0: - // type 1 - base = load1(var1); - break; - case 1: - // type 2 - base = load2(var1); - break; - case 2: - // type 3 - base = load3(var1); - break; - case 3: - // type 0 - base = load0(var1); - break; - default: - throw new IllegalStateException(); - } - return base; - } - - private WorldMapTypeBase load0(InputStream in) - { - WorldMapType0 wm = new WorldMapType0(); - - wm.field606 = in.readUnsignedByte(); - wm.field605 = in.readUnsignedByte(); - wm.field601 = in.readUnsignedShort(); - wm.field602 = in.readUnsignedByte(); - wm.field603 = in.readUnsignedShort(); - wm.field607 = in.readUnsignedByte(); - wm.field604 = in.readUnsignedShort(); - wm.field600 = in.readUnsignedByte(); - wm.field608 = in.readUnsignedShort(); - wm.field609 = in.readUnsignedByte(); - - return wm; - } - - private WorldMapTypeBase load1(InputStream in) - { - WorldMapType1 wm = new WorldMapType1(); - - wm.field434 = in.readUnsignedByte(); - wm.field424 = in.readUnsignedByte(); - wm.field425 = in.readUnsignedShort(); - wm.field426 = in.readUnsignedShort(); - wm.field427 = in.readUnsignedShort(); - wm.field431 = in.readUnsignedShort(); - wm.field429 = in.readUnsignedShort(); - wm.field428 = in.readUnsignedShort(); - wm.field433 = in.readUnsignedShort(); - wm.field435 = in.readUnsignedShort(); - - return wm; - } - - private WorldMapTypeBase load2(InputStream in) - { - WorldMapType2 wm = new WorldMapType2(); - - wm.field519 = in.readUnsignedByte(); - wm.field511 = in.readUnsignedByte(); - wm.field510 = in.readUnsignedShort(); - wm.field512 = in.readUnsignedShort(); - wm.field514 = in.readUnsignedShort(); - wm.field515 = in.readUnsignedShort(); - - return wm; - } - - private WorldMapTypeBase load3(InputStream in) - { - WorldMapType3 wm = new WorldMapType3(); - - wm.field387 = in.readUnsignedByte(); - wm.field377 = in.readUnsignedByte(); - wm.field378 = in.readUnsignedShort(); - wm.field382 = in.readUnsignedByte(); - wm.field376 = in.readUnsignedByte(); - wm.field383 = in.readUnsignedShort(); - wm.field385 = in.readUnsignedByte(); - wm.field379 = in.readUnsignedByte(); - wm.field380 = in.readUnsignedShort(); - wm.field386 = in.readUnsignedByte(); - wm.field388 = in.readUnsignedByte(); - wm.field381 = in.readUnsignedShort(); - wm.field384 = in.readUnsignedByte(); - wm.field389 = in.readUnsignedByte(); - - return wm; - } -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/loaders/sound/SoundEffect1Loader.java b/cache/src/main/java/net/runelite/cache/definitions/loaders/sound/SoundEffect1Loader.java deleted file mode 100644 index a5c8f16f78..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/loaders/sound/SoundEffect1Loader.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * 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.loaders.sound; - -import net.runelite.cache.definitions.sound.SoundEffect1Definition; -import net.runelite.cache.definitions.sound.SoundEffect2Definition; -import net.runelite.cache.io.InputStream; - -public class SoundEffect1Loader -{ - private final SoundEffect2Loader se2Loader = new SoundEffect2Loader(); - private final SoundEffect3Loader se3Loader = new SoundEffect3Loader(); - - public SoundEffect1Definition load(InputStream in) - { - SoundEffect1Definition se = new SoundEffect1Definition(); - - load(se, in); - - return se; - } - - private void load(SoundEffect1Definition se, InputStream var1) - { - se.field1181 = se2Loader.load(var1); - se.field1173 = se2Loader.load(var1); - int var2 = var1.readUnsignedByte(); - if (var2 != 0) - { - var1.setOffset(var1.getOffset() - 1); - se.field1174 = se2Loader.load(var1); - se.field1193 = se2Loader.load(var1); - } - - var2 = var1.readUnsignedByte(); - if (var2 != 0) - { - var1.setOffset(var1.getOffset() - 1); - se.field1183 = se2Loader.load(var1); - se.field1192 = se2Loader.load(var1); - } - - var2 = var1.readUnsignedByte(); - if (var2 != 0) - { - var1.setOffset(var1.getOffset() - 1); - se.field1178 = se2Loader.load(var1); - se.field1175 = se2Loader.load(var1); - } - - for (int var3 = 0; var3 < 10; ++var3) - { - int var4 = var1.readUnsignedShortSmart(); - if (var4 == 0) - { - break; - } - - se.field1180[var3] = var4; - se.field1179[var3] = var1.readShortSmart(); - se.field1177[var3] = var1.readUnsignedShortSmart(); - } - - se.field1187 = var1.readUnsignedShortSmart(); - se.field1184 = var1.readUnsignedShortSmart(); - se.field1176 = var1.readUnsignedShort(); - se.field1188 = var1.readUnsignedShort(); - se.field1186 = new SoundEffect2Definition(); - se.field1182 = se3Loader.load(var1, se.field1186); - } -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/loaders/sound/SoundEffect2Loader.java b/cache/src/main/java/net/runelite/cache/definitions/loaders/sound/SoundEffect2Loader.java deleted file mode 100644 index d9ae3d3abb..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/loaders/sound/SoundEffect2Loader.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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.loaders.sound; - -import net.runelite.cache.definitions.sound.SoundEffect2Definition; -import net.runelite.cache.io.InputStream; - -public class SoundEffect2Loader -{ - public SoundEffect2Definition load(InputStream in) - { - SoundEffect2Definition se = new SoundEffect2Definition(); - - load(se, in); - - return se; - } - - private void load(SoundEffect2Definition se, InputStream var1) - { - se.field1087 = var1.readUnsignedByte(); - se.field1088 = var1.readInt(); - se.field1089 = var1.readInt(); - this.method1144(se, var1); - } - - final void method1144(SoundEffect2Definition se, InputStream var1) - { - se.field1092 = var1.readUnsignedByte(); - se.field1086 = new int[se.field1092]; - se.field1090 = new int[se.field1092]; - - for (int var2 = 0; var2 < se.field1092; ++var2) - { - se.field1086[var2] = var1.readUnsignedShort(); - se.field1090[var2] = var1.readUnsignedShort(); - } - - } -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/loaders/sound/SoundEffect3Loader.java b/cache/src/main/java/net/runelite/cache/definitions/loaders/sound/SoundEffect3Loader.java deleted file mode 100644 index ad7f733efb..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/loaders/sound/SoundEffect3Loader.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * 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.loaders.sound; - -import net.runelite.cache.definitions.sound.SoundEffect2Definition; -import net.runelite.cache.definitions.sound.SoundEffect3Definition; -import net.runelite.cache.io.InputStream; - -public class SoundEffect3Loader -{ - private final SoundEffect2Loader se2Loader = new SoundEffect2Loader(); - - public SoundEffect3Definition load(InputStream in, SoundEffect2Definition var2) - { - SoundEffect3Definition se = new SoundEffect3Definition(); - - load(se, in, var2); - - return se; - } - - private void load(SoundEffect3Definition se, InputStream var1, SoundEffect2Definition var2) - { - int var3 = var1.readUnsignedByte(); - se.field1155[0] = var3 >> 4; - se.field1155[1] = var3 & 15; - if (var3 != 0) - { - se.field1156[0] = var1.readUnsignedShort(); - se.field1156[1] = var1.readUnsignedShort(); - int var4 = var1.readUnsignedByte(); - - int var5; - int var6; - for (var5 = 0; var5 < 2; ++var5) - { - for (var6 = 0; var6 < se.field1155[var5]; ++var6) - { - se.field1154[var5][0][var6] = var1.readUnsignedShort(); - se.field1159[var5][0][var6] = var1.readUnsignedShort(); - } - } - - for (var5 = 0; var5 < 2; ++var5) - { - for (var6 = 0; var6 < se.field1155[var5]; ++var6) - { - if ((var4 & 1 << var5 * 4 << var6) != 0) - { - se.field1154[var5][1][var6] = var1.readUnsignedShort(); - se.field1159[var5][1][var6] = var1.readUnsignedShort(); - } - else - { - se.field1154[var5][1][var6] = se.field1154[var5][0][var6]; - se.field1159[var5][1][var6] = se.field1159[var5][0][var6]; - } - } - } - - if (var4 != 0 || se.field1156[1] != se.field1156[0]) - { - se2Loader.method1144(var2, var1); - } - } - else - { - int[] var7 = se.field1156; - se.field1156[1] = 0; - var7[0] = 0; - } - } -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/loaders/sound/SoundEffectLoader.java b/cache/src/main/java/net/runelite/cache/definitions/loaders/sound/SoundEffectLoader.java deleted file mode 100644 index ddb6a4d9fc..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/loaders/sound/SoundEffectLoader.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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.loaders.sound; - -import net.runelite.cache.definitions.sound.SoundEffectDefinition; -import net.runelite.cache.definitions.sound.SoundEffect1Definition; -import net.runelite.cache.io.InputStream; - -public class SoundEffectLoader -{ - public SoundEffectDefinition load(byte[] b) - { - SoundEffectDefinition se = new SoundEffectDefinition(); - InputStream in = new InputStream(b); - - load(se, in); - - return se; - } - - private void load(SoundEffectDefinition se, InputStream var1) - { - for (int var2 = 0; var2 < 10; ++var2) - { - int var3 = var1.readUnsignedByte(); - if (var3 != 0) - { - var1.setOffset(var1.getOffset() - 1); - - SoundEffect1Loader se1Loader = new SoundEffect1Loader(); - SoundEffect1Definition se1 = se1Loader.load(var1); - - se.field1008[var2] = se1; - } - } - - se.field1006 = var1.readUnsignedShort(); - se.field1009 = var1.readUnsignedShort(); - } -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/providers/ItemProvider.java b/cache/src/main/java/net/runelite/cache/definitions/providers/ItemProvider.java deleted file mode 100644 index 7d58c98104..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/providers/ItemProvider.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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.definitions.providers; - -import net.runelite.cache.definitions.ItemDefinition; - -public interface ItemProvider -{ - ItemDefinition provide(int itemId); -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/providers/ModelProvider.java b/cache/src/main/java/net/runelite/cache/definitions/providers/ModelProvider.java deleted file mode 100644 index 36a8412b81..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/providers/ModelProvider.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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.definitions.providers; - -import java.io.IOException; -import net.runelite.cache.definitions.ModelDefinition; - -public interface ModelProvider -{ - ModelDefinition provide(int modelId) throws IOException; -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/providers/OverlayProvider.java b/cache/src/main/java/net/runelite/cache/definitions/providers/OverlayProvider.java deleted file mode 100644 index a793b39962..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/providers/OverlayProvider.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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.definitions.providers; - -import net.runelite.cache.definitions.OverlayDefinition; - -public interface OverlayProvider -{ - OverlayDefinition provide(int overlayId); -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/providers/SpriteProvider.java b/cache/src/main/java/net/runelite/cache/definitions/providers/SpriteProvider.java deleted file mode 100644 index f7177bd378..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/providers/SpriteProvider.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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.definitions.providers; - -import net.runelite.cache.definitions.SpriteDefinition; - -public interface SpriteProvider -{ - SpriteDefinition provide(int spriteId, int frameId); -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/providers/StructProvider.java b/cache/src/main/java/net/runelite/cache/definitions/providers/StructProvider.java deleted file mode 100644 index 54d03060c1..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/providers/StructProvider.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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.definitions.providers; - -import net.runelite.cache.definitions.StructDefinition; - -public interface StructProvider -{ - StructDefinition provide(int structId); -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/providers/TextureProvider.java b/cache/src/main/java/net/runelite/cache/definitions/providers/TextureProvider.java deleted file mode 100644 index f85fec54d3..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/providers/TextureProvider.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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.definitions.providers; - -import net.runelite.cache.definitions.TextureDefinition; - -public interface TextureProvider -{ - TextureDefinition[] provide(); -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/providers/UnderlayProvider.java b/cache/src/main/java/net/runelite/cache/definitions/providers/UnderlayProvider.java deleted file mode 100644 index 3b0381c7a3..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/providers/UnderlayProvider.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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.definitions.providers; - -import net.runelite.cache.definitions.UnderlayDefinition; - -public interface UnderlayProvider -{ - UnderlayDefinition provide(int underlayId); -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/savers/InterfaceSaver.java b/cache/src/main/java/net/runelite/cache/definitions/savers/InterfaceSaver.java deleted file mode 100644 index 61151a4158..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/savers/InterfaceSaver.java +++ /dev/null @@ -1,226 +0,0 @@ -/* - * 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.savers; - -import net.runelite.cache.definitions.ClientScript1Instruction; -import net.runelite.cache.definitions.InterfaceDefinition; -import net.runelite.cache.io.OutputStream; - -public class InterfaceSaver -{ - public byte[] save(InterfaceDefinition def) - { - if (def.isIf3) - { - return saveIf3(def); - } - else - { - return saveIf1(def); - } - } - - private byte[] saveIf3(InterfaceDefinition def) - { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. - } - - private byte[] saveIf1(InterfaceDefinition def) - { - OutputStream out = new OutputStream(); - out.writeByte(def.type); - out.writeByte(def.menuType); - out.writeShort(def.contentType); - out.writeShort(def.originalX); - out.writeShort(def.originalY); - out.writeShort(def.originalWidth); - out.writeShort(def.originalHeight); - out.writeByte(def.opacity); - out.writeShort(def.parentId); - out.writeShort(def.hoveredSiblingId); - if (def.alternateOperators != null) - { - out.writeByte(def.alternateOperators.length); - for (int i = 0; i < def.alternateOperators.length; ++i) - { - out.writeByte(def.alternateOperators[i]); - out.writeShort(def.alternateRhs[i]); - } - } - else - { - out.writeByte(0); - } - if (def.clientScripts != null) - { - out.writeByte(def.clientScripts.length); - for (int i = 0; i < def.clientScripts.length; ++i) - { - int len = 0; - for (int j = 0; j < def.clientScripts[i].length; ++j) - { - ClientScript1Instruction ins = def.clientScripts[i][j]; - len++; - if (ins.operands != null) - { - len += ins.operands.length; - } - } - out.writeShort(len); - for (int j = 0; j < def.clientScripts[i].length; ++j) - { - ClientScript1Instruction ins = def.clientScripts[i][j]; - out.writeShort(ins.opcode.ordinal()); - if (ins.operands != null) - { - for (int op : ins.operands) - { - out.writeShort(op); - } - } - } - } - } - else - { - out.writeByte(0); - } - if (def.type == 0) - { - out.writeShort(def.scrollHeight); - out.writeByte(def.isHidden ? 1 : 0); - } - if (def.type == 1) - { - out.writeShort(0); - out.writeByte(0); - } - if (def.type == 2) - { - out.writeByte((def.clickMask & 268435456) != 0 ? 1 : 0); - out.writeByte((def.clickMask & 1073741824) != 0 ? 1 : 0); - out.writeByte((def.clickMask & Integer.MIN_VALUE) != 0 ? 1 : 0); - out.writeByte((def.clickMask & 536870912) != 0 ? 1 : 0); - out.writeByte(def.xPitch); - out.writeByte(def.yPitch); - for (int i = 0; i < 20; ++i) - { - if (def.sprites[i] != -1) - { - out.writeByte(1); - out.writeShort(def.xOffsets[i]); - out.writeShort(def.yOffsets[i]); - out.writeShort(def.sprites[i]); - } - else - { - out.writeByte(0); - } - } - for (int i = 0; i < 5; ++i) - { - if (def.configActions[i] != null) - { - out.writeString(def.configActions[i]); - } - else - { - out.writeString(""); - } - } - } - if (def.type == 3) - { - out.writeByte(def.filled ? 1 : 0); - } - if (def.type == 4 || def.type == 1) - { - out.writeByte(def.xTextAlignment); - out.writeByte(def.yTextAlignment); - out.writeByte(def.lineHeight); - out.writeShort(def.fontId); - out.writeByte(def.textShadowed ? 1 : 0); - } - if (def.type == 4) - { - out.writeString(def.text); - out.writeString(def.alternateText); - } - if (def.type == 1 || def.type == 3 || def.type == 4) - { - out.writeInt(def.textColor); - } - if (def.type == 3 || def.type == 4) - { - out.writeInt(def.alternateTextColor); - out.writeInt(def.hoveredTextColor); - out.writeInt(def.alternateHoveredTextColor); - } - if (def.type == 5) - { - out.writeInt(def.spriteId); - out.writeInt(def.alternateSpriteId); - } - if (def.type == 6) - { - out.writeShort(def.modelId); - out.writeShort(def.alternateModelId); - out.writeShort(def.animation); - out.writeShort(def.alternateAnimation); - out.writeShort(def.modelZoom); - out.writeShort(def.rotationX); - out.writeShort(def.rotationZ); - } - if (def.type == 7) - { - out.writeByte(def.xTextAlignment); - out.writeShort(def.fontId); - out.writeByte(def.textShadowed ? 1 : 0); - out.writeInt(def.textColor); - out.writeShort(def.xPitch); - out.writeShort(def.yPitch); - out.writeByte((def.clickMask & 1073741824) != 0 ? 1 : 0); - for (int i = 0; i < 5; ++i) - { - out.writeString(def.configActions[i]); - } - } - if (def.type == 8) - { - out.writeString(def.text); - } - if (def.menuType == 2 || def.type == 2) - { - out.writeString(def.targetVerb); - out.writeString(def.spellName); - out.writeShort((def.clickMask >>> 11) & 63); - } - if (def.menuType == 1 || def.menuType == 4 || def.menuType == 5 || def.menuType == 6) - { - out.writeString(def.tooltip); - } - return out.flip(); - } -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/savers/ItemSaver.java b/cache/src/main/java/net/runelite/cache/definitions/savers/ItemSaver.java deleted file mode 100644 index baa9af3bea..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/savers/ItemSaver.java +++ /dev/null @@ -1,235 +0,0 @@ -/* - * 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.savers; - -import java.util.Map.Entry; -import net.runelite.cache.definitions.ItemDefinition; -import net.runelite.cache.io.OutputStream; - -public class ItemSaver -{ - public byte[] save(ItemDefinition item) - { - OutputStream out = new OutputStream(); - if (item.inventoryModel != 0) - { - out.writeByte(1); - out.writeShort(item.inventoryModel); - } - if (item.name != null) - { - out.writeByte(2); - out.writeString(item.name); - } - out.writeByte(4); - out.writeShort(item.zoom2d); - out.writeByte(5); - out.writeShort(item.xan2d); - out.writeByte(6); - out.writeShort(item.yan2d); - out.writeByte(7); - out.writeShort(item.xOffset2d); - out.writeByte(8); - out.writeShort(item.yOffset2d); - if (item.stackable != 0) - { - out.writeByte(11); - } - out.writeByte(12); - out.writeInt(item.cost); - if (item.members) - { - out.writeByte(16); - } - if (item.maleModel0 != -1 || item.maleOffset != 0) - { - out.writeByte(23); - out.writeShort(item.maleModel0); - out.writeByte(item.maleOffset); - } - if (item.maleModel1 != -1) - { - out.writeByte(24); - out.writeShort(item.maleModel1); - } - if (item.femaleModel0 != -1 || item.femaleOffset != 0) - { - out.writeByte(25); - out.writeShort(item.femaleModel0); - out.writeByte(item.femaleOffset); - } - if (item.femaleModel1 != -1) - { - out.writeByte(26); - out.writeShort(item.femaleModel1); - } - for (int i = 0; i < 5; ++i) - { - if (item.options[i] != null) - { - out.writeByte(30 + i); - out.writeString(item.options[i]); - } - } - for (int i = 0; i < 5; ++i) - { - if (item.interfaceOptions[i] != null) - { - out.writeByte(35 + i); - out.writeString(item.interfaceOptions[i]); - } - } - if (item.colorFind != null && item.colorReplace != null) - { - out.writeByte(40); - out.writeByte(item.colorFind.length); - for (int i = 0; i < item.colorFind.length; ++i) - { - out.writeShort(item.colorFind[i]); - out.writeShort(item.colorReplace[i]); - } - } - if (item.textureFind != null && item.textureReplace != null) - { - out.writeByte(41); - out.writeByte(item.textureFind.length); - for (int i = 0; i < item.textureFind.length; ++i) - { - out.writeShort(item.textureFind[i]); - out.writeShort(item.textureReplace[i]); - } - } - out.writeByte(42); - out.writeByte(item.shiftClickDropIndex); - if (item.isTradeable) - { - out.writeByte(65); - } - if (item.maleModel2 != -1) - { - out.writeByte(78); - out.writeShort(item.maleModel2); - } - if (item.femaleModel2 != -1) - { - out.writeByte(79); - out.writeShort(item.femaleModel2); - } - if (item.maleHeadModel != -1) - { - out.writeByte(90); - out.writeShort(item.maleHeadModel); - } - if (item.femaleHeadModel != -1) - { - out.writeByte(91); - out.writeShort(item.femaleHeadModel); - } - if (item.maleHeadModel2 != -1) - { - out.writeByte(92); - out.writeShort(item.maleHeadModel2); - } - if (item.femaleHeadModel2 != -1) - { - out.writeByte(93); - out.writeShort(item.femaleHeadModel2); - } - out.writeByte(95); - out.writeShort(item.zan2d); - if (item.notedID != -1) - { - out.writeByte(97); - out.writeShort(item.notedID); - } - if (item.notedTemplate != -1) - { - out.writeByte(98); - out.writeShort(item.notedTemplate); - } - if (item.countObj != null) - { - for (int i = 0; i < 10; ++i) - { - out.writeByte(100 + i); - out.writeShort(item.countObj[i]); - out.writeShort(item.countCo[i]); - } - } - out.writeByte(110); - out.writeShort(item.resizeX); - out.writeByte(111); - out.writeShort(item.resizeY); - out.writeByte(112); - out.writeShort(item.resizeZ); - out.writeByte(113); - out.writeByte(item.ambient); - out.writeByte(114); - out.writeByte(item.contrast); - out.writeByte(115); - out.writeByte(item.team); - if (item.boughtId != -1) - { - out.writeByte(139); - out.writeShort(item.boughtId); - } - if (item.boughtTemplateId != -1) - { - out.writeByte(140); - out.writeShort(item.boughtTemplateId); - } - if (item.placeholderId != -1) - { - out.writeByte(148); - out.writeShort(item.placeholderId); - } - if (item.placeholderTemplateId != -1) - { - out.writeByte(149); - out.writeShort(item.placeholderTemplateId); - } - if (item.params != null) - { - out.writeByte(249); - out.writeByte(item.params.size()); - for (Entry entry : item.params.entrySet()) - { - out.writeByte(entry.getValue() instanceof String ? 1 : 0); - out.write24BitInt(entry.getKey()); - if (entry.getValue() instanceof String) - { - out.writeString((String) entry.getValue()); - } - else - { - out.writeInt((Integer) entry.getValue()); - } - } - } - out.writeByte(0); - - return out.flip(); - } -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/savers/MapSaver.java b/cache/src/main/java/net/runelite/cache/definitions/savers/MapSaver.java deleted file mode 100644 index 855ccd413c..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/savers/MapSaver.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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.savers; - -import net.runelite.cache.definitions.MapDefinition; -import net.runelite.cache.definitions.MapDefinition.Tile; -import net.runelite.cache.io.OutputStream; -import static net.runelite.cache.region.Region.X; -import static net.runelite.cache.region.Region.Y; -import static net.runelite.cache.region.Region.Z; - -public class MapSaver -{ - public byte[] save(MapDefinition map) - { - Tile[][][] tiles = map.getTiles(); - OutputStream out = new OutputStream(); - for (int z = 0; z < Z; z++) - { - for (int x = 0; x < X; x++) - { - for (int y = 0; y < Y; y++) - { - Tile tile = tiles[z][x][y]; - if (tile.attrOpcode != 0) - { - out.writeByte(tile.attrOpcode); - out.writeByte(tile.overlayId); - } - if (tile.settings != 0) - { - out.writeByte(tile.settings + 49); - } - if (tile.underlayId != 0) - { - out.writeByte(tile.underlayId + 81); - } - if (tile.height == null) - { - out.writeByte(0); - } - else - { - out.writeByte(1); - out.writeByte(tile.height); - } - } - } - } - return out.flip(); - } -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/savers/NpcSaver.java b/cache/src/main/java/net/runelite/cache/definitions/savers/NpcSaver.java deleted file mode 100644 index 55d4b966e9..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/savers/NpcSaver.java +++ /dev/null @@ -1,195 +0,0 @@ -/* - * 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.savers; - -import java.util.Map; -import net.runelite.cache.definitions.NpcDefinition; -import net.runelite.cache.io.OutputStream; - -public class NpcSaver -{ - public byte[] save(NpcDefinition npc) - { - OutputStream out = new OutputStream(); - if (npc.models != null) - { - out.writeByte(1); - out.writeByte(npc.models.length); - for (int modelId : npc.models) - { - out.writeShort(modelId); - } - } - if (npc.name != null) - { - out.writeByte(2); - out.writeString(npc.name); - } - if (npc.tileSpacesOccupied != 1) - { - out.writeByte(12); - out.writeByte(npc.tileSpacesOccupied); - } - if (npc.stanceAnimation != -1) - { - out.writeByte(13); - out.writeShort(npc.stanceAnimation); - } - if (npc.walkAnimation != -1) - { - out.writeByte(14); - out.writeShort(npc.walkAnimation); - } - if (npc.anInt2165 != -1) - { - out.writeByte(15); - out.writeShort(npc.anInt2165); - } - if (npc.anInt2189 != -1) - { - out.writeByte(16); - out.writeShort(npc.anInt2189); - } - if (npc.rotate180Animation != -1 || npc.rotate90LeftAnimation != -1 || npc.rotate90RightAnimation != -1) - { - out.writeByte(17); - out.writeShort(npc.walkAnimation); - out.writeShort(npc.rotate180Animation); - out.writeShort(npc.rotate90RightAnimation); - out.writeShort(npc.rotate90LeftAnimation); - } - for (int i = 0; i < 5; ++i) - { - if (npc.options[i] != null) - { - out.writeByte(30 + i); - out.writeString(npc.options[i]); - } - } - if (npc.recolorToFind != null && npc.recolorToReplace != null) - { - out.writeByte(40); - out.writeByte(npc.recolorToFind.length); - for (int i = 0; i < npc.recolorToFind.length; ++i) - { - out.writeShort(npc.recolorToFind[i]); - out.writeShort(npc.recolorToReplace[i]); - } - } - if (npc.retextureToFind != null && npc.retextureToReplace != null) - { - out.writeByte(41); - out.writeByte(npc.retextureToFind.length); - for (int i = 0; i < npc.retextureToFind.length; ++i) - { - out.writeShort(npc.retextureToFind[i]); - out.writeShort(npc.retextureToReplace[i]); - } - } - if (npc.models_2 != null) - { - out.writeByte(60); - out.writeByte(npc.models_2.length); - for (int modelId : npc.models_2) - { - out.writeShort(modelId); - } - } - if (!npc.renderOnMinimap) - { - out.writeByte(93); - } - if (npc.combatLevel != -1) - { - out.writeByte(95); - out.writeShort(npc.combatLevel); - } - out.writeByte(97); - out.writeShort(npc.resizeX); - out.writeByte(98); - out.writeShort(npc.resizeY); - if (npc.hasRenderPriority) - { - out.writeByte(99); - } - out.writeByte(100); - out.writeByte(npc.ambient); - out.writeByte(101); - out.writeByte(npc.contrast); - if (npc.headIcon != -1) - { - out.writeByte(102); - out.writeShort(npc.headIcon); - } - out.writeByte(103); - out.writeShort(npc.rotation); - if (!npc.isClickable) - { - out.writeByte(107); - } - if (!npc.aBool2170) - { - out.writeByte(109); - } - if (npc.aBool2190) - { - out.writeByte(111); - } - if (npc.configs != null) - { - out.writeByte(118); - out.writeShort(npc.varbitIndex); - out.writeShort(npc.varpIndex); - - int[] c = npc.configs; - out.writeShort(c[c.length - 1]); - out.writeByte(c.length - 2); - for (int i = 0; i <= c.length - 2; ++i) - { - out.writeShort(c[i]); - } - } - if (npc.params != null) - { - out.writeByte(249); - out.writeByte(npc.params.size()); - for (Map.Entry entry : npc.params.entrySet()) - { - out.writeByte(entry.getValue() instanceof String ? 1 : 0); - out.write24BitInt(entry.getKey()); - if (entry.getValue() instanceof String) - { - out.writeString((String) entry.getValue()); - } - else - { - out.writeInt((Integer) entry.getValue()); - } - } - } - out.writeByte(0); - return out.flip(); - } -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/savers/ObjectSaver.java b/cache/src/main/java/net/runelite/cache/definitions/savers/ObjectSaver.java deleted file mode 100644 index e1bb77896d..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/savers/ObjectSaver.java +++ /dev/null @@ -1,231 +0,0 @@ -/* - * 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.savers; - -import java.util.Map; -import net.runelite.cache.definitions.ObjectDefinition; -import net.runelite.cache.io.OutputStream; - -public class ObjectSaver -{ - public byte[] save(ObjectDefinition obj) - { - OutputStream out = new OutputStream(); - if (obj.getObjectTypes() != null && obj.getObjectModels() != null) - { - out.writeByte(1); - out.writeByte(obj.getObjectTypes().length); - for (int i = 0; i < obj.getObjectTypes().length; ++i) - { - out.writeShort(obj.getObjectModels()[i]); - out.writeByte(obj.getObjectTypes()[i]); - } - } - if (obj.getName() != null) - { - out.writeByte(2); - out.writeString(obj.getName()); - } - if (obj.getObjectTypes() == null && obj.getObjectModels() != null) - { - out.writeByte(5); - out.writeByte(obj.getObjectModels().length); - for (int i = 0; i < obj.getObjectModels().length; ++i) - { - out.writeShort(obj.getObjectModels()[i]); - } - } - out.writeByte(14); - out.writeByte(obj.getSizeX()); - out.writeByte(15); - out.writeByte(obj.getSizeY()); - if (obj.getInteractType() == 0 && !obj.isBlocksProjectile()) - { - out.writeByte(17); - } - else if (!obj.isBlocksProjectile()) - { - out.writeByte(18); - } - if (obj.getAnInt2088() != -1) - { - out.writeByte(19); - out.writeByte(obj.getAnInt2088()); - } - if (obj.getAnInt2105() == 0) - { - out.writeByte(21); - } - if (!obj.isNonFlatShading()) - { - out.writeByte(22); - } - if (obj.isABool2111()) - { - out.writeByte(23); - } - if (obj.getAnimationID() != -1) - { - out.writeByte(24); - out.writeShort(obj.getAnimationID()); - } - if (obj.getInteractType() == 1) - { - out.writeByte(27); - } - out.writeByte(28); - out.writeByte(obj.getAnInt2069()); - out.writeByte(29); - out.writeByte(obj.getAmbient()); - out.writeByte(39); - out.writeByte(obj.getContrast()); - for (int i = 0; i < 5; ++i) - { - out.writeByte(30 + i); - String action = obj.getActions()[i]; - out.writeString(action != null ? action : "Hidden"); - } - if (obj.getRecolorToFind() != null && obj.getRecolorToReplace() != null) - { - out.writeByte(40); - out.writeByte(obj.getRecolorToFind().length); - for (int i = 0; i < obj.getRecolorToFind().length; ++i) - { - out.writeShort(obj.getRecolorToFind()[i]); - out.writeShort(obj.getRecolorToReplace()[i]); - } - } - if (obj.getRetextureToFind() != null && obj.getTextureToReplace() != null) - { - out.writeByte(41); - out.writeByte(obj.getRetextureToFind().length); - for (int i = 0; i < obj.getRetextureToFind().length; ++i) - { - out.writeShort(obj.getRetextureToFind()[i]); - out.writeShort(obj.getTextureToReplace()[i]); - } - } - if (obj.isRotated()) - { - out.writeByte(62); - } - if (!obj.isABool2097()) - { - out.writeByte(64); - } - out.writeByte(65); - out.writeShort(obj.getModelSizeX()); - out.writeByte(66); - out.writeShort(obj.getModelSizeHeight()); - out.writeByte(67); - out.writeShort(obj.getModelSizeY()); - if (obj.getMapSceneID() != -1) - { - out.writeByte(68); - out.writeShort(obj.getMapSceneID()); - } - out.writeByte(70); - out.writeShort(obj.getOffsetX()); - out.writeByte(71); - out.writeShort(obj.getOffsetHeight()); - out.writeByte(72); - out.writeShort(obj.getOffsetY()); - if (obj.isABool2104()) - { - out.writeByte(73); - } - if (obj.isSolid()) - { - out.writeByte(74); - } - if (obj.getAnInt2106() != -1) - { - out.writeByte(75); - out.writeByte(obj.getAnInt2106()); - } - if (obj.getAnInt2110() != -1) - { - out.writeByte(78); - out.writeShort(obj.getAnInt2110()); - out.writeByte(obj.getAnInt2083()); - } - if (obj.getAnIntArray2084() != null) - { - out.writeByte(79); - out.writeShort(obj.getAnInt2112()); - out.writeShort(obj.getAnInt2113()); - out.writeByte(obj.getAnInt2083()); - out.writeByte(obj.getAnIntArray2084().length); - for (int i : obj.getAnIntArray2084()) - { - out.writeShort(i); - } - } - if (obj.getAnInt2105() != -1) - { - out.writeByte(81); - out.writeByte(obj.getAnInt2105() / 256); - } - if (obj.getMapAreaId() != -1) - { - out.writeByte(82); - out.writeShort(obj.getMapAreaId()); - } - if (obj.getConfigChangeDest() != null) - { - out.writeByte(92); - out.writeShort(obj.getVarbitID()); - out.writeShort(obj.getVarpID()); - - int[] c = obj.getConfigChangeDest(); - out.writeShort(c[c.length - 1]); - out.writeByte(c.length - 2); - for (int i = 0; i <= c.length - 2; ++i) - { - out.writeShort(c[i]); - } - } - if (obj.getParams() != null) - { - out.writeByte(249); - out.writeByte(obj.getParams().size()); - for (Map.Entry entry : obj.getParams().entrySet()) - { - out.writeByte(entry.getValue() instanceof String ? 1 : 0); - out.write24BitInt(entry.getKey()); - if (entry.getValue() instanceof String) - { - out.writeString((String) entry.getValue()); - } - else - { - out.writeInt((Integer) entry.getValue()); - } - } - } - out.writeByte(0); - return out.flip(); - } -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/savers/ScriptSaver.java b/cache/src/main/java/net/runelite/cache/definitions/savers/ScriptSaver.java deleted file mode 100644 index 3b130c4c53..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/savers/ScriptSaver.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * 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.savers; - -import java.util.Map; -import java.util.Map.Entry; -import net.runelite.cache.definitions.ScriptDefinition; -import net.runelite.cache.io.OutputStream; -import static net.runelite.cache.script.Opcodes.SCONST; -import static net.runelite.cache.script.Opcodes.POP_INT; -import static net.runelite.cache.script.Opcodes.POP_STRING; -import static net.runelite.cache.script.Opcodes.RETURN; - -public class ScriptSaver -{ - public byte[] save(ScriptDefinition script) - { - int[] instructions = script.getInstructions(); - int[] intOperands = script.getIntOperands(); - String[] stringOperands = script.getStringOperands(); - Map[] switches = script.getSwitches(); - - OutputStream out = new OutputStream(); - out.writeByte(0); // null string - for (int i = 0; i < instructions.length; ++i) - { - int opcode = instructions[i]; - out.writeShort(opcode); - if (opcode == SCONST) - { - out.writeString(stringOperands[i]); - } - else if (opcode < 100 && opcode != RETURN && opcode != POP_INT && opcode != POP_STRING) - { - out.writeInt(intOperands[i]); - } - else - { - out.writeByte(intOperands[i]); - } - } - out.writeInt(instructions.length); - out.writeShort(script.getLocalIntCount()); - out.writeShort(script.getLocalStringCount()); - out.writeShort(script.getIntStackCount()); - out.writeShort(script.getStringStackCount()); - int switchStart = out.getOffset(); - if (switches == null) - { - out.writeByte(0); - } - else - { - out.writeByte(switches.length); - for (Map s : switches) - { - out.writeShort(s.size()); - for (Entry e : s.entrySet()) - { - out.writeInt(e.getKey()); - out.writeInt(e.getValue()); - } - } - } - int switchLength = out.getOffset() - switchStart; - out.writeShort(switchLength); - return out.flip(); - } -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/sound/SoundEffect1Definition.java b/cache/src/main/java/net/runelite/cache/definitions/sound/SoundEffect1Definition.java deleted file mode 100644 index ecd9854892..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/sound/SoundEffect1Definition.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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.sound; - -public class SoundEffect1Definition -{ - public SoundEffect2Definition field1173; - public SoundEffect2Definition field1174; - public SoundEffect2Definition field1175; - public int field1176 = 500; - public int[] field1177 = new int[] - { - 0, 0, 0, 0, 0 - }; - public SoundEffect2Definition field1178; - public int[] field1179 = new int[] - { - 0, 0, 0, 0, 0 - }; - public int[] field1180 = new int[] - { - 0, 0, 0, 0, 0 - }; - public SoundEffect2Definition field1181; - public SoundEffect3Definition field1182; - public SoundEffect2Definition field1183; - public int field1184 = 100; - public SoundEffect2Definition field1186; - public int field1187 = 0; - public int field1188 = 0; - public SoundEffect2Definition field1192; - public SoundEffect2Definition field1193; -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/sound/SoundEffect2Definition.java b/cache/src/main/java/net/runelite/cache/definitions/sound/SoundEffect2Definition.java deleted file mode 100644 index 358d462f50..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/sound/SoundEffect2Definition.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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.sound; - -public class SoundEffect2Definition -{ - public int field1085; - public int[] field1086 = new int[2]; - public int field1087; - public int field1088; - public int field1089; - public int[] field1090 = new int[2]; - public int field1091; - public int field1092 = 2; - public int field1093; - public int field1094; - public int field1095; - - public SoundEffect2Definition() - { - this.field1086[0] = 0; - this.field1086[1] = '\uffff'; - this.field1090[0] = 0; - this.field1090[1] = '\uffff'; - } -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/sound/SoundEffect3Definition.java b/cache/src/main/java/net/runelite/cache/definitions/sound/SoundEffect3Definition.java deleted file mode 100644 index a6580c046f..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/sound/SoundEffect3Definition.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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.sound; - -public class SoundEffect3Definition -{ - public int[][][] field1154 = new int[2][2][4]; - public int[] field1155 = new int[2]; - public int[] field1156 = new int[2]; - public int[][][] field1159 = new int[2][2][4]; -} diff --git a/cache/src/main/java/net/runelite/cache/definitions/sound/SoundEffectDefinition.java b/cache/src/main/java/net/runelite/cache/definitions/sound/SoundEffectDefinition.java deleted file mode 100644 index 0eda10254e..0000000000 --- a/cache/src/main/java/net/runelite/cache/definitions/sound/SoundEffectDefinition.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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.sound; - -public class SoundEffectDefinition -{ - public int field1006; - public SoundEffect1Definition[] field1008 = new SoundEffect1Definition[10]; - public int field1009; -} diff --git a/cache/src/main/java/net/runelite/cache/fs/Archive.java b/cache/src/main/java/net/runelite/cache/fs/Archive.java deleted file mode 100644 index d7b8435f3c..0000000000 --- a/cache/src/main/java/net/runelite/cache/fs/Archive.java +++ /dev/null @@ -1,224 +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.cache.fs; - -import java.io.IOException; -import net.runelite.cache.index.FileData; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class Archive -{ - private static final Logger logger = LoggerFactory.getLogger(Archive.class); - - private final Index index; // member of this index - - private final int archiveId; - private int nameHash; - private int crc; - private int revision; - private int compression; - private FileData[] fileData; - private byte[] hash; // used by webservice, sha256 hash of content - - public Archive(Index index, int id) - { - this.index = index; - this.archiveId = id; - } - - @Override - public int hashCode() - { - int hash = 7; - hash = 47 * hash + this.archiveId; - hash = 47 * hash + this.nameHash; - hash = 47 * hash + this.revision; - return hash; - } - - @Override - public boolean equals(Object obj) - { - if (obj == null) - { - return false; - } - if (getClass() != obj.getClass()) - { - return false; - } - final Archive other = (Archive) obj; - if (this.archiveId != other.archiveId) - { - return false; - } - if (this.nameHash != other.nameHash) - { - return false; - } - if (this.revision != other.revision) - { - return false; - } - return true; - } - - public Index getIndex() - { - return index; - } - - public byte[] decompress(byte[] data) throws IOException - { - return decompress(data, null); - } - - public byte[] decompress(byte[] data, int[] keys) throws IOException - { - if (data == null) - { - return null; - } - - byte[] encryptedData = data; - - Container container = Container.decompress(encryptedData, keys); - if (container == null) - { - logger.warn("Unable to decrypt archive {}", this); - return null; - } - - byte[] decompressedData = container.data; - - if (this.crc != container.crc) - { - logger.warn("crc mismatch for archive {}/{}", index.getId(), this.getArchiveId()); - throw new IOException("CRC mismatch for " + index.getId() + "/" + this.getArchiveId()); - } - - if (container.revision != -1 && this.getRevision() != container.revision) - { - // compressed data doesn't always include a revision, but check it if it does - logger.warn("revision mismatch for archive {}/{}, expected {} was {}", - index.getId(), this.getArchiveId(), - this.getRevision(), container.revision); - // I've seen this happen with vanilla caches where the - // revision in the index data differs from the revision - // stored for the archive data on disk... I assume this - // is more correct - this.setRevision(container.revision); - } - - setCompression(container.compression); - return decompressedData; - } - - public ArchiveFiles getFiles(byte[] data) throws IOException - { - return getFiles(data, null); - } - - public ArchiveFiles getFiles(byte[] data, int[] keys) throws IOException - { - byte[] decompressedData = decompress(data, keys); - - ArchiveFiles files = new ArchiveFiles(); - for (FileData fileEntry : fileData) - { - FSFile file = new FSFile(fileEntry.getId()); - file.setNameHash(fileEntry.getNameHash()); - files.addFile(file); - } - files.loadContents(decompressedData); - return files; - } - - public int getArchiveId() - { - return archiveId; - } - - public int getNameHash() - { - return nameHash; - } - - public void setNameHash(int nameHash) - { - this.nameHash = nameHash; - } - - public int getCrc() - { - return crc; - } - - public void setCrc(int crc) - { - this.crc = crc; - } - - public int getRevision() - { - return revision; - } - - public void setRevision(int revision) - { - this.revision = revision; - } - - public int getCompression() - { - return compression; - } - - public void setCompression(int compression) - { - this.compression = compression; - } - - public FileData[] getFileData() - { - return fileData; - } - - public void setFileData(FileData[] fileData) - { - this.fileData = fileData; - } - - public byte[] getHash() - { - return hash; - } - - public void setHash(byte[] hash) - { - this.hash = hash; - } -} diff --git a/cache/src/main/java/net/runelite/cache/fs/ArchiveFiles.java b/cache/src/main/java/net/runelite/cache/fs/ArchiveFiles.java deleted file mode 100644 index 2642b1fbb4..0000000000 --- a/cache/src/main/java/net/runelite/cache/fs/ArchiveFiles.java +++ /dev/null @@ -1,208 +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.cache.fs; - -import com.google.common.base.Preconditions; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import net.runelite.cache.io.InputStream; -import net.runelite.cache.io.OutputStream; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class ArchiveFiles -{ - private static final Logger logger = LoggerFactory.getLogger(ArchiveFiles.class); - - private final List files = new ArrayList<>(); - private final Map fileMap = new HashMap<>(); - - @Override - public int hashCode() - { - int hash = 7; - hash = 67 * hash + Objects.hashCode(this.files); - return hash; - } - - @Override - public boolean equals(Object obj) - { - if (obj == null) - { - return false; - } - if (getClass() != obj.getClass()) - { - return false; - } - final ArchiveFiles other = (ArchiveFiles) obj; - if (!Objects.equals(this.files, other.files)) - { - return false; - } - return true; - } - - public void addFile(FSFile file) - { - Preconditions.checkArgument(file.getFileId() != -1); - - if (fileMap.containsKey(file.getFileId())) - { - throw new IllegalStateException("duplicate file ids"); - } - - files.add(file); - fileMap.put(file.getFileId(), file); - } - - public List getFiles() - { - return Collections.unmodifiableList(files); - } - - public FSFile findFile(int fileId) - { - return fileMap.get(fileId); - } - - public void clear() - { - files.clear(); - fileMap.clear(); - } - - public void loadContents(byte[] data) - { - logger.trace("Loading contents of archive ({} files)", files.size()); - - assert !this.getFiles().isEmpty(); - - if (this.getFiles().size() == 1) - { - this.getFiles().get(0).setContents(data); - return; - } - - int filesCount = this.getFiles().size(); - - InputStream stream = new InputStream(data); - stream.setOffset(stream.getLength() - 1); - int chunks = stream.readUnsignedByte(); - - // -1 for chunks count + one int per file slot per chunk - stream.setOffset(stream.getLength() - 1 - chunks * filesCount * 4); - int[][] chunkSizes = new int[filesCount][chunks]; - int[] filesSize = new int[filesCount]; - - for (int chunk = 0; chunk < chunks; ++chunk) - { - int chunkSize = 0; - - for (int id = 0; id < filesCount; ++id) - { - int delta = stream.readInt(); - chunkSize += delta; // size of this chunk - - chunkSizes[id][chunk] = chunkSize; // store size of chunk - - filesSize[id] += chunkSize; // add chunk size to file size - } - } - - byte[][] fileContents = new byte[filesCount][]; - int[] fileOffsets = new int[filesCount]; - - for (int i = 0; i < filesCount; ++i) - { - fileContents[i] = new byte[filesSize[i]]; - } - - // the file data is at the beginning of the stream - stream.setOffset(0); - - for (int chunk = 0; chunk < chunks; ++chunk) - { - for (int id = 0; id < filesCount; ++id) - { - int chunkSize = chunkSizes[id][chunk]; - - stream.readBytes(fileContents[id], fileOffsets[id], chunkSize); - - fileOffsets[id] += chunkSize; - } - } - - for (int i = 0; i < filesCount; ++i) - { - FSFile f = this.getFiles().get(i); - f.setContents(fileContents[i]); - } - } - - public byte[] saveContents() - { - OutputStream stream = new OutputStream(); - - int filesCount = this.getFiles().size(); - - if (filesCount == 1) - { - FSFile file = this.getFiles().get(0); - stream.writeBytes(file.getContents()); - } - else - { - for (FSFile file : this.getFiles()) - { - byte[] contents = file.getContents(); - stream.writeBytes(contents); - } - - int offset = 0; - - for (FSFile file : this.getFiles()) - { - int chunkSize = file.getSize(); - - int sz = chunkSize - offset; - offset = chunkSize; - stream.writeInt(sz); - } - - stream.writeByte(1); // chunks - } - - byte[] fileData = stream.flip(); - - logger.trace("Saved contents of archive ({} files), {} bytes", files.size(), fileData.length); - return fileData; - } -} diff --git a/cache/src/main/java/net/runelite/cache/fs/Container.java b/cache/src/main/java/net/runelite/cache/fs/Container.java deleted file mode 100644 index 9d57264bc7..0000000000 --- a/cache/src/main/java/net/runelite/cache/fs/Container.java +++ /dev/null @@ -1,216 +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.cache.fs; - -import static com.google.common.primitives.Bytes.concat; -import com.google.common.primitives.Ints; -import java.io.IOException; -import net.runelite.cache.fs.jagex.CompressionType; -import net.runelite.cache.io.InputStream; -import net.runelite.cache.io.OutputStream; -import net.runelite.cache.util.BZip2; -import net.runelite.cache.util.Crc32; -import net.runelite.cache.util.GZip; -import net.runelite.cache.util.Xtea; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class Container -{ - private static final Logger logger = LoggerFactory.getLogger(Container.class); - - public byte[] data; - public int compression; // compression - public int revision; - public int crc; // crc of compressed data - - public Container(int compression, int revision) - { - this.compression = compression; - this.revision = revision; - } - - public void compress(byte[] data, int[] keys) throws IOException - { - OutputStream stream = new OutputStream(); - - byte[] compressedData; - int length; - switch (compression) - { - case CompressionType.NONE: - compressedData = data; - length = compressedData.length; - break; - case CompressionType.BZ2: - compressedData = concat(Ints.toByteArray(data.length), BZip2.compress(data)); - length = compressedData.length - 4; - break; - case CompressionType.GZ: - compressedData = concat(Ints.toByteArray(data.length), GZip.compress(data)); - length = compressedData.length - 4; - break; - default: - throw new RuntimeException("Unknown compression type"); - } - - compressedData = encrypt(compressedData, compressedData.length, keys); - - stream.writeByte(compression); - stream.writeInt(length); - - stream.writeBytes(compressedData); - if (revision != -1) - { - stream.writeShort(revision); - } - - this.data = stream.flip(); - } - - public static Container decompress(byte[] b, int[] keys) throws IOException - { - InputStream stream = new InputStream(b); - - int compression = stream.readUnsignedByte(); - int compressedLength = stream.readInt(); - if (compressedLength < 0 || compressedLength > 1000000) - { - throw new RuntimeException("Invalid data"); - } - - Crc32 crc32 = new Crc32(); - crc32.update(b, 0, 5); // compression + length - - byte[] data; - int revision = -1; - switch (compression) - { - case CompressionType.NONE: - { - byte[] encryptedData = new byte[compressedLength]; - stream.readBytes(encryptedData, 0, compressedLength); - - crc32.update(encryptedData, 0, compressedLength); - byte[] decryptedData = decrypt(encryptedData, encryptedData.length, keys); - - if (stream.remaining() >= 2) - { - revision = stream.readUnsignedShort(); - assert revision != -1; - } - - data = decryptedData; - - break; - } - case CompressionType.BZ2: - { - byte[] encryptedData = new byte[compressedLength + 4]; - stream.readBytes(encryptedData); - - crc32.update(encryptedData, 0, encryptedData.length); - byte[] decryptedData = decrypt(encryptedData, encryptedData.length, keys); - - if (stream.remaining() >= 2) - { - revision = stream.readUnsignedShort(); - assert revision != -1; - } - - stream = new InputStream(decryptedData); - - int decompressedLength = stream.readInt(); - data = BZip2.decompress(stream.getRemaining(), compressedLength); - - if (data == null) - { - return null; - } - - assert data.length == decompressedLength; - - break; - } - case CompressionType.GZ: - { - byte[] encryptedData = new byte[compressedLength + 4]; - stream.readBytes(encryptedData); - - crc32.update(encryptedData, 0, encryptedData.length); - byte[] decryptedData = decrypt(encryptedData, encryptedData.length, keys); - - if (stream.remaining() >= 2) - { - revision = stream.readUnsignedShort(); - assert revision != -1; - } - - stream = new InputStream(decryptedData); - - int decompressedLength = stream.readInt(); - data = GZip.decompress(stream.getRemaining(), compressedLength); - - if (data == null) - { - return null; - } - - assert data.length == decompressedLength; - - break; - } - default: - throw new RuntimeException("Unknown decompression type"); - } - - Container container = new Container(compression, revision); - container.data = data; - container.crc = crc32.getHash(); - return container; - } - - private static byte[] decrypt(byte[] data, int length, int[] keys) - { - if (keys == null) - { - return data; - } - - Xtea xtea = new Xtea(keys); - return xtea.decrypt(data, length); - } - - private static byte[] encrypt(byte[] data, int length, int[] keys) - { - if (keys == null) - { - return data; - } - - Xtea xtea = new Xtea(keys); - return xtea.encrypt(data, length); - } -} diff --git a/cache/src/main/java/net/runelite/cache/fs/Index.java b/cache/src/main/java/net/runelite/cache/fs/Index.java deleted file mode 100644 index 6e915f9336..0000000000 --- a/cache/src/main/java/net/runelite/cache/fs/Index.java +++ /dev/null @@ -1,209 +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.cache.fs; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; -import net.runelite.cache.index.ArchiveData; -import net.runelite.cache.index.FileData; -import net.runelite.cache.index.IndexData; -import net.runelite.cache.util.Djb2; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class Index -{ - private static final Logger logger = LoggerFactory.getLogger(Index.class); - - private final int id; - - private int protocol = 6; - private boolean named = true; - private int revision; - private int crc; - private int compression; // compression method of this index's data in 255 - - private final List archives = new ArrayList<>(); - - public Index(int id) - { - this.id = id; - } - - @Override - public int hashCode() - { - int hash = 3; - hash = 97 * hash + this.id; - hash = 97 * hash + this.revision; - hash = 97 * hash + Objects.hashCode(this.archives); - return hash; - } - - @Override - public boolean equals(Object obj) - { - if (obj == null) - { - return false; - } - if (getClass() != obj.getClass()) - { - return false; - } - final Index other = (Index) obj; - if (this.id != other.id) - { - return false; - } - if (this.revision != other.revision) - { - return false; - } - if (!Objects.equals(this.archives, other.archives)) - { - return false; - } - return true; - } - - public int getId() - { - return id; - } - - public int getProtocol() - { - return protocol; - } - - public void setProtocol(int protocol) - { - this.protocol = protocol; - } - - public boolean isNamed() - { - return named; - } - - public void setNamed(boolean named) - { - this.named = named; - } - - public int getRevision() - { - return revision; - } - - public void setRevision(int revision) - { - this.revision = revision; - } - - public int getCrc() - { - return crc; - } - - public void setCrc(int crc) - { - this.crc = crc; - } - - public int getCompression() - { - return compression; - } - - public void setCompression(int compression) - { - this.compression = compression; - } - - public List getArchives() - { - return archives; - } - - public Archive addArchive(int id) - { - Archive archive = new Archive(this, id); - this.archives.add(archive); - return archive; - } - - public Archive getArchive(int id) - { - for (Archive a : archives) - { - if (a.getArchiveId() == id) - { - return a; - } - } - return null; - } - - public Archive findArchiveByName(String name) - { - int hash = Djb2.hash(name); - for (Archive a : archives) - { - if (a.getNameHash() == hash) - { - return a; - } - } - return null; - } - - public IndexData toIndexData() - { - IndexData data = new IndexData(); - data.setProtocol(protocol); - data.setRevision(revision); - data.setNamed(named); - - ArchiveData[] archiveDatas = new ArchiveData[archives.size()]; - data.setArchives(archiveDatas); - - int idx = 0; - for (Archive archive : archives) - { - ArchiveData ad = archiveDatas[idx++] = new ArchiveData(); - ad.setId(archive.getArchiveId()); - ad.setNameHash(archive.getNameHash()); - ad.setCrc(archive.getCrc()); - ad.setRevision(archive.getRevision()); - - FileData[] files = archive.getFileData(); - ad.setFiles(files); - } - return data; - } -} diff --git a/cache/src/main/java/net/runelite/cache/fs/Store.java b/cache/src/main/java/net/runelite/cache/fs/Store.java deleted file mode 100644 index 6423a8039e..0000000000 --- a/cache/src/main/java/net/runelite/cache/fs/Store.java +++ /dev/null @@ -1,150 +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.cache.fs; - -import java.io.Closeable; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; -import net.runelite.cache.IndexType; -import net.runelite.cache.fs.jagex.DiskStorage; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public final class Store implements Closeable -{ - private static final Logger logger = LoggerFactory.getLogger(Store.class); - - private final Storage storage; - private final List indexes = new ArrayList<>(); - - public Store(File folder) throws IOException - { - storage = new DiskStorage(folder); - storage.init(this); - } - - public Store(Storage storage) throws IOException - { - this.storage = storage; - - storage.init(this); - } - - public Storage getStorage() - { - return storage; - } - - @Override - public void close() throws IOException - { - storage.close(); - } - - @Override - public int hashCode() - { - int hash = 5; - hash = 79 * hash + Objects.hashCode(this.indexes); - return hash; - } - - @Override - public boolean equals(Object obj) - { - if (obj == null) - { - return false; - } - if (getClass() != obj.getClass()) - { - return false; - } - final Store other = (Store) obj; - if (!Objects.equals(this.indexes, other.indexes)) - { - return false; - } - return true; - } - - public final Index addIndex(int id) throws FileNotFoundException - { - for (Index i : indexes) - { - if (i.getId() == id) - { - throw new IllegalArgumentException("index " + id + " already exists"); - } - } - - Index index = new Index(id); - this.indexes.add(index); - - return index; - } - - public void removeIndex(Index index) - { - assert indexes.contains(index); - indexes.remove(index); - } - - public void load() throws IOException - { - storage.load(this); - } - - public void save() throws IOException - { - storage.save(this); - } - - public List getIndexes() - { - return indexes; - } - - public Index getIndex(IndexType type) - { - return findIndex(type.getNumber()); - } - - public Index findIndex(int id) - { - for (Index i : indexes) - { - if (i.getId() == id) - { - return i; - } - } - return null; - } -} diff --git a/cache/src/main/java/net/runelite/cache/fs/flat/FlatStorage.java b/cache/src/main/java/net/runelite/cache/fs/flat/FlatStorage.java deleted file mode 100644 index 8c5d7e77a7..0000000000 --- a/cache/src/main/java/net/runelite/cache/fs/flat/FlatStorage.java +++ /dev/null @@ -1,268 +0,0 @@ -/* - * 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.fs.flat; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.io.PrintStream; -import java.util.ArrayList; -import java.util.Base64; -import java.util.Comparator; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -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; - -/** - * A Storage that stores the cache as a series of flat files, designed - * to be git revisioned. - */ -public class FlatStorage implements Storage -{ - protected static final String EXTENSION = ".flatcache"; - - private final File directory; - private final Map data = new HashMap<>(); - - public FlatStorage(File directory) throws IOException - { - this.directory = directory; - } - - protected FlatStorage() - { - this.directory = null; - } - - protected InputStream openReader(String filename) throws IOException - { - return new FileInputStream(new File(directory, filename)); - } - - protected OutputStream openWriter(String filename) throws IOException - { - return new FileOutputStream(new File(directory, filename)); - } - - protected String[] listFlatcacheFiles() throws IOException - { - return directory.list((dir, name) -> name.endsWith(EXTENSION)); - } - - @Override - public void init(Store store) throws IOException - { - String[] idxs = listFlatcacheFiles(); - for (String idx : idxs) - { - int id = Integer.parseInt(idx.substring(0, idx.length() - EXTENSION.length())); - store.addIndex(id); - } - } - - @Override - public void close() throws IOException - { - } - - @Override - public void load(Store store) throws IOException - { - for (Index idx : store.getIndexes()) - { - String file = idx.getId() + EXTENSION; - try (BufferedReader br = new BufferedReader(new InputStreamReader(openReader(file)))) - { - int lineNo = 0; - Archive archive = null; - List fileData = null; - for (String line = br.readLine(); line != null; line = br.readLine()) - { - lineNo++; - - try - { - int lidx = line.indexOf('='); - String key = line.substring(0, lidx); - String value = line.substring(lidx + 1); - - if ("file".equals(key)) - { - if (fileData == null) - { - fileData = new ArrayList<>(); - } - - int vidx = value.indexOf('='); - FileData fd = new FileData(); - fd.setId(Integer.parseInt(value.substring(0, vidx))); - fd.setNameHash(Integer.parseInt(value.substring(vidx + 1))); - fileData.add(fd); - continue; - } - else if (fileData != null) - { - archive.setFileData(fileData.toArray(new FileData[0])); - fileData = null; - } - - if ("id".equals(key)) - { - archive = idx.addArchive(Integer.parseInt(value)); - continue; - } - - if (archive == null) - { - switch (key) - { - case "protocol": - idx.setProtocol(Integer.parseInt(value)); - continue; - case "revision": - idx.setRevision(Integer.parseInt(value)); - continue; - case "compression": - idx.setCompression(Integer.parseInt(value)); - continue; - case "crc": - idx.setCrc(Integer.parseInt(value)); - continue; - case "named": - idx.setNamed(Boolean.parseBoolean(value)); - continue; - } - } - else - { - switch (key) - { - case "namehash": - archive.setNameHash(Integer.parseInt(value)); - continue; - case "revision": - archive.setRevision(Integer.parseInt(value)); - continue; - case "crc": - archive.setCrc(Integer.parseInt(value)); - continue; - case "hash": - archive.setHash(Base64.getDecoder().decode(value)); - continue; - case "compression": - archive.setCompression(Integer.parseInt(value)); - continue; - case "contents": - data.put((long) idx.getId() << 32 | archive.getArchiveId(), Base64.getDecoder().decode(value)); - continue; - } - } - throw new IOException("unknown key: \"" + key + "\""); - } - catch (Exception e) - { - throw new IOException("error reading flatcache at " + file + ":" + lineNo, e); - } - } - - if (fileData != null) - { - archive.setFileData(fileData.toArray(new FileData[0])); - fileData = null; - } - } - } - } - - @Override - public void save(Store store) throws IOException - { - store.getIndexes().sort(Comparator.comparing(Index::getId)); - for (Index idx : store.getIndexes()) - { - String file = idx.getId() + EXTENSION; - try (PrintStream br = new PrintStream(openWriter(file))) - { - br.printf("protocol=%d\n", idx.getProtocol()); - br.printf("revision=%d\n", idx.getRevision()); - br.printf("compression=%d\n", idx.getCompression()); - br.printf("crc=%d\n", idx.getCrc()); - br.printf("named=%b\n", idx.getCompression()); - - idx.getArchives().sort(Comparator.comparing(Archive::getArchiveId)); - for (Archive archive : idx.getArchives()) - { - br.printf("id=%d\n", archive.getArchiveId()); - br.printf("namehash=%d\n", archive.getNameHash()); - br.printf("revision=%d\n", archive.getRevision()); - br.printf("crc=%d\n", archive.getCrc()); - - if (archive.getHash() != null) - { - br.append("hash="); - br.write(Base64.getEncoder().encode(archive.getHash())); - br.append("\n"); - } - - byte[] contents = store.getStorage().loadArchive(archive); - if (contents != null) - { - br.append("contents="); - br.write(Base64.getEncoder().encode(contents)); - br.append("\n"); - } - - br.printf("compression=%d\n", archive.getCompression()); - for (FileData fd : archive.getFileData()) - { - br.printf("file=%d=%d\n", fd.getId(), fd.getNameHash()); - } - } - } - } - } - - @Override - public byte[] loadArchive(Archive archive) throws IOException - { - return data.get((long) archive.getIndex().getId() << 32 | archive.getArchiveId()); - } - - @Override - public void saveArchive(Archive archive, byte[] bytes) throws IOException - { - data.put((long) archive.getIndex().getId() << 32 | archive.getArchiveId(), bytes); - } -} diff --git a/cache/src/main/java/net/runelite/cache/fs/jagex/CompressionType.java b/cache/src/main/java/net/runelite/cache/fs/jagex/CompressionType.java deleted file mode 100644 index d11b3e276b..0000000000 --- a/cache/src/main/java/net/runelite/cache/fs/jagex/CompressionType.java +++ /dev/null @@ -1,32 +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.cache.fs.jagex; - -public class CompressionType -{ - public static final int NONE = 0; - public static final int BZ2 = 1; - public static final int GZ = 2; -} diff --git a/cache/src/main/java/net/runelite/cache/fs/jagex/DataFile.java b/cache/src/main/java/net/runelite/cache/fs/jagex/DataFile.java deleted file mode 100644 index 89eb607eee..0000000000 --- a/cache/src/main/java/net/runelite/cache/fs/jagex/DataFile.java +++ /dev/null @@ -1,253 +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.cache.fs.jagex; - -import java.io.Closeable; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.RandomAccessFile; -import java.nio.ByteBuffer; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class DataFile implements Closeable -{ - private static final Logger logger = LoggerFactory.getLogger(DataFile.class); - - private static final int SECTOR_SIZE = 520; - - private final RandomAccessFile dat; - - public DataFile(File file) throws FileNotFoundException - { - this.dat = new RandomAccessFile(file, "rw"); - } - - @Override - public void close() throws IOException - { - dat.close(); - } - - public void clear() throws IOException - { - dat.setLength(0L); - } - - /** - * - * @param indexId expected index of archive of contents being read - * @param archiveId expected archive of contents being read - * @param sector sector to start reading at - * @param size size of file - * @return - * @throws IOException - */ - public byte[] read(int indexId, int archiveId, int sector, int size) throws IOException - { - if (sector <= 0L || dat.length() / SECTOR_SIZE < (long) sector) - { - logger.warn("bad read, dat length {}, requested sector {}", dat.length(), sector); - return null; - } - - byte[] readBuffer = new byte[SECTOR_SIZE]; - ByteBuffer buffer = ByteBuffer.allocate(size); - - for (int part = 0, readBytesCount = 0, nextSector; - size > readBytesCount; - sector = nextSector) - { - if (sector == 0) - { - logger.warn("Unexpected end of file"); - return null; - } - - dat.seek(SECTOR_SIZE * sector); - - int dataBlockSize = size - readBytesCount; - byte headerSize; - int currentIndex; - int currentPart; - int currentArchive; - if (archiveId > 0xFFFF) - { - headerSize = 10; - if (dataBlockSize > SECTOR_SIZE - headerSize) - { - dataBlockSize = SECTOR_SIZE - headerSize; - } - - int i = dat.read(readBuffer, 0, headerSize + dataBlockSize); - if (i != headerSize + dataBlockSize) - { - logger.warn("Short read when reading file data for {}/{}", indexId, archiveId); - return null; - } - - currentArchive = ((readBuffer[0] & 0xFF) << 24) - | ((readBuffer[1] & 0xFF) << 16) - | ((readBuffer[2] & 0xFF) << 8) - | (readBuffer[3] & 0xFF); - currentPart = ((readBuffer[4] & 0xFF) << 8) + (readBuffer[5] & 0xFF); - nextSector = ((readBuffer[6] & 0xFF) << 16) - | ((readBuffer[7] & 0xFF) << 8) - | (readBuffer[8] & 0xFF); - currentIndex = readBuffer[9] & 0xFF; - } - else - { - headerSize = 8; - if (dataBlockSize > SECTOR_SIZE - headerSize) - { - dataBlockSize = SECTOR_SIZE - headerSize; - } - - int i = dat.read(readBuffer, 0, headerSize + dataBlockSize); - if (i != headerSize + dataBlockSize) - { - logger.warn("short read"); - return null; - } - - currentArchive = ((readBuffer[0] & 0xFF) << 8) - | (readBuffer[1] & 0xFF); - currentPart = ((readBuffer[2] & 0xFF) << 8) - | (readBuffer[3] & 0xFF); - nextSector = ((readBuffer[4] & 0xFF) << 16) - | ((readBuffer[5] & 0xFF) << 8) - | (readBuffer[6] & 0xFF); - currentIndex = readBuffer[7] & 0xFF; - } - - if (archiveId != currentArchive || currentPart != part || indexId != currentIndex) - { - logger.warn("data mismatch {} != {}, {} != {}, {} != {}", - archiveId, currentArchive, - part, currentPart, - indexId, currentIndex); - return null; - } - - if (nextSector < 0 || dat.length() / SECTOR_SIZE < (long) nextSector) - { - logger.warn("Invalid next sector"); - return null; - } - - buffer.put(readBuffer, headerSize, dataBlockSize); - readBytesCount += dataBlockSize; - - ++part; - } - - buffer.flip(); - return buffer.array(); - } - - public DataFileWriteResult write(int indexId, int archiveId, byte[] compressedData) throws IOException - { - int sector; - int startSector; - - byte[] writeBuffer = new byte[SECTOR_SIZE]; - ByteBuffer data = ByteBuffer.wrap(compressedData); - - sector = (int) ((dat.length() + (long) (SECTOR_SIZE - 1)) / (long) SECTOR_SIZE); - if (sector == 0) - { - sector = 1; - } - startSector = sector; - - for (int part = 0; data.hasRemaining(); ++part) - { - int nextSector = sector + 1; // we always just append sectors - int dataToWrite; - - if (0xFFFF < archiveId) - { - if (data.remaining() <= 510) - { - nextSector = 0; - } - - writeBuffer[0] = (byte) (archiveId >> 24); - writeBuffer[1] = (byte) (archiveId >> 16); - writeBuffer[2] = (byte) (archiveId >> 8); - writeBuffer[3] = (byte) archiveId; - writeBuffer[4] = (byte) (part >> 8); - writeBuffer[5] = (byte) part; - writeBuffer[6] = (byte) (nextSector >> 16); - writeBuffer[7] = (byte) (nextSector >> 8); - writeBuffer[8] = (byte) nextSector; - writeBuffer[9] = (byte) indexId; - dat.seek(SECTOR_SIZE * sector); - dat.write(writeBuffer, 0, 10); - - dataToWrite = data.remaining(); - if (dataToWrite > 510) - { - dataToWrite = 510; - } - } - else - { - if (data.remaining() <= 512) - { - nextSector = 0; - } - - writeBuffer[0] = (byte) (archiveId >> 8); - writeBuffer[1] = (byte) archiveId; - writeBuffer[2] = (byte) (part >> 8); - writeBuffer[3] = (byte) part; - writeBuffer[4] = (byte) (nextSector >> 16); - writeBuffer[5] = (byte) (nextSector >> 8); - writeBuffer[6] = (byte) nextSector; - writeBuffer[7] = (byte) indexId; - dat.seek(SECTOR_SIZE * sector); - dat.write(writeBuffer, 0, 8); - - dataToWrite = data.remaining(); - if (dataToWrite > 512) - { - dataToWrite = 512; - } - } - - data.get(writeBuffer, 0, dataToWrite); - dat.write(writeBuffer, 0, dataToWrite); - sector = nextSector; - } - - DataFileWriteResult res = new DataFileWriteResult(); - res.sector = startSector; - res.compressedLength = compressedData.length; - return res; - } -} diff --git a/cache/src/main/java/net/runelite/cache/fs/jagex/DiskStorage.java b/cache/src/main/java/net/runelite/cache/fs/jagex/DiskStorage.java deleted file mode 100644 index bebcc9711f..0000000000 --- a/cache/src/main/java/net/runelite/cache/fs/jagex/DiskStorage.java +++ /dev/null @@ -1,229 +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.cache.fs.jagex; - -import com.google.common.primitives.Ints; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import net.runelite.cache.fs.Archive; -import net.runelite.cache.fs.Container; -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.cache.util.Crc32; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class DiskStorage implements Storage -{ - private static final Logger logger = LoggerFactory.getLogger(DiskStorage.class); - - private static final String MAIN_FILE_CACHE_DAT = "main_file_cache.dat2"; - private static final String MAIN_FILE_CACHE_IDX = "main_file_cache.idx"; - - private final File folder; - - private final DataFile data; - private final IndexFile index255; - private final List indexFiles = new ArrayList<>(); - - public DiskStorage(File folder) throws IOException - { - this.folder = folder; - - this.data = new DataFile(new File(folder, MAIN_FILE_CACHE_DAT)); - this.index255 = new IndexFile(255, new File(folder, MAIN_FILE_CACHE_IDX + "255")); - } - - @Override - public void init(Store store) throws IOException - { - for (int i = 0; i < index255.getIndexCount(); ++i) - { - store.addIndex(i); - getIndex(i); - } - - assert store.getIndexes().size() == indexFiles.size(); - } - - @Override - public void close() throws IOException - { - data.close(); - index255.close(); - for (IndexFile indexFile : indexFiles) - { - indexFile.close(); - } - } - - private IndexFile getIndex(int i) throws FileNotFoundException - { - for (IndexFile indexFile : indexFiles) - { - if (indexFile.getIndexFileId() == i) - { - return indexFile; - } - } - - IndexFile indexFile = new IndexFile(i, new File(folder, MAIN_FILE_CACHE_IDX + i)); - indexFiles.add(indexFile); - return indexFile; - } - - @Override - public void load(Store store) throws IOException - { - for (Index index : store.getIndexes()) - { - loadIndex(index); - } - } - - public byte[] readIndex(int indexId) throws IOException - { - IndexEntry entry = index255.read(indexId); - byte[] indexData = data.read(index255.getIndexFileId(), entry.getId(), entry.getSector(), entry.getLength()); - return indexData; - } - - private void loadIndex(Index index) throws IOException - { - logger.trace("Loading index {}", index.getId()); - - byte[] indexData = readIndex(index.getId()); - Container res = Container.decompress(indexData, null); - byte[] data = res.data; - - IndexData id = new IndexData(); - id.load(data); - - index.setProtocol(id.getProtocol()); - index.setRevision(id.getRevision()); - index.setNamed(id.isNamed()); - - for (ArchiveData ad : id.getArchives()) - { - Archive archive = index.addArchive(ad.getId()); - archive.setNameHash(ad.getNameHash()); - archive.setCrc(ad.getCrc()); - archive.setRevision(ad.getRevision()); - archive.setFileData(ad.getFiles()); - - assert ad.getFiles().length > 0; - } - - index.setCrc(res.crc); - index.setCompression(res.compression); - assert res.revision == -1; - } - - @Override - public byte[] loadArchive(Archive archive) throws IOException - { - Index index = archive.getIndex(); - IndexFile indexFile = getIndex(index.getId()); - - assert indexFile.getIndexFileId() == index.getId(); - - IndexEntry entry = indexFile.read(archive.getArchiveId()); - if (entry == null) - { - logger.debug("can't read archive " + archive.getArchiveId() + " from index " + index.getId()); - return null; - } - - assert entry.getId() == archive.getArchiveId(); - - logger.trace("Loading archive {} for index {} from sector {} length {}", - archive.getArchiveId(), index.getId(), entry.getSector(), entry.getLength()); - - byte[] archiveData = data.read(index.getId(), entry.getId(), entry.getSector(), entry.getLength()); - return archiveData; - } - - @Override - public void save(Store store) throws IOException - { - logger.debug("Saving store"); - - for (Index i : store.getIndexes()) - { - saveIndex(i); - } - } - - private void saveIndex(Index index) throws IOException - { - IndexData indexData = index.toIndexData(); - byte[] data = indexData.writeIndexData(); - - Container container = new Container(index.getCompression(), -1); // index data revision is always -1 - container.compress(data, null); - byte[] compressedData = container.data; - DataFileWriteResult res = this.data.write(index255.getIndexFileId(), index.getId(), compressedData); - - index255.write(new IndexEntry(index255, index.getId(), res.sector, res.compressedLength)); - - Crc32 crc = new Crc32(); - crc.update(compressedData, 0, compressedData.length); - index.setCrc(crc.getHash()); - } - - @Override - public void saveArchive(Archive a, byte[] archiveData) throws IOException - { - Index index = a.getIndex(); - IndexFile indexFile = getIndex(index.getId()); - assert indexFile.getIndexFileId() == index.getId(); - - DataFileWriteResult res = data.write(index.getId(), a.getArchiveId(), archiveData); - indexFile.write(new IndexEntry(indexFile, a.getArchiveId(), res.sector, res.compressedLength)); - - byte compression = archiveData[0]; - int compressedSize = Ints.fromBytes(archiveData[1], archiveData[2], - archiveData[3], archiveData[4]); - - // don't crc the appended revision, if it is there - int length = 1 // compression type - + 4 // compressed size - + compressedSize - + (compression != CompressionType.NONE ? 4 : 0); - - Crc32 crc = new Crc32(); - crc.update(archiveData, 0, length); - a.setCrc(crc.getHash()); - - logger.trace("Saved archive {}/{} at sector {}, compressed length {}", - index.getId(), a.getArchiveId(), res.sector, res.compressedLength); - } -} diff --git a/cache/src/main/java/net/runelite/cache/fs/jagex/IndexFile.java b/cache/src/main/java/net/runelite/cache/fs/jagex/IndexFile.java deleted file mode 100644 index b95ae70e30..0000000000 --- a/cache/src/main/java/net/runelite/cache/fs/jagex/IndexFile.java +++ /dev/null @@ -1,138 +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.cache.fs.jagex; - -import java.io.Closeable; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.RandomAccessFile; -import java.util.Objects; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class IndexFile implements Closeable -{ - private static final Logger logger = LoggerFactory.getLogger(IndexFile.class); - - private static final int INDEX_ENTRY_LEN = 6; - - private final int indexFileId; - private final File file; - private final RandomAccessFile idx; - private final byte[] buffer = new byte[INDEX_ENTRY_LEN]; - - public IndexFile(int indexFileId, File file) throws FileNotFoundException - { - this.indexFileId = indexFileId; - this.file = file; - this.idx = new RandomAccessFile(file, "rw"); - } - - @Override - public void close() throws IOException - { - idx.close(); - } - - public void clear() throws IOException - { - idx.setLength(0L); - } - - @Override - public int hashCode() - { - int hash = 3; - hash = 41 * hash + Objects.hashCode(this.file); - return hash; - } - - @Override - public boolean equals(Object obj) - { - if (obj == null) - { - return false; - } - if (getClass() != obj.getClass()) - { - return false; - } - final IndexFile other = (IndexFile) obj; - if (!Objects.equals(this.file, other.file)) - { - return false; - } - return true; - } - - public int getIndexFileId() - { - return indexFileId; - } - - public synchronized void write(IndexEntry entry) throws IOException - { - idx.seek(entry.getId() * INDEX_ENTRY_LEN); - - buffer[0] = (byte) (entry.getLength() >> 16); - buffer[1] = (byte) (entry.getLength() >> 8); - buffer[2] = (byte) entry.getLength(); - - buffer[3] = (byte) (entry.getSector() >> 16); - buffer[4] = (byte) (entry.getSector() >> 8); - buffer[5] = (byte) entry.getSector(); - - idx.write(buffer); - } - - public synchronized IndexEntry read(int id) throws IOException - { - idx.seek(id * INDEX_ENTRY_LEN); - int i = idx.read(buffer); - if (i != INDEX_ENTRY_LEN) - { - logger.debug("short read for id {} on index {}: {}", id, indexFileId, i); - return null; - } - - int length = ((buffer[0] & 0xFF) << 16) | ((buffer[1] & 0xFF) << 8) | (buffer[2] & 0xFF); - int sector = ((buffer[3] & 0xFF) << 16) | ((buffer[4] & 0xFF) << 8) | (buffer[5] & 0xFF); - - if (length <= 0 || sector <= 0) - { - logger.debug("invalid length or sector {}/{}", length, sector); - return null; - } - - return new IndexEntry(this, id, sector, length); - } - - public synchronized int getIndexCount() throws IOException - { - return (int) (idx.length() / INDEX_ENTRY_LEN); - } -} diff --git a/cache/src/main/java/net/runelite/cache/index/IndexData.java b/cache/src/main/java/net/runelite/cache/index/IndexData.java deleted file mode 100644 index 38747bd450..0000000000 --- a/cache/src/main/java/net/runelite/cache/index/IndexData.java +++ /dev/null @@ -1,298 +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.cache.index; - -import net.runelite.cache.io.InputStream; -import net.runelite.cache.io.OutputStream; - -public class IndexData -{ - private int protocol; - private int revision; - private boolean named; - private ArchiveData[] archives; - - public void load(byte[] data) - { - InputStream stream = new InputStream(data); - protocol = stream.readUnsignedByte(); - if (protocol < 5 || protocol > 7) - { - throw new IllegalArgumentException("Unsupported protocol"); - } - - if (protocol >= 6) - { - this.revision = stream.readInt(); - } - - int hash = stream.readUnsignedByte(); - named = (1 & hash) != 0; - if ((hash & ~1) != 0) - { - throw new IllegalArgumentException("Unknown flags"); - } - assert (hash & ~3) == 0; - int validArchivesCount = protocol >= 7 ? stream.readBigSmart() : stream.readUnsignedShort(); - int lastArchiveId = 0; - - archives = new ArchiveData[validArchivesCount]; - - for (int index = 0; index < validArchivesCount; ++index) - { - int archive = lastArchiveId += protocol >= 7 ? stream.readBigSmart() : stream.readUnsignedShort(); - - ArchiveData ad = new ArchiveData(); - ad.id = archive; - archives[index] = ad; - } - - if (named) - { - for (int index = 0; index < validArchivesCount; ++index) - { - int nameHash = stream.readInt(); - ArchiveData ad = archives[index]; - ad.nameHash = nameHash; - } - } - - for (int index = 0; index < validArchivesCount; ++index) - { - int crc = stream.readInt(); - - ArchiveData ad = archives[index]; - ad.crc = crc; - } - - for (int index = 0; index < validArchivesCount; ++index) - { - int revision = stream.readInt(); - - ArchiveData ad = archives[index]; - ad.revision = revision; - } - - int[] numberOfFiles = new int[validArchivesCount]; - for (int index = 0; index < validArchivesCount; ++index) - { - int num = protocol >= 7 ? stream.readBigSmart() : stream.readUnsignedShort(); - numberOfFiles[index] = num; - } - - for (int index = 0; index < validArchivesCount; ++index) - { - ArchiveData ad = archives[index]; - int num = numberOfFiles[index]; - - ad.files = new FileData[num]; - - int last = 0; - for (int i = 0; i < num; ++i) - { - int fileId = last += protocol >= 7 ? stream.readBigSmart() : stream.readUnsignedShort(); - - FileData fd = ad.files[i] = new FileData(); - fd.id = fileId; - } - } - - if (named) - { - for (int index = 0; index < validArchivesCount; ++index) - { - ArchiveData ad = archives[index]; - int num = numberOfFiles[index]; - - for (int i = 0; i < num; ++i) - { - FileData fd = ad.files[i]; - int name = stream.readInt(); - fd.nameHash = name; - } - } - } - } - - public byte[] writeIndexData() - { - OutputStream stream = new OutputStream(); - stream.writeByte(protocol); - if (protocol >= 6) - { - stream.writeInt(this.revision); - } - - stream.writeByte(named ? 1 : 0); - if (protocol >= 7) - { - stream.writeBigSmart(this.archives.length); - } - else - { - stream.writeShort(this.archives.length); - } - - for (int i = 0; i < this.archives.length; ++i) - { - ArchiveData a = this.archives[i]; - int archive = a.getId(); - - if (i != 0) - { - ArchiveData prev = this.archives[i - 1]; - archive -= prev.getId(); - } - - if (protocol >= 7) - { - stream.writeBigSmart(archive); - } - else - { - stream.writeShort(archive); - } - } - - if (named) - { - for (int i = 0; i < this.archives.length; ++i) - { - ArchiveData a = this.archives[i]; - stream.writeInt(a.getNameHash()); - } - } - - for (int i = 0; i < this.archives.length; ++i) - { - ArchiveData a = this.archives[i]; - stream.writeInt(a.getCrc()); - } - - for (int i = 0; i < this.archives.length; ++i) - { - ArchiveData a = this.archives[i]; - stream.writeInt(a.getRevision()); - } - - for (int i = 0; i < this.archives.length; ++i) - { - ArchiveData a = this.archives[i]; - - int len = a.getFiles().length; - - if (protocol >= 7) - { - stream.writeBigSmart(len); - } - else - { - stream.writeShort(len); - } - } - - for (int i = 0; i < this.archives.length; ++i) - { - ArchiveData a = this.archives[i]; - - for (int j = 0; j < a.getFiles().length; ++j) - { - FileData file = a.getFiles()[j]; - int offset = file.getId(); - - if (j != 0) - { - FileData prev = a.getFiles()[j - 1]; - offset -= prev.getId(); - } - - if (protocol >= 7) - { - stream.writeBigSmart(offset); - } - else - { - stream.writeShort(offset); - } - } - } - - if (named) - { - for (int i = 0; i < this.archives.length; ++i) - { - ArchiveData a = this.archives[i]; - - for (int j = 0; j < a.getFiles().length; ++j) - { - FileData file = a.getFiles()[j]; - stream.writeInt(file.getNameHash()); - } - } - } - - return stream.flip(); - } - - public int getProtocol() - { - return protocol; - } - - public void setProtocol(int protocol) - { - this.protocol = protocol; - } - - public int getRevision() - { - return revision; - } - - public void setRevision(int revision) - { - this.revision = revision; - } - - public boolean isNamed() - { - return named; - } - - public void setNamed(boolean named) - { - this.named = named; - } - - public ArchiveData[] getArchives() - { - return archives; - } - - public void setArchives(ArchiveData[] archives) - { - this.archives = archives; - } -} diff --git a/cache/src/main/java/net/runelite/cache/io/InputStream.java b/cache/src/main/java/net/runelite/cache/io/InputStream.java deleted file mode 100644 index 1fde0d97a3..0000000000 --- a/cache/src/main/java/net/runelite/cache/io/InputStream.java +++ /dev/null @@ -1,241 +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.cache.io; - -import java.io.IOException; -import java.nio.ByteBuffer; - -public class InputStream extends java.io.InputStream -{ - private static final char[] CHARACTERS = new char[] - { - '\u20ac', '\u0000', '\u201a', '\u0192', '\u201e', '\u2026', - '\u2020', '\u2021', '\u02c6', '\u2030', '\u0160', '\u2039', - '\u0152', '\u0000', '\u017d', '\u0000', '\u0000', '\u2018', - '\u2019', '\u201c', '\u201d', '\u2022', '\u2013', '\u2014', - '\u02dc', '\u2122', '\u0161', '\u203a', '\u0153', '\u0000', - '\u017e', '\u0178' - }; - - private final ByteBuffer buffer; - - public InputStream(byte[] buffer) - { - this.buffer = ByteBuffer.wrap(buffer); - } - - public byte[] getArray() - { - assert buffer.hasArray(); - return buffer.array(); - } - - @Override - public String toString() - { - return "InputStream{" + "buffer=" + buffer + '}'; - } - - public int read24BitInt() - { - return (this.readUnsignedByte() << 16) + (this.readUnsignedByte() << 8) + this.readUnsignedByte(); - } - - public void skip(int length) - { - int pos = buffer.position(); - pos += length; - buffer.position(pos); - } - - public void setOffset(int offset) - { - buffer.position(offset); - } - - public int getOffset() - { - return buffer.position(); - } - - public int getLength() - { - return buffer.limit(); - } - - public int remaining() - { - return buffer.remaining(); - } - - public byte readByte() - { - return buffer.get(); - } - - public void readBytes(byte[] buffer, int off, int len) - { - this.buffer.get(buffer, off, len); - } - - public void readBytes(byte[] buffer) - { - this.buffer.get(buffer); - } - - public int readUnsignedByte() - { - return this.readByte() & 0xFF; - } - - public int readUnsignedShort() - { - return buffer.getShort() & 0xFFFF; - } - - public short readShort() - { - return buffer.getShort(); - } - - public int readInt() - { - return buffer.getInt(); - } - - public byte peek() - { - return buffer.get(buffer.position()); - } - - public int readBigSmart() - { - return peek() >= 0 ? (this.readUnsignedShort() & 0xFFFF) : (this.readInt() & Integer.MAX_VALUE); - } - - public int readBigSmart2() - { - if (peek() < 0) - { - return readInt() & Integer.MAX_VALUE; // and off sign bit - } - int value = readUnsignedShort(); - return value == 32767 ? -1 : value; - } - - public int readShortSmart() - { - int peek = this.peek() & 0xFF; - return peek < 128 ? this.readUnsignedByte() - 64 : this.readUnsignedShort() - 0xc000; - } - - public int readUnsignedShortSmart() - { - int peek = this.peek() & 0xFF; - return peek < 128 ? this.readUnsignedByte() : this.readUnsignedShort() - 0x8000; - } - - public int readUnsignedIntSmartShortCompat() - { - int var1 = 0; - - int var2; - for (var2 = this.readUnsignedShortSmart(); var2 == 32767; var2 = this.readUnsignedShortSmart()) - { - var1 += 32767; - } - - var1 += var2; - return var1; - } - - public String readString() - { - StringBuilder sb = new StringBuilder(); - - for (; ; ) - { - int ch = this.readUnsignedByte(); - - if (ch == 0) - { - break; - } - - if (ch >= 128 && ch < 160) - { - char var7 = CHARACTERS[ch - 128]; - if (0 == var7) - { - var7 = '?'; - } - - ch = var7; - } - - sb.append((char) ch); - } - return sb.toString(); - } - - public String readStringOrNull() - { - if (this.peek() != 0) - { - return readString(); - } - else - { - this.readByte(); // discard - return null; - } - } - - public int readVarInt() - { - byte var1 = this.readByte(); - - int var2; - for (var2 = 0; var1 < 0; var1 = this.readByte()) - { - var2 = (var2 | var1 & 127) << 7; - } - - return var2 | var1; - } - - public byte[] getRemaining() - { - byte[] b = new byte[buffer.remaining()]; - buffer.get(b); - return b; - } - - @Override - public int read() throws IOException - { - return this.readUnsignedByte(); - } -} diff --git a/cache/src/main/java/net/runelite/cache/io/OutputStream.java b/cache/src/main/java/net/runelite/cache/io/OutputStream.java deleted file mode 100644 index 751905f4fb..0000000000 --- a/cache/src/main/java/net/runelite/cache/io/OutputStream.java +++ /dev/null @@ -1,211 +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.cache.io; - -import com.google.common.base.Preconditions; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.nio.ByteBuffer; - -public final class OutputStream extends java.io.OutputStream -{ - private ByteBuffer buffer; - - public OutputStream(int capacity) - { - buffer = ByteBuffer.allocate(capacity); - } - - public OutputStream() - { - this(16); - } - - public byte[] getArray() - { - assert buffer.hasArray(); - return buffer.array(); - } - - private void ensureRemaining(int remaining) - { - while (remaining > buffer.remaining()) - { - int newCapacity = buffer.capacity() * 2; - - ByteBuffer old = buffer; - old.flip(); - - buffer = ByteBuffer.allocate(newCapacity); - - buffer.put(old); - } - } - - public void skip(int length) - { - int pos = buffer.position(); - pos += length; - buffer.position(pos); - } - - public int getOffset() - { - return buffer.position(); - } - - public void setOffset(int offset) - { - buffer.position(offset); - } - - public void writeBytes(byte[] b) - { - writeBytes(b, 0, b.length); - } - - public void writeBytes(byte[] b, int offset, int length) - { - ensureRemaining(length); - buffer.put(b, offset, length); - } - - public void writeByte(int i) - { - ensureRemaining(1); - buffer.put((byte) i); - } - - public void writeBigSmart(int value) - { - Preconditions.checkArgument(value >= 0); - if (value >= 32768) - { - ensureRemaining(4); - this.writeInt((1 << 31) | value); - } - else - { - ensureRemaining(2); - this.writeShort(value); - } - } - - public void writeShort(int i) - { - ensureRemaining(2); - buffer.putShort((short) i); - } - - public void writeShortSmart(int value) - { - Preconditions.checkArgument(value >= 0); - if (value < 128) - { - writeByte(value); - } - else - { - writeShort(0x8000 | value); - } - } - - public void write24BitInt(int i) - { - ensureRemaining(3); - buffer.put((byte) (i >>> 16)); - buffer.put((byte) (i >>> 8)); - buffer.put((byte) (i & 0xFF)); - } - - public void writeInt(int i) - { - ensureRemaining(4); - buffer.putInt(i); - } - - public void writeVarInt(int var1) - { - if ((var1 & -128) != 0) - { - if ((var1 & -16384) != 0) - { - if ((var1 & -2097152) != 0) - { - if ((var1 & -268435456) != 0) - { - this.writeByte(var1 >>> 28 | 128); - } - - this.writeByte(var1 >>> 21 | 128); - } - - this.writeByte(var1 >>> 14 | 128); - } - - this.writeByte(var1 >>> 7 | 128); - } - - this.writeByte(var1 & 127); - } - - public void writeLengthFromMark(int var1) - { - this.getArray()[this.getOffset() - var1 - 4] = (byte) (var1 >> 24); - this.getArray()[this.getOffset() - var1 - 3] = (byte) (var1 >> 16); - this.getArray()[this.getOffset() - var1 - 2] = (byte) (var1 >> 8); - this.getArray()[this.getOffset() - var1 - 1] = (byte) var1; - } - - public void writeString(String str) - { - byte[] b; - try - { - b = str.getBytes("ISO-8859-1"); - } - catch (UnsupportedEncodingException ex) - { - throw new RuntimeException(ex); - } - writeBytes(b); - writeByte(0); - } - - public byte[] flip() - { - buffer.flip(); - byte[] b = new byte[buffer.limit()]; - buffer.get(b); - return b; - } - - @Override - public void write(int b) throws IOException - { - buffer.put((byte) b); - } - -} diff --git a/cache/src/main/java/net/runelite/cache/item/ColorPalette.java b/cache/src/main/java/net/runelite/cache/item/ColorPalette.java deleted file mode 100644 index 6486afe2fb..0000000000 --- a/cache/src/main/java/net/runelite/cache/item/ColorPalette.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - * 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.item; - -import lombok.Getter; - -public class ColorPalette -{ - @Getter - private final int[] colorPalette; - - public ColorPalette(double brightness, int var2, int var3) - { - colorPalette = buildColorPalettee(brightness, var2, var3); - } - - private int[] buildColorPalettee(double brightness, int var2, int var3) - { - int[] colorPalette = new int[65536]; - int var4 = var2 * 128; - - for (int var5 = var2; var5 < var3; ++var5) - { - double var6 = (double) (var5 >> 3) / 64.0D + 0.0078125D; - double var8 = (double) (var5 & 7) / 8.0D + 0.0625D; - - for (int var10 = 0; var10 < 128; ++var10) - { - double var11 = (double) var10 / 128.0D; - double var13 = var11; - double var15 = var11; - double var17 = var11; - if (var8 != 0.0D) - { - double var19; - if (var11 < 0.5D) - { - var19 = var11 * (1.0D + var8); - } - else - { - var19 = var11 + var8 - var11 * var8; - } - - double var21 = 2.0D * var11 - var19; - double var23 = var6 + 0.3333333333333333D; - if (var23 > 1.0D) - { - --var23; - } - - double var27 = var6 - 0.3333333333333333D; - if (var27 < 0.0D) - { - ++var27; - } - - if (6.0D * var23 < 1.0D) - { - var13 = var21 + (var19 - var21) * 6.0D * var23; - } - else if (2.0D * var23 < 1.0D) - { - var13 = var19; - } - else if (3.0D * var23 < 2.0D) - { - var13 = var21 + (var19 - var21) * (0.6666666666666666D - var23) * 6.0D; - } - else - { - var13 = var21; - } - - if (6.0D * var6 < 1.0D) - { - var15 = var21 + (var19 - var21) * 6.0D * var6; - } - else if (2.0D * var6 < 1.0D) - { - var15 = var19; - } - else if (3.0D * var6 < 2.0D) - { - var15 = var21 + (var19 - var21) * (0.6666666666666666D - var6) * 6.0D; - } - else - { - var15 = var21; - } - - if (6.0D * var27 < 1.0D) - { - var17 = var21 + (var19 - var21) * 6.0D * var27; - } - else if (2.0D * var27 < 1.0D) - { - var17 = var19; - } - else if (3.0D * var27 < 2.0D) - { - var17 = var21 + (var19 - var21) * (0.6666666666666666D - var27) * 6.0D; - } - else - { - var17 = var21; - } - } - - int var29 = (int) (var13 * 256.0D); - int var20 = (int) (var15 * 256.0D); - int var30 = (int) (var17 * 256.0D); - int var22 = var30 + (var20 << 8) + (var29 << 16); - var22 = adjustRGB(var22, brightness); - if (var22 == 0) - { - var22 = 1; - } - - colorPalette[var4++] = var22; - } - } - return colorPalette; - } - - private static int adjustRGB(int var0, double var1) - { - double var3 = (double) (var0 >> 16) / 256.0D; - double var5 = (double) (var0 >> 8 & 255) / 256.0D; - double var7 = (double) (var0 & 255) / 256.0D; - var3 = Math.pow(var3, var1); - var5 = Math.pow(var5, var1); - var7 = Math.pow(var7, var1); - int var9 = (int) (var3 * 256.0D); - int var10 = (int) (var5 * 256.0D); - int var11 = (int) (var7 * 256.0D); - return var11 + (var10 << 8) + (var9 << 16); - } -} diff --git a/cache/src/main/java/net/runelite/cache/item/Graphics3D.java b/cache/src/main/java/net/runelite/cache/item/Graphics3D.java deleted file mode 100644 index 248ab6c572..0000000000 --- a/cache/src/main/java/net/runelite/cache/item/Graphics3D.java +++ /dev/null @@ -1,2818 +0,0 @@ -/* - * 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.item; - -class Graphics3D extends Rasterizer2D -{ - private static final double UNIT = Math.PI / 1024d; // How much of the circle each unit of SINE/COSINE is - - public static final int[] SINE = new int[2048]; // sine angles for each of the 2048 units, * 65536 and stored as an int - public static final int[] COSINE = new int[2048]; // cosine - - private static int[] field1932 = new int[512]; - static int[] field1933 = new int[2048]; - - static - { - for (int i = 0; i < 2048; ++i) - { - SINE[i] = (int) (65536.0D * Math.sin((double) i * UNIT)); - COSINE[i] = (int) (65536.0D * Math.cos((double) i * UNIT)); - } - - int var0; - for (var0 = 1; var0 < 512; ++var0) - { - field1932[var0] = 32768 / var0; - } - - for (var0 = 1; var0 < 2048; ++var0) - { - field1933[var0] = 65536 / var0; - } - } - - private final RSTextureProvider textureProvider; - boolean rasterClipEnable; - boolean field1909; - boolean lowMem; - public boolean rasterGouraudLowRes = true; - int rasterAlpha; - public int Rasterizer3D_zoom = 512; - int centerX; - int centerY; - int rasterClipX; - int Rasterizer3D_clipHeight; - int Rasterizer3D_clipNegativeMidX; - int Rasterizer3D_clipMidX2; - int Rasterizer3D_clipNegativeMidY; - int Rasterizer3D_clipMidY2; - int[] rasterClipY = new int[1024]; - public int[] colorPalette; - - public Graphics3D(RSTextureProvider textureProvider) - { - this.textureProvider = textureProvider; - } - - public final void setRasterClipping() - { - setRasterClipping(draw_region_x, drawingAreaTop, drawingAreaRight, drawingAreaBottom); - } - - final void setRasterClipping(int var0, int var1, int var2, int var3) - { - rasterClipX = var2 - var0; - Rasterizer3D_clipHeight = var3 - var1; - Rasterizer3D_method3(); - - if (rasterClipY.length < Rasterizer3D_clipHeight) - { - // Find closest 2^n >= v - int v = Rasterizer3D_clipHeight - 1; - v |= v >>> 1; - v |= v >>> 2; - v |= v >>> 4; - v |= v >>> 8; - v |= v >>> 16; - rasterClipY = new int[v + 1]; - } - - int var4 = var0 + graphicsPixelsWidth * var1; - for (int i = 0; i < Rasterizer3D_clipHeight; ++i) - { - rasterClipY[i] = var4; - var4 += graphicsPixelsWidth; - } - - } - - public final void Rasterizer3D_method3() - { - centerX = rasterClipX / 2; - centerY = Rasterizer3D_clipHeight / 2; - Rasterizer3D_clipNegativeMidX = -centerX; - Rasterizer3D_clipMidX2 = rasterClipX - centerX; - Rasterizer3D_clipNegativeMidY = -centerY; - Rasterizer3D_clipMidY2 = Rasterizer3D_clipHeight - centerY; - } - - public final void setOffset(int x, int y) - { - int var2 = rasterClipY[0]; - int var3 = var2 / graphicsPixelsWidth; - int var4 = var2 - var3 * graphicsPixelsWidth; - centerX = x - var4; - centerY = y - var3; - Rasterizer3D_clipNegativeMidX = -centerX; - Rasterizer3D_clipMidX2 = rasterClipX - centerX; - Rasterizer3D_clipNegativeMidY = -centerY; - Rasterizer3D_clipMidY2 = Rasterizer3D_clipHeight - centerY; - } - - public final void setBrightness(double var0) - { - colorPalette = new ColorPalette(var0, 0, 512).getColorPalette(); - } - - final void rasterGouraud(int var0, int var1, int var2, int var3, int var4, int var5, int var6, int var7, int var8) - { - int var9 = var4 - var3; - int var10 = var1 - var0; - int var11 = var5 - var3; - int var12 = var2 - var0; - int var13 = var7 - var6; - int var14 = var8 - var6; - int var15; - if (var2 != var1) - { - var15 = (var5 - var4 << 14) / (var2 - var1); - } - else - { - var15 = 0; - } - - int var16; - if (var0 != var1) - { - var16 = (var9 << 14) / var10; - } - else - { - var16 = 0; - } - - int var17; - if (var0 != var2) - { - var17 = (var11 << 14) / var12; - } - else - { - var17 = 0; - } - - int var18 = var9 * var12 - var11 * var10; - if (var18 != 0) - { - int var19 = (var13 * var12 - var14 * var10 << 8) / var18; - int var20 = (var14 * var9 - var13 * var11 << 8) / var18; - if (var0 <= var1 && var0 <= var2) - { - if (var0 < Rasterizer3D_clipHeight) - { - if (var1 > Rasterizer3D_clipHeight) - { - var1 = Rasterizer3D_clipHeight; - } - - if (var2 > Rasterizer3D_clipHeight) - { - var2 = Rasterizer3D_clipHeight; - } - - var6 = var19 + ((var6 << 8) - var3 * var19); - if (var1 < var2) - { - var5 = var3 <<= 14; - if (var0 < 0) - { - var5 -= var0 * var17; - var3 -= var0 * var16; - var6 -= var0 * var20; - var0 = 0; - } - - var4 <<= 14; - if (var1 < 0) - { - var4 -= var15 * var1; - var1 = 0; - } - - if (var0 != var1 && var17 < var16 || var0 == var1 && var17 > var15) - { - var2 -= var1; - var1 -= var0; - var0 = rasterClipY[var0]; - - while (true) - { - --var1; - if (var1 < 0) - { - while (true) - { - --var2; - if (var2 < 0) - { - return; - } - - method2778(graphicsPixels, var0, 0, 0, var5 >> 14, var4 >> 14, var6, var19); - var5 += var17; - var4 += var15; - var6 += var20; - var0 += graphicsPixelsWidth; - } - } - - method2778(graphicsPixels, var0, 0, 0, var5 >> 14, var3 >> 14, var6, var19); - var5 += var17; - var3 += var16; - var6 += var20; - var0 += graphicsPixelsWidth; - } - } - else - { - var2 -= var1; - var1 -= var0; - var0 = rasterClipY[var0]; - - while (true) - { - --var1; - if (var1 < 0) - { - while (true) - { - --var2; - if (var2 < 0) - { - return; - } - - method2778(graphicsPixels, var0, 0, 0, var4 >> 14, var5 >> 14, var6, var19); - var5 += var17; - var4 += var15; - var6 += var20; - var0 += graphicsPixelsWidth; - } - } - - method2778(graphicsPixels, var0, 0, 0, var3 >> 14, var5 >> 14, var6, var19); - var5 += var17; - var3 += var16; - var6 += var20; - var0 += graphicsPixelsWidth; - } - } - } - else - { - var4 = var3 <<= 14; - if (var0 < 0) - { - var4 -= var0 * var17; - var3 -= var0 * var16; - var6 -= var0 * var20; - var0 = 0; - } - - var5 <<= 14; - if (var2 < 0) - { - var5 -= var15 * var2; - var2 = 0; - } - - if (var0 != var2 && var17 < var16 || var0 == var2 && var15 > var16) - { - var1 -= var2; - var2 -= var0; - var0 = rasterClipY[var0]; - - while (true) - { - --var2; - if (var2 < 0) - { - while (true) - { - --var1; - if (var1 < 0) - { - return; - } - - method2778(graphicsPixels, var0, 0, 0, var5 >> 14, var3 >> 14, var6, var19); - var5 += var15; - var3 += var16; - var6 += var20; - var0 += graphicsPixelsWidth; - } - } - - method2778(graphicsPixels, var0, 0, 0, var4 >> 14, var3 >> 14, var6, var19); - var4 += var17; - var3 += var16; - var6 += var20; - var0 += graphicsPixelsWidth; - } - } - else - { - var1 -= var2; - var2 -= var0; - var0 = rasterClipY[var0]; - - while (true) - { - --var2; - if (var2 < 0) - { - while (true) - { - --var1; - if (var1 < 0) - { - return; - } - - method2778(graphicsPixels, var0, 0, 0, var3 >> 14, var5 >> 14, var6, var19); - var5 += var15; - var3 += var16; - var6 += var20; - var0 += graphicsPixelsWidth; - } - } - - method2778(graphicsPixels, var0, 0, 0, var3 >> 14, var4 >> 14, var6, var19); - var4 += var17; - var3 += var16; - var6 += var20; - var0 += graphicsPixelsWidth; - } - } - } - } - } - else if (var1 <= var2) - { - if (var1 < Rasterizer3D_clipHeight) - { - if (var2 > Rasterizer3D_clipHeight) - { - var2 = Rasterizer3D_clipHeight; - } - - if (var0 > Rasterizer3D_clipHeight) - { - var0 = Rasterizer3D_clipHeight; - } - - var7 = var19 + ((var7 << 8) - var19 * var4); - if (var2 < var0) - { - var3 = var4 <<= 14; - if (var1 < 0) - { - var3 -= var16 * var1; - var4 -= var15 * var1; - var7 -= var20 * var1; - var1 = 0; - } - - var5 <<= 14; - if (var2 < 0) - { - var5 -= var17 * var2; - var2 = 0; - } - - if (var2 != var1 && var16 < var15 || var2 == var1 && var16 > var17) - { - var0 -= var2; - var2 -= var1; - var1 = rasterClipY[var1]; - - while (true) - { - --var2; - if (var2 < 0) - { - while (true) - { - --var0; - if (var0 < 0) - { - return; - } - - method2778(graphicsPixels, var1, 0, 0, var3 >> 14, var5 >> 14, var7, var19); - var3 += var16; - var5 += var17; - var7 += var20; - var1 += graphicsPixelsWidth; - } - } - - method2778(graphicsPixels, var1, 0, 0, var3 >> 14, var4 >> 14, var7, var19); - var3 += var16; - var4 += var15; - var7 += var20; - var1 += graphicsPixelsWidth; - } - } - else - { - var0 -= var2; - var2 -= var1; - var1 = rasterClipY[var1]; - - while (true) - { - --var2; - if (var2 < 0) - { - while (true) - { - --var0; - if (var0 < 0) - { - return; - } - - method2778(graphicsPixels, var1, 0, 0, var5 >> 14, var3 >> 14, var7, var19); - var3 += var16; - var5 += var17; - var7 += var20; - var1 += graphicsPixelsWidth; - } - } - - method2778(graphicsPixels, var1, 0, 0, var4 >> 14, var3 >> 14, var7, var19); - var3 += var16; - var4 += var15; - var7 += var20; - var1 += graphicsPixelsWidth; - } - } - } - else - { - var5 = var4 <<= 14; - if (var1 < 0) - { - var5 -= var16 * var1; - var4 -= var15 * var1; - var7 -= var20 * var1; - var1 = 0; - } - - var3 <<= 14; - if (var0 < 0) - { - var3 -= var0 * var17; - var0 = 0; - } - - if (var16 < var15) - { - var2 -= var0; - var0 -= var1; - var1 = rasterClipY[var1]; - - while (true) - { - --var0; - if (var0 < 0) - { - while (true) - { - --var2; - if (var2 < 0) - { - return; - } - - method2778(graphicsPixels, var1, 0, 0, var3 >> 14, var4 >> 14, var7, var19); - var3 += var17; - var4 += var15; - var7 += var20; - var1 += graphicsPixelsWidth; - } - } - - method2778(graphicsPixels, var1, 0, 0, var5 >> 14, var4 >> 14, var7, var19); - var5 += var16; - var4 += var15; - var7 += var20; - var1 += graphicsPixelsWidth; - } - } - else - { - var2 -= var0; - var0 -= var1; - var1 = rasterClipY[var1]; - - while (true) - { - --var0; - if (var0 < 0) - { - while (true) - { - --var2; - if (var2 < 0) - { - return; - } - - method2778(graphicsPixels, var1, 0, 0, var4 >> 14, var3 >> 14, var7, var19); - var3 += var17; - var4 += var15; - var7 += var20; - var1 += graphicsPixelsWidth; - } - } - - method2778(graphicsPixels, var1, 0, 0, var4 >> 14, var5 >> 14, var7, var19); - var5 += var16; - var4 += var15; - var7 += var20; - var1 += graphicsPixelsWidth; - } - } - } - } - } - else if (var2 < Rasterizer3D_clipHeight) - { - if (var0 > Rasterizer3D_clipHeight) - { - var0 = Rasterizer3D_clipHeight; - } - - if (var1 > Rasterizer3D_clipHeight) - { - var1 = Rasterizer3D_clipHeight; - } - - var8 = var19 + ((var8 << 8) - var5 * var19); - if (var0 < var1) - { - var4 = var5 <<= 14; - if (var2 < 0) - { - var4 -= var15 * var2; - var5 -= var17 * var2; - var8 -= var20 * var2; - var2 = 0; - } - - var3 <<= 14; - if (var0 < 0) - { - var3 -= var0 * var16; - var0 = 0; - } - - if (var15 < var17) - { - var1 -= var0; - var0 -= var2; - var2 = rasterClipY[var2]; - - while (true) - { - --var0; - if (var0 < 0) - { - while (true) - { - --var1; - if (var1 < 0) - { - return; - } - - method2778(graphicsPixels, var2, 0, 0, var4 >> 14, var3 >> 14, var8, var19); - var4 += var15; - var3 += var16; - var8 += var20; - var2 += graphicsPixelsWidth; - } - } - - method2778(graphicsPixels, var2, 0, 0, var4 >> 14, var5 >> 14, var8, var19); - var4 += var15; - var5 += var17; - var8 += var20; - var2 += graphicsPixelsWidth; - } - } - else - { - var1 -= var0; - var0 -= var2; - var2 = rasterClipY[var2]; - - while (true) - { - --var0; - if (var0 < 0) - { - while (true) - { - --var1; - if (var1 < 0) - { - return; - } - - method2778(graphicsPixels, var2, 0, 0, var3 >> 14, var4 >> 14, var8, var19); - var4 += var15; - var3 += var16; - var8 += var20; - var2 += graphicsPixelsWidth; - } - } - - method2778(graphicsPixels, var2, 0, 0, var5 >> 14, var4 >> 14, var8, var19); - var4 += var15; - var5 += var17; - var8 += var20; - var2 += graphicsPixelsWidth; - } - } - } - else - { - var3 = var5 <<= 14; - if (var2 < 0) - { - var3 -= var15 * var2; - var5 -= var17 * var2; - var8 -= var20 * var2; - var2 = 0; - } - - var4 <<= 14; - if (var1 < 0) - { - var4 -= var16 * var1; - var1 = 0; - } - - if (var15 < var17) - { - var0 -= var1; - var1 -= var2; - var2 = rasterClipY[var2]; - - while (true) - { - --var1; - if (var1 < 0) - { - while (true) - { - --var0; - if (var0 < 0) - { - return; - } - - method2778(graphicsPixels, var2, 0, 0, var4 >> 14, var5 >> 14, var8, var19); - var4 += var16; - var5 += var17; - var8 += var20; - var2 += graphicsPixelsWidth; - } - } - - method2778(graphicsPixels, var2, 0, 0, var3 >> 14, var5 >> 14, var8, var19); - var3 += var15; - var5 += var17; - var8 += var20; - var2 += graphicsPixelsWidth; - } - } - else - { - var0 -= var1; - var1 -= var2; - var2 = rasterClipY[var2]; - - while (true) - { - --var1; - if (var1 < 0) - { - while (true) - { - --var0; - if (var0 < 0) - { - return; - } - - method2778(graphicsPixels, var2, 0, 0, var5 >> 14, var4 >> 14, var8, var19); - var4 += var16; - var5 += var17; - var8 += var20; - var2 += graphicsPixelsWidth; - } - } - - method2778(graphicsPixels, var2, 0, 0, var5 >> 14, var3 >> 14, var8, var19); - var3 += var15; - var5 += var17; - var8 += var20; - var2 += graphicsPixelsWidth; - } - } - } - } - } - } - - - final void method2778(int[] var0, int var1, int var2, int var3, int var4, int var5, int var6, int var7) - { - if (rasterClipEnable) - { - if (var5 > rasterClipX) - { - var5 = rasterClipX; - } - - if (var4 < 0) - { - var4 = 0; - } - } - - if (var4 < var5) - { - var1 += var4; - var6 += var4 * var7; - int var8; - int var9; - int var10; - if (rasterGouraudLowRes) - { - var3 = var5 - var4 >> 2; - var7 <<= 2; - if (rasterAlpha == 0) - { - if (var3 > 0) - { - do - { - var2 = colorPalette[var6 >> 8]; - var6 += var7; - var0[var1++] = var2; - var0[var1++] = var2; - var0[var1++] = var2; - var0[var1++] = var2; - --var3; - } while (var3 > 0); - } - - var3 = var5 - var4 & 3; - if (var3 > 0) - { - var2 = colorPalette[var6 >> 8]; - - do - { - var0[var1++] = var2; - --var3; - } while (var3 > 0); - } - } - else - { - var8 = rasterAlpha; - var9 = 256 - rasterAlpha; - if (var3 > 0) - { - do - { - var2 = colorPalette[var6 >> 8]; - var6 += var7; - var2 = (var9 * (var2 & 65280) >> 8 & 65280) + (var9 * (var2 & 16711935) >> 8 & 16711935); - var10 = var0[var1]; - var0[var1++] = ((var10 & 16711935) * var8 >> 8 & 16711935) + var2 + (var8 * (var10 & 65280) >> 8 & 65280); - var10 = var0[var1]; - var0[var1++] = ((var10 & 16711935) * var8 >> 8 & 16711935) + var2 + (var8 * (var10 & 65280) >> 8 & 65280); - var10 = var0[var1]; - var0[var1++] = ((var10 & 16711935) * var8 >> 8 & 16711935) + var2 + (var8 * (var10 & 65280) >> 8 & 65280); - var10 = var0[var1]; - var0[var1++] = ((var10 & 16711935) * var8 >> 8 & 16711935) + var2 + (var8 * (var10 & 65280) >> 8 & 65280); - --var3; - } while (var3 > 0); - } - - var3 = var5 - var4 & 3; - if (var3 > 0) - { - var2 = colorPalette[var6 >> 8]; - var2 = (var9 * (var2 & 65280) >> 8 & 65280) + (var9 * (var2 & 16711935) >> 8 & 16711935); - - do - { - var10 = var0[var1]; - var0[var1++] = ((var10 & 16711935) * var8 >> 8 & 16711935) + var2 + (var8 * (var10 & 65280) >> 8 & 65280); - --var3; - } while (var3 > 0); - } - } - - } - else - { - var3 = var5 - var4; - if (rasterAlpha == 0) - { - do - { - var0[var1++] = colorPalette[var6 >> 8]; - var6 += var7; - --var3; - } while (var3 > 0); - } - else - { - var8 = rasterAlpha; - var9 = 256 - rasterAlpha; - - do - { - var2 = colorPalette[var6 >> 8]; - var6 += var7; - var2 = (var9 * (var2 & 65280) >> 8 & 65280) + (var9 * (var2 & 16711935) >> 8 & 16711935); - var10 = var0[var1]; - var0[var1++] = ((var10 & 16711935) * var8 >> 8 & 16711935) + var2 + (var8 * (var10 & 65280) >> 8 & 65280); - --var3; - } while (var3 > 0); - } - - } - } - } - - - public final void rasterFlat(int var0, int var1, int var2, int var3, int var4, int var5, int var6) - { - int var7 = 0; - if (var0 != var1) - { - var7 = (var4 - var3 << 14) / (var1 - var0); - } - - int var8 = 0; - if (var2 != var1) - { - var8 = (var5 - var4 << 14) / (var2 - var1); - } - - int var9 = 0; - if (var0 != var2) - { - var9 = (var3 - var5 << 14) / (var0 - var2); - } - - if (var0 <= var1 && var0 <= var2) - { - if (var0 < Rasterizer3D_clipHeight) - { - if (var1 > Rasterizer3D_clipHeight) - { - var1 = Rasterizer3D_clipHeight; - } - - if (var2 > Rasterizer3D_clipHeight) - { - var2 = Rasterizer3D_clipHeight; - } - - if (var1 < var2) - { - var5 = var3 <<= 14; - if (var0 < 0) - { - var5 -= var0 * var9; - var3 -= var0 * var7; - var0 = 0; - } - - var4 <<= 14; - if (var1 < 0) - { - var4 -= var8 * var1; - var1 = 0; - } - - if ((var0 == var1 || var9 >= var7) && (var0 != var1 || var9 <= var8)) - { - var2 -= var1; - var1 -= var0; - var0 = rasterClipY[var0]; - - while (true) - { - --var1; - if (var1 < 0) - { - while (true) - { - --var2; - if (var2 < 0) - { - return; - } - - method2842(graphicsPixels, var0, var6, 0, var4 >> 14, var5 >> 14); - var5 += var9; - var4 += var8; - var0 += graphicsPixelsWidth; - } - } - - method2842(graphicsPixels, var0, var6, 0, var3 >> 14, var5 >> 14); - var5 += var9; - var3 += var7; - var0 += graphicsPixelsWidth; - } - } - else - { - var2 -= var1; - var1 -= var0; - var0 = rasterClipY[var0]; - - while (true) - { - --var1; - if (var1 < 0) - { - while (true) - { - --var2; - if (var2 < 0) - { - return; - } - - method2842(graphicsPixels, var0, var6, 0, var5 >> 14, var4 >> 14); - var5 += var9; - var4 += var8; - var0 += graphicsPixelsWidth; - } - } - - method2842(graphicsPixels, var0, var6, 0, var5 >> 14, var3 >> 14); - var5 += var9; - var3 += var7; - var0 += graphicsPixelsWidth; - } - } - } - else - { - var4 = var3 <<= 14; - if (var0 < 0) - { - var4 -= var0 * var9; - var3 -= var0 * var7; - var0 = 0; - } - - var5 <<= 14; - if (var2 < 0) - { - var5 -= var8 * var2; - var2 = 0; - } - - if (var0 != var2 && var9 < var7 || var0 == var2 && var8 > var7) - { - var1 -= var2; - var2 -= var0; - var0 = rasterClipY[var0]; - - while (true) - { - --var2; - if (var2 < 0) - { - while (true) - { - --var1; - if (var1 < 0) - { - return; - } - - method2842(graphicsPixels, var0, var6, 0, var5 >> 14, var3 >> 14); - var5 += var8; - var3 += var7; - var0 += graphicsPixelsWidth; - } - } - - method2842(graphicsPixels, var0, var6, 0, var4 >> 14, var3 >> 14); - var4 += var9; - var3 += var7; - var0 += graphicsPixelsWidth; - } - } - else - { - var1 -= var2; - var2 -= var0; - var0 = rasterClipY[var0]; - - while (true) - { - --var2; - if (var2 < 0) - { - while (true) - { - --var1; - if (var1 < 0) - { - return; - } - - method2842(graphicsPixels, var0, var6, 0, var3 >> 14, var5 >> 14); - var5 += var8; - var3 += var7; - var0 += graphicsPixelsWidth; - } - } - - method2842(graphicsPixels, var0, var6, 0, var3 >> 14, var4 >> 14); - var4 += var9; - var3 += var7; - var0 += graphicsPixelsWidth; - } - } - } - } - } - else if (var1 <= var2) - { - if (var1 < Rasterizer3D_clipHeight) - { - if (var2 > Rasterizer3D_clipHeight) - { - var2 = Rasterizer3D_clipHeight; - } - - if (var0 > Rasterizer3D_clipHeight) - { - var0 = Rasterizer3D_clipHeight; - } - - if (var2 < var0) - { - var3 = var4 <<= 14; - if (var1 < 0) - { - var3 -= var7 * var1; - var4 -= var8 * var1; - var1 = 0; - } - - var5 <<= 14; - if (var2 < 0) - { - var5 -= var9 * var2; - var2 = 0; - } - - if ((var2 == var1 || var7 >= var8) && (var2 != var1 || var7 <= var9)) - { - var0 -= var2; - var2 -= var1; - var1 = rasterClipY[var1]; - - while (true) - { - --var2; - if (var2 < 0) - { - while (true) - { - --var0; - if (var0 < 0) - { - return; - } - - method2842(graphicsPixels, var1, var6, 0, var5 >> 14, var3 >> 14); - var3 += var7; - var5 += var9; - var1 += graphicsPixelsWidth; - } - } - - method2842(graphicsPixels, var1, var6, 0, var4 >> 14, var3 >> 14); - var3 += var7; - var4 += var8; - var1 += graphicsPixelsWidth; - } - } - else - { - var0 -= var2; - var2 -= var1; - var1 = rasterClipY[var1]; - - while (true) - { - --var2; - if (var2 < 0) - { - while (true) - { - --var0; - if (var0 < 0) - { - return; - } - - method2842(graphicsPixels, var1, var6, 0, var3 >> 14, var5 >> 14); - var3 += var7; - var5 += var9; - var1 += graphicsPixelsWidth; - } - } - - method2842(graphicsPixels, var1, var6, 0, var3 >> 14, var4 >> 14); - var3 += var7; - var4 += var8; - var1 += graphicsPixelsWidth; - } - } - } - else - { - var5 = var4 <<= 14; - if (var1 < 0) - { - var5 -= var7 * var1; - var4 -= var8 * var1; - var1 = 0; - } - - var3 <<= 14; - if (var0 < 0) - { - var3 -= var0 * var9; - var0 = 0; - } - - if (var7 < var8) - { - var2 -= var0; - var0 -= var1; - var1 = rasterClipY[var1]; - - while (true) - { - --var0; - if (var0 < 0) - { - while (true) - { - --var2; - if (var2 < 0) - { - return; - } - - method2842(graphicsPixels, var1, var6, 0, var3 >> 14, var4 >> 14); - var3 += var9; - var4 += var8; - var1 += graphicsPixelsWidth; - } - } - - method2842(graphicsPixels, var1, var6, 0, var5 >> 14, var4 >> 14); - var5 += var7; - var4 += var8; - var1 += graphicsPixelsWidth; - } - } - else - { - var2 -= var0; - var0 -= var1; - var1 = rasterClipY[var1]; - - while (true) - { - --var0; - if (var0 < 0) - { - while (true) - { - --var2; - if (var2 < 0) - { - return; - } - - method2842(graphicsPixels, var1, var6, 0, var4 >> 14, var3 >> 14); - var3 += var9; - var4 += var8; - var1 += graphicsPixelsWidth; - } - } - - method2842(graphicsPixels, var1, var6, 0, var4 >> 14, var5 >> 14); - var5 += var7; - var4 += var8; - var1 += graphicsPixelsWidth; - } - } - } - } - } - else if (var2 < Rasterizer3D_clipHeight) - { - if (var0 > Rasterizer3D_clipHeight) - { - var0 = Rasterizer3D_clipHeight; - } - - if (var1 > Rasterizer3D_clipHeight) - { - var1 = Rasterizer3D_clipHeight; - } - - if (var0 < var1) - { - var4 = var5 <<= 14; - if (var2 < 0) - { - var4 -= var8 * var2; - var5 -= var9 * var2; - var2 = 0; - } - - var3 <<= 14; - if (var0 < 0) - { - var3 -= var0 * var7; - var0 = 0; - } - - if (var8 < var9) - { - var1 -= var0; - var0 -= var2; - var2 = rasterClipY[var2]; - - while (true) - { - --var0; - if (var0 < 0) - { - while (true) - { - --var1; - if (var1 < 0) - { - return; - } - - method2842(graphicsPixels, var2, var6, 0, var4 >> 14, var3 >> 14); - var4 += var8; - var3 += var7; - var2 += graphicsPixelsWidth; - } - } - - method2842(graphicsPixels, var2, var6, 0, var4 >> 14, var5 >> 14); - var4 += var8; - var5 += var9; - var2 += graphicsPixelsWidth; - } - } - else - { - var1 -= var0; - var0 -= var2; - var2 = rasterClipY[var2]; - - while (true) - { - --var0; - if (var0 < 0) - { - while (true) - { - --var1; - if (var1 < 0) - { - return; - } - - method2842(graphicsPixels, var2, var6, 0, var3 >> 14, var4 >> 14); - var4 += var8; - var3 += var7; - var2 += graphicsPixelsWidth; - } - } - - method2842(graphicsPixels, var2, var6, 0, var5 >> 14, var4 >> 14); - var4 += var8; - var5 += var9; - var2 += graphicsPixelsWidth; - } - } - } - else - { - var3 = var5 <<= 14; - if (var2 < 0) - { - var3 -= var8 * var2; - var5 -= var9 * var2; - var2 = 0; - } - - var4 <<= 14; - if (var1 < 0) - { - var4 -= var7 * var1; - var1 = 0; - } - - if (var8 < var9) - { - var0 -= var1; - var1 -= var2; - var2 = rasterClipY[var2]; - - while (true) - { - --var1; - if (var1 < 0) - { - while (true) - { - --var0; - if (var0 < 0) - { - return; - } - - method2842(graphicsPixels, var2, var6, 0, var4 >> 14, var5 >> 14); - var4 += var7; - var5 += var9; - var2 += graphicsPixelsWidth; - } - } - - method2842(graphicsPixels, var2, var6, 0, var3 >> 14, var5 >> 14); - var3 += var8; - var5 += var9; - var2 += graphicsPixelsWidth; - } - } - else - { - var0 -= var1; - var1 -= var2; - var2 = rasterClipY[var2]; - - while (true) - { - --var1; - if (var1 < 0) - { - while (true) - { - --var0; - if (var0 < 0) - { - return; - } - - method2842(graphicsPixels, var2, var6, 0, var5 >> 14, var4 >> 14); - var4 += var7; - var5 += var9; - var2 += graphicsPixelsWidth; - } - } - - method2842(graphicsPixels, var2, var6, 0, var5 >> 14, var3 >> 14); - var3 += var8; - var5 += var9; - var2 += graphicsPixelsWidth; - } - } - } - } - } - - - final void method2842(int[] var0, int var1, int var2, int var3, int var4, int var5) - { - if (rasterClipEnable) - { - if (var5 > rasterClipX) - { - var5 = rasterClipX; - } - - if (var4 < 0) - { - var4 = 0; - } - } - - if (var4 < var5) - { - var1 += var4; - var3 = var5 - var4 >> 2; - if (rasterAlpha != 0) - { - if (rasterAlpha == 254) - { - while (true) - { - --var3; - if (var3 < 0) - { - var3 = var5 - var4 & 3; - - while (true) - { - --var3; - if (var3 < 0) - { - return; - } - - var0[var1++] = var0[var1]; - } - } - - var0[var1++] = var0[var1]; - var0[var1++] = var0[var1]; - var0[var1++] = var0[var1]; - var0[var1++] = var0[var1]; - } - } - else - { - int var6 = rasterAlpha; - int var7 = 256 - rasterAlpha; - var2 = (var7 * (var2 & 65280) >> 8 & 65280) + (var7 * (var2 & 16711935) >> 8 & 16711935); - - while (true) - { - --var3; - int var8; - if (var3 < 0) - { - var3 = var5 - var4 & 3; - - while (true) - { - --var3; - if (var3 < 0) - { - return; - } - - var8 = var0[var1]; - var0[var1++] = ((var8 & 16711935) * var6 >> 8 & 16711935) + var2 + (var6 * (var8 & 65280) >> 8 & 65280); - } - } - - var8 = var0[var1]; - var0[var1++] = ((var8 & 16711935) * var6 >> 8 & 16711935) + var2 + (var6 * (var8 & 65280) >> 8 & 65280); - var8 = var0[var1]; - var0[var1++] = ((var8 & 16711935) * var6 >> 8 & 16711935) + var2 + (var6 * (var8 & 65280) >> 8 & 65280); - var8 = var0[var1]; - var0[var1++] = ((var8 & 16711935) * var6 >> 8 & 16711935) + var2 + (var6 * (var8 & 65280) >> 8 & 65280); - var8 = var0[var1]; - var0[var1++] = ((var8 & 16711935) * var6 >> 8 & 16711935) + var2 + (var6 * (var8 & 65280) >> 8 & 65280); - } - } - } - else - { - while (true) - { - --var3; - if (var3 < 0) - { - var3 = var5 - var4 & 3; - - while (true) - { - --var3; - if (var3 < 0) - { - return; - } - - var0[var1++] = var2; - } - } - - var0[var1++] = var2; - var0[var1++] = var2; - var0[var1++] = var2; - var0[var1++] = var2; - } - } - } - } - - - final void rasterTextureAffine(int var0, int var1, int var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9, int var10, int var11, int var12, int var13, int var14, int var15, int var16, int var17, int var18) - { - int[] var19 = textureProvider.load(var18); - int var20; - if (var19 == null) - { - var20 = textureProvider.getAverageTextureRGB(var18); - rasterGouraud(var0, var1, var2, var3, var4, var5, method2794(var20, var6), method2794(var20, var7), method2794(var20, var8)); - } - else - { - lowMem = textureProvider.vmethod3066(var18); - field1909 = textureProvider.vmethod3057(var18); - var20 = var4 - var3; - int var21 = var1 - var0; - int var22 = var5 - var3; - int var23 = var2 - var0; - int var24 = var7 - var6; - int var25 = var8 - var6; - int var26 = 0; - if (var0 != var1) - { - var26 = (var4 - var3 << 14) / (var1 - var0); - } - - int var27 = 0; - if (var2 != var1) - { - var27 = (var5 - var4 << 14) / (var2 - var1); - } - - int var28 = 0; - if (var0 != var2) - { - var28 = (var3 - var5 << 14) / (var0 - var2); - } - - int var29 = var20 * var23 - var22 * var21; - if (var29 != 0) - { - int var30 = (var24 * var23 - var25 * var21 << 9) / var29; - int var31 = (var25 * var20 - var24 * var22 << 9) / var29; - var10 = var9 - var10; - var13 = var12 - var13; - var16 = var15 - var16; - var11 -= var9; - var14 -= var12; - var17 -= var15; - int var32 = var11 * var12 - var9 * var14 << 14; - int var33 = (int) (((long) (var15 * var14 - var17 * var12) << 3 << 14) / (long) Rasterizer3D_zoom); - int var34 = (int) (((long) (var17 * var9 - var11 * var15) << 14) / (long) Rasterizer3D_zoom); - int var35 = var10 * var12 - var13 * var9 << 14; - int var36 = (int) (((long) (var13 * var15 - var16 * var12) << 3 << 14) / (long) Rasterizer3D_zoom); - int var37 = (int) (((long) (var16 * var9 - var10 * var15) << 14) / (long) Rasterizer3D_zoom); - int var38 = var13 * var11 - var10 * var14 << 14; - int var39 = (int) (((long) (var16 * var14 - var13 * var17) << 3 << 14) / (long) Rasterizer3D_zoom); - int var40 = (int) (((long) (var17 * var10 - var11 * var16) << 14) / (long) Rasterizer3D_zoom); - int var41; - if (var0 <= var1 && var0 <= var2) - { - if (var0 < Rasterizer3D_clipHeight) - { - if (var1 > Rasterizer3D_clipHeight) - { - var1 = Rasterizer3D_clipHeight; - } - - if (var2 > Rasterizer3D_clipHeight) - { - var2 = Rasterizer3D_clipHeight; - } - - var6 = var30 + ((var6 << 9) - var3 * var30); - if (var1 < var2) - { - var5 = var3 <<= 14; - if (var0 < 0) - { - var5 -= var0 * var28; - var3 -= var0 * var26; - var6 -= var0 * var31; - var0 = 0; - } - - var4 <<= 14; - if (var1 < 0) - { - var4 -= var27 * var1; - var1 = 0; - } - - var41 = var0 - centerY; - var32 += var34 * var41; - var35 += var37 * var41; - var38 += var40 * var41; - if ((var0 == var1 || var28 >= var26) && (var0 != var1 || var28 <= var27)) - { - var2 -= var1; - var1 -= var0; - var0 = rasterClipY[var0]; - - while (true) - { - --var1; - if (var1 < 0) - { - while (true) - { - --var2; - if (var2 < 0) - { - return; - } - - method2791(graphicsPixels, var19, 0, 0, var0, var4 >> 14, var5 >> 14, var6, var30, var32, var35, var38, var33, var36, var39); - var5 += var28; - var4 += var27; - var6 += var31; - var0 += graphicsPixelsWidth; - var32 += var34; - var35 += var37; - var38 += var40; - } - } - - method2791(graphicsPixels, var19, 0, 0, var0, var3 >> 14, var5 >> 14, var6, var30, var32, var35, var38, var33, var36, var39); - var5 += var28; - var3 += var26; - var6 += var31; - var0 += graphicsPixelsWidth; - var32 += var34; - var35 += var37; - var38 += var40; - } - } - else - { - var2 -= var1; - var1 -= var0; - var0 = rasterClipY[var0]; - - while (true) - { - --var1; - if (var1 < 0) - { - while (true) - { - --var2; - if (var2 < 0) - { - return; - } - - method2791(graphicsPixels, var19, 0, 0, var0, var5 >> 14, var4 >> 14, var6, var30, var32, var35, var38, var33, var36, var39); - var5 += var28; - var4 += var27; - var6 += var31; - var0 += graphicsPixelsWidth; - var32 += var34; - var35 += var37; - var38 += var40; - } - } - - method2791(graphicsPixels, var19, 0, 0, var0, var5 >> 14, var3 >> 14, var6, var30, var32, var35, var38, var33, var36, var39); - var5 += var28; - var3 += var26; - var6 += var31; - var0 += graphicsPixelsWidth; - var32 += var34; - var35 += var37; - var38 += var40; - } - } - } - else - { - var4 = var3 <<= 14; - if (var0 < 0) - { - var4 -= var0 * var28; - var3 -= var0 * var26; - var6 -= var0 * var31; - var0 = 0; - } - - var5 <<= 14; - if (var2 < 0) - { - var5 -= var27 * var2; - var2 = 0; - } - - var41 = var0 - centerY; - var32 += var34 * var41; - var35 += var37 * var41; - var38 += var40 * var41; - if (var0 != var2 && var28 < var26 || var0 == var2 && var27 > var26) - { - var1 -= var2; - var2 -= var0; - var0 = rasterClipY[var0]; - - while (true) - { - --var2; - if (var2 < 0) - { - while (true) - { - --var1; - if (var1 < 0) - { - return; - } - - method2791(graphicsPixels, var19, 0, 0, var0, var5 >> 14, var3 >> 14, var6, var30, var32, var35, var38, var33, var36, var39); - var5 += var27; - var3 += var26; - var6 += var31; - var0 += graphicsPixelsWidth; - var32 += var34; - var35 += var37; - var38 += var40; - } - } - - method2791(graphicsPixels, var19, 0, 0, var0, var4 >> 14, var3 >> 14, var6, var30, var32, var35, var38, var33, var36, var39); - var4 += var28; - var3 += var26; - var6 += var31; - var0 += graphicsPixelsWidth; - var32 += var34; - var35 += var37; - var38 += var40; - } - } - else - { - var1 -= var2; - var2 -= var0; - var0 = rasterClipY[var0]; - - while (true) - { - --var2; - if (var2 < 0) - { - while (true) - { - --var1; - if (var1 < 0) - { - return; - } - - method2791(graphicsPixels, var19, 0, 0, var0, var3 >> 14, var5 >> 14, var6, var30, var32, var35, var38, var33, var36, var39); - var5 += var27; - var3 += var26; - var6 += var31; - var0 += graphicsPixelsWidth; - var32 += var34; - var35 += var37; - var38 += var40; - } - } - - method2791(graphicsPixels, var19, 0, 0, var0, var3 >> 14, var4 >> 14, var6, var30, var32, var35, var38, var33, var36, var39); - var4 += var28; - var3 += var26; - var6 += var31; - var0 += graphicsPixelsWidth; - var32 += var34; - var35 += var37; - var38 += var40; - } - } - } - } - } - else if (var1 <= var2) - { - if (var1 < Rasterizer3D_clipHeight) - { - if (var2 > Rasterizer3D_clipHeight) - { - var2 = Rasterizer3D_clipHeight; - } - - if (var0 > Rasterizer3D_clipHeight) - { - var0 = Rasterizer3D_clipHeight; - } - - var7 = var30 + ((var7 << 9) - var30 * var4); - if (var2 < var0) - { - var3 = var4 <<= 14; - if (var1 < 0) - { - var3 -= var26 * var1; - var4 -= var27 * var1; - var7 -= var31 * var1; - var1 = 0; - } - - var5 <<= 14; - if (var2 < 0) - { - var5 -= var28 * var2; - var2 = 0; - } - - var41 = var1 - centerY; - var32 += var34 * var41; - var35 += var37 * var41; - var38 += var40 * var41; - if ((var2 == var1 || var26 >= var27) && (var2 != var1 || var26 <= var28)) - { - var0 -= var2; - var2 -= var1; - var1 = rasterClipY[var1]; - - while (true) - { - --var2; - if (var2 < 0) - { - while (true) - { - --var0; - if (var0 < 0) - { - return; - } - - method2791(graphicsPixels, var19, 0, 0, var1, var5 >> 14, var3 >> 14, var7, var30, var32, var35, var38, var33, var36, var39); - var3 += var26; - var5 += var28; - var7 += var31; - var1 += graphicsPixelsWidth; - var32 += var34; - var35 += var37; - var38 += var40; - } - } - - method2791(graphicsPixels, var19, 0, 0, var1, var4 >> 14, var3 >> 14, var7, var30, var32, var35, var38, var33, var36, var39); - var3 += var26; - var4 += var27; - var7 += var31; - var1 += graphicsPixelsWidth; - var32 += var34; - var35 += var37; - var38 += var40; - } - } - else - { - var0 -= var2; - var2 -= var1; - var1 = rasterClipY[var1]; - - while (true) - { - --var2; - if (var2 < 0) - { - while (true) - { - --var0; - if (var0 < 0) - { - return; - } - - method2791(graphicsPixels, var19, 0, 0, var1, var3 >> 14, var5 >> 14, var7, var30, var32, var35, var38, var33, var36, var39); - var3 += var26; - var5 += var28; - var7 += var31; - var1 += graphicsPixelsWidth; - var32 += var34; - var35 += var37; - var38 += var40; - } - } - - method2791(graphicsPixels, var19, 0, 0, var1, var3 >> 14, var4 >> 14, var7, var30, var32, var35, var38, var33, var36, var39); - var3 += var26; - var4 += var27; - var7 += var31; - var1 += graphicsPixelsWidth; - var32 += var34; - var35 += var37; - var38 += var40; - } - } - } - else - { - var5 = var4 <<= 14; - if (var1 < 0) - { - var5 -= var26 * var1; - var4 -= var27 * var1; - var7 -= var31 * var1; - var1 = 0; - } - - var3 <<= 14; - if (var0 < 0) - { - var3 -= var0 * var28; - var0 = 0; - } - - var41 = var1 - centerY; - var32 += var34 * var41; - var35 += var37 * var41; - var38 += var40 * var41; - if (var26 < var27) - { - var2 -= var0; - var0 -= var1; - var1 = rasterClipY[var1]; - - while (true) - { - --var0; - if (var0 < 0) - { - while (true) - { - --var2; - if (var2 < 0) - { - return; - } - - method2791(graphicsPixels, var19, 0, 0, var1, var3 >> 14, var4 >> 14, var7, var30, var32, var35, var38, var33, var36, var39); - var3 += var28; - var4 += var27; - var7 += var31; - var1 += graphicsPixelsWidth; - var32 += var34; - var35 += var37; - var38 += var40; - } - } - - method2791(graphicsPixels, var19, 0, 0, var1, var5 >> 14, var4 >> 14, var7, var30, var32, var35, var38, var33, var36, var39); - var5 += var26; - var4 += var27; - var7 += var31; - var1 += graphicsPixelsWidth; - var32 += var34; - var35 += var37; - var38 += var40; - } - } - else - { - var2 -= var0; - var0 -= var1; - var1 = rasterClipY[var1]; - - while (true) - { - --var0; - if (var0 < 0) - { - while (true) - { - --var2; - if (var2 < 0) - { - return; - } - - method2791(graphicsPixels, var19, 0, 0, var1, var4 >> 14, var3 >> 14, var7, var30, var32, var35, var38, var33, var36, var39); - var3 += var28; - var4 += var27; - var7 += var31; - var1 += graphicsPixelsWidth; - var32 += var34; - var35 += var37; - var38 += var40; - } - } - - method2791(graphicsPixels, var19, 0, 0, var1, var4 >> 14, var5 >> 14, var7, var30, var32, var35, var38, var33, var36, var39); - var5 += var26; - var4 += var27; - var7 += var31; - var1 += graphicsPixelsWidth; - var32 += var34; - var35 += var37; - var38 += var40; - } - } - } - } - } - else if (var2 < Rasterizer3D_clipHeight) - { - if (var0 > Rasterizer3D_clipHeight) - { - var0 = Rasterizer3D_clipHeight; - } - - if (var1 > Rasterizer3D_clipHeight) - { - var1 = Rasterizer3D_clipHeight; - } - - var8 = (var8 << 9) - var5 * var30 + var30; - if (var0 < var1) - { - var4 = var5 <<= 14; - if (var2 < 0) - { - var4 -= var27 * var2; - var5 -= var28 * var2; - var8 -= var31 * var2; - var2 = 0; - } - - var3 <<= 14; - if (var0 < 0) - { - var3 -= var0 * var26; - var0 = 0; - } - - var41 = var2 - centerY; - var32 += var34 * var41; - var35 += var37 * var41; - var38 += var40 * var41; - if (var27 < var28) - { - var1 -= var0; - var0 -= var2; - var2 = rasterClipY[var2]; - - while (true) - { - --var0; - if (var0 < 0) - { - while (true) - { - --var1; - if (var1 < 0) - { - return; - } - - method2791(graphicsPixels, var19, 0, 0, var2, var4 >> 14, var3 >> 14, var8, var30, var32, var35, var38, var33, var36, var39); - var4 += var27; - var3 += var26; - var8 += var31; - var2 += graphicsPixelsWidth; - var32 += var34; - var35 += var37; - var38 += var40; - } - } - - method2791(graphicsPixels, var19, 0, 0, var2, var4 >> 14, var5 >> 14, var8, var30, var32, var35, var38, var33, var36, var39); - var4 += var27; - var5 += var28; - var8 += var31; - var2 += graphicsPixelsWidth; - var32 += var34; - var35 += var37; - var38 += var40; - } - } - else - { - var1 -= var0; - var0 -= var2; - var2 = rasterClipY[var2]; - - while (true) - { - --var0; - if (var0 < 0) - { - while (true) - { - --var1; - if (var1 < 0) - { - return; - } - - method2791(graphicsPixels, var19, 0, 0, var2, var3 >> 14, var4 >> 14, var8, var30, var32, var35, var38, var33, var36, var39); - var4 += var27; - var3 += var26; - var8 += var31; - var2 += graphicsPixelsWidth; - var32 += var34; - var35 += var37; - var38 += var40; - } - } - - method2791(graphicsPixels, var19, 0, 0, var2, var5 >> 14, var4 >> 14, var8, var30, var32, var35, var38, var33, var36, var39); - var4 += var27; - var5 += var28; - var8 += var31; - var2 += graphicsPixelsWidth; - var32 += var34; - var35 += var37; - var38 += var40; - } - } - } - else - { - var3 = var5 <<= 14; - if (var2 < 0) - { - var3 -= var27 * var2; - var5 -= var28 * var2; - var8 -= var31 * var2; - var2 = 0; - } - - var4 <<= 14; - if (var1 < 0) - { - var4 -= var26 * var1; - var1 = 0; - } - - var41 = var2 - centerY; - var32 += var34 * var41; - var35 += var37 * var41; - var38 += var40 * var41; - if (var27 < var28) - { - var0 -= var1; - var1 -= var2; - var2 = rasterClipY[var2]; - - while (true) - { - --var1; - if (var1 < 0) - { - while (true) - { - --var0; - if (var0 < 0) - { - return; - } - - method2791(graphicsPixels, var19, 0, 0, var2, var4 >> 14, var5 >> 14, var8, var30, var32, var35, var38, var33, var36, var39); - var4 += var26; - var5 += var28; - var8 += var31; - var2 += graphicsPixelsWidth; - var32 += var34; - var35 += var37; - var38 += var40; - } - } - - method2791(graphicsPixels, var19, 0, 0, var2, var3 >> 14, var5 >> 14, var8, var30, var32, var35, var38, var33, var36, var39); - var3 += var27; - var5 += var28; - var8 += var31; - var2 += graphicsPixelsWidth; - var32 += var34; - var35 += var37; - var38 += var40; - } - } - else - { - var0 -= var1; - var1 -= var2; - var2 = rasterClipY[var2]; - - while (true) - { - --var1; - if (var1 < 0) - { - while (true) - { - --var0; - if (var0 < 0) - { - return; - } - - method2791(graphicsPixels, var19, 0, 0, var2, var5 >> 14, var4 >> 14, var8, var30, var32, var35, var38, var33, var36, var39); - var4 += var26; - var5 += var28; - var8 += var31; - var2 += graphicsPixelsWidth; - var32 += var34; - var35 += var37; - var38 += var40; - } - } - - method2791(graphicsPixels, var19, 0, 0, var2, var5 >> 14, var3 >> 14, var8, var30, var32, var35, var38, var33, var36, var39); - var3 += var27; - var5 += var28; - var8 += var31; - var2 += graphicsPixelsWidth; - var32 += var34; - var35 += var37; - var38 += var40; - } - } - } - } - } - } - } - - - final void method2791(int[] var0, int[] var1, int var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9, int var10, int var11, int var12, int var13, int var14) - { - if (rasterClipEnable) - { - if (var6 > rasterClipX) - { - var6 = rasterClipX; - } - - if (var5 < 0) - { - var5 = 0; - } - } - - if (var5 < var6) - { - var4 += var5; - var7 += var5 * var8; - int var17 = var6 - var5; - int var15; - int var16; - int var10000; - int var18; - int var19; - int var20; - int var21; - int var22; - int var23; - if (lowMem) - { - var23 = var5 - centerX; - var9 += var23 * (var12 >> 3); - var10 += (var13 >> 3) * var23; - var11 += var23 * (var14 >> 3); - var22 = var11 >> 12; - if (var22 != 0) - { - var18 = var9 / var22; - var19 = var10 / var22; - if (var18 < 0) - { - var18 = 0; - } - else if (var18 > 4032) - { - var18 = 4032; - } - } - else - { - var18 = 0; - var19 = 0; - } - - var9 += var12; - var10 += var13; - var11 += var14; - var22 = var11 >> 12; - if (var22 != 0) - { - var20 = var9 / var22; - var21 = var10 / var22; - if (var20 < 0) - { - var20 = 0; - } - else if (var20 > 4032) - { - var20 = 4032; - } - } - else - { - var20 = 0; - var21 = 0; - } - - var2 = (var18 << 20) + var19; - var16 = (var21 - var19 >> 3) + (var20 - var18 >> 3 << 20); - var17 >>= 3; - var8 <<= 3; - var15 = var7 >> 8; - if (field1909) - { - if (var17 > 0) - { - do - { - var3 = var1[(var2 >>> 26) + (var2 & 4032)]; - var0[var4++] = (var15 * (var3 & 65280) & 16711680) + ((var3 & 16711935) * var15 & -16711936) >> 8; - var2 += var16; - var3 = var1[(var2 >>> 26) + (var2 & 4032)]; - var0[var4++] = (var15 * (var3 & 65280) & 16711680) + ((var3 & 16711935) * var15 & -16711936) >> 8; - var2 += var16; - var3 = var1[(var2 >>> 26) + (var2 & 4032)]; - var0[var4++] = (var15 * (var3 & 65280) & 16711680) + ((var3 & 16711935) * var15 & -16711936) >> 8; - var2 += var16; - var3 = var1[(var2 >>> 26) + (var2 & 4032)]; - var0[var4++] = (var15 * (var3 & 65280) & 16711680) + ((var3 & 16711935) * var15 & -16711936) >> 8; - var2 += var16; - var3 = var1[(var2 >>> 26) + (var2 & 4032)]; - var0[var4++] = (var15 * (var3 & 65280) & 16711680) + ((var3 & 16711935) * var15 & -16711936) >> 8; - var2 += var16; - var3 = var1[(var2 >>> 26) + (var2 & 4032)]; - var0[var4++] = (var15 * (var3 & 65280) & 16711680) + ((var3 & 16711935) * var15 & -16711936) >> 8; - var2 += var16; - var3 = var1[(var2 >>> 26) + (var2 & 4032)]; - var0[var4++] = (var15 * (var3 & 65280) & 16711680) + ((var3 & 16711935) * var15 & -16711936) >> 8; - var2 += var16; - var3 = var1[(var2 >>> 26) + (var2 & 4032)]; - var0[var4++] = (var15 * (var3 & 65280) & 16711680) + ((var3 & 16711935) * var15 & -16711936) >> 8; - var10000 = var16 + var2; - var18 = var20; - var19 = var21; - var9 += var12; - var10 += var13; - var11 += var14; - var22 = var11 >> 12; - if (var22 != 0) - { - var20 = var9 / var22; - var21 = var10 / var22; - if (var20 < 0) - { - var20 = 0; - } - else if (var20 > 4032) - { - var20 = 4032; - } - } - else - { - var20 = 0; - var21 = 0; - } - - var2 = (var18 << 20) + var19; - var16 = (var21 - var19 >> 3) + (var20 - var18 >> 3 << 20); - var7 += var8; - var15 = var7 >> 8; - --var17; - } while (var17 > 0); - } - - var17 = var6 - var5 & 7; - if (var17 > 0) - { - do - { - var3 = var1[(var2 >>> 26) + (var2 & 4032)]; - var0[var4++] = (var15 * (var3 & 65280) & 16711680) + ((var3 & 16711935) * var15 & -16711936) >> 8; - var2 += var16; - --var17; - } while (var17 > 0); - } - } - else - { - if (var17 > 0) - { - do - { - if ((var3 = var1[(var2 >>> 26) + (var2 & 4032)]) != 0) - { - var0[var4] = (var15 * (var3 & 65280) & 16711680) + ((var3 & 16711935) * var15 & -16711936) >> 8; - } - - ++var4; - var2 += var16; - if ((var3 = var1[(var2 >>> 26) + (var2 & 4032)]) != 0) - { - var0[var4] = (var15 * (var3 & 65280) & 16711680) + ((var3 & 16711935) * var15 & -16711936) >> 8; - } - - ++var4; - var2 += var16; - if ((var3 = var1[(var2 >>> 26) + (var2 & 4032)]) != 0) - { - var0[var4] = (var15 * (var3 & 65280) & 16711680) + ((var3 & 16711935) * var15 & -16711936) >> 8; - } - - ++var4; - var2 += var16; - if ((var3 = var1[(var2 >>> 26) + (var2 & 4032)]) != 0) - { - var0[var4] = (var15 * (var3 & 65280) & 16711680) + ((var3 & 16711935) * var15 & -16711936) >> 8; - } - - ++var4; - var2 += var16; - if ((var3 = var1[(var2 >>> 26) + (var2 & 4032)]) != 0) - { - var0[var4] = (var15 * (var3 & 65280) & 16711680) + ((var3 & 16711935) * var15 & -16711936) >> 8; - } - - ++var4; - var2 += var16; - if ((var3 = var1[(var2 >>> 26) + (var2 & 4032)]) != 0) - { - var0[var4] = (var15 * (var3 & 65280) & 16711680) + ((var3 & 16711935) * var15 & -16711936) >> 8; - } - - ++var4; - var2 += var16; - if ((var3 = var1[(var2 >>> 26) + (var2 & 4032)]) != 0) - { - var0[var4] = (var15 * (var3 & 65280) & 16711680) + ((var3 & 16711935) * var15 & -16711936) >> 8; - } - - ++var4; - var2 += var16; - if ((var3 = var1[(var2 >>> 26) + (var2 & 4032)]) != 0) - { - var0[var4] = (var15 * (var3 & 65280) & 16711680) + ((var3 & 16711935) * var15 & -16711936) >> 8; - } - - ++var4; - var10000 = var16 + var2; - var18 = var20; - var19 = var21; - var9 += var12; - var10 += var13; - var11 += var14; - var22 = var11 >> 12; - if (var22 != 0) - { - var20 = var9 / var22; - var21 = var10 / var22; - if (var20 < 0) - { - var20 = 0; - } - else if (var20 > 4032) - { - var20 = 4032; - } - } - else - { - var20 = 0; - var21 = 0; - } - - var2 = (var18 << 20) + var19; - var16 = (var21 - var19 >> 3) + (var20 - var18 >> 3 << 20); - var7 += var8; - var15 = var7 >> 8; - --var17; - } while (var17 > 0); - } - - var17 = var6 - var5 & 7; - if (var17 > 0) - { - do - { - if ((var3 = var1[(var2 >>> 26) + (var2 & 4032)]) != 0) - { - var0[var4] = (var15 * (var3 & 65280) & 16711680) + ((var3 & 16711935) * var15 & -16711936) >> 8; - } - - ++var4; - var2 += var16; - --var17; - } while (var17 > 0); - } - } - } - else - { - var23 = var5 - centerX; - var9 += var23 * (var12 >> 3); - var10 += (var13 >> 3) * var23; - var11 += var23 * (var14 >> 3); - var22 = var11 >> 14; - if (var22 != 0) - { - var18 = var9 / var22; - var19 = var10 / var22; - if (var18 < 0) - { - var18 = 0; - } - else if (var18 > 16256) - { - var18 = 16256; - } - } - else - { - var18 = 0; - var19 = 0; - } - - var9 += var12; - var10 += var13; - var11 += var14; - var22 = var11 >> 14; - if (var22 != 0) - { - var20 = var9 / var22; - var21 = var10 / var22; - if (var20 < 0) - { - var20 = 0; - } - else if (var20 > 16256) - { - var20 = 16256; - } - } - else - { - var20 = 0; - var21 = 0; - } - - var2 = (var18 << 18) + var19; - var16 = (var21 - var19 >> 3) + (var20 - var18 >> 3 << 18); - var17 >>= 3; - var8 <<= 3; - var15 = var7 >> 8; - if (field1909) - { - if (var17 > 0) - { - do - { - var3 = var1[(var2 & 16256) + (var2 >>> 25)]; - var0[var4++] = (var15 * (var3 & 65280) & 16711680) + ((var3 & 16711935) * var15 & -16711936) >> 8; - var2 += var16; - var3 = var1[(var2 & 16256) + (var2 >>> 25)]; - var0[var4++] = (var15 * (var3 & 65280) & 16711680) + ((var3 & 16711935) * var15 & -16711936) >> 8; - var2 += var16; - var3 = var1[(var2 & 16256) + (var2 >>> 25)]; - var0[var4++] = (var15 * (var3 & 65280) & 16711680) + ((var3 & 16711935) * var15 & -16711936) >> 8; - var2 += var16; - var3 = var1[(var2 & 16256) + (var2 >>> 25)]; - var0[var4++] = (var15 * (var3 & 65280) & 16711680) + ((var3 & 16711935) * var15 & -16711936) >> 8; - var2 += var16; - var3 = var1[(var2 & 16256) + (var2 >>> 25)]; - var0[var4++] = (var15 * (var3 & 65280) & 16711680) + ((var3 & 16711935) * var15 & -16711936) >> 8; - var2 += var16; - var3 = var1[(var2 & 16256) + (var2 >>> 25)]; - var0[var4++] = (var15 * (var3 & 65280) & 16711680) + ((var3 & 16711935) * var15 & -16711936) >> 8; - var2 += var16; - var3 = var1[(var2 & 16256) + (var2 >>> 25)]; - var0[var4++] = (var15 * (var3 & 65280) & 16711680) + ((var3 & 16711935) * var15 & -16711936) >> 8; - var2 += var16; - var3 = var1[(var2 & 16256) + (var2 >>> 25)]; - var0[var4++] = (var15 * (var3 & 65280) & 16711680) + ((var3 & 16711935) * var15 & -16711936) >> 8; - var10000 = var16 + var2; - var18 = var20; - var19 = var21; - var9 += var12; - var10 += var13; - var11 += var14; - var22 = var11 >> 14; - if (var22 != 0) - { - var20 = var9 / var22; - var21 = var10 / var22; - if (var20 < 0) - { - var20 = 0; - } - else if (var20 > 16256) - { - var20 = 16256; - } - } - else - { - var20 = 0; - var21 = 0; - } - - var2 = (var18 << 18) + var19; - var16 = (var21 - var19 >> 3) + (var20 - var18 >> 3 << 18); - var7 += var8; - var15 = var7 >> 8; - --var17; - } while (var17 > 0); - } - - var17 = var6 - var5 & 7; - if (var17 > 0) - { - do - { - var3 = var1[(var2 & 16256) + (var2 >>> 25)]; - var0[var4++] = (var15 * (var3 & 65280) & 16711680) + ((var3 & 16711935) * var15 & -16711936) >> 8; - var2 += var16; - --var17; - } while (var17 > 0); - } - } - else - { - if (var17 > 0) - { - do - { - if ((var3 = var1[(var2 & 16256) + (var2 >>> 25)]) != 0) - { - var0[var4] = (var15 * (var3 & 65280) & 16711680) + ((var3 & 16711935) * var15 & -16711936) >> 8; - } - - ++var4; - var2 += var16; - if ((var3 = var1[(var2 & 16256) + (var2 >>> 25)]) != 0) - { - var0[var4] = (var15 * (var3 & 65280) & 16711680) + ((var3 & 16711935) * var15 & -16711936) >> 8; - } - - ++var4; - var2 += var16; - if ((var3 = var1[(var2 & 16256) + (var2 >>> 25)]) != 0) - { - var0[var4] = (var15 * (var3 & 65280) & 16711680) + ((var3 & 16711935) * var15 & -16711936) >> 8; - } - - ++var4; - var2 += var16; - if ((var3 = var1[(var2 & 16256) + (var2 >>> 25)]) != 0) - { - var0[var4] = (var15 * (var3 & 65280) & 16711680) + ((var3 & 16711935) * var15 & -16711936) >> 8; - } - - ++var4; - var2 += var16; - if ((var3 = var1[(var2 & 16256) + (var2 >>> 25)]) != 0) - { - var0[var4] = (var15 * (var3 & 65280) & 16711680) + ((var3 & 16711935) * var15 & -16711936) >> 8; - } - - ++var4; - var2 += var16; - if ((var3 = var1[(var2 & 16256) + (var2 >>> 25)]) != 0) - { - var0[var4] = (var15 * (var3 & 65280) & 16711680) + ((var3 & 16711935) * var15 & -16711936) >> 8; - } - - ++var4; - var2 += var16; - if ((var3 = var1[(var2 & 16256) + (var2 >>> 25)]) != 0) - { - var0[var4] = (var15 * (var3 & 65280) & 16711680) + ((var3 & 16711935) * var15 & -16711936) >> 8; - } - - ++var4; - var2 += var16; - if ((var3 = var1[(var2 & 16256) + (var2 >>> 25)]) != 0) - { - var0[var4] = (var15 * (var3 & 65280) & 16711680) + ((var3 & 16711935) * var15 & -16711936) >> 8; - } - - ++var4; - var10000 = var16 + var2; - var18 = var20; - var19 = var21; - var9 += var12; - var10 += var13; - var11 += var14; - var22 = var11 >> 14; - if (var22 != 0) - { - var20 = var9 / var22; - var21 = var10 / var22; - if (var20 < 0) - { - var20 = 0; - } - else if (var20 > 16256) - { - var20 = 16256; - } - } - else - { - var20 = 0; - var21 = 0; - } - - var2 = (var18 << 18) + var19; - var16 = (var21 - var19 >> 3) + (var20 - var18 >> 3 << 18); - var7 += var8; - var15 = var7 >> 8; - --var17; - } while (var17 > 0); - } - - var17 = var6 - var5 & 7; - if (var17 > 0) - { - do - { - if ((var3 = var1[(var2 & 16256) + (var2 >>> 25)]) != 0) - { - var0[var4] = (var15 * (var3 & 65280) & 16711680) + ((var3 & 16711935) * var15 & -16711936) >> 8; - } - - ++var4; - var2 += var16; - --var17; - } while (var17 > 0); - } - } - } - - } - } - - static final int method2794(int var0, int var1) - { - var1 = (var0 & 127) * var1 >> 7; - if (var1 < 2) - { - var1 = 2; - } - else if (var1 > 126) - { - var1 = 126; - } - - return (var0 & 65408) + var1; - } -} diff --git a/cache/src/main/java/net/runelite/cache/item/ItemSpriteFactory.java b/cache/src/main/java/net/runelite/cache/item/ItemSpriteFactory.java deleted file mode 100644 index c93edf3611..0000000000 --- a/cache/src/main/java/net/runelite/cache/item/ItemSpriteFactory.java +++ /dev/null @@ -1,439 +0,0 @@ -/* - * 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.item; - -import java.awt.image.BufferedImage; -import java.io.IOException; -import net.runelite.cache.definitions.ItemDefinition; -import net.runelite.cache.definitions.ModelDefinition; -import net.runelite.cache.definitions.providers.ItemProvider; -import net.runelite.cache.definitions.providers.ModelProvider; -import net.runelite.cache.definitions.providers.SpriteProvider; -import net.runelite.cache.definitions.providers.TextureProvider; -import net.runelite.cache.models.FaceNormal; -import net.runelite.cache.models.VertexNormal; - -public class ItemSpriteFactory -{ - public static final BufferedImage createSprite(ItemProvider itemProvider, ModelProvider modelProvider, - SpriteProvider spriteProvider, TextureProvider textureProvider, - int itemId, int quantity, int border, int shadowColor, - boolean noted) throws IOException - { - SpritePixels spritePixels = createSpritePixels(itemProvider, modelProvider, spriteProvider, textureProvider, - itemId, quantity, border, shadowColor, noted); - return spritePixels == null ? null : spritePixels.toBufferedImage(); - } - - private static final SpritePixels createSpritePixels(ItemProvider itemProvider, ModelProvider modelProvider, - SpriteProvider spriteProvider, TextureProvider textureProvider, - int itemId, int quantity, int border, int shadowColor, - boolean noted) throws IOException - { - ItemDefinition item = itemProvider.provide(itemId); - - if (quantity > 1 && item.countObj != null) - { - int stackItemID = -1; - - for (int i = 0; i < 10; ++i) - { - if (quantity >= item.countCo[i] && item.countCo[i] != 0) - { - stackItemID = item.countObj[i]; - } - } - - if (stackItemID != -1) - { - item = itemProvider.provide(stackItemID); - } - } - - if (item.notedTemplate != -1) - { - item.updateNote(itemProvider.provide(item.notedTemplate), itemProvider.provide(item.notedID)); - } - - Model itemModel = getModel(modelProvider, item); - if (itemModel == null) - { - return null; - } - - SpritePixels auxSpritePixels = null; - if (item.notedTemplate != -1) - { - auxSpritePixels = createSpritePixels(itemProvider, modelProvider, spriteProvider, textureProvider, - item.notedID, 10, 1, 0, true); - if (auxSpritePixels == null) - { - return null; - } - } - else if (item.boughtTemplateId != -1) - { - auxSpritePixels = createSpritePixels(itemProvider, modelProvider, spriteProvider, textureProvider, - item.boughtId, quantity, border, shadowColor, false); - if (auxSpritePixels == null) - { - return null; - } - } - else if (item.placeholderTemplateId != -1) - { - auxSpritePixels = createSpritePixels(itemProvider, modelProvider, spriteProvider, textureProvider, - item.placeholderId, quantity, 0, 0, false); - if (auxSpritePixels == null) - { - return null; - } - } - - RSTextureProvider rsTextureProvider = new RSTextureProvider(textureProvider, spriteProvider); - - SpritePixels spritePixels = new SpritePixels(36, 32); - Graphics3D graphics = new Graphics3D(rsTextureProvider); - graphics.setBrightness(0.6d); - graphics.setRasterBuffer(spritePixels.pixels, 36, 32); - graphics.reset(); - graphics.setRasterClipping(); - graphics.setOffset(16, 16); - graphics.rasterGouraudLowRes = false; - if (item.placeholderTemplateId != -1) - { - auxSpritePixels.drawAtOn(graphics, 0, 0); - } - - int zoom2d = item.zoom2d; - if (noted) - { - zoom2d = (int) ((double) zoom2d * 1.5D); - } - else if (border == 2) - { - zoom2d = (int) ((double) zoom2d * 1.04D); - } - - int var17 = zoom2d * Graphics3D.SINE[item.xan2d] >> 16; - int var18 = zoom2d * Graphics3D.COSINE[item.xan2d] >> 16; - - itemModel.calculateBoundsCylinder(); - itemModel.rotateAndProject(graphics, 0, - item.yan2d, - item.zan2d, - item.xan2d, - item.xOffset2d, - itemModel.modelHeight / 2 + var17 + item.yOffset2d, - var18 + item.yOffset2d); - if (item.boughtTemplateId != -1) - { - auxSpritePixels.drawAtOn(graphics, 0, 0); - } - - if (border >= 1) - { - spritePixels.drawBorder(1); - } - - if (border >= 2) - { - spritePixels.drawBorder(0xffffff); - } - - if (shadowColor != 0) - { - spritePixels.drawShadow(shadowColor); - } - - graphics.setRasterBuffer(spritePixels.pixels, 36, 32); - if (item.notedTemplate != -1) - { - auxSpritePixels.drawAtOn(graphics, 0, 0); - } - - graphics.setRasterBuffer(graphics.graphicsPixels, - graphics.graphicsPixelsWidth, - graphics.graphicsPixelsHeight); - - graphics.setRasterClipping(); - graphics.rasterGouraudLowRes = true; - return spritePixels; - } - - private static Model getModel(ModelProvider modelProvider, ItemDefinition item) throws IOException - { - Model itemModel; - ModelDefinition inventoryModel = modelProvider.provide(item.inventoryModel); - if (inventoryModel == null) - { - return null; - } - - if (item.resizeX != 128 || item.resizeY != 128 || item.resizeZ != 128) - { - inventoryModel.resize(item.resizeX, item.resizeY, item.resizeZ); - } - - if (item.colorFind != null) - { - for (int i = 0; i < item.colorFind.length; ++i) - { - inventoryModel.recolor(item.colorFind[i], item.colorReplace[i]); - } - } - - if (item.textureFind != null) - { - for (int i = 0; i < item.textureFind.length; ++i) - { - inventoryModel.retexture(item.textureFind[i], item.textureReplace[i]); - } - } - - itemModel = light(inventoryModel, item.ambient + 64, item.contrast + 768, -50, -10, -50); - itemModel.isItemModel = true; - return itemModel; - } - - private static Model light(ModelDefinition def, int ambient, int contrast, int x, int y, int z) - { - def.computeNormals(); - int somethingMagnitude = (int) Math.sqrt((double) (z * z + x * x + y * y)); - int var7 = somethingMagnitude * contrast >> 8; - Model litModel = new Model(); - litModel.field1856 = new int[def.faceCount]; - litModel.field1854 = new int[def.faceCount]; - litModel.field1823 = new int[def.faceCount]; - if (def.textureTriangleCount > 0 && def.textureCoordinates != null) - { - int[] var9 = new int[def.textureTriangleCount]; - - int var10; - for (var10 = 0; var10 < def.faceCount; ++var10) - { - if (def.textureCoordinates[var10] != -1) - { - ++var9[def.textureCoordinates[var10] & 255]; - } - } - - litModel.field1852 = 0; - - for (var10 = 0; var10 < def.textureTriangleCount; ++var10) - { - if (var9[var10] > 0 && def.textureRenderTypes[var10] == 0) - { - ++litModel.field1852; - } - } - - litModel.field1844 = new int[litModel.field1852]; - litModel.field1865 = new int[litModel.field1852]; - litModel.field1846 = new int[litModel.field1852]; - var10 = 0; - - - for (int i = 0; i < def.textureTriangleCount; ++i) - { - if (var9[i] > 0 && def.textureRenderTypes[i] == 0) - { - litModel.field1844[var10] = def.textureTriangleVertexIndices1[i] & '\uffff'; - litModel.field1865[var10] = def.textureTriangleVertexIndices2[i] & '\uffff'; - litModel.field1846[var10] = def.textureTriangleVertexIndices3[i] & '\uffff'; - var9[i] = var10++; - } - else - { - var9[i] = -1; - } - } - - litModel.field1840 = new byte[def.faceCount]; - - for (int i = 0; i < def.faceCount; ++i) - { - if (def.textureCoordinates[i] != -1) - { - litModel.field1840[i] = (byte) var9[def.textureCoordinates[i] & 255]; - } - else - { - litModel.field1840[i] = -1; - } - } - } - - for (int faceIdx = 0; faceIdx < def.faceCount; ++faceIdx) - { - byte faceType; - if (def.faceRenderTypes == null) - { - faceType = 0; - } - else - { - faceType = def.faceRenderTypes[faceIdx]; - } - - byte faceAlpha; - if (def.faceAlphas == null) - { - faceAlpha = 0; - } - else - { - faceAlpha = def.faceAlphas[faceIdx]; - } - - short faceTexture; - if (def.faceTextures == null) - { - faceTexture = -1; - } - else - { - faceTexture = def.faceTextures[faceIdx]; - } - - if (faceAlpha == -2) - { - faceType = 3; - } - - if (faceAlpha == -1) - { - faceType = 2; - } - - VertexNormal vertexNormal; - int tmp; - FaceNormal faceNormal; - if (faceTexture == -1) - { - if (faceType != 0) - { - if (faceType == 1) - { - faceNormal = def.faceNormals[faceIdx]; - tmp = (y * faceNormal.y + z * faceNormal.z + x * faceNormal.x) / (var7 / 2 + var7) + ambient; - litModel.field1856[faceIdx] = method2608(def.faceColors[faceIdx] & '\uffff', tmp); - litModel.field1823[faceIdx] = -1; - } - else if (faceType == 3) - { - litModel.field1856[faceIdx] = 128; - litModel.field1823[faceIdx] = -1; - } - else - { - litModel.field1823[faceIdx] = -2; - } - } - else - { - int var15 = def.faceColors[faceIdx] & '\uffff'; - vertexNormal = def.vertexNormals[def.faceVertexIndices1[faceIdx]]; - - tmp = (y * vertexNormal.y + z * vertexNormal.z + x * vertexNormal.x) / (var7 * vertexNormal.magnitude) + ambient; - litModel.field1856[faceIdx] = method2608(var15, tmp); - vertexNormal = def.vertexNormals[def.faceVertexIndices2[faceIdx]]; - - tmp = (y * vertexNormal.y + z * vertexNormal.z + x * vertexNormal.x) / (var7 * vertexNormal.magnitude) + ambient; - litModel.field1854[faceIdx] = method2608(var15, tmp); - vertexNormal = def.vertexNormals[def.faceVertexIndices3[faceIdx]]; - - tmp = (y * vertexNormal.y + z * vertexNormal.z + x * vertexNormal.x) / (var7 * vertexNormal.magnitude) + ambient; - litModel.field1823[faceIdx] = method2608(var15, tmp); - } - } - else if (faceType != 0) - { - if (faceType == 1) - { - faceNormal = def.faceNormals[faceIdx]; - tmp = (y * faceNormal.y + z * faceNormal.z + x * faceNormal.x) / (var7 / 2 + var7) + ambient; - litModel.field1856[faceIdx] = bound2to126(tmp); - litModel.field1823[faceIdx] = -1; - } - else - { - litModel.field1823[faceIdx] = -2; - } - } - else - { - vertexNormal = def.vertexNormals[def.faceVertexIndices1[faceIdx]]; - - tmp = (y * vertexNormal.y + z * vertexNormal.z + x * vertexNormal.x) / (var7 * vertexNormal.magnitude) + ambient; - litModel.field1856[faceIdx] = bound2to126(tmp); - vertexNormal = def.vertexNormals[def.faceVertexIndices2[faceIdx]]; - - tmp = (y * vertexNormal.y + z * vertexNormal.z + x * vertexNormal.x) / (var7 * vertexNormal.magnitude) + ambient; - litModel.field1854[faceIdx] = bound2to126(tmp); - vertexNormal = def.vertexNormals[def.faceVertexIndices3[faceIdx]]; - - tmp = (y * vertexNormal.y + z * vertexNormal.z + x * vertexNormal.x) / (var7 * vertexNormal.magnitude) + ambient; - litModel.field1823[faceIdx] = bound2to126(tmp); - } - } - - litModel.verticesCount = def.vertexCount; - litModel.verticesX = def.vertexPositionsX; - litModel.verticesY = def.vertexPositionsY; - litModel.verticesZ = def.vertexPositionsZ; - litModel.indicesCount = def.faceCount; - litModel.indices1 = def.faceVertexIndices1; - litModel.indices2 = def.faceVertexIndices2; - litModel.indices3 = def.faceVertexIndices3; - litModel.field1838 = def.faceRenderPriorities; - litModel.field1882 = def.faceAlphas; - litModel.field1842 = def.priority; - litModel.field1841 = def.faceTextures; - return litModel; - } - - static final int method2608(int var0, int var1) - { - var1 = ((var0 & 127) * var1) >> 7; - var1 = bound2to126(var1); - - return (var0 & 65408) + var1; - } - - static final int bound2to126(int var0) - { - if (var0 < 2) - { - var0 = 2; - } - else if (var0 > 126) - { - var0 = 126; - } - - return var0; - } -} diff --git a/cache/src/main/java/net/runelite/cache/item/Model.java b/cache/src/main/java/net/runelite/cache/item/Model.java deleted file mode 100644 index e35943acfb..0000000000 --- a/cache/src/main/java/net/runelite/cache/item/Model.java +++ /dev/null @@ -1,773 +0,0 @@ -/* - * 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.item; - -class Model extends Renderable -{ - boolean[] field1887 = new boolean[4700]; - boolean[] field1885 = new boolean[4700]; - int[] modelViewportYs = new int[4700]; - int[] modelViewportXs = new int[4700]; - int[] modelViewportZs = new int[4700]; - int[] yViewportBuffer = new int[4700]; - int[] field1839 = new int[4700]; - int[] field1869 = new int[4700]; - int[] field1871 = new int[1600]; - int[][] field1868 = new int[1600][512]; - int[] field1872 = new int[12]; - int[][] field1874 = new int[12][2000]; - int[] field1857 = new int[2000]; - int[] field1863 = new int[2000]; - int[] field1877 = new int[12]; - int[] field1831 = new int[10]; - int[] field1837 = new int[10]; - int[] xViewportBuffer = new int[10]; - static int[] Model_sine; - static int[] Model_cosine; - static int[] field1890; - int verticesCount; - int[] verticesX; - int[] verticesY; - int[] verticesZ; - int indicesCount; - int[] indices1; - int[] indices2; - int[] indices3; - int[] field1856; - int[] field1854; - int[] field1823; - byte[] field1838; - byte[] field1882; - byte[] field1840; - short[] field1841; - byte field1842; - int field1852; - int[] field1844; - int[] field1865; - int[] field1846; - public boolean isItemModel; - int boundsType; - int bottomY; - int XYZMag; - int diameter; - int radius; - public int extremeX; - public int extremeY; - public int extremeZ; - - static - { - Model_sine = Graphics3D.SINE; - Model_cosine = Graphics3D.COSINE; - field1890 = Graphics3D.field1933; - } - - Model() - { - this.verticesCount = 0; - this.indicesCount = 0; - this.field1842 = 0; - this.field1852 = 0; - this.isItemModel = false; - this.extremeX = -1; - this.extremeY = -1; - this.extremeZ = -1; - } - - public void calculateBoundsCylinder() - { - if (this.boundsType != 1) - { - this.boundsType = 1; - super.modelHeight = 0; - this.bottomY = 0; - this.XYZMag = 0; - - for (int var1 = 0; var1 < this.verticesCount; ++var1) - { - int var2 = this.verticesX[var1]; - int var3 = this.verticesY[var1]; - int var4 = this.verticesZ[var1]; - if (-var3 > super.modelHeight) - { - super.modelHeight = -var3; - } - - if (var3 > this.bottomY) - { - this.bottomY = var3; - } - - int var5 = var2 * var2 + var4 * var4; - if (var5 > this.XYZMag) - { - this.XYZMag = var5; - } - } - - this.XYZMag = (int) (Math.sqrt((double) this.XYZMag) + 0.99D); - this.radius = (int) (Math.sqrt((double) (this.XYZMag * this.XYZMag + super.modelHeight * super.modelHeight)) + 0.99D); - this.diameter = this.radius + (int) (Math.sqrt((double) (this.XYZMag * this.XYZMag + this.bottomY * this.bottomY)) + 0.99D); - } - } - - public final void rotateAndProject(Graphics3D graphics, int rotation_1, int yRotation, int zRotation, int xRotation, int xOffset, int yOffset, int zOffset) - { - field1871[0] = -1; - // (re?)Calculate magnitude as necessary - if (this.boundsType != 2 && this.boundsType != 1) - { - this.boundsType = 2; - this.XYZMag = 0; - - for (int var1 = 0; var1 < this.verticesCount; ++var1) - { - int x = this.verticesX[var1]; - int y = this.verticesY[var1]; - int z = this.verticesZ[var1]; - int magnitude_squared = x * x + z * z + y * y; - if (magnitude_squared > this.XYZMag) - { - this.XYZMag = magnitude_squared; - } - } - - this.XYZMag = (int) (Math.sqrt((double) this.XYZMag) + 0.99D); - this.radius = this.XYZMag; - this.diameter = this.XYZMag + this.XYZMag; - } - - // rotate + perspective transform - int sinX = Model_sine[xRotation]; - int cosX = Model_cosine[xRotation]; - int zRelatedVariable = sinX * yOffset + cosX * zOffset >> 16; - - for (int i = 0; i < this.verticesCount; ++i) - { - int x = this.verticesX[i]; - int y = this.verticesY[i]; - int z = this.verticesZ[i]; - if (zRotation != 0) - { - int sinZ = Model_sine[zRotation]; - int cosZ = Model_cosine[zRotation]; - int tmp; - tmp = y * sinZ + x * cosZ >> 16; - y = y * cosZ - x * sinZ >> 16; - x = tmp; - } - - if (rotation_1 != 0) - { - int sinR1 = Model_sine[rotation_1]; - int cosR1 = Model_cosine[rotation_1]; - int tmp; - tmp = y * cosR1 - z * sinR1 >> 16; - z = y * sinR1 + z * cosR1 >> 16; - y = tmp; - } - - if (yRotation != 0) - { - int sinY = Model_sine[yRotation]; - int cosY = Model_cosine[yRotation]; - int tmp; - tmp = z * sinY + x * cosY >> 16; - z = z * cosY - x * sinY >> 16; - x = tmp; - } - - x += xOffset; - y += yOffset; - z += zOffset; - int tmp = y * cosX - z * sinX >> 16; - z = y * sinX + z * cosX >> 16; - modelViewportZs[i] = z - zRelatedVariable; - modelViewportYs[i] = x * graphics.Rasterizer3D_zoom / z + graphics.centerX; - modelViewportXs[i] = tmp * graphics.Rasterizer3D_zoom / z + graphics.centerY; - if (this.field1852 > 0) - { - yViewportBuffer[i] = x; - field1839[i] = tmp; - field1869[i] = z; - } - } - - this.method0(graphics, false, false, 0); - } - - - private void method0(Graphics3D graphics, boolean var1, boolean var3, int var4) - { - if (this.diameter < 1600) - { - for (int var5 = 0; var5 < this.diameter; ++var5) - { - field1871[var5] = 0; - } - - int var7; - int var9; - int var10; - int var11; - int var12; - int var13; - int var14; - int var15; - int var16; - int var17; - int var18; - int var19; - int var20; - int var27; - - int var26; - for (var26 = 0; var26 < this.indicesCount; ++var26) - { - if (this.field1823[var26] != -2) - { - var7 = this.indices1[var26]; - var27 = this.indices2[var26]; - var9 = this.indices3[var26]; - var10 = modelViewportYs[var7]; - var11 = modelViewportYs[var27]; - var12 = modelViewportYs[var9]; - if (var1 && (var10 == -5000 || var11 == -5000 || var12 == -5000)) - { - var13 = yViewportBuffer[var7]; - var14 = yViewportBuffer[var27]; - var15 = yViewportBuffer[var9]; - var16 = field1839[var7]; - var17 = field1839[var27]; - var18 = field1839[var9]; - var19 = field1869[var7]; - var20 = field1869[var27]; - int var21 = field1869[var9]; - var13 -= var14; - var15 -= var14; - var16 -= var17; - var18 -= var17; - var19 -= var20; - var21 -= var20; - int var22 = var16 * var21 - var19 * var18; - int var23 = var19 * var15 - var13 * var21; - int var24 = var13 * var18 - var16 * var15; - if (var14 * var22 + var17 * var23 + var20 * var24 > 0) - { - field1885[var26] = true; - int var25 = (modelViewportZs[var7] + modelViewportZs[var27] + modelViewportZs[var9]) / 3 + this.radius; - field1868[var25][field1871[var25]++] = var26; - } - } - else - { - if ((var10 - var11) * (modelViewportXs[var9] - modelViewportXs[var27]) - (var12 - var11) * (modelViewportXs[var7] - modelViewportXs[var27]) > 0) - { - field1885[var26] = false; - if (var10 >= 0 && var11 >= 0 && var12 >= 0 && var10 <= graphics.rasterClipX && var11 <= graphics.rasterClipX && var12 <= graphics.rasterClipX) - { - field1887[var26] = false; - } - else - { - field1887[var26] = true; - } - - var13 = (modelViewportZs[var7] + modelViewportZs[var27] + modelViewportZs[var9]) / 3 + this.radius; - field1868[var13][field1871[var13]++] = var26; - } - } - } - } - - int[] var8; - if (this.field1838 == null) - { - for (var26 = this.diameter - 1; var26 >= 0; --var26) - { - var7 = field1871[var26]; - if (var7 > 0) - { - var8 = field1868[var26]; - - for (var9 = 0; var9 < var7; ++var9) - { - this.method2706(graphics, var8[var9]); - } - } - } - - } - else - { - for (var26 = 0; var26 < 12; ++var26) - { - field1872[var26] = 0; - field1877[var26] = 0; - } - - for (var26 = this.diameter - 1; var26 >= 0; --var26) - { - var7 = field1871[var26]; - if (var7 > 0) - { - var8 = field1868[var26]; - - for (var9 = 0; var9 < var7; ++var9) - { - var10 = var8[var9]; - byte var31 = this.field1838[var10]; - var12 = field1872[var31]++; - field1874[var31][var12] = var10; - if (var31 < 10) - { - field1877[var31] += var26; - } - else if (var31 == 10) - { - field1857[var12] = var26; - } - else - { - field1863[var12] = var26; - } - } - } - } - - var26 = 0; - if (field1872[1] > 0 || field1872[2] > 0) - { - var26 = (field1877[1] + field1877[2]) / (field1872[1] + field1872[2]); - } - - var7 = 0; - if (field1872[3] > 0 || field1872[4] > 0) - { - var7 = (field1877[3] + field1877[4]) / (field1872[3] + field1872[4]); - } - - var27 = 0; - if (field1872[6] > 0 || field1872[8] > 0) - { - var27 = (field1877[8] + field1877[6]) / (field1872[8] + field1872[6]); - } - - var10 = 0; - var11 = field1872[10]; - int[] var28 = field1874[10]; - int[] var29 = field1857; - if (var10 == var11) - { - var10 = 0; - var11 = field1872[11]; - var28 = field1874[11]; - var29 = field1863; - } - - if (var10 < var11) - { - var9 = var29[var10]; - } - else - { - var9 = -1000; - } - - for (var14 = 0; var14 < 10; ++var14) - { - while (var14 == 0 && var9 > var26) - { - this.method2706(graphics, var28[var10++]); - if (var10 == var11 && var28 != field1874[11]) - { - var10 = 0; - var11 = field1872[11]; - var28 = field1874[11]; - var29 = field1863; - } - - if (var10 < var11) - { - var9 = var29[var10]; - } - else - { - var9 = -1000; - } - } - - while (var14 == 3 && var9 > var7) - { - this.method2706(graphics, var28[var10++]); - if (var10 == var11 && var28 != field1874[11]) - { - var10 = 0; - var11 = field1872[11]; - var28 = field1874[11]; - var29 = field1863; - } - - if (var10 < var11) - { - var9 = var29[var10]; - } - else - { - var9 = -1000; - } - } - - while (var14 == 5 && var9 > var27) - { - this.method2706(graphics, var28[var10++]); - if (var10 == var11 && var28 != field1874[11]) - { - var10 = 0; - var11 = field1872[11]; - var28 = field1874[11]; - var29 = field1863; - } - - if (var10 < var11) - { - var9 = var29[var10]; - } - else - { - var9 = -1000; - } - } - - var15 = field1872[var14]; - int[] var30 = field1874[var14]; - - for (var17 = 0; var17 < var15; ++var17) - { - this.method2706(graphics, var30[var17]); - } - } - - while (var9 != -1000) - { - this.method2706(graphics, var28[var10++]); - if (var10 == var11 && var28 != field1874[11]) - { - var10 = 0; - var28 = field1874[11]; - var11 = field1872[11]; - var29 = field1863; - } - - if (var10 < var11) - { - var9 = var29[var10]; - } - else - { - var9 = -1000; - } - } - - } - } - } - - private void method2706(Graphics3D graphics, int var1) - { - if (field1885[var1]) - { - this.method2707(graphics, var1); - } - else - { - int var2 = this.indices1[var1]; - int var3 = this.indices2[var1]; - int var4 = this.indices3[var1]; - graphics.rasterClipEnable = field1887[var1]; - if (this.field1882 == null) - { - graphics.rasterAlpha = 0; - } - else - { - graphics.rasterAlpha = this.field1882[var1] & 255; - } - - if (this.field1841 != null && this.field1841[var1] != -1) - { - int var5; - int var6; - int var7; - if (this.field1840 != null && this.field1840[var1] != -1) - { - int var8 = this.field1840[var1] & 255; - var5 = this.field1844[var8]; - var6 = this.field1865[var8]; - var7 = this.field1846[var8]; - } - else - { - var5 = var2; - var6 = var3; - var7 = var4; - } - - if (this.field1823[var1] == -1) - { - graphics.rasterTextureAffine(modelViewportXs[var2], modelViewportXs[var3], modelViewportXs[var4], modelViewportYs[var2], modelViewportYs[var3], modelViewportYs[var4], this.field1856[var1], this.field1856[var1], this.field1856[var1], yViewportBuffer[var5], yViewportBuffer[var6], yViewportBuffer[var7], field1839[var5], field1839[var6], field1839[var7], field1869[var5], field1869[var6], field1869[var7], this.field1841[var1]); - } - else - { - graphics.rasterTextureAffine(modelViewportXs[var2], modelViewportXs[var3], modelViewportXs[var4], modelViewportYs[var2], modelViewportYs[var3], modelViewportYs[var4], this.field1856[var1], this.field1854[var1], this.field1823[var1], yViewportBuffer[var5], yViewportBuffer[var6], yViewportBuffer[var7], field1839[var5], field1839[var6], field1839[var7], field1869[var5], field1869[var6], field1869[var7], this.field1841[var1]); - } - } - else if (this.field1823[var1] == -1) - { - int[] field1889 = graphics.colorPalette; - graphics.rasterFlat(modelViewportXs[var2], modelViewportXs[var3], modelViewportXs[var4], modelViewportYs[var2], modelViewportYs[var3], modelViewportYs[var4], field1889[this.field1856[var1]]); - } - else - { - graphics.rasterGouraud(modelViewportXs[var2], modelViewportXs[var3], modelViewportXs[var4], modelViewportYs[var2], modelViewportYs[var3], modelViewportYs[var4], this.field1856[var1], this.field1854[var1], this.field1823[var1]); - } - - } - } - - - private void method2707(Graphics3D graphics, int var1) - { - int var2 = graphics.centerX; - int var3 = graphics.centerY; - int var4 = 0; - int var5 = this.indices1[var1]; - int var6 = this.indices2[var1]; - int var7 = this.indices3[var1]; - int var8 = field1869[var5]; - int var9 = field1869[var6]; - int var10 = field1869[var7]; - if (this.field1882 == null) - { - graphics.rasterAlpha = 0; - } - else - { - graphics.rasterAlpha = this.field1882[var1] & 255; - } - - int var11; - int var12; - int var13; - int var14; - if (var8 >= 50) - { - field1831[var4] = modelViewportYs[var5]; - field1837[var4] = modelViewportXs[var5]; - xViewportBuffer[var4++] = this.field1856[var1]; - } - else - { - var11 = yViewportBuffer[var5]; - var12 = field1839[var5]; - var13 = this.field1856[var1]; - if (var10 >= 50) - { - var14 = field1890[var10 - var8] * (50 - var8); - field1831[var4] = var2 + graphics.Rasterizer3D_zoom * (var11 + ((yViewportBuffer[var7] - var11) * var14 >> 16)) / 50; - field1837[var4] = var3 + graphics.Rasterizer3D_zoom * (var12 + ((field1839[var7] - var12) * var14 >> 16)) / 50; - xViewportBuffer[var4++] = var13 + ((this.field1823[var1] - var13) * var14 >> 16); - } - - if (var9 >= 50) - { - var14 = field1890[var9 - var8] * (50 - var8); - field1831[var4] = var2 + graphics.Rasterizer3D_zoom * (var11 + ((yViewportBuffer[var6] - var11) * var14 >> 16)) / 50; - field1837[var4] = var3 + graphics.Rasterizer3D_zoom * (var12 + ((field1839[var6] - var12) * var14 >> 16)) / 50; - xViewportBuffer[var4++] = var13 + ((this.field1854[var1] - var13) * var14 >> 16); - } - } - - if (var9 >= 50) - { - field1831[var4] = modelViewportYs[var6]; - field1837[var4] = modelViewportXs[var6]; - xViewportBuffer[var4++] = this.field1854[var1]; - } - else - { - var11 = yViewportBuffer[var6]; - var12 = field1839[var6]; - var13 = this.field1854[var1]; - if (var8 >= 50) - { - var14 = field1890[var8 - var9] * (50 - var9); - field1831[var4] = var2 + graphics.Rasterizer3D_zoom * (var11 + ((yViewportBuffer[var5] - var11) * var14 >> 16)) / 50; - field1837[var4] = var3 + graphics.Rasterizer3D_zoom * (var12 + ((field1839[var5] - var12) * var14 >> 16)) / 50; - xViewportBuffer[var4++] = var13 + ((this.field1856[var1] - var13) * var14 >> 16); - } - - if (var10 >= 50) - { - var14 = field1890[var10 - var9] * (50 - var9); - field1831[var4] = var2 + graphics.Rasterizer3D_zoom * (var11 + ((yViewportBuffer[var7] - var11) * var14 >> 16)) / 50; - field1837[var4] = var3 + graphics.Rasterizer3D_zoom * (var12 + ((field1839[var7] - var12) * var14 >> 16)) / 50; - xViewportBuffer[var4++] = var13 + ((this.field1823[var1] - var13) * var14 >> 16); - } - } - - if (var10 >= 50) - { - field1831[var4] = modelViewportYs[var7]; - field1837[var4] = modelViewportXs[var7]; - xViewportBuffer[var4++] = this.field1823[var1]; - } - else - { - var11 = yViewportBuffer[var7]; - var12 = field1839[var7]; - var13 = this.field1823[var1]; - if (var9 >= 50) - { - var14 = field1890[var9 - var10] * (50 - var10); - field1831[var4] = var2 + graphics.Rasterizer3D_zoom * (var11 + ((yViewportBuffer[var6] - var11) * var14 >> 16)) / 50; - field1837[var4] = var3 + graphics.Rasterizer3D_zoom * (var12 + ((field1839[var6] - var12) * var14 >> 16)) / 50; - xViewportBuffer[var4++] = var13 + ((this.field1854[var1] - var13) * var14 >> 16); - } - - if (var8 >= 50) - { - var14 = field1890[var8 - var10] * (50 - var10); - field1831[var4] = var2 + graphics.Rasterizer3D_zoom * (var11 + ((yViewportBuffer[var5] - var11) * var14 >> 16)) / 50; - field1837[var4] = var3 + graphics.Rasterizer3D_zoom * (var12 + ((field1839[var5] - var12) * var14 >> 16)) / 50; - xViewportBuffer[var4++] = var13 + ((this.field1856[var1] - var13) * var14 >> 16); - } - } - - var11 = field1831[0]; - var12 = field1831[1]; - var13 = field1831[2]; - var14 = field1837[0]; - int var15 = field1837[1]; - int var16 = field1837[2]; - graphics.rasterClipEnable = false; - int var17; - int var18; - int var19; - int var20; - if (var4 == 3) - { - if (var11 < 0 || var12 < 0 || var13 < 0 || var11 > graphics.rasterClipX || var12 > graphics.rasterClipX || var13 > graphics.rasterClipX) - { - graphics.rasterClipEnable = true; - } - - if (this.field1841 != null && this.field1841[var1] != -1) - { - if (this.field1840 != null && this.field1840[var1] != -1) - { - var20 = this.field1840[var1] & 255; - var17 = this.field1844[var20]; - var18 = this.field1865[var20]; - var19 = this.field1846[var20]; - } - else - { - var17 = var5; - var18 = var6; - var19 = var7; - } - - if (this.field1823[var1] == -1) - { - graphics.rasterTextureAffine(var14, var15, var16, var11, var12, var13, this.field1856[var1], this.field1856[var1], this.field1856[var1], yViewportBuffer[var17], yViewportBuffer[var18], yViewportBuffer[var19], field1839[var17], field1839[var18], field1839[var19], field1869[var17], field1869[var18], field1869[var19], this.field1841[var1]); - } - else - { - graphics.rasterTextureAffine(var14, var15, var16, var11, var12, var13, xViewportBuffer[0], xViewportBuffer[1], xViewportBuffer[2], yViewportBuffer[var17], yViewportBuffer[var18], yViewportBuffer[var19], field1839[var17], field1839[var18], field1839[var19], field1869[var17], field1869[var18], field1869[var19], this.field1841[var1]); - } - } - else if (this.field1823[var1] == -1) - { - int[] field1889 = graphics.colorPalette; - graphics.rasterFlat(var14, var15, var16, var11, var12, var13, field1889[this.field1856[var1]]); - } - else - { - graphics.rasterGouraud(var14, var15, var16, var11, var12, var13, xViewportBuffer[0], xViewportBuffer[1], xViewportBuffer[2]); - } - } - - if (var4 == 4) - { - if (var11 < 0 || var12 < 0 || var13 < 0 || var11 > graphics.rasterClipX || var12 > graphics.rasterClipX || var13 > graphics.rasterClipX || field1831[3] < 0 || field1831[3] > graphics.rasterClipX) - { - graphics.rasterClipEnable = true; - } - - if (this.field1841 != null && this.field1841[var1] != -1) - { - if (this.field1840 != null && this.field1840[var1] != -1) - { - var20 = this.field1840[var1] & 255; - var17 = this.field1844[var20]; - var18 = this.field1865[var20]; - var19 = this.field1846[var20]; - } - else - { - var17 = var5; - var18 = var6; - var19 = var7; - } - - short var21 = this.field1841[var1]; - if (this.field1823[var1] == -1) - { - graphics.rasterTextureAffine(var14, var15, var16, var11, var12, var13, this.field1856[var1], this.field1856[var1], this.field1856[var1], yViewportBuffer[var17], yViewportBuffer[var18], yViewportBuffer[var19], field1839[var17], field1839[var18], field1839[var19], field1869[var17], field1869[var18], field1869[var19], var21); - graphics.rasterTextureAffine(var14, var16, field1837[3], var11, var13, field1831[3], this.field1856[var1], this.field1856[var1], this.field1856[var1], yViewportBuffer[var17], yViewportBuffer[var18], yViewportBuffer[var19], field1839[var17], field1839[var18], field1839[var19], field1869[var17], field1869[var18], field1869[var19], var21); - } - else - { - graphics.rasterTextureAffine(var14, var15, var16, var11, var12, var13, xViewportBuffer[0], xViewportBuffer[1], xViewportBuffer[2], yViewportBuffer[var17], yViewportBuffer[var18], yViewportBuffer[var19], field1839[var17], field1839[var18], field1839[var19], field1869[var17], field1869[var18], field1869[var19], var21); - graphics.rasterTextureAffine(var14, var16, field1837[3], var11, var13, field1831[3], xViewportBuffer[0], xViewportBuffer[2], xViewportBuffer[3], yViewportBuffer[var17], yViewportBuffer[var18], yViewportBuffer[var19], field1839[var17], field1839[var18], field1839[var19], field1869[var17], field1869[var18], field1869[var19], var21); - } - } - else if (this.field1823[var1] == -1) - { - int[] field1889 = graphics.colorPalette; - var17 = field1889[this.field1856[var1]]; - graphics.rasterFlat(var14, var15, var16, var11, var12, var13, var17); - graphics.rasterFlat(var14, var16, field1837[3], var11, var13, field1831[3], var17); - } - else - { - graphics.rasterGouraud(var14, var15, var16, var11, var12, var13, xViewportBuffer[0], xViewportBuffer[1], xViewportBuffer[2]); - graphics.rasterGouraud(var14, var16, field1837[3], var11, var13, field1831[3], xViewportBuffer[0], xViewportBuffer[2], xViewportBuffer[3]); - } - } - - } -} \ No newline at end of file diff --git a/cache/src/main/java/net/runelite/cache/item/RSTextureProvider.java b/cache/src/main/java/net/runelite/cache/item/RSTextureProvider.java deleted file mode 100644 index a38f14dce3..0000000000 --- a/cache/src/main/java/net/runelite/cache/item/RSTextureProvider.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * 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.item; - -import net.runelite.cache.definitions.TextureDefinition; -import net.runelite.cache.definitions.providers.SpriteProvider; -import net.runelite.cache.definitions.providers.TextureProvider; - -public class RSTextureProvider -{ - private final SpriteProvider spriteProvider; - TextureDefinition[] textures; - int maxSize; - int size; - double brightness; - int width; - - public RSTextureProvider(TextureProvider textureProvider, SpriteProvider spriteProvider) - { - this.spriteProvider = spriteProvider; - this.size = 0; - this.brightness = 1.0D; - this.width = 128; - this.maxSize = 20; - this.size = this.maxSize; - this.brightness = 0.8D; - this.width = 128; - - int max = -1; - for (TextureDefinition textureDefinition : textureProvider.provide()) - { - if (textureDefinition.getId() > max) - { - max = textureDefinition.getId(); - } - } - - textures = new TextureDefinition[max + 1]; - for (TextureDefinition textureDefinition : textureProvider.provide()) - { - textures[textureDefinition.getId()] = textureDefinition; - } - } - - public int[] load(int var1) - { - TextureDefinition var2 = this.textures[var1]; - if (var2 != null) - { - if (var2.pixels != null) - { - return var2.pixels; - } - - boolean var3 = var2.method2680(this.brightness, this.width, spriteProvider); - return var2.pixels; - } - - return null; - } - - - public int getAverageTextureRGB(int var1) - { - return this.textures[var1] != null ? this.textures[var1].field1777 : 0; - } - - - public boolean vmethod3057(int var1) - { - return this.textures[var1].field1778; - } - - - public boolean vmethod3066(int var1) - { - return this.width == 64; - } -} diff --git a/cache/src/main/java/net/runelite/cache/item/Rasterizer2D.java b/cache/src/main/java/net/runelite/cache/item/Rasterizer2D.java deleted file mode 100644 index b3d03fdd61..0000000000 --- a/cache/src/main/java/net/runelite/cache/item/Rasterizer2D.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * 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.item; - -class Rasterizer2D -{ - public int[] graphicsPixels; - public int graphicsPixelsWidth; - public int graphicsPixelsHeight; - public int drawingAreaTop; - public int drawingAreaBottom; - public int draw_region_x; - protected int drawingAreaRight; - - public void setRasterBuffer(int[] var0, int var1, int var2) - { - graphicsPixels = var0; - graphicsPixelsWidth = var1; - graphicsPixelsHeight = var2; - setDrawRegion(0, 0, var1, var2); - } - - public void setDrawRegion(int var0, int var1, int var2, int var3) - { - if (var0 < 0) - { - var0 = 0; - } - - if (var1 < 0) - { - var1 = 0; - } - - if (var2 > graphicsPixelsWidth) - { - var2 = graphicsPixelsWidth; - } - - if (var3 > graphicsPixelsHeight) - { - var3 = graphicsPixelsHeight; - } - - draw_region_x = var0; - drawingAreaTop = var1; - drawingAreaRight = var2; - drawingAreaBottom = var3; - } - - public void reset() - { - int var0 = 0; - - int var1; - for (var1 = graphicsPixelsWidth * graphicsPixelsHeight - 7; var0 < var1; graphicsPixels[var0++] = 0) - { - graphicsPixels[var0++] = 0; - graphicsPixels[var0++] = 0; - graphicsPixels[var0++] = 0; - graphicsPixels[var0++] = 0; - graphicsPixels[var0++] = 0; - graphicsPixels[var0++] = 0; - graphicsPixels[var0++] = 0; - } - - for (var1 += 7; var0 < var1; graphicsPixels[var0++] = 0) - { - ; - } - - } - -} \ No newline at end of file diff --git a/cache/src/main/java/net/runelite/cache/item/Renderable.java b/cache/src/main/java/net/runelite/cache/item/Renderable.java deleted file mode 100644 index e1ef1b427a..0000000000 --- a/cache/src/main/java/net/runelite/cache/item/Renderable.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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.item; - -abstract class Renderable -{ - public int modelHeight; - - protected Renderable() - { - this.modelHeight = 1000; - } -} diff --git a/cache/src/main/java/net/runelite/cache/item/SpritePixels.java b/cache/src/main/java/net/runelite/cache/item/SpritePixels.java deleted file mode 100644 index 02079847f7..0000000000 --- a/cache/src/main/java/net/runelite/cache/item/SpritePixels.java +++ /dev/null @@ -1,216 +0,0 @@ -/* - * 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.item; - -import java.awt.image.BufferedImage; - -class SpritePixels -{ - public int[] pixels; - public int width; - public int height; - public int offsetX; - int offsetY; - - public SpritePixels(int[] var1, int var2, int var3) - { - this.pixels = var1; - this.width = var2; - this.height = var3; - this.offsetY = 0; - this.offsetX = 0; - } - - public SpritePixels(int var1, int var2) - { - this(new int[var2 * var1], var1, var2); - } - - public void drawBorder(int color) - { - int[] newPixels = new int[this.width * this.height]; - int pixelIndex = 0; - - for (int y = 0; y < this.height; ++y) - { - for (int x = 0; x < this.width; ++x) - { - int pixel = this.pixels[pixelIndex]; - if (pixel == 0) - { - // W - if (x > 0 && this.pixels[pixelIndex - 1] != 0) - { - pixel = color; - } - // N - else if (y > 0 && this.pixels[pixelIndex - this.width] != 0) - { - pixel = color; - } - // E - else if (x < this.width - 1 && this.pixels[pixelIndex + 1] != 0) - { - pixel = color; - } - // S - else if (y < this.height - 1 && this.pixels[pixelIndex + this.width] != 0) - { - pixel = color; - } - } - - newPixels[pixelIndex++] = pixel; - } - } - - this.pixels = newPixels; - } - - - public void drawShadow(int color) - { - for (int y = this.height - 1; y > 0; --y) - { - int rowOffset = y * this.width; - - for (int x = this.width - 1; x > 0; --x) - { - // if *this* pixel is black/unset AND the pixel to the NW isn't black/unset - if (this.pixels[x + rowOffset] == 0 && this.pixels[x + rowOffset - 1 - this.width] != 0) - { - this.pixels[x + rowOffset] = color; - } - } - } - - } - - public void drawAtOn(Rasterizer2D graphics, int x, int y) - { - x += this.offsetX; - y += this.offsetY; - int pixelIndex = x + y * graphics.graphicsPixelsWidth; - int deltaIndex = 0; - int height = this.height; - int width = this.width; - int var7 = graphics.graphicsPixelsWidth - width; - int var8 = 0; - if (y < graphics.drawingAreaTop) - { - int deltaY = graphics.drawingAreaTop - y; - height -= deltaY; - y = graphics.drawingAreaTop; - deltaIndex += deltaY * width; - pixelIndex += deltaY * graphics.graphicsPixelsWidth; - } - - if (height + y > graphics.drawingAreaBottom) - { - height -= height + y - graphics.drawingAreaBottom; - } - - if (x < graphics.draw_region_x) - { - int deltaX = graphics.draw_region_x - x; - width -= deltaX; - x = graphics.draw_region_x; - deltaIndex += deltaX; - pixelIndex += deltaX; - var8 += deltaX; - var7 += deltaX; - } - - if (width + x > graphics.drawingAreaRight) - { - int deltaX = width + x - graphics.drawingAreaRight; - width -= deltaX; - var8 += deltaX; - var7 += deltaX; - } - - if (width > 0 && height > 0) - { - method5843(graphics.graphicsPixels, this.pixels, 0, deltaIndex, pixelIndex, width, height, var7, var8); - } - } - - static void method5843(int[] rasterizerPixels, int[] spritePixels, int var2, int var3, int pixelIndex, int width, int height, int var7, int var8) - { - int var9 = -(width >> 2); - width = -(width & 3); - - for (int var10 = -height; var10 < 0; ++var10) - { - for (int i = var9 * 4; i < 0; ++i) - { - var2 = spritePixels[var3++]; - if (var2 != 0) - { - rasterizerPixels[pixelIndex++] = var2; - } - else - { - ++pixelIndex; - } - } - - for (int i = width; i < 0; ++i) - { - var2 = spritePixels[var3++]; - if (var2 != 0) - { - rasterizerPixels[pixelIndex++] = var2; - } - else - { - ++pixelIndex; - } - } - - pixelIndex += var7; - var3 += var8; - } - - } - - public BufferedImage toBufferedImage() - { - int[] transPixels = new int[pixels.length]; - BufferedImage img = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); - - for (int i = 0; i < pixels.length; i++) - { - if (pixels[i] != 0) - { - transPixels[i] = pixels[i] | 0xff000000; - } - } - - img.setRGB(0, 0, width, height, transPixels, 0, width); - return img; - } - -} diff --git a/cache/src/main/java/net/runelite/cache/models/CircularAngle.java b/cache/src/main/java/net/runelite/cache/models/CircularAngle.java deleted file mode 100644 index b93f1eec5c..0000000000 --- a/cache/src/main/java/net/runelite/cache/models/CircularAngle.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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.models; - -public class CircularAngle -{ - private static final double UNIT = Math.PI / 1024d; // How much of the circle each unit of SINE/COSINE is - - public static final int[] SINE = new int[2048]; // sine angles for each of the 2048 units, * 65536 and stored as an int - public static final int[] COSINE = new int[2048]; // cosine - - static - { - for (int i = 0; i < 2048; ++i) - { - SINE[i] = (int) (65536.0D * Math.sin((double) i * UNIT)); - COSINE[i] = (int) (65536.0D * Math.cos((double) i * UNIT)); - } - } -} diff --git a/cache/src/main/java/net/runelite/cache/models/FaceNormal.java b/cache/src/main/java/net/runelite/cache/models/FaceNormal.java deleted file mode 100644 index 387db6a335..0000000000 --- a/cache/src/main/java/net/runelite/cache/models/FaceNormal.java +++ /dev/null @@ -1,8 +0,0 @@ -package net.runelite.cache.models; - -public class FaceNormal -{ - public int x; - public int y; - public int z; -} diff --git a/cache/src/main/java/net/runelite/cache/models/ObjExporter.java b/cache/src/main/java/net/runelite/cache/models/ObjExporter.java deleted file mode 100644 index 8913610177..0000000000 --- a/cache/src/main/java/net/runelite/cache/models/ObjExporter.java +++ /dev/null @@ -1,151 +0,0 @@ -/* - * 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.models; - -import java.awt.Color; -import java.io.PrintWriter; -import net.runelite.cache.TextureManager; -import net.runelite.cache.definitions.ModelDefinition; -import net.runelite.cache.definitions.TextureDefinition; - -public class ObjExporter -{ - private final TextureManager textureManager; - private final ModelDefinition model; - - public ObjExporter(TextureManager textureManager, ModelDefinition model) - { - this.textureManager = textureManager; - this.model = model; - } - - public void export(PrintWriter objWriter, PrintWriter mtlWriter) - { - model.computeNormals(); - model.computeTextureUVCoordinates(); - - objWriter.println("mtllib " + model.id + ".mtl"); - - objWriter.println("o runescapemodel"); - - for (int i = 0; i < model.vertexCount; ++i) - { - objWriter.println("v " + model.vertexPositionsX[i] + " " - + model.vertexPositionsY[i] * -1 + " " - + model.vertexPositionsZ[i] * -1); - } - - if (model.faceTextures != null) - { - float[][] u = model.faceTextureUCoordinates; - float[][] v = model.faceTextureVCoordinates; - - for (int i = 0; i < model.faceCount; ++i) - { - objWriter.println("vt " + u[i][0] + " " + v[i][0]); - objWriter.println("vt " + u[i][1] + " " + v[i][1]); - objWriter.println("vt " + u[i][2] + " " + v[i][2]); - } - } - - for (VertexNormal normal : model.vertexNormals) - { - objWriter.println("vn " + normal.x + " " + normal.y + " " + normal.z); - } - - for (int i = 0; i < model.faceCount; ++i) - { - int x = model.faceVertexIndices1[i] + 1; - int y = model.faceVertexIndices2[i] + 1; - int z = model.faceVertexIndices3[i] + 1; - - objWriter.println("usemtl m" + i); - if (model.faceTextures != null) - { - objWriter.println("f " - + x + "/" + (i * 3 + 1) + " " - + y + "/" + (i * 3 + 2) + " " - + z + "/" + (i * 3 + 3)); - - } - else - { - objWriter.println("f " + x + " " + y + " " + z); - } - objWriter.println(""); - } - - // Write material - for (int i = 0; i < model.faceCount; ++i) - { - short textureId = -1; - - if (model.faceTextures != null) - { - textureId = model.faceTextures[i]; - } - - mtlWriter.println("newmtl m" + i); - - if (textureId == -1) - { - Color color = rs2hsbToColor(model.faceColors[i]); - - double r = color.getRed() / 255.0; - double g = color.getGreen() / 255.0; - double b = color.getBlue() / 255.0; - - mtlWriter.println("Kd " + r + " " + g + " " + b); - } - else - { - TextureDefinition texture = textureManager.findTexture(textureId); - assert texture != null; - - mtlWriter.println("map_Kd sprite/" + texture.getFileIds()[0] + "-0.png"); - } - - int alpha = 0; - - if (model.faceAlphas != null) - { - alpha = model.faceAlphas[i] & 0xFF; - } - - if (alpha != 0) - { - mtlWriter.println("d " + (alpha / 255.0)); - } - } - } - - private static Color rs2hsbToColor(int hsb) - { - int decode_hue = (hsb >> 10) & 0x3f; - int decode_saturation = (hsb >> 7) & 0x07; - int decode_brightness = (hsb & 0x7f); - return Color.getHSBColor((float) decode_hue / 63, (float) decode_saturation / 7, (float) decode_brightness / 127); - } -} diff --git a/cache/src/main/java/net/runelite/cache/models/Vector3f.java b/cache/src/main/java/net/runelite/cache/models/Vector3f.java deleted file mode 100644 index a93e1cd1ff..0000000000 --- a/cache/src/main/java/net/runelite/cache/models/Vector3f.java +++ /dev/null @@ -1,103 +0,0 @@ -package net.runelite.cache.models; - -public class Vector3f -{ - public float x; - public float y; - public float z; - - public Vector3f() - { - } - - public Vector3f(float x, float y, float z) - { - this.x = x; - this.y = y; - this.z = z; - } - - public Vector3f(Vector3f other) - { - this.x = other.x; - this.y = other.y; - this.z = other.z; - } - - @Override - public String toString() - { - return "Vector3f{" + "x=" + x + ", y=" + y + ", z=" + z + '}'; - } - - @Override - public int hashCode() - { - int hash = 7; - hash = 23 * hash + Float.floatToIntBits(this.x); - hash = 23 * hash + Float.floatToIntBits(this.y); - hash = 23 * hash + Float.floatToIntBits(this.z); - return hash; - } - - @Override - public boolean equals(Object obj) - { - if (this == obj) - { - return true; - } - if (obj == null) - { - return false; - } - if (getClass() != obj.getClass()) - { - return false; - } - final Vector3f other = (Vector3f) obj; - if (Float.floatToIntBits(this.x) != Float.floatToIntBits(other.x)) - { - return false; - } - if (Float.floatToIntBits(this.y) != Float.floatToIntBits(other.y)) - { - return false; - } - if (Float.floatToIntBits(this.z) != Float.floatToIntBits(other.z)) - { - return false; - } - return true; - } - - public float getX() - { - return x; - } - - public void setX(float x) - { - this.x = x; - } - - public float getY() - { - return y; - } - - public void setY(float y) - { - this.y = y; - } - - public float getZ() - { - return z; - } - - public void setZ(float z) - { - this.z = z; - } -} diff --git a/cache/src/main/java/net/runelite/cache/models/VertexNormal.java b/cache/src/main/java/net/runelite/cache/models/VertexNormal.java deleted file mode 100644 index b1635ed1c9..0000000000 --- a/cache/src/main/java/net/runelite/cache/models/VertexNormal.java +++ /dev/null @@ -1,30 +0,0 @@ -package net.runelite.cache.models; - -public class VertexNormal -{ - public int x; - public int y; - public int z; - public int magnitude; - - public Vector3f normalize() - { - Vector3f v = new Vector3f(); - - int length = (int) Math.sqrt((double) (x * x + y * y + z * z)); - if (length == 0) - { - length = 1; - } - - v.x = (float) x / length; - v.y = (float) y / length; - v.z = (float) z / length; - - assert v.x >= -1f && v.x <= 1f; - assert v.y >= -1f && v.y <= 1f; - assert v.z >= -1f && v.z <= 1f; - - return v; - } -} diff --git a/cache/src/main/java/net/runelite/cache/region/HeightCalc.java b/cache/src/main/java/net/runelite/cache/region/HeightCalc.java deleted file mode 100644 index 18b291e89f..0000000000 --- a/cache/src/main/java/net/runelite/cache/region/HeightCalc.java +++ /dev/null @@ -1,100 +0,0 @@ -/** - * Copyright (c) 2015 Kyle Friz - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -package net.runelite.cache.region; - -/** - * @author Kyle Friz - * @since Feb 20, 2016 - */ -public class HeightCalc -{ - private static final int JAGEX_CIRCULAR_ANGLE = 2048; - private static final double ANGULAR_RATIO = 360D / JAGEX_CIRCULAR_ANGLE; - private static final double JAGEX_RADIAN = Math.toRadians(ANGULAR_RATIO); - - private static final int[] SIN = new int[JAGEX_CIRCULAR_ANGLE]; - private static final int[] COS = new int[JAGEX_CIRCULAR_ANGLE]; - - static - { - for (int i = 0; i < JAGEX_CIRCULAR_ANGLE; i++) - { - SIN[i] = (int) (65536.0D * Math.sin((double) i * JAGEX_RADIAN)); - COS[i] = (int) (65536.0D * Math.cos((double) i * JAGEX_RADIAN)); - } - } - - public static int calculate(int x, int y) - { - int n = interpolateNoise(x + 45365, y + 91923, 4) - 128 - + (interpolateNoise(10294 + x, y + 37821, 2) - 128 >> 1) - + (interpolateNoise(x, y, 1) - 128 >> 2); - n = 35 + (int) ((double) n * 0.3D); - if (n < 10) - { - n = 10; - } - else if (n > 60) - { - n = 60; - } - - return n; - } - - public static int interpolateNoise(int x, int y, int frequency) - { - int intX = x / frequency; - int fracX = x & frequency - 1; - int intY = y / frequency; - int fracY = y & frequency - 1; - int v1 = smoothedNoise1(intX, intY); - int v2 = smoothedNoise1(intX + 1, intY); - int v3 = smoothedNoise1(intX, intY + 1); - int v4 = smoothedNoise1(1 + intX, 1 + intY); - int i1 = interpolate(v1, v2, fracX, frequency); - int i2 = interpolate(v3, v4, fracX, frequency); - return interpolate(i1, i2, fracY, frequency); - } - - public static int smoothedNoise1(int x, int y) - { - int corners = noise(x - 1, y - 1) + noise(x + 1, y - 1) + noise(x - 1, 1 + y) + noise(x + 1, y + 1); - int sides = noise(x - 1, y) + noise(1 + x, y) + noise(x, y - 1) + noise(x, 1 + y); - int center = noise(x, y); - return center / 4 + sides / 8 + corners / 16; - } - - public static int noise(int x, int y) - { - int n = x + y * 57; - n ^= n << 13; - return ((n * (n * n * 15731 + 789221) + 1376312589) & Integer.MAX_VALUE) >> 19 & 255; - } - - public static int interpolate(int a, int b, int x, int y) - { - int f = 65536 - COS[1024 * x / y] >> 1; - return (f * b >> 16) + (a * (65536 - f) >> 16); - } - -} diff --git a/cache/src/main/java/net/runelite/cache/region/Region.java b/cache/src/main/java/net/runelite/cache/region/Region.java deleted file mode 100644 index 7dbda27534..0000000000 --- a/cache/src/main/java/net/runelite/cache/region/Region.java +++ /dev/null @@ -1,189 +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.cache.region; - -import java.util.ArrayList; -import java.util.List; -import net.runelite.cache.definitions.LocationsDefinition; -import net.runelite.cache.definitions.MapDefinition; -import net.runelite.cache.definitions.MapDefinition.Tile; - -public class Region -{ - - public static final int X = 64; - public static final int Y = 64; - public static final int Z = 4; - - private final int regionID; - private final int baseX; - private final int baseY; - - private final int[][][] tileHeights = new int[Z][X][Y]; - private final byte[][][] tileSettings = new byte[Z][X][Y]; - private final byte[][][] overlayIds = new byte[Z][X][Y]; - private final byte[][][] overlayPaths = new byte[Z][X][Y]; - private final byte[][][] overlayRotations = new byte[Z][X][Y]; - private final byte[][][] underlayIds = new byte[Z][X][Y]; - - private final List locations = new ArrayList<>(); - - public Region(int id) - { - this.regionID = id; - this.baseX = ((id >> 8) & 0xFF) << 6; // local coords are in bottom 6 bits (64*64) - this.baseY = (id & 0xFF) << 6; - } - - public Region(int x, int y) - { - this.regionID = x << 8 | y; - this.baseX = x << 6; - this.baseY = y << 6; - } - - public void loadTerrain(MapDefinition map) - { - Tile[][][] tiles = map.getTiles(); - for (int z = 0; z < Z; z++) - { - for (int x = 0; x < X; x++) - { - for (int y = 0; y < Y; y++) - { - Tile tile = tiles[z][x][y]; - - if (tile.height == null) - { - if (z == 0) - { - tileHeights[0][x][y] = -HeightCalc.calculate(baseX + x + 0xe3b7b, baseY + y + 0x87cce) * 8; - } - else - { - tileHeights[z][x][y] = tileHeights[z - 1][x][y] - 240; - } - } - else - { - int height = tile.getHeight(); - if (height == 1) - { - height = 0; - } - - if (z == 0) - { - tileHeights[0][x][y] = -height * 8; - } - else - { - tileHeights[z][x][y] = tileHeights[z - 1][x][y] - height * 8; - } - } - - overlayIds[z][x][y] = tile.getOverlayId(); - overlayPaths[z][x][y] = tile.getOverlayPath(); - overlayRotations[z][x][y] = tile.getOverlayRotation(); - - tileSettings[z][x][y] = tile.getSettings(); - underlayIds[z][x][y] = tile.getUnderlayId(); - } - } - } - } - - public void loadLocations(LocationsDefinition locs) - { - for (Location loc : locs.getLocations()) - { - Location newLoc = new Location(loc.getId(), loc.getType(), loc.getOrientation(), - new Position(getBaseX() + loc.getPosition().getX(), - getBaseY() + loc.getPosition().getY(), - loc.getPosition().getZ())); - locations.add(newLoc); - } - } - - public int getRegionID() - { - return regionID; - } - - public int getBaseX() - { - return baseX; - } - - public int getBaseY() - { - return baseY; - } - - public int getTileHeight(int z, int x, int y) - { - return tileHeights[z][x][y]; - } - - public byte getTileSetting(int z, int x, int y) - { - return tileSettings[z][x][y]; - } - - public int getOverlayId(int z, int x, int y) - { - return overlayIds[z][x][y] & 0xFF; - } - - public byte getOverlayPath(int z, int x, int y) - { - return overlayPaths[z][x][y]; - } - - public byte getOverlayRotation(int z, int x, int y) - { - return overlayRotations[z][x][y]; - } - - public int getUnderlayId(int z, int x, int y) - { - return underlayIds[z][x][y] & 0xFF; - } - - public List getLocations() - { - return locations; - } - - public int getRegionX() - { - return baseX >> 6; - } - - public int getRegionY() - { - return baseY >> 6; - } -} diff --git a/cache/src/main/java/net/runelite/cache/region/RegionLoader.java b/cache/src/main/java/net/runelite/cache/region/RegionLoader.java deleted file mode 100644 index a15e25a868..0000000000 --- a/cache/src/main/java/net/runelite/cache/region/RegionLoader.java +++ /dev/null @@ -1,176 +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.cache.region; - -import java.io.IOException; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; -import net.runelite.cache.IndexType; -import net.runelite.cache.definitions.LocationsDefinition; -import net.runelite.cache.definitions.MapDefinition; -import net.runelite.cache.definitions.loaders.LocationsLoader; -import net.runelite.cache.definitions.loaders.MapLoader; -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.util.XteaKeyManager; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class RegionLoader -{ - private static final Logger logger = LoggerFactory.getLogger(RegionLoader.class); - - private static final int MAX_REGION = 32768; - - private final Store store; - private final Index index; - private final XteaKeyManager keyManager; - - private final Map regions = new HashMap<>(); - private Region lowestX = null, lowestY = null; - private Region highestX = null, highestY = null; - - public RegionLoader(Store store) - { - this.store = store; - index = store.getIndex(IndexType.MAPS); - keyManager = new XteaKeyManager(); - keyManager.loadKeys(); - } - - public void loadRegions() throws IOException - { - for (int i = 0; i < MAX_REGION; ++i) - { - Region region = this.loadRegionFromArchive(i); - if (region != null) - { - regions.put(i, region); - } - } - } - - public Region loadRegionFromArchive(int i) throws IOException - { - int x = i >> 8; - int y = i & 0xFF; - - Storage storage = store.getStorage(); - Archive map = index.findArchiveByName("m" + x + "_" + y); - Archive land = index.findArchiveByName("l" + x + "_" + y); - - assert (map == null) == (land == null); - - if (map == null || land == null) - { - return null; - } - - byte[] data = map.decompress(storage.loadArchive(map)); - - MapDefinition mapDef = new MapLoader().load(x, y, data); - - Region region = new Region(i); - region.loadTerrain(mapDef); - - int[] keys = keyManager.getKeys(i); - if (keys != null) - { - try - { - data = land.decompress(storage.loadArchive(land), keys); - LocationsDefinition locDef = new LocationsLoader().load(x, y, data); - region.loadLocations(locDef); - } - catch (IOException ex) - { - logger.debug("Can't decrypt region " + i, ex); - } - } - - return region; - } - - public void calculateBounds() - { - for (Region region : regions.values()) - { - if (lowestX == null || region.getBaseX() < lowestX.getBaseX()) - { - lowestX = region; - } - - if (highestX == null || region.getBaseX() > highestX.getBaseX()) - { - highestX = region; - } - - if (lowestY == null || region.getBaseY() < lowestY.getBaseY()) - { - lowestY = region; - } - - if (highestY == null || region.getBaseY() > highestY.getBaseY()) - { - highestY = region; - } - } - } - - public Collection getRegions() - { - return regions.values(); - } - - public Region findRegionForWorldCoordinates(int x, int y) - { - x >>>= 6; - y >>>= 6; - return regions.get((x << 8) | y); - } - - public Region getLowestX() - { - return lowestX; - } - - public Region getLowestY() - { - return lowestY; - } - - public Region getHighestX() - { - return highestX; - } - - public Region getHighestY() - { - return highestY; - } -} diff --git a/cache/src/main/java/net/runelite/cache/script/Instructions.java b/cache/src/main/java/net/runelite/cache/script/Instructions.java deleted file mode 100644 index 17dfabfcd1..0000000000 --- a/cache/src/main/java/net/runelite/cache/script/Instructions.java +++ /dev/null @@ -1,534 +0,0 @@ -/* - * Copyright (c) 2017, Adam - * Copyright (c) 2018-2019, Hunter WB - * Copyright (c) 2019, 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.script; - -import java.util.HashMap; -import java.util.Map; -import static net.runelite.cache.script.Opcodes.*; - -public class Instructions -{ - private final Map instructions = new HashMap<>(); - private final Map instructionsByName = new HashMap<>(); - - public void init() - { - add(ICONST, "iconst"); - add(GET_VARP, "get_varp"); - add(SET_VARP, "set_varp"); - add(SCONST, "sconst"); - add(JUMP, "jump"); - add(IF_ICMPNE, "if_icmpne"); - add(IF_ICMPEQ, "if_icmpeq"); - add(IF_ICMPLT, "if_icmplt"); - add(IF_ICMPGT, "if_icmpgt"); - add(RETURN, "return"); - add(GET_VARBIT, "get_varbit"); - add(SET_VARBIT, "set_varbit"); - add(IF_ICMPLE, "if_icmple"); - add(IF_ICMPGE, "if_icmpge"); - add(ILOAD, "iload"); - add(ISTORE, "istore"); - add(SLOAD, "sload"); - add(SSTORE, "sstore"); - add(JOIN_STRING, "join_string"); - add(POP_INT, "pop_int"); - add(POP_STRING, "pop_string"); - add(INVOKE, "invoke"); - add(GET_VARC_INT, "get_varc_int"); - add(SET_VARC_INT, "set_varc_int"); - add(DEFINE_ARRAY, "define_array"); - add(GET_ARRAY_INT, "get_array_int"); - add(SET_ARRAY_INT, "set_array_int"); - add(GET_VARC_STRING_OLD, "get_varc_string_old"); - add(SET_VARC_STRING_OLD, "set_varc_string_old"); - add(GET_VARC_STRING, "get_varc_string"); - add(SET_VARC_STRING, "set_varc_string"); - add(SWITCH, "switch"); - add(CC_CREATE, "cc_create"); - add(CC_DELETE, "cc_delete"); - add(CC_DELETEALL, "cc_deleteall"); - add(CC_FIND, "cc_find"); - add(IF_FIND, "if_find"); - add(CC_SETPOSITION, "cc_setposition"); - add(CC_SETSIZE, "cc_setsize"); - add(CC_SETHIDE, "cc_sethide"); - add(CC_SETNOCLICKTHROUGH, "cc_setnoclickthrough"); - add(CC_SETSCROLLPOS, "cc_setscrollpos"); - add(CC_SETCOLOUR, "cc_setcolour"); - add(CC_SETFILL, "cc_setfill"); - add(CC_SETTRANS, "cc_settrans"); - add(CC_SETLINEWID, "cc_setlinewid"); - add(CC_SETGRAPHIC, "cc_setgraphic"); - add(CC_SET2DANGLE, "cc_set2dangle"); - add(CC_SETTILING, "cc_settiling"); - add(CC_SETMODEL, "cc_setmodel"); - add(CC_SETMODELANGLE, "cc_setmodelangle"); - add(CC_SETMODELANIM, "cc_setmodelanim"); - add(CC_SETMODELORTHOG, "cc_setmodelorthog"); - add(CC_SETTEXT, "cc_settext"); - add(CC_SETTEXTFONT, "cc_settextfont"); - add(CC_SETTEXTALIGN, "cc_settextalign"); - add(CC_SETTEXTSHADOW, "cc_settextshadow"); - add(CC_SETOUTLINE, "cc_setoutline"); - add(CC_SETGRAPHICSHADOW, "cc_setgraphicshadow"); - add(CC_SETVFLIP, "cc_setvflip"); - add(CC_SETHFLIP, "cc_sethflip"); - add(CC_SETSCROLLSIZE, "cc_setscrollsize"); - add(CC_RESUME_PAUSEBUTTON, "cc_resume_pausebutton"); - add(CC_SETFILLCOLOUR, "cc_setfillcolour"); - add(CC_SETLINEDIRECTION, "cc_setlinedirection"); - add(CC_SETOBJECT, "cc_setobject"); - add(CC_SETNPCHEAD, "cc_setnpchead"); - add(CC_SETPLAYERHEAD_SELF, "cc_setplayerhead_self"); - add(CC_SETOBJECT_NONUM, "cc_setobject_nonum"); - add(CC_SETOBJECT_ALWAYS_NUM, "cc_setobject_always_num"); - add(CC_SETOP, "cc_setop"); - add(CC_SETDRAGGABLE, "cc_setdraggable"); - add(CC_SETDRAGGABLEBEHAVIOR, "cc_setdraggablebehavior"); - add(CC_SETDRAGDEADZONE, "cc_setdragdeadzone"); - add(CC_SETDRAGDEADTIME, "cc_setdragdeadtime"); - add(CC_SETOPBASE, "cc_setopbase"); - add(CC_SETTARGETVERB, "cc_settargetverb"); - add(CC_CLEAROPS, "cc_clearops"); - add(CC_SETONCLICK, "cc_setonclick"); - add(CC_SETONHOLD, "cc_setonhold"); - add(CC_SETONRELEASE, "cc_setonrelease"); - add(CC_SETONMOUSEOVER, "cc_setonmouseover"); - add(CC_SETONMOUSELEAVE, "cc_setonmouseleave"); - add(CC_SETONDRAG, "cc_setondrag"); - add(CC_SETONTARGETLEAVE, "cc_setontargetleave"); - add(CC_SETONVARTRANSMIT, "cc_setonvartransmit"); - add(CC_SETONTIMER, "cc_setontimer"); - add(CC_SETONOP, "cc_setonop"); - add(CC_SETONDRAGCOMPLETE, "cc_setondragcomplete"); - add(CC_SETONCLICKREPEAT, "cc_setonclickrepeat"); - add(CC_SETONMOUSEREPEAT, "cc_setonmouserepeat"); - add(CC_SETONINVTRANSMIT, "cc_setoninvtransmit"); - add(CC_SETONSTATTRANSMIT, "cc_setonstattransmit"); - add(CC_SETONTARGETENTER, "cc_setontargetenter"); - add(CC_SETONSCROLLWHEEL, "cc_setonscrollwheel"); - add(CC_SETONCHATTRANSMIT, "cc_setonchattransmit"); - add(CC_SETONKEY, "cc_setonkey"); - add(CC_SETONFRIENDTRANSMIT, "cc_setonfriendtransmit"); - add(CC_SETONCLANTRANSMIT, "cc_setonclantransmit"); - add(CC_SETONMISCTRANSMIT, "cc_setonmisctransmit"); - add(CC_SETONDIALOGABORT, "cc_setondialogabort"); - add(CC_SETONSUBCHANGE, "cc_setonsubchange"); - add(CC_SETONSTOCKTRANSMIT, "cc_setonstocktransmit"); - add(CC_SETONRESIZE, "cc_setonresize"); - add(CC_GETX, "cc_getx"); - add(CC_GETY, "cc_gety"); - add(CC_GETWIDTH, "cc_getwidth"); - add(CC_GETHEIGHT, "cc_getheight"); - add(CC_GETHIDE, "cc_gethide"); - add(CC_GETLAYER, "cc_getlayer"); - add(CC_GETSCROLLX, "cc_getscrollx"); - add(CC_GETSCROLLY, "cc_getscrolly"); - add(CC_GETTEXT, "cc_gettext"); - add(CC_GETSCROLLWIDTH, "cc_getscrollwidth"); - add(CC_GETSCROLLHEIGHT, "cc_getscrollheight"); - add(CC_GETMODELZOOM, "cc_getmodelzoom"); - add(CC_GETMODELANGLE_X, "cc_getmodelangle_x"); - add(CC_GETMODELANGLE_Z, "cc_getmodelangle_z"); - add(CC_GETMODELANGLE_Y, "cc_getmodelangle_y"); - add(CC_GETTRANS, "cc_gettrans"); - add(CC_GETCOLOUR, "cc_getcolour"); - add(CC_GETFILLCOLOUR, "cc_getfillcolour"); - add(CC_GETINVOBJECT, "cc_getinvobject"); - add(CC_GETINVCOUNT, "cc_getinvcount"); - add(CC_GETID, "cc_getid"); - add(CC_GETTARGETMASK, "cc_gettargetmask"); - add(CC_GETOP, "cc_getop"); - add(CC_GETOPBASE, "cc_getopbase"); - add(CC_CALLONRESIZE, "cc_callonresize"); - add(IF_SETPOSITION, "if_setposition"); - add(IF_SETSIZE, "if_setsize"); - add(IF_SETHIDE, "if_sethide"); - add(IF_SETNOCLICKTHROUGH, "if_setnoclickthrough"); - add(IF_SETSCROLLPOS, "if_setscrollpos"); - add(IF_SETCOLOUR, "if_setcolour"); - add(IF_SETFILL, "if_setfill"); - add(IF_SETTRANS, "if_settrans"); - add(IF_SETLINEWID, "if_setlinewid"); - add(IF_SETGRAPHIC, "if_setgraphic"); - add(IF_SET2DANGLE, "if_set2dangle"); - add(IF_SETTILING, "if_settiling"); - add(IF_SETMODEL, "if_setmodel"); - add(IF_SETMODELANGLE, "if_setmodelangle"); - add(IF_SETMODELANIM, "if_setmodelanim"); - add(IF_SETMODELORTHOG, "if_setmodelorthog"); - add(IF_SETTEXT, "if_settext"); - add(IF_SETTEXTFONT, "if_settextfont"); - add(IF_SETTEXTALIGN, "if_settextalign"); - add(IF_SETTEXTSHADOW, "if_settextshadow"); - add(IF_SETOUTLINE, "if_setoutline"); - add(IF_SETGRAPHICSHADOW, "if_setgraphicshadow"); - add(IF_SETVFLIP, "if_setvflip"); - add(IF_SETHFLIP, "if_sethflip"); - add(IF_SETSCROLLSIZE, "if_setscrollsize"); - add(IF_RESUME_PAUSEBUTTON, "if_resume_pausebutton"); - add(IF_SETFILLCOLOUR, "if_setfillcolour"); - add(IF_SETLINEDIRECTION, "if_setlinedirection"); - add(IF_SETOBJECT, "if_setobject"); - add(IF_SETNPCHEAD, "if_setnpchead"); - add(IF_SETPLAYERHEAD_SELF, "if_setplayerhead_self"); - add(IF_SETOBJECT_NONUM, "if_setobject_nonum"); - add(IF_SETOBJECT_ALWAYS_NUM, "if_setobject_always_num"); - add(IF_SETOP, "if_setop"); - add(IF_SETDRAGGABLE, "if_setdraggable"); - add(IF_SETDRAGGABLEBEHAVIOR, "if_setdraggablebehavior"); - add(IF_SETDRAGDEADZONE, "if_setdragdeadzone"); - add(IF_SETDRAGDEADTIME, "if_setdragdeadtime"); - add(IF_SETOPBASE, "if_setopbase"); - add(IF_SETTARGETVERB, "if_settargetverb"); - add(IF_CLEAROPS, "if_clearops"); - add(IF_SETOPKEY, "if_setopkey"); - add(IF_SETOPTKEY, "if_setoptkey"); - add(IF_SETOPKEYRATE, "if_setopkeyrate"); - add(IF_SETOPTKEYRATE, "if_setoptkeyrate"); - add(IF_SETOPKEYIGNOREHELD, "if_setopkeyignoreheld"); - add(IF_SETOPTKEYIGNOREHELD, "if_setoptkeyignoreheld"); - add(IF_SETONCLICK, "if_setonclick"); - add(IF_SETONHOLD, "if_setonhold"); - add(IF_SETONRELEASE, "if_setonrelease"); - add(IF_SETONMOUSEOVER, "if_setonmouseover"); - add(IF_SETONMOUSELEAVE, "if_setonmouseleave"); - add(IF_SETONDRAG, "if_setondrag"); - add(IF_SETONTARGETLEAVE, "if_setontargetleave"); - add(IF_SETONVARTRANSMIT, "if_setonvartransmit"); - add(IF_SETONTIMER, "if_setontimer"); - add(IF_SETONOP, "if_setonop"); - add(IF_SETONDRAGCOMPLETE, "if_setondragcomplete"); - add(IF_SETONCLICKREPEAT, "if_setonclickrepeat"); - add(IF_SETONMOUSEREPEAT, "if_setonmouserepeat"); - add(IF_SETONINVTRANSMIT, "if_setoninvtransmit"); - add(IF_SETONSTATTRANSMIT, "if_setonstattransmit"); - add(IF_SETONTARGETENTER, "if_setontargetenter"); - add(IF_SETONSCROLLWHEEL, "if_setonscrollwheel"); - add(IF_SETONCHATTRANSMIT, "if_setonchattransmit"); - add(IF_SETONKEY, "if_setonkey"); - add(IF_SETONFRIENDTRANSMIT, "if_setonfriendtransmit"); - add(IF_SETONCLANTRANSMIT, "if_setonclantransmit"); - add(IF_SETONMISCTRANSMIT, "if_setonmisctransmit"); - add(IF_SETONDIALOGABORT, "if_setondialogabort"); - add(IF_SETONSUBCHANGE, "if_setonsubchange"); - add(IF_SETONSTOCKTRANSMIT, "if_setonstocktransmit"); - add(IF_SETONRESIZE, "if_setonresize"); - add(IF_GETX, "if_getx"); - add(IF_GETY, "if_gety"); - add(IF_GETWIDTH, "if_getwidth"); - add(IF_GETHEIGHT, "if_getheight"); - add(IF_GETHIDE, "if_gethide"); - add(IF_GETLAYER, "if_getlayer"); - add(IF_GETSCROLLX, "if_getscrollx"); - add(IF_GETSCROLLY, "if_getscrolly"); - add(IF_GETTEXT, "if_gettext"); - add(IF_GETSCROLLWIDTH, "if_getscrollwidth"); - add(IF_GETSCROLLHEIGHT, "if_getscrollheight"); - add(IF_GETMODELZOOM, "if_getmodelzoom"); - add(IF_GETMODELANGLE_X, "if_getmodelangle_x"); - add(IF_GETMODELANGLE_Z, "if_getmodelangle_z"); - add(IF_GETMODELANGLE_Y, "if_getmodelangle_y"); - add(IF_GETTRANS, "if_gettrans"); - add(IF_GETCOLOUR, "if_getcolour"); - add(IF_GETFILLCOLOUR, "if_getfillcolour"); - add(IF_GETINVOBJECT, "if_getinvobject"); - add(IF_GETINVCOUNT, "if_getinvcount"); - add(IF_HASSUB, "if_hassub"); - add(IF_GETTOP, "if_gettop"); - add(IF_GETTARGETMASK, "if_gettargetmask"); - add(IF_GETOP, "if_getop"); - add(IF_GETOPBASE, "if_getopbase"); - add(IF_CALLONRESIZE, "if_callonresize"); - add(MES, "mes"); - add(ANIM, "anim"); - add(IF_CLOSE, "if_close"); - add(RESUME_COUNTDIALOG, "resume_countdialog"); - add(RESUME_NAMEDIALOG, "resume_namedialog"); - add(RESUME_STRINGDIALOG, "resume_stringdialog"); - add(OPPLAYER, "opplayer"); - add(IF_DRAGPICKUP, "if_dragpickup"); - add(CC_DRAGPICKUP, "cc_dragpickup"); - add(MOUSECAM, "mousecam"); - add(GETREMOVEROOFS, "getremoveroofs"); - add(SETREMOVEROOFS, "setremoveroofs"); - add(OPENURL, "openurl"); - add(RESUME_OBJDIALOG, "resume_objdialog"); - add(BUG_REPORT, "bug_report"); - add(SETSHIFTCLICKDROP, "setshiftclickdrop"); - add(SETSHOWMOUSEOVERTEXT, "setshowmouseovertext"); - add(RENDERSELF, "renderself"); - add(SETSHOWMOUSECROSS, "setshowmousecross"); - add(SETSHOWLOADINGMESSAGES, "setshowloadingmessages"); - add(SETTAPTODROP, "settaptodrop"); - add(GETTAPTODROP, "gettaptodrop"); - add(GETCANVASSIZE, "getcanvassize"); - add(SETHIDEUSERNAME, "sethideusername"); - add(GETHIDEUSERNAME, "gethideusername"); - add(SETREMEMBERUSERNAME, "setrememberusername"); - add(GETREMEMBERUSERNAME, "getrememberusername"); - add(SOUND_SYNTH, "sound_synth"); - add(SOUND_SONG, "sound_song"); - add(SOUND_JINGLE, "sound_jingle"); - add(CLIENTCLOCK, "clientclock"); - add(INV_GETOBJ, "inv_getobj"); - add(INV_GETNUM, "inv_getnum"); - add(INV_TOTAL, "inv_total"); - add(INV_SIZE, "inv_size"); - add(STAT, "stat"); - add(STAT_BASE, "stat_base"); - add(STAT_XP, "stat_xp"); - add(COORD, "coord"); - add(COORDX, "coordx"); - add(COORDZ, "coordz"); - add(COORDY, "coordy"); - add(MAP_MEMBERS, "map_members"); - add(INVOTHER_GETOBJ, "invother_getobj"); - add(INVOTHER_GETNUM, "invother_getnum"); - add(INVOTHER_TOTAL, "invother_total"); - add(STAFFMODLEVEL, "staffmodlevel"); - add(REBOOTTIMER, "reboottimer"); - add(MAP_WORLD, "map_world"); - add(RUNENERGY_VISIBLE, "runenergy_visible"); - add(RUNWEIGHT_VISIBLE, "runweight_visible"); - add(PLAYERMOD, "playermod"); - add(WORLDFLAGS, "worldflags"); - add(MOVECOORD, "movecoord"); - add(ENUM_STRING, "enum_string"); - add(ENUM, "enum"); - add(ENUM_GETOUTPUTCOUNT, "enum_getoutputcount"); - add(FRIEND_COUNT, "friend_count"); - add(FRIEND_GETNAME, "friend_getname"); - add(FRIEND_GETWORLD, "friend_getworld"); - add(FRIEND_GETRANK, "friend_getrank"); - add(FRIEND_SETRANK, "friend_setrank"); - add(FRIEND_ADD, "friend_add"); - add(FRIEND_DEL, "friend_del"); - add(IGNORE_ADD, "ignore_add"); - add(IGNORE_DEL, "ignore_del"); - add(FRIEND_TEST, "friend_test"); - add(CLAN_GETCHATDISPLAYNAME, "clan_getchatdisplayname"); - add(CLAN_GETCHATCOUNT, "clan_getchatcount"); - add(CLAN_GETCHATUSERNAME, "clan_getchatusername"); - add(CLAN_GETCHATUSERWORLD, "clan_getchatuserworld"); - add(CLAN_GETCHATUSERRANK, "clan_getchatuserrank"); - add(CLAN_GETCHATMINKICK, "clan_getchatminkick"); - add(CLAN_KICKUSER, "clan_kickuser"); - add(CLAN_GETCHATRANK, "clan_getchatrank"); - add(CLAN_JOINCHAT, "clan_joinchat"); - add(CLAN_LEAVECHAT, "clan_leavechat"); - add(IGNORE_COUNT, "ignore_count"); - add(IGNORE_GETNAME, "ignore_getname"); - add(IGNORE_TEST, "ignore_test"); - add(CLAN_ISSELF, "clan_isself"); - add(CLAN_GETCHATOWNERNAME, "clan_getchatownername"); - add(CLAN_ISFRIEND, "clan_isfriend"); - add(CLAN_ISIGNORE, "clan_isignore"); - add(STOCKMARKET_GETOFFERTYPE, "stockmarket_getoffertype"); - add(STOCKMARKET_GETOFFERITEM, "stockmarket_getofferitem"); - add(STOCKMARKET_GETOFFERPRICE, "stockmarket_getofferprice"); - add(STOCKMARKET_GETOFFERCOUNT, "stockmarket_getoffercount"); - add(STOCKMARKET_GETOFFERCOMPLETEDCOUNT, "stockmarket_getoffercompletedcount"); - add(STOCKMARKET_GETOFFERCOMPLETEDGOLD, "stockmarket_getoffercompletedgold"); - add(STOCKMARKET_ISOFFEREMPTY, "stockmarket_isofferempty"); - add(STOCKMARKET_ISOFFERSTABLE, "stockmarket_isofferstable"); - add(STOCKMARKET_ISOFFERFINISHED, "stockmarket_isofferfinished"); - add(STOCKMARKET_ISOFFERADDING, "stockmarket_isofferadding"); - add(TRADINGPOST_SORTBY_NAME, "tradingpost_sortby_name"); - add(TRADINGPOST_SORTBY_PRICE, "tradingpost_sortby_price"); - add(TRADINGPOST_SORTFILTERBY_WORLD, "tradingpost_sortfilterby_world"); - add(TRADINGPOST_SORTBY_AGE, "tradingpost_sortby_age"); - add(TRADINGPOST_SORTBY_COUNT, "tradingpost_sortby_count"); - add(TRADINGPOST_GETTOTALOFFERS, "tradingpost_gettotaloffers"); - add(TRADINGPOST_GETOFFERWORLD, "tradingpost_getofferworld"); - add(TRADINGPOST_GETOFFERNAME, "tradingpost_getoffername"); - add(TRADINGPOST_GETOFFERPREVIOUSNAME, "tradingpost_getofferpreviousname"); - add(TRADINGPOST_GETOFFERAGE, "tradingpost_getofferage"); - add(TRADINGPOST_GETOFFERCOUNT, "tradingpost_getoffercount"); - add(TRADINGPOST_GETOFFERPRICE, "tradingpost_getofferprice"); - add(TRADINGPOST_GETOFFERITEM, "tradingpost_getofferitem"); - add(ADD, "add"); - add(SUB, "sub"); - add(MULTIPLY, "multiply"); - add(DIV, "div"); - add(RANDOM, "random"); - add(RANDOMINC, "randominc"); - add(INTERPOLATE, "interpolate"); - add(ADDPERCENT, "addpercent"); - add(SETBIT, "setbit"); - add(CLEARBIT, "clearbit"); - add(TESTBIT, "testbit"); - add(MOD, "mod"); - add(POW, "pow"); - add(INVPOW, "invpow"); - add(AND, "and"); - add(OR, "or"); - add(SCALE, "scale"); - add(APPEND_NUM, "append_num"); - add(APPEND, "append"); - add(APPEND_SIGNNUM, "append_signnum"); - add(LOWERCASE, "lowercase"); - add(FROMDATE, "fromdate"); - add(TEXT_GENDER, "text_gender"); - add(TOSTRING, "tostring"); - add(COMPARE, "compare"); - add(PARAHEIGHT, "paraheight"); - add(PARAWIDTH, "parawidth"); - add(TEXT_SWITCH, "text_switch"); - add(ESCAPE, "escape"); - add(APPEND_CHAR, "append_char"); - add(CHAR_ISPRINTABLE, "char_isprintable"); - add(CHAR_ISALPHANUMERIC, "char_isalphanumeric"); - add(CHAR_ISALPHA, "char_isalpha"); - add(CHAR_ISNUMERIC, "char_isnumeric"); - add(STRING_LENGTH, "string_length"); - add(SUBSTRING, "substring"); - add(REMOVETAGS, "removetags"); - add(STRING_INDEXOF_CHAR, "string_indexof_char"); - add(STRING_INDEXOF_STRING, "string_indexof_string"); - add(OC_NAME, "oc_name"); - add(OC_OP, "oc_op"); - add(OC_IOP, "oc_iop"); - add(OC_COST, "oc_cost"); - add(OC_STACKABLE, "oc_stackable"); - add(OC_CERT, "oc_cert"); - add(OC_UNCERT, "oc_uncert"); - add(OC_MEMBERS, "oc_members"); - add(OC_PLACEHOLDER, "oc_placeholder"); - add(OC_UNPLACEHOLDER, "oc_unplaceholder"); - add(OC_FIND, "oc_find"); - add(OC_FINDNEXT, "oc_findnext"); - add(OC_FINDRESET, "oc_findreset"); - add(CHAT_GETFILTER_PUBLIC, "chat_getfilter_public"); - add(CHAT_SETFILTER, "chat_setfilter"); - add(CHAT_SENDABUSEREPORT, "chat_sendabusereport"); - add(CHAT_GETHISTORY_BYTYPEANDLINE, "chat_gethistory_bytypeandline"); - add(CHAT_GETHISTORY_BYUID, "chat_gethistory_byuid"); - add(CHAT_GETFILTER_PRIVATE, "chat_getfilter_private"); - add(CHAT_SENDPUBLIC, "chat_sendpublic"); - add(CHAT_SENDPRIVATE, "chat_sendprivate"); - add(CHAT_PLAYERNAME, "chat_playername"); - add(CHAT_GETFILTER_TRADE, "chat_getfilter_trade"); - add(CHAT_GETHISTORYLENGTH, "chat_gethistorylength"); - add(CHAT_GETNEXTUID, "chat_getnextuid"); - add(CHAT_GETPREVUID, "chat_getprevuid"); - add(DOCHEAT, "docheat"); - add(CHAT_SETMESSAGEFILTER, "chat_setmessagefilter"); - add(CHAT_GETMESSAGEFILTER, "chat_getmessagefilter"); - add(GETWINDOWMODE, "getwindowmode"); - add(SETWINDOWMODE, "setwindowmode"); - add(GETDEFAULTWINDOWMODE, "getdefaultwindowmode"); - add(SETDEFAULTWINDOWMODE, "setdefaultwindowmode"); - add(CAM_FORCEANGLE, "cam_forceangle"); - add(CAM_GETANGLE_XA, "cam_getangle_xa"); - add(CAM_GETANGLE_YA, "cam_getangle_ya"); - add(CAM_SETFOLLOWHEIGHT, "cam_setfollowheight"); - add(CAM_GETFOLLOWHEIGHT, "cam_getfollowheight"); - add(LOGOUT, "logout"); - add(VIEWPORT_SETFOV, "viewport_setfov"); - add(VIEWPORT_SETZOOM, "viewport_setzoom"); - add(VIEWPORT_CLAMPFOV, "viewport_clampfov"); - add(VIEWPORT_GETEFFECTIVESIZE, "viewport_geteffectivesize"); - add(VIEWPORT_GETZOOM, "viewport_getzoom"); - add(VIEWPORT_GETFOV, "viewport_getfov"); - add(WORLDLIST_FETCH, "worldlist_fetch"); - add(WORLDLIST_START, "worldlist_start"); - add(WORLDLIST_NEXT, "worldlist_next"); - add(WORLDLIST_SPECIFIC, "worldlist_specific"); - add(WORLDLIST_SORT, "worldlist_sort"); - add(SETFOLLOWEROPSLOWPRIORITY, "setfolloweropslowpriority"); - add(NC_PARAM, "nc_param"); - add(LC_PARAM, "lc_param"); - add(OC_PARAM, "oc_param"); - add(STRUCT_PARAM, "struct_param"); - add(ON_MOBILE, "on_mobile"); - add(CLIENTTYPE, "clienttype"); - add(BATTERYLEVEL, "batterylevel"); - add(BATTERYCHARGING, "batterycharging"); - add(WIFIAVAILABLE, "wifiavailable"); - add(WORLDMAP_GETMAPNAME, "worldmap_getmapname"); - add(WORLDMAP_SETMAP, "worldmap_setmap"); - add(WORLDMAP_GETZOOM, "worldmap_getzoom"); - add(WORLDMAP_SETZOOM, "worldmap_setzoom"); - add(WORLDMAP_ISLOADED, "worldmap_isloaded"); - add(WORLDMAP_JUMPTODISPLAYCOORD, "worldmap_jumptodisplaycoord"); - add(WORLDMAP_JUMPTODISPLAYCOORD_INSTANT, "worldmap_jumptodisplaycoord_instant"); - add(WORLDMAP_JUMPTOSOURCECOORD, "worldmap_jumptosourcecoord"); - add(WORLDMAP_JUMPTOSOURCECOORD_INSTANT, "worldmap_jumptosourcecoord_instant"); - add(WORLDMAP_GETDISPLAYPOSITION, "worldmap_getdisplayposition"); - add(WORLDMAP_GETCONFIGORIGIN, "worldmap_getconfigorigin"); - add(WORLDMAP_GETCONFIGSIZE, "worldmap_getconfigsize"); - add(WORLDMAP_GETCONFIGBOUNDS, "worldmap_getconfigbounds"); - add(WORLDMAP_GETCONFIGZOOM, "worldmap_getconfigzoom"); - add(WORLDMAP_GETCURRENTMAP, "worldmap_getcurrentmap"); - add(WORLDMAP_GETDISPLAYCOORD, "worldmap_getdisplaycoord"); - add(WORLDMAP_COORDINMAP, "worldmap_coordinmap"); - add(WORLDMAP_GETSIZE, "worldmap_getsize"); - add(WORLDMAP_PERPETUALFLASH, "worldmap_perpetualflash"); - add(WORLDMAP_FLASHELEMENT, "worldmap_flashelement"); - add(WORLDMAP_FLASHELEMENTCATEGORY, "worldmap_flashelementcategory"); - add(WORLDMAP_STOPCURRENTFLASHES, "worldmap_stopcurrentflashes"); - add(WORLDMAP_DISABLEELEMENTS, "worldmap_disableelements"); - add(WORLDMAP_DISABLEELEMENT, "worldmap_disableelement"); - add(WORLDMAP_DISABLEELEMENTCATEGORY, "worldmap_disableelementcategory"); - add(WORLDMAP_GETDISABLEELEMENTS, "worldmap_getdisableelements"); - add(WORLDMAP_GETDISABLEELEMENT, "worldmap_getdisableelement"); - add(WORLDMAP_GETDISABLEELEMENTCATEGORY, "worldmap_getdisableelementcategory"); - add(WORLDMAP_LISTELEMENT_START, "worldmap_listelement_start"); - add(WORLDMAP_LISTELEMENT_NEXT, "worldmap_listelement_next"); - add(MEC_TEXT, "mec_text"); - add(MEC_TEXTSIZE, "mec_textsize"); - add(MEC_CATEGORY, "mec_category"); - add(MEC_SPRITE, "mec_sprite"); - } - - protected void add(int opcode, String name) - { - Instruction i = new Instruction(opcode); - i.setName(name); - - assert instructions.containsKey(opcode) == false; - instructions.put(opcode, i); - - if (name != null) - { - assert instructionsByName.containsKey(name) == false; - instructionsByName.put(name, i); - } - } - - public Instruction find(int opcode) - { - return instructions.get(opcode); - } - - public Instruction find(String name) - { - return instructionsByName.get(name); - } -} diff --git a/cache/src/main/java/net/runelite/cache/script/Opcodes.java b/cache/src/main/java/net/runelite/cache/script/Opcodes.java deleted file mode 100644 index e69a1ef5ef..0000000000 --- a/cache/src/main/java/net/runelite/cache/script/Opcodes.java +++ /dev/null @@ -1,499 +0,0 @@ -/* - * Copyright (c) 2017, Adam - * Copyright (c) 2018-2019, Hunter WB - * Copyright (c) 2019, 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.script; - -public class Opcodes -{ - public static final int ICONST = 0; - public static final int GET_VARP = 1; - public static final int SET_VARP = 2; - public static final int SCONST = 3; - public static final int JUMP = 6; - public static final int IF_ICMPNE = 7; - public static final int IF_ICMPEQ = 8; - public static final int IF_ICMPLT = 9; - public static final int IF_ICMPGT = 10; - public static final int RETURN = 21; - public static final int GET_VARBIT = 25; - public static final int SET_VARBIT = 27; - public static final int IF_ICMPLE = 31; - public static final int IF_ICMPGE = 32; - public static final int ILOAD = 33; - public static final int ISTORE = 34; - public static final int SLOAD = 35; - public static final int SSTORE = 36; - public static final int JOIN_STRING = 37; - public static final int POP_INT = 38; - public static final int POP_STRING = 39; - public static final int INVOKE = 40; - public static final int GET_VARC_INT = 42; - public static final int SET_VARC_INT = 43; - public static final int DEFINE_ARRAY = 44; - public static final int GET_ARRAY_INT = 45; - public static final int SET_ARRAY_INT = 46; - public static final int GET_VARC_STRING_OLD = 47; - public static final int SET_VARC_STRING_OLD = 48; - public static final int GET_VARC_STRING = 49; - public static final int SET_VARC_STRING = 50; - public static final int SWITCH = 60; - public static final int CC_CREATE = 100; - public static final int CC_DELETE = 101; - public static final int CC_DELETEALL = 102; - public static final int CC_FIND = 200; - public static final int IF_FIND = 201; - public static final int CC_SETPOSITION = 1000; - public static final int CC_SETSIZE = 1001; - public static final int CC_SETHIDE = 1003; - public static final int CC_SETNOCLICKTHROUGH = 1005; - public static final int CC_SETSCROLLPOS = 1100; - public static final int CC_SETCOLOUR = 1101; - public static final int CC_SETFILL = 1102; - public static final int CC_SETTRANS = 1103; - public static final int CC_SETLINEWID = 1104; - public static final int CC_SETGRAPHIC = 1105; - public static final int CC_SET2DANGLE = 1106; - public static final int CC_SETTILING = 1107; - public static final int CC_SETMODEL = 1108; - public static final int CC_SETMODELANGLE = 1109; - public static final int CC_SETMODELANIM = 1110; - public static final int CC_SETMODELORTHOG = 1111; - public static final int CC_SETTEXT = 1112; - public static final int CC_SETTEXTFONT = 1113; - public static final int CC_SETTEXTALIGN = 1114; - public static final int CC_SETTEXTSHADOW = 1115; - public static final int CC_SETOUTLINE = 1116; - public static final int CC_SETGRAPHICSHADOW = 1117; - public static final int CC_SETVFLIP = 1118; - public static final int CC_SETHFLIP = 1119; - public static final int CC_SETSCROLLSIZE = 1120; - public static final int CC_RESUME_PAUSEBUTTON = 1121; - public static final int CC_SETFILLCOLOUR = 1123; - public static final int CC_SETLINEDIRECTION = 1126; - public static final int CC_SETOBJECT = 1200; - public static final int CC_SETNPCHEAD = 1201; - public static final int CC_SETPLAYERHEAD_SELF = 1202; - public static final int CC_SETOBJECT_NONUM = 1205; - public static final int CC_SETOBJECT_ALWAYS_NUM = 1212; - public static final int CC_SETOP = 1300; - public static final int CC_SETDRAGGABLE = 1301; - public static final int CC_SETDRAGGABLEBEHAVIOR = 1302; - public static final int CC_SETDRAGDEADZONE = 1303; - public static final int CC_SETDRAGDEADTIME = 1304; - public static final int CC_SETOPBASE = 1305; - public static final int CC_SETTARGETVERB = 1306; - public static final int CC_CLEAROPS = 1307; - public static final int CC_SETONCLICK = 1400; - public static final int CC_SETONHOLD = 1401; - public static final int CC_SETONRELEASE = 1402; - public static final int CC_SETONMOUSEOVER = 1403; - public static final int CC_SETONMOUSELEAVE = 1404; - public static final int CC_SETONDRAG = 1405; - public static final int CC_SETONTARGETLEAVE = 1406; - public static final int CC_SETONVARTRANSMIT = 1407; - public static final int CC_SETONTIMER = 1408; - public static final int CC_SETONOP = 1409; - public static final int CC_SETONDRAGCOMPLETE = 1410; - public static final int CC_SETONCLICKREPEAT = 1411; - public static final int CC_SETONMOUSEREPEAT = 1412; - public static final int CC_SETONINVTRANSMIT = 1414; - public static final int CC_SETONSTATTRANSMIT = 1415; - public static final int CC_SETONTARGETENTER = 1416; - public static final int CC_SETONSCROLLWHEEL = 1417; - public static final int CC_SETONCHATTRANSMIT = 1418; - public static final int CC_SETONKEY = 1419; - public static final int CC_SETONFRIENDTRANSMIT = 1420; - public static final int CC_SETONCLANTRANSMIT = 1421; - public static final int CC_SETONMISCTRANSMIT = 1422; - public static final int CC_SETONDIALOGABORT = 1423; - public static final int CC_SETONSUBCHANGE = 1424; - public static final int CC_SETONSTOCKTRANSMIT = 1425; - public static final int CC_SETONRESIZE = 1427; - public static final int CC_GETX = 1500; - public static final int CC_GETY = 1501; - public static final int CC_GETWIDTH = 1502; - public static final int CC_GETHEIGHT = 1503; - public static final int CC_GETHIDE = 1504; - public static final int CC_GETLAYER = 1505; - public static final int CC_GETSCROLLX = 1600; - public static final int CC_GETSCROLLY = 1601; - public static final int CC_GETTEXT = 1602; - public static final int CC_GETSCROLLWIDTH = 1603; - public static final int CC_GETSCROLLHEIGHT = 1604; - public static final int CC_GETMODELZOOM = 1605; - public static final int CC_GETMODELANGLE_X = 1606; - public static final int CC_GETMODELANGLE_Z = 1607; - public static final int CC_GETMODELANGLE_Y = 1608; - public static final int CC_GETTRANS = 1609; - public static final int CC_GETCOLOUR = 1611; - public static final int CC_GETFILLCOLOUR = 1612; - public static final int CC_GETINVOBJECT = 1700; - public static final int CC_GETINVCOUNT = 1701; - public static final int CC_GETID = 1702; - public static final int CC_GETTARGETMASK = 1800; - public static final int CC_GETOP = 1801; - public static final int CC_GETOPBASE = 1802; - public static final int CC_CALLONRESIZE = 1927; - public static final int IF_SETPOSITION = 2000; - public static final int IF_SETSIZE = 2001; - public static final int IF_SETHIDE = 2003; - public static final int IF_SETNOCLICKTHROUGH = 2005; - public static final int IF_SETSCROLLPOS = 2100; - public static final int IF_SETCOLOUR = 2101; - public static final int IF_SETFILL = 2102; - public static final int IF_SETTRANS = 2103; - public static final int IF_SETLINEWID = 2104; - public static final int IF_SETGRAPHIC = 2105; - public static final int IF_SET2DANGLE = 2106; - public static final int IF_SETTILING = 2107; - public static final int IF_SETMODEL = 2108; - public static final int IF_SETMODELANGLE = 2109; - public static final int IF_SETMODELANIM = 2110; - public static final int IF_SETMODELORTHOG = 2111; - public static final int IF_SETTEXT = 2112; - public static final int IF_SETTEXTFONT = 2113; - public static final int IF_SETTEXTALIGN = 2114; - public static final int IF_SETTEXTSHADOW = 2115; - public static final int IF_SETOUTLINE = 2116; - public static final int IF_SETGRAPHICSHADOW = 2117; - public static final int IF_SETVFLIP = 2118; - public static final int IF_SETHFLIP = 2119; - public static final int IF_SETSCROLLSIZE = 2120; - public static final int IF_RESUME_PAUSEBUTTON = 2121; - public static final int IF_SETFILLCOLOUR = 2123; - public static final int IF_SETLINEDIRECTION = 2126; - public static final int IF_SETOBJECT = 2200; - public static final int IF_SETNPCHEAD = 2201; - public static final int IF_SETPLAYERHEAD_SELF = 2202; - public static final int IF_SETOBJECT_NONUM = 2205; - public static final int IF_SETOBJECT_ALWAYS_NUM = 2212; - public static final int IF_SETOP = 2300; - public static final int IF_SETDRAGGABLE = 2301; - public static final int IF_SETDRAGGABLEBEHAVIOR = 2302; - public static final int IF_SETDRAGDEADZONE = 2303; - public static final int IF_SETDRAGDEADTIME = 2304; - public static final int IF_SETOPBASE = 2305; - public static final int IF_SETTARGETVERB = 2306; - public static final int IF_CLEAROPS = 2307; - public static final int IF_SETOPKEY = 2350; - public static final int IF_SETOPTKEY = 2351; - public static final int IF_SETOPKEYRATE = 2352; - public static final int IF_SETOPTKEYRATE = 2353; - public static final int IF_SETOPKEYIGNOREHELD = 2354; - public static final int IF_SETOPTKEYIGNOREHELD = 2355; - public static final int IF_SETONCLICK = 2400; - public static final int IF_SETONHOLD = 2401; - public static final int IF_SETONRELEASE = 2402; - public static final int IF_SETONMOUSEOVER = 2403; - public static final int IF_SETONMOUSELEAVE = 2404; - public static final int IF_SETONDRAG = 2405; - public static final int IF_SETONTARGETLEAVE = 2406; - public static final int IF_SETONVARTRANSMIT = 2407; - public static final int IF_SETONTIMER = 2408; - public static final int IF_SETONOP = 2409; - public static final int IF_SETONDRAGCOMPLETE = 2410; - public static final int IF_SETONCLICKREPEAT = 2411; - public static final int IF_SETONMOUSEREPEAT = 2412; - public static final int IF_SETONINVTRANSMIT = 2414; - public static final int IF_SETONSTATTRANSMIT = 2415; - public static final int IF_SETONTARGETENTER = 2416; - public static final int IF_SETONSCROLLWHEEL = 2417; - public static final int IF_SETONCHATTRANSMIT = 2418; - public static final int IF_SETONKEY = 2419; - public static final int IF_SETONFRIENDTRANSMIT = 2420; - public static final int IF_SETONCLANTRANSMIT = 2421; - public static final int IF_SETONMISCTRANSMIT = 2422; - public static final int IF_SETONDIALOGABORT = 2423; - public static final int IF_SETONSUBCHANGE = 2424; - public static final int IF_SETONSTOCKTRANSMIT = 2425; - public static final int IF_SETONRESIZE = 2427; - public static final int IF_GETX = 2500; - public static final int IF_GETY = 2501; - public static final int IF_GETWIDTH = 2502; - public static final int IF_GETHEIGHT = 2503; - public static final int IF_GETHIDE = 2504; - public static final int IF_GETLAYER = 2505; - public static final int IF_GETSCROLLX = 2600; - public static final int IF_GETSCROLLY = 2601; - public static final int IF_GETTEXT = 2602; - public static final int IF_GETSCROLLWIDTH = 2603; - public static final int IF_GETSCROLLHEIGHT = 2604; - public static final int IF_GETMODELZOOM = 2605; - public static final int IF_GETMODELANGLE_X = 2606; - public static final int IF_GETMODELANGLE_Z = 2607; - public static final int IF_GETMODELANGLE_Y = 2608; - public static final int IF_GETTRANS = 2609; - public static final int IF_GETCOLOUR = 2611; - public static final int IF_GETFILLCOLOUR = 2612; - public static final int IF_GETINVOBJECT = 2700; - public static final int IF_GETINVCOUNT = 2701; - public static final int IF_HASSUB = 2702; - public static final int IF_GETTOP = 2706; - public static final int IF_GETTARGETMASK = 2800; - public static final int IF_GETOP = 2801; - public static final int IF_GETOPBASE = 2802; - public static final int IF_CALLONRESIZE = 2927; - public static final int MES = 3100; - public static final int ANIM = 3101; - public static final int IF_CLOSE = 3103; - public static final int RESUME_COUNTDIALOG = 3104; - public static final int RESUME_NAMEDIALOG = 3105; - public static final int RESUME_STRINGDIALOG = 3106; - public static final int OPPLAYER = 3107; - public static final int IF_DRAGPICKUP = 3108; - public static final int CC_DRAGPICKUP = 3109; - public static final int MOUSECAM = 3110; - public static final int GETREMOVEROOFS = 3111; - public static final int SETREMOVEROOFS = 3112; - public static final int OPENURL = 3113; - public static final int RESUME_OBJDIALOG = 3115; - public static final int BUG_REPORT = 3116; - public static final int SETSHIFTCLICKDROP = 3117; - public static final int SETSHOWMOUSEOVERTEXT = 3118; - public static final int RENDERSELF = 3119; - public static final int SETSHOWMOUSECROSS = 3125; - public static final int SETSHOWLOADINGMESSAGES = 3126; - public static final int SETTAPTODROP = 3127; - public static final int GETTAPTODROP = 3128; - public static final int GETCANVASSIZE = 3132; - public static final int SETHIDEUSERNAME = 3141; - public static final int GETHIDEUSERNAME = 3142; - public static final int SETREMEMBERUSERNAME = 3143; - public static final int GETREMEMBERUSERNAME = 3144; - public static final int SOUND_SYNTH = 3200; - public static final int SOUND_SONG = 3201; - public static final int SOUND_JINGLE = 3202; - public static final int CLIENTCLOCK = 3300; - public static final int INV_GETOBJ = 3301; - public static final int INV_GETNUM = 3302; - public static final int INV_TOTAL = 3303; - public static final int INV_SIZE = 3304; - public static final int STAT = 3305; - public static final int STAT_BASE = 3306; - public static final int STAT_XP = 3307; - public static final int COORD = 3308; - public static final int COORDX = 3309; - public static final int COORDZ = 3310; - public static final int COORDY = 3311; - public static final int MAP_MEMBERS = 3312; - public static final int INVOTHER_GETOBJ = 3313; - public static final int INVOTHER_GETNUM = 3314; - public static final int INVOTHER_TOTAL = 3315; - public static final int STAFFMODLEVEL = 3316; - public static final int REBOOTTIMER = 3317; - public static final int MAP_WORLD = 3318; - public static final int RUNENERGY_VISIBLE = 3321; - public static final int RUNWEIGHT_VISIBLE = 3322; - public static final int PLAYERMOD = 3323; - public static final int WORLDFLAGS = 3324; - public static final int MOVECOORD = 3325; - public static final int ENUM_STRING = 3400; - public static final int ENUM = 3408; - public static final int ENUM_GETOUTPUTCOUNT = 3411; - public static final int FRIEND_COUNT = 3600; - public static final int FRIEND_GETNAME = 3601; - public static final int FRIEND_GETWORLD = 3602; - public static final int FRIEND_GETRANK = 3603; - public static final int FRIEND_SETRANK = 3604; - public static final int FRIEND_ADD = 3605; - public static final int FRIEND_DEL = 3606; - public static final int IGNORE_ADD = 3607; - public static final int IGNORE_DEL = 3608; - public static final int FRIEND_TEST = 3609; - public static final int CLAN_GETCHATDISPLAYNAME = 3611; - public static final int CLAN_GETCHATCOUNT = 3612; - public static final int CLAN_GETCHATUSERNAME = 3613; - public static final int CLAN_GETCHATUSERWORLD = 3614; - public static final int CLAN_GETCHATUSERRANK = 3615; - public static final int CLAN_GETCHATMINKICK = 3616; - public static final int CLAN_KICKUSER = 3617; - public static final int CLAN_GETCHATRANK = 3618; - public static final int CLAN_JOINCHAT = 3619; - public static final int CLAN_LEAVECHAT = 3620; - public static final int IGNORE_COUNT = 3621; - public static final int IGNORE_GETNAME = 3622; - public static final int IGNORE_TEST = 3623; - public static final int CLAN_ISSELF = 3624; - public static final int CLAN_GETCHATOWNERNAME = 3625; - public static final int CLAN_ISFRIEND = 3626; - public static final int CLAN_ISIGNORE = 3627; - public static final int STOCKMARKET_GETOFFERTYPE = 3903; - public static final int STOCKMARKET_GETOFFERITEM = 3904; - public static final int STOCKMARKET_GETOFFERPRICE = 3905; - public static final int STOCKMARKET_GETOFFERCOUNT = 3906; - public static final int STOCKMARKET_GETOFFERCOMPLETEDCOUNT = 3907; - public static final int STOCKMARKET_GETOFFERCOMPLETEDGOLD = 3908; - public static final int STOCKMARKET_ISOFFEREMPTY = 3910; - public static final int STOCKMARKET_ISOFFERSTABLE = 3911; - public static final int STOCKMARKET_ISOFFERFINISHED = 3912; - public static final int STOCKMARKET_ISOFFERADDING = 3913; - public static final int TRADINGPOST_SORTBY_NAME = 3914; - public static final int TRADINGPOST_SORTBY_PRICE = 3915; - public static final int TRADINGPOST_SORTFILTERBY_WORLD = 3916; - public static final int TRADINGPOST_SORTBY_AGE = 3917; - public static final int TRADINGPOST_SORTBY_COUNT = 3918; - public static final int TRADINGPOST_GETTOTALOFFERS = 3919; - public static final int TRADINGPOST_GETOFFERWORLD = 3920; - public static final int TRADINGPOST_GETOFFERNAME = 3921; - public static final int TRADINGPOST_GETOFFERPREVIOUSNAME = 3922; - public static final int TRADINGPOST_GETOFFERAGE = 3923; - public static final int TRADINGPOST_GETOFFERCOUNT = 3924; - public static final int TRADINGPOST_GETOFFERPRICE = 3925; - public static final int TRADINGPOST_GETOFFERITEM = 3926; - public static final int ADD = 4000; - public static final int SUB = 4001; - public static final int MULTIPLY = 4002; - public static final int DIV = 4003; - public static final int RANDOM = 4004; - public static final int RANDOMINC = 4005; - public static final int INTERPOLATE = 4006; - public static final int ADDPERCENT = 4007; - public static final int SETBIT = 4008; - public static final int CLEARBIT = 4009; - public static final int TESTBIT = 4010; - public static final int MOD = 4011; - public static final int POW = 4012; - public static final int INVPOW = 4013; - public static final int AND = 4014; - public static final int OR = 4015; - public static final int SCALE = 4018; - public static final int APPEND_NUM = 4100; - public static final int APPEND = 4101; - public static final int APPEND_SIGNNUM = 4102; - public static final int LOWERCASE = 4103; - public static final int FROMDATE = 4104; - public static final int TEXT_GENDER = 4105; - public static final int TOSTRING = 4106; - public static final int COMPARE = 4107; - public static final int PARAHEIGHT = 4108; - public static final int PARAWIDTH = 4109; - public static final int TEXT_SWITCH = 4110; - public static final int ESCAPE = 4111; - public static final int APPEND_CHAR = 4112; - public static final int CHAR_ISPRINTABLE = 4113; - public static final int CHAR_ISALPHANUMERIC = 4114; - public static final int CHAR_ISALPHA = 4115; - public static final int CHAR_ISNUMERIC = 4116; - public static final int STRING_LENGTH = 4117; - public static final int SUBSTRING = 4118; - public static final int REMOVETAGS = 4119; - public static final int STRING_INDEXOF_CHAR = 4120; - public static final int STRING_INDEXOF_STRING = 4121; - public static final int OC_NAME = 4200; - public static final int OC_OP = 4201; - public static final int OC_IOP = 4202; - public static final int OC_COST = 4203; - public static final int OC_STACKABLE = 4204; - public static final int OC_CERT = 4205; - public static final int OC_UNCERT = 4206; - public static final int OC_MEMBERS = 4207; - public static final int OC_PLACEHOLDER = 4208; - public static final int OC_UNPLACEHOLDER = 4209; - public static final int OC_FIND = 4210; - public static final int OC_FINDNEXT = 4211; - public static final int OC_FINDRESET = 4212; - public static final int CHAT_GETFILTER_PUBLIC = 5000; - public static final int CHAT_SETFILTER = 5001; - public static final int CHAT_SENDABUSEREPORT = 5002; - public static final int CHAT_GETHISTORY_BYTYPEANDLINE = 5003; - public static final int CHAT_GETHISTORY_BYUID = 5004; - public static final int CHAT_GETFILTER_PRIVATE = 5005; - public static final int CHAT_SENDPUBLIC = 5008; - public static final int CHAT_SENDPRIVATE = 5009; - public static final int CHAT_PLAYERNAME = 5015; - public static final int CHAT_GETFILTER_TRADE = 5016; - public static final int CHAT_GETHISTORYLENGTH = 5017; - public static final int CHAT_GETNEXTUID = 5018; - public static final int CHAT_GETPREVUID = 5019; - public static final int DOCHEAT = 5020; - public static final int CHAT_SETMESSAGEFILTER = 5021; - public static final int CHAT_GETMESSAGEFILTER = 5022; - public static final int GETWINDOWMODE = 5306; - public static final int SETWINDOWMODE = 5307; - public static final int GETDEFAULTWINDOWMODE = 5308; - public static final int SETDEFAULTWINDOWMODE = 5309; - public static final int CAM_FORCEANGLE = 5504; - public static final int CAM_GETANGLE_XA = 5505; - public static final int CAM_GETANGLE_YA = 5506; - public static final int CAM_SETFOLLOWHEIGHT = 5530; - public static final int CAM_GETFOLLOWHEIGHT = 5531; - public static final int LOGOUT = 5630; - public static final int VIEWPORT_SETFOV = 6200; - public static final int VIEWPORT_SETZOOM = 6201; - public static final int VIEWPORT_CLAMPFOV = 6202; - public static final int VIEWPORT_GETEFFECTIVESIZE = 6203; - public static final int VIEWPORT_GETZOOM = 6204; - public static final int VIEWPORT_GETFOV = 6205; - public static final int WORLDLIST_FETCH = 6500; - public static final int WORLDLIST_START = 6501; - public static final int WORLDLIST_NEXT = 6502; - public static final int WORLDLIST_SPECIFIC = 6506; - public static final int WORLDLIST_SORT = 6507; - public static final int SETFOLLOWEROPSLOWPRIORITY = 6512; - public static final int NC_PARAM = 6513; - public static final int LC_PARAM = 6514; - public static final int OC_PARAM = 6515; - public static final int STRUCT_PARAM = 6516; - public static final int ON_MOBILE = 6518; - public static final int CLIENTTYPE = 6519; - public static final int BATTERYLEVEL = 6524; - public static final int BATTERYCHARGING = 6525; - public static final int WIFIAVAILABLE = 6526; - public static final int WORLDMAP_GETMAPNAME = 6601; - public static final int WORLDMAP_SETMAP = 6602; - public static final int WORLDMAP_GETZOOM = 6603; - public static final int WORLDMAP_SETZOOM = 6604; - public static final int WORLDMAP_ISLOADED = 6605; - public static final int WORLDMAP_JUMPTODISPLAYCOORD = 6606; - public static final int WORLDMAP_JUMPTODISPLAYCOORD_INSTANT = 6607; - public static final int WORLDMAP_JUMPTOSOURCECOORD = 6608; - public static final int WORLDMAP_JUMPTOSOURCECOORD_INSTANT = 6609; - public static final int WORLDMAP_GETDISPLAYPOSITION = 6610; - public static final int WORLDMAP_GETCONFIGORIGIN = 6611; - public static final int WORLDMAP_GETCONFIGSIZE = 6612; - public static final int WORLDMAP_GETCONFIGBOUNDS = 6613; - public static final int WORLDMAP_GETCONFIGZOOM = 6614; - public static final int WORLDMAP_GETCURRENTMAP = 6616; - public static final int WORLDMAP_GETDISPLAYCOORD = 6617; - public static final int WORLDMAP_COORDINMAP = 6621; - public static final int WORLDMAP_GETSIZE = 6622; - public static final int WORLDMAP_PERPETUALFLASH = 6628; - public static final int WORLDMAP_FLASHELEMENT = 6629; - public static final int WORLDMAP_FLASHELEMENTCATEGORY = 6630; - public static final int WORLDMAP_STOPCURRENTFLASHES = 6631; - public static final int WORLDMAP_DISABLEELEMENTS = 6632; - public static final int WORLDMAP_DISABLEELEMENT = 6633; - public static final int WORLDMAP_DISABLEELEMENTCATEGORY = 6634; - public static final int WORLDMAP_GETDISABLEELEMENTS = 6635; - public static final int WORLDMAP_GETDISABLEELEMENT = 6636; - public static final int WORLDMAP_GETDISABLEELEMENTCATEGORY = 6637; - public static final int WORLDMAP_LISTELEMENT_START = 6639; - public static final int WORLDMAP_LISTELEMENT_NEXT = 6640; - public static final int MEC_TEXT = 6693; - public static final int MEC_TEXTSIZE = 6694; - public static final int MEC_CATEGORY = 6695; - public static final int MEC_SPRITE = 6696; -} diff --git a/cache/src/main/java/net/runelite/cache/script/assembler/Assembler.java b/cache/src/main/java/net/runelite/cache/script/assembler/Assembler.java deleted file mode 100644 index 643057911e..0000000000 --- a/cache/src/main/java/net/runelite/cache/script/assembler/Assembler.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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.script.assembler; - -import java.io.IOException; -import java.io.InputStream; -import net.runelite.cache.definitions.ScriptDefinition; -import net.runelite.cache.script.Instructions; -import net.runelite.cache.script.assembler.rs2asmParser.ProgContext; -import org.antlr.v4.runtime.ANTLRInputStream; -import org.antlr.v4.runtime.CommonTokenStream; -import org.antlr.v4.runtime.tree.ParseTreeWalker; - -public class Assembler -{ - private final Instructions instructions; - - public Assembler(Instructions instructions) - { - this.instructions = instructions; - } - - public ScriptDefinition assemble(InputStream in) throws IOException - { - // Get our lexer - rs2asmLexer lexer = new rs2asmLexer(new ANTLRInputStream(in)); - - LexerErrorListener errorListener = new LexerErrorListener(); - lexer.addErrorListener(errorListener); - - // Get a list of matched tokens - CommonTokenStream tokens = new CommonTokenStream(lexer); - - // Pass the tokens to the parser - rs2asmParser parser = new rs2asmParser(tokens); - - // Specify our entry point - ProgContext progContext = parser.prog(); - - if (errorListener.getErrors() > 0) - { - throw new RuntimeException("syntax error"); - } - - // Walk it and attach our listener - ParseTreeWalker walker = new ParseTreeWalker(); - - // walk through first and resolve labels - LabelVisitor labelVisitor = new LabelVisitor(); - walker.walk(labelVisitor, progContext); - - ScriptWriter listener = new ScriptWriter(instructions, labelVisitor); - walker.walk(listener, progContext); - - return listener.buildScript(); - } -} diff --git a/cache/src/main/java/net/runelite/cache/script/assembler/LabelVisitor.java b/cache/src/main/java/net/runelite/cache/script/assembler/LabelVisitor.java deleted file mode 100644 index b78cfd6523..0000000000 --- a/cache/src/main/java/net/runelite/cache/script/assembler/LabelVisitor.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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.script.assembler; - -import java.util.HashMap; -import java.util.Map; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class LabelVisitor extends rs2asmBaseListener -{ - private static final Logger logger = LoggerFactory.getLogger(LabelVisitor.class); - - private int pos; - private final Map map = new HashMap<>(); - - @Override - public void exitInstruction(rs2asmParser.InstructionContext ctx) - { - ++pos; - } - - @Override - public void enterLabel(rs2asmParser.LabelContext ctx) - { - String text = ctx.getText(); - text = text.substring(0, text.length() - 1); // remove trailing : - - logger.debug("Label {} is on instruction {}", text, pos); - - map.put(text, pos); - } - - public Integer getInstructionForLabel(String label) - { - return map.get(label); - } -} diff --git a/cache/src/main/java/net/runelite/cache/script/assembler/LexerErrorListener.java b/cache/src/main/java/net/runelite/cache/script/assembler/LexerErrorListener.java deleted file mode 100644 index bd3463a946..0000000000 --- a/cache/src/main/java/net/runelite/cache/script/assembler/LexerErrorListener.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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.script.assembler; - -import org.antlr.v4.runtime.BaseErrorListener; -import org.antlr.v4.runtime.RecognitionException; -import org.antlr.v4.runtime.Recognizer; - -public class LexerErrorListener extends BaseErrorListener -{ - private int errors; - - @Override - public void syntaxError(Recognizer recognizer, Object offendingSymbol, int line, int charPositionInLine, String msg, RecognitionException e) - { - ++errors; - } - - public int getErrors() - { - return errors; - } - -} diff --git a/cache/src/main/java/net/runelite/cache/script/assembler/LookupCase.java b/cache/src/main/java/net/runelite/cache/script/assembler/LookupCase.java deleted file mode 100644 index 8c97feef3d..0000000000 --- a/cache/src/main/java/net/runelite/cache/script/assembler/LookupCase.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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.script.assembler; - -public class LookupCase -{ - private int value; - private int offset; - - public int getValue() - { - return value; - } - - public void setValue(int value) - { - this.value = value; - } - - public int getOffset() - { - return offset; - } - - public void setOffset(int offset) - { - this.offset = offset; - } -} diff --git a/cache/src/main/java/net/runelite/cache/script/assembler/ScriptWriter.java b/cache/src/main/java/net/runelite/cache/script/assembler/ScriptWriter.java deleted file mode 100644 index 2797d4a4c6..0000000000 --- a/cache/src/main/java/net/runelite/cache/script/assembler/ScriptWriter.java +++ /dev/null @@ -1,279 +0,0 @@ -/* - * 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.script.assembler; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import net.runelite.cache.definitions.ScriptDefinition; -import net.runelite.cache.script.Instruction; -import net.runelite.cache.script.Instructions; -import net.runelite.cache.script.Opcodes; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class ScriptWriter extends rs2asmBaseListener -{ - private static final Logger logger = LoggerFactory.getLogger(ScriptWriter.class); - - private final Instructions instructions; - private final LabelVisitor labelVisitor; - - private int id; - private int pos; - private int intStackCount; - private int stringStackCount; - private int localIntCount; - private int localStringCount; - private List opcodes = new ArrayList<>(); - private List iops = new ArrayList<>(); - private List sops = new ArrayList<>(); - private List switches = new ArrayList<>(); - - public ScriptWriter(Instructions instructions, LabelVisitor labelVisitor) - { - this.instructions = instructions; - this.labelVisitor = labelVisitor; - } - - @Override - public void enterId_value(rs2asmParser.Id_valueContext ctx) - { - int value = Integer.parseInt(ctx.getText()); - id = value; - } - - @Override - public void enterInt_stack_value(rs2asmParser.Int_stack_valueContext ctx) - { - int value = Integer.parseInt(ctx.getText()); - intStackCount = value; - } - - @Override - public void enterString_stack_value(rs2asmParser.String_stack_valueContext ctx) - { - int value = Integer.parseInt(ctx.getText()); - stringStackCount = value; - } - - @Override - public void enterInt_var_value(rs2asmParser.Int_var_valueContext ctx) - { - int value = Integer.parseInt(ctx.getText()); - localIntCount = value; - } - - @Override - public void enterString_var_value(rs2asmParser.String_var_valueContext ctx) - { - int value = Integer.parseInt(ctx.getText()); - localStringCount = value; - } - - @Override - public void exitInstruction(rs2asmParser.InstructionContext ctx) - { - ++pos; - } - - @Override - public void enterName_string(rs2asmParser.Name_stringContext ctx) - { - String text = ctx.getText(); - Instruction i = instructions.find(text); - if (i == null) - { - logger.warn("Unknown instruction {}", text); - throw new RuntimeException("Unknown instruction " + text); - } - - int opcode = i.getOpcode(); - addOpcode(opcode); - } - - @Override - public void enterName_opcode(rs2asmParser.Name_opcodeContext ctx) - { - String text = ctx.getText(); - int opcode = Integer.parseInt(text); - addOpcode(opcode); - } - - private void addOpcode(int opcode) - { - assert opcodes.size() == pos; - assert iops.size() == pos; - assert sops.size() == pos; - assert switches.size() == pos; - - opcodes.add(opcode); - iops.add(null); - sops.add(null); - switches.add(null); - } - - @Override - public void enterOperand_int(rs2asmParser.Operand_intContext ctx) - { - String text = ctx.getText(); - int value = Integer.parseInt(text); - iops.set(pos, value); - } - - @Override - public void enterOperand_qstring(rs2asmParser.Operand_qstringContext ctx) - { - String text = ctx.getText(); - text = text.substring(1, text.length() - 1); - sops.set(pos, text); - } - - @Override - public void enterOperand_label(rs2asmParser.Operand_labelContext ctx) - { - String text = ctx.getText(); - Integer instruction = labelVisitor.getInstructionForLabel(text); - if (instruction == null) - { - throw new RuntimeException("reference to unknown label " + text); - } - - int target = instruction - pos - 1; // -1 to go to the instruction prior - iops.set(pos, target); - } - - @Override - public void enterSwitch_lookup(rs2asmParser.Switch_lookupContext ctx) - { - if (switches.get(pos - 1) != null) - { - return; - } - - LookupSwitch ls = new LookupSwitch(); - switches.set(pos - 1, ls); - } - - @Override - public void exitSwitch_key(rs2asmParser.Switch_keyContext ctx) - { - String text = ctx.getText(); - int key = Integer.parseInt(text); - - LookupSwitch ls = switches.get(pos - 1); - assert ls != null; - - LookupCase scase = new LookupCase(); - scase.setValue(key); - - ls.getCases().add(scase); - } - - @Override - public void exitSwitch_value(rs2asmParser.Switch_valueContext ctx) - { - String text = ctx.getText(); - Integer instruction = labelVisitor.getInstructionForLabel(text); - if (instruction == null) - { - throw new RuntimeException("reference to unknown label " + text); - } - - int target = instruction // target instruction index - - (pos - 1) // pos is already at the instruction after the switch, so - 1 - - 1; // to go to the instruction prior to target - - LookupSwitch ls = switches.get(pos - 1); - assert ls != null; - - LookupCase scase = ls.getCases().get(ls.getCases().size() - 1); - scase.setOffset(target); - } - - public ScriptDefinition buildScript() - { - setSwitchOperands(); - - ScriptDefinition script = new ScriptDefinition(); - script.setId(id); - script.setIntStackCount(intStackCount); - script.setStringStackCount(stringStackCount); - script.setLocalIntCount(localIntCount); - script.setLocalStringCount(localStringCount); - script.setInstructions(opcodes.stream().mapToInt(Integer::valueOf).toArray()); - script.setIntOperands(iops.stream() - .map(i -> i == null ? 0 : i) - .mapToInt(Integer::valueOf) - .toArray()); - script.setStringOperands(sops.toArray(new String[0])); - script.setSwitches(buildSwitches()); - return script; - } - - private void setSwitchOperands() - { - int count = 0; - for (int i = 0; i < opcodes.size(); ++i) - { - if (opcodes.get(i) != Opcodes.SWITCH) - { - continue; - } - - iops.set(i, count++); - } - } - - private Map[] buildSwitches() - { - int count = (int) switches.stream().filter(Objects::nonNull).count(); - - if (count == 0) - { - return null; - } - - int index = 0; - Map[] maps = new Map[count]; - for (LookupSwitch lswitch : switches) - { - if (lswitch == null) - { - continue; - } - - Map map = maps[index++] = new HashMap<>(); - - for (LookupCase scase : lswitch.getCases()) - { - map.put(scase.getValue(), scase.getOffset()); - } - } - return maps; - } -} diff --git a/cache/src/main/java/net/runelite/cache/script/disassembler/Disassembler.java b/cache/src/main/java/net/runelite/cache/script/disassembler/Disassembler.java deleted file mode 100644 index 0a6382fec8..0000000000 --- a/cache/src/main/java/net/runelite/cache/script/disassembler/Disassembler.java +++ /dev/null @@ -1,233 +0,0 @@ -/* - * 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.script.disassembler; - -import java.io.IOException; -import java.util.Map; -import java.util.Map.Entry; -import net.runelite.cache.definitions.ScriptDefinition; -import net.runelite.cache.script.Instruction; -import net.runelite.cache.script.Instructions; -import net.runelite.cache.script.Opcodes; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class Disassembler -{ - private static final Logger logger = LoggerFactory.getLogger(Disassembler.class); - - private final Instructions instructions = new Instructions(); - - public Disassembler() - { - instructions.init(); - } - - private boolean isJump(int opcode) - { - switch (opcode) - { - case Opcodes.JUMP: - case Opcodes.IF_ICMPEQ: - case Opcodes.IF_ICMPGE: - case Opcodes.IF_ICMPGT: - case Opcodes.IF_ICMPLE: - case Opcodes.IF_ICMPLT: - case Opcodes.IF_ICMPNE: - return true; - default: - return false; - } - } - - private boolean[] needLabel(ScriptDefinition script) - { - int[] instructions = script.getInstructions(); - int[] iops = script.getIntOperands(); - Map[] switches = script.getSwitches(); - - boolean[] jumped = new boolean[instructions.length]; - - for (int i = 0; i < instructions.length; ++i) - { - int opcode = instructions[i]; - int iop = iops[i]; - - if (opcode == Opcodes.SWITCH) - { - Map switchMap = switches[iop]; - - for (Entry entry : switchMap.entrySet()) - { - int offset = entry.getValue(); - - int to = i + offset + 1; - assert to >= 0 && to < instructions.length; - jumped[to] = true; - } - } - - if (!isJump(opcode)) - { - continue; - } - - // + 1 because the jumps go to the instructions prior to the - // one you really want, because the pc is incremented on the - // next loop - int to = i + iop + 1; - assert to >= 0 && to < instructions.length; - - jumped[to] = true; - } - - return jumped; - } - - public String disassemble(ScriptDefinition script) throws IOException - { - int[] instructions = script.getInstructions(); - int[] iops = script.getIntOperands(); - String[] sops = script.getStringOperands(); - Map[] switches = script.getSwitches(); - - assert iops.length == instructions.length; - assert sops.length == instructions.length; - - boolean[] jumps = needLabel(script); - - StringBuilder writer = new StringBuilder(); - writerHeader(writer, script); - - for (int i = 0; i < instructions.length; ++i) - { - int opcode = instructions[i]; - int iop = iops[i]; - String sop = sops[i]; - - Instruction ins = this.instructions.find(opcode); - if (ins == null) - { - logger.warn("Unknown instruction {} in script {}", opcode, script.getId()); - } - - if (jumps[i]) - { - // something jumps here - writer.append("LABEL").append(i).append(":\n"); - } - - String name; - if (ins != null && ins.getName() != null) - { - name = ins.getName(); - } - else - { - name = String.format("%03d", opcode); - } - - writer.append(String.format(" %-22s", name)); - - if (shouldWriteIntOperand(opcode, iop)) - { - if (isJump(opcode)) - { - writer.append(" LABEL").append(i + iop + 1); - } - else - { - writer.append(" ").append(iop); - } - } - - if (sop != null) - { - writer.append(" \"").append(sop).append("\""); - } - - if (opcode == Opcodes.SWITCH) - { - Map switchMap = switches[iop]; - - for (Entry entry : switchMap.entrySet()) - { - int value = entry.getKey(); - int jump = entry.getValue(); - - writer.append("\n"); - writer.append(" ").append(value).append(": LABEL").append(i + jump + 1); - } - } - - writer.append("\n"); - } - - return writer.toString(); - } - - private boolean shouldWriteIntOperand(int opcode, int operand) - { - if (opcode == Opcodes.SWITCH) - { - // table follows instruction - return false; - } - - if (operand != 0) - { - // always write non-zero operand - return true; - } - - switch (opcode) - { - case Opcodes.ICONST: - case Opcodes.ILOAD: - case Opcodes.SLOAD: - case Opcodes.ISTORE: - case Opcodes.SSTORE: - return true; - } - - // int operand is not used, don't write it - return false; - } - - private void writerHeader(StringBuilder writer, ScriptDefinition script) - { - int id = script.getId(); - int intStackCount = script.getIntStackCount(); - int stringStackCount = script.getStringStackCount(); - int localIntCount = script.getLocalIntCount(); - int localStringCount = script.getLocalStringCount(); - - writer.append(".id ").append(id).append('\n'); - writer.append(".int_stack_count ").append(intStackCount).append('\n'); - writer.append(".string_stack_count ").append(stringStackCount).append('\n'); - writer.append(".int_var_count ").append(localIntCount).append('\n'); - writer.append(".string_var_count ").append(localStringCount).append('\n'); - } -} diff --git a/cache/src/main/java/net/runelite/cache/util/BZip2.java b/cache/src/main/java/net/runelite/cache/util/BZip2.java deleted file mode 100644 index cde6fc55da..0000000000 --- a/cache/src/main/java/net/runelite/cache/util/BZip2.java +++ /dev/null @@ -1,86 +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.cache.util; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.Arrays; -import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream; -import org.apache.commons.compress.compressors.bzip2.BZip2CompressorOutputStream; -import org.apache.commons.compress.utils.IOUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class BZip2 -{ - private static final Logger logger = LoggerFactory.getLogger(BZip2.class); - - private static final byte[] BZIP_HEADER = new byte[] - { - 'B', 'Z', // magic - 'h', // 'h' for Bzip2 ('H'uffman coding) - '1' // block size - }; - - public static byte[] compress(byte[] bytes) throws IOException - { - InputStream is = new ByteArrayInputStream(bytes); - ByteArrayOutputStream bout = new ByteArrayOutputStream(); - try (OutputStream os = new BZip2CompressorOutputStream(bout, 1)) - { - IOUtils.copy(is, os); - } - - byte[] out = bout.toByteArray(); - - assert BZIP_HEADER[0] == out[0]; - assert BZIP_HEADER[1] == out[1]; - assert BZIP_HEADER[2] == out[2]; - assert BZIP_HEADER[3] == out[3]; - - return Arrays.copyOfRange(out, BZIP_HEADER.length, out.length); // remove header.. - } - - public static byte[] decompress(byte[] bytes, int len) throws IOException - { - byte[] data = new byte[len + BZIP_HEADER.length]; - - // add header - System.arraycopy(BZIP_HEADER, 0, data, 0, BZIP_HEADER.length); - System.arraycopy(bytes, 0, data, BZIP_HEADER.length, len); - - ByteArrayOutputStream os = new ByteArrayOutputStream(); - - try (InputStream is = new BZip2CompressorInputStream(new ByteArrayInputStream(data))) - { - IOUtils.copy(is, os); - } - - return os.toByteArray(); - } -} diff --git a/cache/src/main/java/net/runelite/cache/util/Djb2.java b/cache/src/main/java/net/runelite/cache/util/Djb2.java deleted file mode 100644 index e6ccc13e05..0000000000 --- a/cache/src/main/java/net/runelite/cache/util/Djb2.java +++ /dev/null @@ -1,28 +0,0 @@ -package net.runelite.cache.util; - -/** - * An implementation of the {@code djb2} hash function. - * - * @author Graham - * @author `Discardedx2 - */ -public final class Djb2 -{ - /** - * An implementation of Dan Bernstein's {@code djb2} hash function which - * is slightly modified. Instead of the initial hash being 5381, it is - * zero. - * - * @param str The string to hash. - * @return The hash code. - */ - public static int hash(String str) - { - int hash = 0; - for (int i = 0; i < str.length(); i++) - { - hash = str.charAt(i) + ((hash << 5) - hash); - } - return hash; - } -} diff --git a/cache/src/main/java/net/runelite/cache/util/GZip.java b/cache/src/main/java/net/runelite/cache/util/GZip.java deleted file mode 100644 index faae86eaa8..0000000000 --- a/cache/src/main/java/net/runelite/cache/util/GZip.java +++ /dev/null @@ -1,67 +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.cache.util; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.zip.GZIPInputStream; -import java.util.zip.GZIPOutputStream; -import org.apache.commons.compress.utils.IOUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class GZip -{ - private static final Logger logger = LoggerFactory.getLogger(GZip.class); - - public static byte[] compress(byte[] bytes) throws IOException - { - InputStream is = new ByteArrayInputStream(bytes); - ByteArrayOutputStream bout = new ByteArrayOutputStream(); - - try (OutputStream os = new GZIPOutputStream(bout)) - { - IOUtils.copy(is, os); - } - - return bout.toByteArray(); - } - - public static byte[] decompress(byte[] bytes, int len) throws IOException - { - ByteArrayOutputStream os = new ByteArrayOutputStream(); - - try (InputStream is = new GZIPInputStream(new ByteArrayInputStream(bytes, 0, len))) - { - IOUtils.copy(is, os); - } - - return os.toByteArray(); - } -} diff --git a/cache/src/main/java/net/runelite/cache/util/IDClass.java b/cache/src/main/java/net/runelite/cache/util/IDClass.java deleted file mode 100644 index e647fb27e1..0000000000 --- a/cache/src/main/java/net/runelite/cache/util/IDClass.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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.util; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.PrintWriter; - -public class IDClass extends PrintWriter -{ - private final Namer namer = new Namer(); - - private IDClass(File file) throws FileNotFoundException - { - super(file); - } - - public static IDClass create(File directory, String name) throws IOException - { - IDClass c = new IDClass(new File(directory, name + ".java")); - c.println("/* This file is automatically generated. Do not edit. */"); - c.println("package net.runelite.api;"); - c.println(); - c.print("public final class "); - c.println(name); - c.println("{"); - return c; - } - - public void add(String name, int id) - { - String javaName = namer.name(name, id); - if (javaName == null) - { - return; - } - - println(" public static final int " + javaName + " = " + id + ";"); - } - - @Override - public void println() - { - // Java 9+ only reads line.separator on startup, so we have to override it here - write('\n'); - } - - @Override - public void close() - { - println("\t/* This file is automatically generated. Do not edit. */"); - println("}"); - super.close(); - } -} diff --git a/cache/src/main/java/net/runelite/cache/util/Namer.java b/cache/src/main/java/net/runelite/cache/util/Namer.java deleted file mode 100644 index 834da31f98..0000000000 --- a/cache/src/main/java/net/runelite/cache/util/Namer.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) 2017, Adam - * 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.util; - -import java.util.HashSet; -import java.util.Set; - -public class Namer -{ - private final Set used = new HashSet<>(); - - public String name(String name, int id) - { - name = sanitize(name); - - if (name == null) - { - return null; - } - - if (used.contains(name)) - { - name = name + "_" + id; - assert !used.contains(name); - } - - used.add(name); - - return name; - } - - private static String sanitize(String in) - { - String s = removeTags(in) - .toUpperCase() - .replace(' ', '_') - .replaceAll("[^a-zA-Z0-9_]", ""); - if (s.isEmpty()) - { - return null; - } - if (Character.isDigit(s.charAt(0))) - { - return "_" + s; - } - else - { - return s; - } - } - - public static String removeTags(String str) - { - StringBuilder builder = new StringBuilder(str.length()); - boolean inTag = false; - - for (int i = 0; i < str.length(); i++) - { - char currentChar = str.charAt(i); - - if (currentChar == '<') - { - inTag = true; - } - else if (currentChar == '>') - { - inTag = false; - } - else if (!inTag) - { - builder.append(currentChar); - } - } - - return builder.toString(); - } -} diff --git a/cache/src/main/java/net/runelite/cache/util/ScriptVarType.java b/cache/src/main/java/net/runelite/cache/util/ScriptVarType.java deleted file mode 100644 index 2ff3bdf515..0000000000 --- a/cache/src/main/java/net/runelite/cache/util/ScriptVarType.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * 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.util; - -import java.util.HashMap; -import java.util.Map; -import lombok.AllArgsConstructor; - -@AllArgsConstructor -public enum ScriptVarType -{ - INTEGER('i', "integer"), - BOOLEAN('1', "boolean"), - SEQ('A', "seq"), - COLOUR('C', "colour"), - /** - * Also known as {@code Widget}. - */ - COMPONENT('I', "component"), - IDKIT('K', "idkit"), - MIDI('M', "midi"), - SYNTH('P', "synth"), - STAT('S', "stat"), - COORDGRID('c', "coordgrid"), - GRAPHIC('d', "graphic"), - FONTMETRICS('f', "fontmetrics"), - ENUM('g', "enum"), - JINGLE('j', "jingle"), - /** - * Also known as {@code Object}. - */ - LOC('l', "loc"), - MODEL('m', "model"), - NPC('n', "npc"), - /** - * Also known as {@code Item}. - */ - OBJ('o', "obj"), - /** - * Another version of {@code OBJ}, but means that on Jagex's side they used the internal name for an item. - */ - NAMEDOBJ('O', "namedobj"), - STRING('s', "string"), - SPOTANIM('t', "spotanim"), - INV('v', "inv"), - TEXTURE('x', "texture"), - CHAR('z', "char"), - MAPSCENEICON('£', "mapsceneicon"), - MAPELEMENT('µ', "mapelement"), - HITMARK('×', "hitmark"), - STRUCT('J', "struct"); - - private static final Map keyToTypeMap = new HashMap<>(); - - static - { - for (ScriptVarType type : values()) - { - keyToTypeMap.put(type.keyChar, type); - } - } - - public static ScriptVarType forCharKey(char key) - { - return keyToTypeMap.get(key); - } - - /** - * The character used when encoding or decoding types. - */ - private final char keyChar; - - /** - * The full name of the var type. - */ - private final String fullName; - -} diff --git a/cache/src/main/java/net/runelite/cache/util/Xtea.java b/cache/src/main/java/net/runelite/cache/util/Xtea.java deleted file mode 100644 index c79dc5a511..0000000000 --- a/cache/src/main/java/net/runelite/cache/util/Xtea.java +++ /dev/null @@ -1,88 +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.cache.util; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; - -public class Xtea -{ - private static final int GOLDEN_RATIO = 0x9E3779B9; - - private static final int ROUNDS = 32; - - private final int[] key; - - public Xtea(int[] key) - { - this.key = key; - } - - public byte[] encrypt(byte[] data, int len) - { - ByteBuf buf = Unpooled.wrappedBuffer(data, 0, len); - ByteBuf out = Unpooled.buffer(len); - int numBlocks = len / 8; - for (int block = 0; block < numBlocks; ++block) - { - int v0 = buf.readInt(); - int v1 = buf.readInt(); - int sum = 0; - for (int i = 0; i < ROUNDS; ++i) - { - v0 += (((v1 << 4) ^ (v1 >>> 5)) + v1) ^ (sum + key[sum & 3]); - sum += GOLDEN_RATIO; - v1 += (((v0 << 4) ^ (v0 >>> 5)) + v0) ^ (sum + key[(sum >>> 11) & 3]); - } - out.writeInt(v0); - out.writeInt(v1); - } - out.writeBytes(buf); - return out.array(); - } - - public byte[] decrypt(byte[] data, int len) - { - ByteBuf buf = Unpooled.wrappedBuffer(data, 0, len); - ByteBuf out = Unpooled.buffer(len); - int numBlocks = len / 8; - for (int block = 0; block < numBlocks; ++block) - { - int v0 = buf.readInt(); - int v1 = buf.readInt(); - int sum = GOLDEN_RATIO * ROUNDS; - for (int i = 0; i < ROUNDS; ++i) - { - v1 -= (((v0 << 4) ^ (v0 >>> 5)) + v0) ^ (sum + key[(sum >>> 11) & 3]); - sum -= GOLDEN_RATIO; - v0 -= (((v1 << 4) ^ (v1 >>> 5)) + v1) ^ (sum + key[sum & 3]); - } - out.writeInt(v0); - out.writeInt(v1); - } - out.writeBytes(buf); - return out.array(); - } -} diff --git a/cache/src/main/resources/djb2.properties b/cache/src/main/resources/djb2.properties deleted file mode 100644 index 4d635ffaae..0000000000 --- a/cache/src/main/resources/djb2.properties +++ /dev/null @@ -1,1403 +0,0 @@ -#Wed Nov 29 15:08:06 PST 2017 --1863637185=miscgraphics,4 --1863637184=miscgraphics,5 --1863637187=miscgraphics,2 --1863637186=miscgraphics,3 --1863637181=miscgraphics,8 --1863637180=miscgraphics,9 --440204630=alls fairy in love n war --1863637183=miscgraphics,6 --1253085654=scorpia_dances --1863637182=miscgraphics,7 -1356196826=backvmid3 --751102526=high seas -1356196825=backvmid2 --1863637189=miscgraphics,0 -549358875=camelot --1863637188=miscgraphics,1 --1619800378=emotes_locked,19 --1619800379=emotes_locked,18 -792536868=understanding -1356196824=backvmid1 --1773559904=title_mute --342013218=p11_full -1523653533=pirates of peril -696768774=harmony --1701556831=magicoff2,27 -281586976=orb_icon,3 -286265996=ready for battle --1701556832=magicoff2,26 -281586977=orb_icon,4 --645977478=scape scared --1701556833=magicoff2,25 -281586978=orb_icon,5 --1701556834=magicoff2,24 --1701556830=magicoff2,28 --1052794696=dance of death --1619800383=emotes_locked,14 --1619800384=emotes_locked,13 --1619800385=emotes_locked,12 --1556842207=sl_flags --1619800386=emotes_locked,11 -1614826739=mapletree --1619800387=emotes_locked,10 --1701556835=magicoff2,23 --1701556836=magicoff2,22 -1363656441=serenade --1701556837=magicoff2,21 -3089326=door --1701556838=magicoff2,20 --1619800380=emotes_locked,17 --1619800381=emotes_locked,16 --1619800382=emotes_locked,15 --1037172987=tomorrow -825974316=melodrama -281586973=orb_icon,0 -281586974=orb_icon,1 -281586975=orb_icon,2 --1701556864=magicoff2,15 --1701556865=magicoff2,14 --1701556866=magicoff2,13 -1509400204=sarcophagus --1701556867=magicoff2,12 --1701556860=magicoff2,19 --1701556861=magicoff2,18 --1701556862=magicoff2,17 -1868377358=lower_depths --1701556863=magicoff2,16 -1086036315=reggae2 --1220755677=hermit --1544597765=sl_stars --1619800350=emotes_locked,26 --1619800351=emotes_locked,25 --1636062434=tex_brown --1619800352=emotes_locked,24 --1619800353=emotes_locked,23 --2122174648=back to life --1619800354=emotes_locked,22 --1701556868=magicoff2,11 --1619800355=emotes_locked,21 --1701556869=magicoff2,10 --1619800356=emotes_locked,20 -1619539773=side_icons,7 -1121239524=scape wild -368271413=diango's little helpers -1619539772=side_icons,6 -1619539775=side_icons,9 -1619539774=side_icons,8 --1938172321=miscgraphics2,0 -1619539771=side_icons,5 -1619539770=side_icons,4 --926977577=the enchanter -1202794514=doorways -1343649581=schools out --1097177625=q8_full -756012174=wornicons,4 -756012173=wornicons,3 -756012176=wornicons,6 -756012175=wornicons,5 -756012170=wornicons,0 -827249681=ogre the top -756012172=wornicons,2 -756012171=wornicons,1 --1741764817=poles apart -756012178=wornicons,8 --1938172320=miscgraphics2,1 -756012177=wornicons,7 --43136286=the last shanty -756012179=wornicons,9 -837131331=mapback --1938172313=miscgraphics2,8 -907740319=the depths --1938172312=miscgraphics2,9 --2099722614=cave of beasts --1938172317=miscgraphics2,4 --1938172316=miscgraphics2,5 --1938172315=miscgraphics2,6 --1938172314=miscgraphics2,7 -1619539769=side_icons,3 --1367483767=cavern --1938172319=miscgraphics2,2 -50474489=treestump --1938172318=miscgraphics2,3 -1619539766=side_icons,0 -1619539768=side_icons,2 -1619539767=side_icons,1 --607416954=prayeron,11 -1837251043=melzars maze --607416953=prayeron,12 -1318893900=have an ice day --607416952=prayeron,13 --1701556800=magicoff2,37 --607416951=prayeron,14 --1701556801=magicoff2,36 --56804840=woodland --607416950=prayeron,15 -1120636327=scape cave -358884868=button_red --1701556806=magicoff2,31 --1701556807=magicoff2,30 --1701556802=magicoff2,35 --1701556803=magicoff2,34 --1701556804=magicoff2,33 --1858265682=monster melee --1701556805=magicoff2,32 --649484675=land of the dwarves --1789903512=golden touch -1328851780=close_buttons,6 -1080306793=shayzien_march --1339126929=damage -4820960=monkey sadness --1951786153=bone dance -1328851781=close_buttons,7 -939546513=forlorn_homestead --1019905269=shadowland --607416955=prayeron,10 --2048535896=pheasant peasant --1025233830=monkey madness -1121125956=scape soft --1562452687=etcetera -1969878996=emotes,47 -1969878994=emotes,45 --1228279872=ge_icons,3 -1969878995=emotes,46 --1228279871=ge_icons,4 -1969878992=emotes,43 --1228279870=ge_icons,5 -1969878993=emotes,44 -1959803992=invback -399048409=mage arena -1969878990=emotes,41 --47057524=lasting -1969878991=emotes,42 --1228279875=ge_icons,0 --1228279874=ge_icons,1 --1228279873=ge_icons,2 --1860080918=inspiration -1997757502=redstone2 -1997757503=redstone3 --1060046352=tribal2 -1997757501=redstone1 --1701556829=magicoff2,29 -1890607210=magicon2,37 -1890607211=magicon2,38 -1890607212=magicon2,39 --1408684838=ascent --848436598=fishing --119984250=combaticons2,17 --119984251=combaticons2,16 -1769177816=jungle island --119984252=combaticons2,15 --119984253=combaticons2,14 --119984254=combaticons2,13 --119984255=combaticons2,12 --119984256=combaticons2,11 --119984257=combaticons2,10 -1890607205=magicon2,32 -1890607206=magicon2,33 -1890607207=magicon2,34 -1890607208=magicon2,35 -135141185=zeah_combat -1890607209=magicon2,36 --180851958=norse code -112903447=water -922007495=talking forest --672706748=miracle dance --1110089645=lament --1237461365=grotto -1890607203=magicon2,30 -1890607204=magicon2,31 --1073910849=mirror --988841056=still night --1857025509=sunburn --468596910=easter jig -796868952=major miner --1066798491=trawler -1640556978=wonderous --1624274920=emperor -740093634=find my way -1890607238=magicon2,44 -1890607239=magicon2,45 -3559837=tick --1839713245=sideicons -1029455878=hells bells -1890607234=magicon2,40 -1890607235=magicon2,41 -1890607236=magicon2,42 -1890607237=magicon2,43 -1503566841=forbidden --895763669=spooky --276138668=ham attack -500433071=combaticons,5 --1021014225=catch me if you can -500433070=combaticons,4 -500433073=combaticons,7 -500433072=combaticons,6 -500433075=combaticons,9 -1533565119=mind over matter -500433074=combaticons,8 -2025958358=emotes_locked,4 -500433066=combaticons,0 -2025958357=emotes_locked,3 -862821975=far away --1228392498=artistry -2025958356=emotes_locked,2 -500433068=combaticons,2 -2025958355=emotes_locked,1 -500433067=combaticons,1 -1085444827=refresh -500433069=combaticons,3 -2025958359=emotes_locked,5 -1427043851=on the up -2025958354=emotes_locked,0 -1316697938=whistle -347955347=venture -1959211608=mapfunction,77 -1959211609=mapfunction,78 -881850881=the chosen -1959211601=mapfunction,70 -1959211602=mapfunction,71 -584643951=lost soul -582140282=rising damp -1959211603=mapfunction,72 -1740872686=soulfall -1959211604=mapfunction,73 -1959211605=mapfunction,74 --119984248=combaticons2,19 -1959211606=mapfunction,75 --119984249=combaticons2,18 -1609255038=slither and thither -82917947=sarim's vermin -1959211607=mapfunction,76 -1728911401=natural --1189743137=duel arena -108698078=roof2 -214634021=head to head -2025958361=emotes_locked,7 --448773288=isle of everywhere -2025958360=emotes_locked,6 --1869996941=titlebox --338347745=showdown --2075972251=long ago -2025958363=emotes_locked,9 -2025958362=emotes_locked,8 --1487589606=7th realm --1253087691=garden --2133902017=zeah_farming --492926285=impetuous -3314014=lair -907815588=the desert --1960860275=barbarianism -1890607241=magicon2,47 -1890607242=magicon2,48 -1890607243=magicon2,49 --919642451=jungle bells -795515487=underground -561438836=fountain --1418827919=illusive --634763748=fruits de mer -1890607240=magicon2,46 -1694458038=large_button -1393517697=bandit camp -1959211632=mapfunction,80 -1884773718=magicoff2,2 -1884773719=magicoff2,3 -1884773716=magicoff2,0 -2121900771=backtop1 -1884773717=magicoff2,1 --103077377=gnomeball --1947119982=blistering barnacles -828650857=autumn voyage -92909147=alone -1691516951=undead dungeon -122265833=expecting --1320617626=dunjun -1959211633=mapfunction,81 -1959211634=mapfunction,82 -1959211635=mapfunction,83 -1959211636=mapfunction,84 -1959211637=mapfunction,85 -777534707=army of darkness -1959211638=mapfunction,86 -1959211639=mapfunction,87 -1884773721=magicoff2,5 -1884773722=magicoff2,6 -1884773720=magicoff2,4 -1959211640=mapfunction,88 -1959211641=mapfunction,89 --327707013=anywhere -1884773725=magicoff2,9 -1884773723=magicoff2,7 -1884773724=magicoff2,8 -1116844876=incantation --728886272=temple of light -685934899=in the clink --1237289460=grumpy -1945133711=inferno -466902883=strange place --418223472=phasmatys -817472004=zombiism -106578554=zeah_book,0 -106578555=zeah_book,1 -1509070203=eagle peak --485932799=expedition -1171923143=emotes,8 --675357975=attack1 -1171923144=emotes,9 -1959211610=mapfunction,79 --675357974=attack2 --675357973=attack3 --675357972=attack4 --675357971=attack5 -40246002=masquerade --675357970=attack6 --734206983=arrival --1980407601=sea shanty xmas -284435223=pharoah's tomb --148552909=down below -1171923141=emotes,6 -1171923142=emotes,7 -1171923140=emotes,5 --1077789440=mellow --710537653=kingdom -1171923138=emotes,3 -1171923139=emotes,4 -1171923136=emotes,1 --2098286081=venture2 -1171923137=emotes,2 -1171923135=emotes,0 --1094248165=sigmunds showdown --271106892=rat a tat tat -3288564=keys --143163121=ham fisted --900633031=medieval -944208821=life's a beach\! --1228279453=riverside --1666444059=combaticons,10 -825919125=options_icons,24 -825919126=options_icons,25 -1179379180=the trade parade --1666444057=combaticons,12 -825919123=options_icons,22 --1666444058=combaticons,11 -825919124=options_icons,23 -825919121=options_icons,20 -1884768169=magicoff,32 -825919122=options_icons,21 -1884768167=magicoff,30 -1884768168=magicoff,31 -1318818808=chainmail -582031337=intrepid -783525419=beetle juice -432605856=untouchable --969918857=neverland -79789174=narnode's theme --705938181=zealot -117588=web --1666444051=combaticons,18 --1666444052=combaticons,17 -1687654733=troubled --1666444050=combaticons,19 --1666444055=combaticons,14 -825919129=options_icons,28 --1666444056=combaticons,13 --1666444053=combaticons,16 -825919127=options_icons,26 --1666444054=combaticons,15 -825919128=options_icons,27 -1320694328=magical journey -364185053=roll the bones --1254483584=jungly1 -981183822=right on track --1254483583=jungly2 --1254483582=jungly3 -3075958=dark --2038936746=deep down -1512143976=everlasting fire --1392319985=beyond -46273615=tale of keldagrim --651951461=goblin game -3522941=save -104084791=mossy -1250935993=the monsters below -794539501=garden of summer -1814277765=elven mist -2110556093=the golem --1475251658=where eagles lair -1884768143=magicoff,27 -1884768144=magicoff,28 -1884768141=magicoff,25 -1529837717=bubble and squeak -1884768142=magicoff,26 --1679325940=technology -1884768145=magicoff,29 --826562194=troubled_waters -1884768140=magicoff,24 --1359348243=painting1 -1267356434=the power of tears --1359348242=painting2 --860755690=jungle hunt -1884768138=magicoff,22 --1197347961=magic magic magic -1884768139=magicoff,23 -1134405764=hypnotized -1959211539=mapfunction,50 -1381363755=my arms journey --1644401602=complication -1959211540=mapfunction,51 -1959211541=mapfunction,52 -1884768136=magicoff,20 -1959211542=mapfunction,53 -2111304827=warning_icons,0 -1884768137=magicoff,21 --440187560=zogre dance -1959211543=mapfunction,54 -2111304828=warning_icons,1 --2002535437=corridors of power -825919130=options_icons,29 -580384095=jungle troubles -1301622585=slice of station -1959211544=mapfunction,55 -2111304829=warning_icons,2 --1294172031=escape --1309477156=expanse --1526067851=alternative root -2124773424=dynasty -1743765602=leftarrow --1482676188=romancing the crone --1891851953=island of the trolls -736457293=small_button_pressed --1106172890=letter -986170990=dreamstate -1959211545=mapfunction,56 -1959211546=mapfunction,57 -1765722413=spirits of elid -1959211547=mapfunction,58 -1959211548=mapfunction,59 --2075333010=lonesome -3314400=lava -1355033875=worldmap_icon,1 -1814357716=knightmare -1690742645=nox_irae -94935104=cross --1249495153=frogland --1642689926=athletes foot -107944162=quest -1355033874=worldmap_icon,0 --2130741313=joy of the hunt --28982081=labyrinth -250959119=marooned --1522984472=altar_ego -1326424637=the lost melody --1779111734=arabique --398925062=sea shanty2 -1884768110=magicoff,15 -1884768111=magicoff,16 -1817249074=woe of the wyvern -1884768114=magicoff,19 -1884768112=magicoff,17 --1624760229=emotion -1884768113=magicoff,18 --353951458=attention -279431252=garden of autumn -422652266=small_button -1884768107=magicoff,12 -1884768108=magicoff,13 -375695247=the far side -1884768105=magicoff,10 -1884768106=magicoff,11 --528864109=crystal sword -1884768109=magicoff,14 -1959211570=mapfunction,60 --158141423=prayeron,7 --158141424=prayeron,6 -1959211571=mapfunction,61 --158141421=prayeron,9 -1959211572=mapfunction,62 --158141422=prayeron,8 -1959211573=mapfunction,63 -1959211574=mapfunction,64 -688840255=piscarilius_sigil -1959211575=mapfunction,65 -1959211576=mapfunction,66 -1170407052=headicons_prayer -1959211577=mapfunction,67 --324496873=soundscape --1418445703=tex_red -1961540869=wornicons,10 --1028580907=that_sullen_hall -397136995=elfpainting --2092714094=haunted mine -1959211578=mapfunction,68 -1959211579=mapfunction,69 --158141429=prayeron,1 --158141427=prayeron,3 --140492390=bunny_sugar_rush --158141428=prayeron,2 --158141425=prayeron,5 -1827366203=righteousness --649601274=darkness_in_the_depths --158141426=prayeron,4 -1961540870=wornicons,11 --158141430=prayeron,0 -910299584=principality --734028978=arrow,1 --734028979=arrow,0 -790067275=garden of spring -35762567=workshop --1095396929=competition -96463963=egypt --1154441378=jollyr --1685231711=cave background --2078908549=time out --1172405897=wildwood --170561624=spookyjungle -2110231453=mod_icons -2061491048=shining --1063411723=tremble -94627585=chest --520702427=ice melody -1346720899=backleft1 --607416919=prayeron,25 --607416918=prayeron,26 -900197712=staticons,6 --607416917=prayeron,27 -900197713=staticons,7 --607416916=prayeron,28 -900197710=staticons,4 --607416915=prayeron,29 -900197711=staticons,5 -957931606=courage -900197714=staticons,8 -900197715=staticons,9 --720253066=the other side --1655721374=prayeroff,31 --607416921=prayeron,23 --1655721375=prayeroff,30 --607416920=prayeron,24 --710515142=the mad mole --1350228392=stratosphere --1666438445=combaticons2,3 --1666438446=combaticons2,2 --1666438443=combaticons2,5 --1666438444=combaticons2,4 --1106570438=legion --1666438441=combaticons2,7 --1666438442=combaticons2,6 -1398587265=flute salad --1666438440=combaticons2,8 -837223705=mapedge -900197709=staticons,3 --243680393=peng_emotes,7 -900197707=staticons,1 -378300078=everlasting -900197708=staticons,2 --944748869=witching --243680396=peng_emotes,4 --1335336992=logo_deadman_mode --1368714737=small_button_blue --795140435=wander --243680397=peng_emotes,3 --243680394=peng_emotes,6 --1666438447=combaticons2,1 --243680395=peng_emotes,5 --1666438448=combaticons2,0 --243680398=peng_emotes,2 --243680399=peng_emotes,1 --607416924=prayeron,20 -900197706=staticons,0 --607416923=prayeron,21 --607416922=prayeron,22 -3016376=bark --89244313=romper chomper -346288985=dorgeshun deep -1585002399=magicon,21 --1725263140=chef surprize -1585002398=magicon,20 --993528987=making waves --628963539=ham and seek --1666438439=combaticons2,9 --333224315=baroque --1236252722=prime time -280241284=waking dream --564582358=distant land -115411843=castlewars -1513246078=al kharid --1377700863=unknown land -1264132816=miles away -1185785872=barbassault_icons,3 -1185785873=barbassault_icons,4 --1655721397=prayeroff,29 --1655721398=prayeroff,28 -1185785874=barbassault_icons,5 --1655721399=prayeroff,27 -1185785875=barbassault_icons,6 -1711341885=fight or flight -1185785870=barbassault_icons,1 -1185785871=barbassault_icons,2 -3530505=sire --309570839=pick_and_shovel -647234089=distillery hilarity --127408236=gnome_village_party -1337378554=backbase2 -109757537=stars -1337378553=backbase1 -109757538=start -819884325=wilderness3 -1328851775=close_buttons,1 -658759958=side_background -1328851774=close_buttons,0 --782211141=wonder -1328851777=close_buttons,3 --1995718284=wall_white -819884324=wilderness2 -1328851776=close_buttons,2 -1328851779=close_buttons,5 --943885542=scape hunter -1328851778=close_buttons,4 -1185785869=barbassault_icons,0 --607416949=prayeron,16 --607416948=prayeron,17 --1779684630=rune essence --607416947=prayeron,18 --607416946=prayeron,19 -1119460311=bandos battalion --967559823=creature cruelty --1904094243=zeah_fishing --1913214770=wilderness -460367020=village -825919161=options_icons,39 -1585002375=magicon,18 -94839810=coins -1585002376=magicon,19 -825919160=options_icons,38 --1282090556=faerie --521895311=the adventurer -788399136=tree spirits --1902858744=beneath_the_stronghold --356730043=pirates of penance -1185785876=barbassault_icons,7 -825919158=options_icons,36 -825919159=options_icons,37 -825919156=options_icons,34 --1455241861=victory is mine -825919157=options_icons,35 --1333874720=side_icons,17 -825919154=options_icons,32 -825919155=options_icons,33 -825919152=options_icons,30 -825919153=options_icons,31 -1437805631=chatback --1623296531=ground scape -685190118=in the brine -1366257555=nightfall -110327241=theme --1333874725=side_icons,12 --1333874726=side_icons,11 --1333874727=side_icons,10 --1333874721=side_icons,16 --1333874722=side_icons,15 --1124681475=darkly_altared --8976533=throne of the demon --1333874723=side_icons,14 --1333874724=side_icons,13 --1989106719=assault and battery -1958759012=greatness -1057075019=b12_full -1143353537=chain of command --51091830=desert voyage --1073927447=mirage --91048728=number_button -3165239=gaol --1380919269=breeze -445640248=rugged_terrain -106079=key --655784411=overlay_multiway --1025835715=backright2 --1025835716=backright1 -1120933843=scape main -3225350=iban --956253112=title fight --123912401=la mort -1585002367=magicon,10 --2128736428=startgame -1585002368=magicon,11 --925031874=royale -1585002369=magicon,12 -1585002370=magicon,13 -1585002373=magicon,16 -1585002374=magicon,17 --1307116191=superstition -1585002371=magicon,14 -1585002372=magicon,15 --587569902=path of peril -3392903=null --1601127242=inadequacy -2136330800=staticons2,0 -2136330801=staticons2,1 -344336468=grip of the talon -2136330804=staticons2,4 -2136330805=staticons2,5 -2136330802=staticons2,2 -2136330803=staticons2,3 -1960215130=barking mad --43712789=scape original -621171714=cellar song -1585002461=magicon,41 -1585002462=magicon,42 -1585002460=magicon,40 -111485446=upass -2136330808=staticons2,8 -694847251=in the manor -2136330809=staticons2,9 -2136330806=staticons2,6 -2136330807=staticons2,7 --1385847955=rightarrow -1343200077=the slayer -1585002465=magicon,45 -1585002466=magicon,46 -1585002463=magicon,43 -1585002464=magicon,44 -1585002469=magicon,49 --95571520=volcanic vikings -1585002467=magicon,47 -1585002468=magicon,48 --1032629963=shipwrecked -93330745=aztec --881372797=tabs,1 -1377351472=oriental -121641580=headicons_hint --881372798=tabs,0 -1585002438=magicon,39 --1661605940=elfwood --607416893=prayeron,30 --822106577=jungle island xmas --607416892=prayeron,31 -332368736=mad eadgar -1585002432=magicon,33 --143368781=side_background_right -1585002433=magicon,34 --1081494434=malady -1585002430=magicon,31 -1585002431=magicon,32 -1585002436=magicon,37 -1585002437=magicon,38 -1585002434=magicon,35 -1585002435=magicon,36 --1938171360=miscgraphics3,0 --1059680853=trinity -781557721=dies_irae --1938171359=miscgraphics3,1 -497375231=stillness --1938171358=miscgraphics3,2 --1938171357=miscgraphics3,3 --960709976=dogs of war -2129339089=magicon,1 -2129339088=magicon,0 -755433248=headicons_pk -108392383=regal --213632750=waterfall --1367706280=canvas -73828649=settlement -848123561=into the abyss -478781900=last stand -1339486127=the shadow --1055503808=roc and roll -837204902=mapdots -950484242=compass --1082154559=fanfare -747848680=nether_realm -788224888=dead quiet -1532279978=monarch waltz --149029727=side_background_left1 -812947089=fanfare2 --149029726=side_background_left2 -1006643748=high spirits --2136059388=starlight -2122572442=the tower --1998869913=spooky2 -1411067174=gnome village2 --2065077267=wild side -812947090=fanfare3 -1585002429=magicon,30 -1294629755=on the wing -2097127567=monkey badness --2032107216=sojourn -1020264019=pest control -3237038=info -1473393027=fe fi fo fum --1686202291=upper_depths -3540994=stop -1742080803=darkwood -740392969=little cave of horrors --158379532=prayerglow --691855347=in between --200702983=the noble rodent -1652745754=forgotten --1895307673=hitmark,3 --1895307674=hitmark,2 --1895307675=hitmark,1 --1895307676=hitmark,0 --1895307670=hitmark,6 --1895307671=hitmark,5 --1895307672=hitmark,4 -1968917071=bone dry --850506182=trawler minor -197029040=mapscene --808772318=in the pits --1165315580=looking back --1763090403=scape_ape --1938177931=miscgraphics,11 --1938177932=miscgraphics,10 -1936130561=thrall_of_the_serpent -1258863383=yesteryear -1994744000=slice of silent movie --1691854169=dead can dance -1585002407=magicon,29 -1585002405=magicon,27 -1585002406=magicon,28 -271319484=frostbite --499867199=meridian -1585002400=magicon,22 --1938177930=miscgraphics,12 --84626226=mudskipper melody -1585002403=magicon,25 -1585002404=magicon,26 -3641802=wall -1585002401=magicon,23 -1585002402=magicon,24 --606457701=wolf mountain -1276599785=button_brown -1969878899=emotes,13 -1969878897=emotes,11 -1969878898=emotes,12 -1969878896=emotes,10 --1938177928=miscgraphics,14 --907669678=brew hoo hoo --1938177929=miscgraphics,13 -72999866=subterranea -619237947=the galleon --1764950404=scape sad -295831445=heart and mind -908430134=dangerous road -738888631=tradebacking --174800339=verdana_11pt_regular -686705631=lightwalk --601591436=side_background_bottom --1479412376=the navigator --359173459=zamorak zoo -744536246=null and void --1701556798=magicoff2,39 --1701556799=magicoff2,38 --1396384012=bamboo --200388662=lighthouse -133626717=suspicious --810515425=voyage -3061973=crag -1802291895=big chords --1661619479=elfwall -113315621=wood2 -1813041183=steelborder2,0 -429244831=slug a bug ball -1813041184=steelborder2,1 --1658386264=shining_spirit -738909086=chamber -526264239=verdana_13pt_regular --877351859=temple -2142215577=the mollusc menace -1124498189=warpath --2136649922=no way out --339706871=grimly_fiendish -547534551=wrath and ruin -544229147=lore and order -3327206=load -1610073470=lovakengj_sigil --419218284=long way home --662489856=food for thought -1306461568=stagnant --1662171955=elfdoor --1043985601=meddling kids -947464074=titlebutton --1309055712=exposed --1487348923=ambient jungle --1829469821=lament of meiyerditch -233203434=leftarrow_small --1216167350=dangerous -114464611=railings --1106574323=legend --1701556767=magicoff2,49 --999707515=time to mine --1701556768=magicoff2,48 -2129339097=magicon,9 -2129339096=magicon,8 -1959211510=mapfunction,42 -2129339095=magicon,7 -1959211511=mapfunction,43 -2129339094=magicon,6 -2129339093=magicon,5 -2129339092=magicon,4 -2129339091=magicon,3 -2129339090=magicon,2 -3522472=saga --1701556769=magicoff2,47 --544722449=rellekka -1033441676=tribal background -1915718129=the desolate isle -1890607150=magicon2,19 -1787618597=stranded -1717999087=forgettable melody -1959211512=mapfunction,44 --243680400=peng_emotes,0 -1959211513=mapfunction,45 -1959211514=mapfunction,46 -1959211515=mapfunction,47 -1959211516=mapfunction,48 -1959211517=mapfunction,49 -1705947058=the cellar dwellers -1216634785=landlubber -1884768198=magicoff,40 --1588113323=the rogues den -1884768199=magicoff,41 --905842564=serene --607599698=prayeroff,2 --607599699=prayeroff,1 -1890607142=magicon2,11 -1389384362=monkey trouble -1890607143=magicon2,12 -1890607144=magicon2,13 -1890607145=magicon2,14 -1890607146=magicon2,15 -1890607147=magicon2,16 -1890607148=magicon2,17 -1966766798=mausoleum -1890607149=magicon2,18 -1808345541=armadyl alliance -290391725=options_slider,7 -1890607141=magicon2,10 -290391722=options_slider,4 --607599696=prayeroff,4 -290391721=options_slider,3 --607599697=prayeroff,3 -290391724=options_slider,6 --607599694=prayeroff,6 -290391723=options_slider,5 --607599695=prayeroff,5 --607599692=prayeroff,8 --607599693=prayeroff,7 -290391720=options_slider,2 --607599691=prayeroff,9 -1334775925=chat_background --1779127378=arabian2 --1779127377=arabian3 -528722471=island life -1890607175=magicon2,23 -1890607176=magicon2,24 -949634504=mouse trap -1890607177=magicon2,25 -1890607178=magicon2,26 -1890607179=magicon2,27 -3327403=logo -290391719=options_slider,1 -1092249049=storm brew -290391718=options_slider,0 -404357804=everywhere -1890607172=magicon2,20 -1890607173=magicon2,21 -951530772=contest -1890607174=magicon2,22 --1701556776=magicoff2,40 -1884768176=magicoff,39 --395250469=corporal punishment -1749113330=newbie melody -1884768174=magicoff,37 -1884768175=magicoff,38 --1701556772=magicoff2,44 --1701556773=magicoff2,43 --1701556774=magicoff2,42 --1701556775=magicoff2,41 --858121616=tzhaar -1884768172=magicoff,35 -1884768173=magicoff,36 -666772244=combat_shield -1884768170=magicoff,33 -1884768171=magicoff,34 -1959211509=mapfunction,41 -1639695510=mapmarker --1661748240=friends_icons --552301350=knightly --1918044851=mastermindless --1701556770=magicoff2,46 --1701556771=magicoff2,45 -201526300=corporealbeast -1959211508=mapfunction,40 -105001967=nomad --70910145=clickcross,3 --1737914947=mapfunction,5 -1801745440=staticons2,11 --70910146=clickcross,2 --865479038=tribal --1737914946=mapfunction,6 -1801745441=staticons2,12 --70910147=clickcross,1 --1737914945=mapfunction,7 -1801745442=staticons2,13 --70910148=clickcross,0 --1737914944=mapfunction,8 -1801745443=staticons2,14 --1737914943=mapfunction,9 -1801745444=staticons2,15 -1801745445=staticons2,16 -1801745446=staticons2,17 --1877545169=land down under -93921962=books --1737914949=mapfunction,3 --1737914948=mapfunction,4 --1655721428=prayeroff,19 --2136884405=title.jpg --1655721429=prayeroff,18 -1584819628=magicoff,6 -1584819629=magicoff,7 -437480876=voodoo cult -1584819624=magicoff,2 -1584819625=magicoff,3 -1584819626=magicoff,4 --1737914952=mapfunction,0 -1584819627=magicoff,5 --1737914951=mapfunction,1 -124995564=harmony2 -1584819622=magicoff,0 -1801745439=staticons2,10 -1584819623=magicoff,1 -346263512=dorgeshun city --1665011705=down and out -1890607180=magicon2,28 -1890607181=magicon2,29 -1417471781=titlescroll -1959211446=mapfunction,20 -1956141536=options_radio_buttons,0 -736568812=ballad of enchantment --1737914950=mapfunction,2 -1959211447=mapfunction,21 -1959211448=mapfunction,22 -1959211449=mapfunction,23 --1890130256=morytania --70910141=clickcross,7 --70910142=clickcross,6 -1956141539=options_radio_buttons,3 --70910143=clickcross,5 -1956141538=options_radio_buttons,2 -284766976=splendour --70910144=clickcross,4 -1956141537=options_radio_buttons,1 -196677638=the quizmaster -530068296=overture --1123094568=sl_button --700552779=hosidius_sigil --614076819=sad meadow -1956141543=options_radio_buttons,7 -1956141542=options_radio_buttons,6 -1956141541=options_radio_buttons,5 -1956141540=options_radio_buttons,4 -1584819631=magicoff,9 -1846633612=gnome village --2128560371=sl_back -1969878905=emotes,19 -306819362=crystal castle -1584819630=magicoff,8 -1969878903=emotes,17 -303737220=options_icons,7 -1969878904=emotes,18 -1969878901=emotes,15 --78220817=devils_may_care -1969878902=emotes,16 --40521666=dimension x -1969878900=emotes,14 -673424924=the lunar isle -789609582=brimstail's scales -303737222=options_icons,9 -303737221=options_icons,8 -1959211415=mapfunction,10 -3059343=coil -1959211416=mapfunction,11 -1959211417=mapfunction,12 --1256560486=last_man_standing -1959211418=mapfunction,13 -336238005=rightarrow_small -1959211419=mapfunction,14 --677662361=forever --1655721430=prayeroff,17 --1655721431=prayeroff,16 --1655721432=prayeroff,15 -1959211420=mapfunction,15 -1959211663=mapfunction,90 -1959211421=mapfunction,16 -1959211422=mapfunction,17 -1959211423=mapfunction,18 -303737217=options_icons,4 -303737216=options_icons,3 -303737215=options_icons,2 --1665005042=funny bunnies -303737214=options_icons,1 -303737219=options_icons,6 -303737218=options_icons,5 -303737213=options_icons,0 -95997798=we are the fairies -2001751835=desert heat -1959211424=mapfunction,19 --1655721437=prayeroff,10 -687938017=clanwars --1776024210=desolate_mage --650944128=strength of saradomin --1655721433=prayeroff,14 -1160873524=aye car rum ba --1655721434=prayeroff,13 --1655721435=prayeroff,12 --1081314499=marble --1655721436=prayeroff,11 -1097075475=reset,0 -1959211477=mapfunction,30 --693313916=warriors guild -3506388=roof -1959211478=mapfunction,31 -1097075476=reset,1 --2134967800=dagannoth dawn --985763247=planks -1959211479=mapfunction,32 -1999746381=fenkenstrain's refrain -898010371=garden of winter -359174830=rat hunt -1959211482=mapfunction,35 -686441581=lightness -1959211483=mapfunction,36 -1959211484=mapfunction,37 -1959211485=mapfunction,38 -1959211486=mapfunction,39 -2023201035=dwarf theme -1959211480=mapfunction,33 -1959211481=mapfunction,34 --1065532022=combatboxes,1 --1065532021=combatboxes,2 --1065532020=combatboxes,3 -1867160429=old_tiles -394756979=scape santa -25205919=elfroof2 --663428071=dangerous way --1065532023=combatboxes,0 -1959211450=mapfunction,24 --895939599=spirit -1959211451=mapfunction,25 -1959211452=mapfunction,26 -1959211453=mapfunction,27 -1959211454=mapfunction,28 -1959211455=mapfunction,29 --275310687=undercurrent -212205923=goblin village --303898981=faithless --1381531001=tomb raider -260940912=marzipan -1343267530=backhmid1 -1343267531=backhmid2 -1097468315=horizon --1655721404=prayeroff,22 -623451622=kourend_the_magnificent --1655721405=prayeroff,21 --1655721406=prayeroff,20 --1655721400=prayeroff,26 --313384067=p12_full --1655721401=prayeroff,25 --1655721402=prayeroff,24 --1655721403=prayeroff,23 -95848451=dream -1966781751=maws_jaws_claws --995428255=parade -95734525=method of madness --1308064877=hitmarks -1030045177=mutant medley -1333034828=blackmark -851641665=davy jones locker -417793574=scrollbar -1346720900=backleft2 -1884768206=magicoff,48 -1884768207=magicoff,49 -1801140808=fangs for the memory -1884768204=magicoff,46 -1345432055=pinball wizard -1884768205=magicoff,47 --783693496=dance of the undead -1274780903=chompy hunt -465278529=the lost tribe --1666437481=combaticons3,6 -2032696205=cabin fever --1666437480=combaticons3,7 -1825640471=borderland -415928477=zeah_mining -1884768202=magicoff,44 --607599700=prayeroff,0 -1884768203=magicoff,45 -1884768200=magicoff,42 -1884768201=magicoff,43 --1666437487=combaticons3,0 --1666437486=combaticons3,1 -813726263=crystal cave -1235442953=pathways -518814479=lullaby --1666437483=combaticons3,4 -1585007985=magicon2,7 --1666437482=combaticons3,5 -1585007986=magicon2,8 --1666437485=combaticons3,2 -1585007987=magicon2,9 --1666437484=combaticons3,3 -104080482=moody -1969878967=emotes,39 --665666447=work work work -1364992651=evil bobs island -1969878965=emotes,37 -1227328817=verdana_15pt_regular -1969878966=emotes,38 -1969878963=emotes,35 -1581724013=monkey business -1969878964=emotes,36 --74307138=miscellania -1969878961=emotes,33 -1969878962=emotes,34 -1969878960=emotes,32 -1131171307=wayward --1154558416=sl_arrows -529929957=overpass -1258058669=huffman --694094064=adventure -1171698653=orb_xp,1 -1171698652=orb_xp,0 -1171698655=orb_xp,3 -1171698654=orb_xp,2 -1802171733=arceuus_sigil -221109227=tears of guthix --1661754893=elfroof --1666437478=combaticons3,9 -1124565314=warrior -1969878958=emotes,30 -1969878959=emotes,31 --934797897=reggae -2110260221=the genie --1666437479=combaticons3,8 -104257585=mummy --1923924724=sworddecor,0 -2136325196=staticons,17 --1332194002=background -2136164423=homescape --1923924721=sworddecor,3 -2136325194=staticons,15 --1923924722=sworddecor,2 --873564465=tiptoe -2136325195=staticons,16 --1923924723=sworddecor,1 -123560953=espionage -2136325192=staticons,13 -2136325193=staticons,14 -1038911415=gnome king -2136325190=staticons,11 -2136325191=staticons,12 -1854274741=karamja jam -1969878989=emotes,40 --1242708793=glyphs -563269755=the terrible tower -1650323088=twilight --12868552=sea shanty -289742397=book of spells -1880989696=dragontooth island -2136325189=staticons,10 -110873=pen --454421102=out of the deep -825919099=options_icons,19 -825919097=options_icons,17 -825919098=options_icons,18 --1349119470=cursed -1585007978=magicon2,0 -825919095=options_icons,15 -1585007979=magicon2,1 -825919096=options_icons,16 -825919093=options_icons,13 -825919094=options_icons,14 -825919091=options_icons,11 -825919092=options_icons,12 --895977880=sphinx --874529881=city of the dead -825919090=options_icons,10 -1585007981=magicon2,3 -1585007982=magicon2,4 -1585007983=magicon2,5 --1618729246=body parts -1585007984=magicon2,6 -1585007980=magicon2,2 -1086075866=shayzien_sigil -2103661451=jester minute --911346307=steelborder,2 --1809781334=button_brown_big --911346306=steelborder,3 --816227352=vision --911346309=steelborder,0 -109407595=shine --911346308=steelborder,1 --119954464=combaticons3,12 --119954465=combaticons3,11 --1846853118=armageddon --119954462=combaticons3,14 --119954463=combaticons3,13 --119954460=combaticons3,16 --908183966=scarab --119954461=combaticons3,15 --282886672=home sweet home -103666243=march -1969878929=emotes,22 -1643875326=fire and brimstone -1969878927=emotes,20 --119954466=combaticons3,10 -1969878928=emotes,21 --839455633=close quarters -941457503=way of the enchanter --1453405761=mor-ul-rek --415134015=have a blast --1658514874=floating free -1213477442=chickened out --1619800349=emotes_locked,27 --599680631=fear and loathing --1081041422=insect queen --1268786147=forest --119954459=combaticons3,17 --119954457=combaticons3,19 --119954458=combaticons3,18 --850395529=trouble brewing --1773920521=cave of the goblins --771284962=claustrophobia -1310729739=bankbuttons,2 -1306691868=upcoming -1465443077=over to nardah -1310729744=bankbuttons,7 -1310729743=bankbuttons,6 -1310729742=bankbuttons,5 -1234827707=deep wildy --90350772=xenophobe --750127868=arabian -1310729741=bankbuttons,4 -1310729740=bankbuttons,3 -1041911129=waterlogged -108875897=runes -1447063382=barb wire --378865792=magic dance -285466503=overlay_duel -1814287296=zeah_magic -1976894499=down to earth -1969878936=emotes,29 -1969878934=emotes,27 --1567437308=deadlands -1969878935=emotes,28 -1310729738=bankbuttons,1 -1969878932=emotes,25 --957019274=too many cooks -1310729737=bankbuttons,0 -2092627105=silence -1969878933=emotes,26 -1969878930=emotes,23 -1969878931=emotes,24 --901674570=well of voyage diff --git a/cache/src/test/java/net/runelite/cache/AreaDumper.java b/cache/src/test/java/net/runelite/cache/AreaDumper.java deleted file mode 100644 index b789d78a0d..0000000000 --- a/cache/src/test/java/net/runelite/cache/AreaDumper.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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 com.google.common.io.Files; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import java.io.File; -import java.io.IOException; -import java.nio.charset.Charset; -import net.runelite.cache.definitions.AreaDefinition; -import net.runelite.cache.fs.Store; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class AreaDumper -{ - private static final Logger logger = LoggerFactory.getLogger(AreaDumper.class); - - @Rule - public TemporaryFolder folder = StoreLocation.getTemporaryFolder(); - - private final Gson gson = new GsonBuilder().setPrettyPrinting().create(); - - @Test - public void extract() throws IOException - { - File base = StoreLocation.LOCATION, - outDir = folder.newFolder(); - - int count = 0; - - try (Store store = new Store(base)) - { - store.load(); - - AreaManager areaManager = new AreaManager(store); - areaManager.load(); - - for (AreaDefinition area : areaManager.getAreas()) - { - Files.write(gson.toJson(area), new File(outDir, area.id + ".json"), Charset.defaultCharset()); - ++count; - } - } - - logger.info("Dumped {} areas to {}", count, outDir); - } -} diff --git a/cache/src/test/java/net/runelite/cache/CacheProperties.java b/cache/src/test/java/net/runelite/cache/CacheProperties.java deleted file mode 100644 index 50da8759dc..0000000000 --- a/cache/src/test/java/net/runelite/cache/CacheProperties.java +++ /dev/null @@ -1,50 +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.cache; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Properties; - -public class CacheProperties -{ - private static Properties getProperies() throws IOException - { - Properties properties = new Properties(); - InputStream resourceAsStream = StoreLocation.class.getResourceAsStream("/cache.properties"); - properties.load(resourceAsStream); - return properties; - } - - public static int getRsVersion() throws IOException - { - return Integer.parseInt(getProperies().getProperty("rs.version")); - } - - public static int getCacheVersion() throws IOException - { - return Integer.parseInt(getProperies().getProperty("cache.version")); - } -} diff --git a/cache/src/test/java/net/runelite/cache/EnumDumperTest.java b/cache/src/test/java/net/runelite/cache/EnumDumperTest.java deleted file mode 100644 index a094b9fc24..0000000000 --- a/cache/src/test/java/net/runelite/cache/EnumDumperTest.java +++ /dev/null @@ -1,91 +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.cache; - -import com.google.common.io.Files; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import java.io.File; -import java.io.IOException; -import java.nio.charset.Charset; -import net.runelite.cache.definitions.EnumDefinition; -import net.runelite.cache.definitions.loaders.EnumLoader; -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 org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class EnumDumperTest -{ - private static final Logger logger = LoggerFactory.getLogger(EnumDumperTest.class); - - private final Gson gson = new GsonBuilder().setPrettyPrinting().create(); - - @Rule - public TemporaryFolder folder = StoreLocation.getTemporaryFolder(); - - @Test - public void test() throws IOException - { - File dumpDir = folder.newFolder(); - int count = 0; - - try (Store store = new Store(StoreLocation.LOCATION)) - { - store.load(); - - Storage storage = store.getStorage(); - Index index = store.getIndex(IndexType.CONFIGS); - Archive archive = index.getArchive(ConfigType.ENUM.getId()); - - byte[] archiveData = storage.loadArchive(archive); - ArchiveFiles files = archive.getFiles(archiveData); - - EnumLoader loader = new EnumLoader(); - - for (FSFile file : files.getFiles()) - { - byte[] b = file.getContents(); - - EnumDefinition def = loader.load(file.getFileId(), b); - - if (def != null) - { - Files.write(gson.toJson(def), new File(dumpDir, file.getFileId() + ".json"), Charset.defaultCharset()); - ++count; - } - } - } - - logger.info("Dumped {} enums to {}", count, dumpDir); - } -} diff --git a/cache/src/test/java/net/runelite/cache/FrameDumper.java b/cache/src/test/java/net/runelite/cache/FrameDumper.java deleted file mode 100644 index 2bd7e2ca17..0000000000 --- a/cache/src/test/java/net/runelite/cache/FrameDumper.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * 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 com.google.common.io.Files; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import java.io.File; -import java.io.IOException; -import java.nio.charset.Charset; -import java.util.ArrayList; -import java.util.List; -import net.runelite.cache.definitions.FrameDefinition; -import net.runelite.cache.definitions.FramemapDefinition; -import net.runelite.cache.definitions.loaders.FrameLoader; -import net.runelite.cache.definitions.loaders.FramemapLoader; -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 org.junit.Ignore; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class FrameDumper -{ - private static final Logger logger = LoggerFactory.getLogger(FrameDumper.class); - - @Rule - public TemporaryFolder folder = StoreLocation.getTemporaryFolder(); - - private final Gson gson = new GsonBuilder().setPrettyPrinting().create(); - - @Test - @Ignore - public void extract() throws IOException - { - File base = StoreLocation.LOCATION, - outDir = folder.newFolder(); - - int count = 0; - - try (Store store = new Store(base)) - { - store.load(); - - Storage storage = store.getStorage(); - Index frameIndex = store.getIndex(IndexType.FRAMES); - Index framemapIndex = store.getIndex(IndexType.FRAMEMAPS); - - for (Archive archive : frameIndex.getArchives()) - { - List frames = new ArrayList<>(); - - byte[] archiveData = storage.loadArchive(archive); - - ArchiveFiles archiveFiles = archive.getFiles(archiveData); - for (FSFile archiveFile : archiveFiles.getFiles()) - { - byte[] contents = archiveFile.getContents(); - - int framemapArchiveId = (contents[0] & 0xff) << 8 | contents[1] & 0xff; - - Archive framemapArchive = framemapIndex.getArchives().get(framemapArchiveId); - archiveData = storage.loadArchive(framemapArchive); - byte[] framemapContents = framemapArchive.decompress(archiveData); - - FramemapLoader fmloader = new FramemapLoader(); - FramemapDefinition framemap = fmloader.load(framemapArchive.getArchiveId(), framemapContents); - - FrameLoader frameLoader = new FrameLoader(); - FrameDefinition frame = frameLoader.load(framemap, archiveFile.getFileId(), contents); - - frames.add(frame); - } - - Files.write(gson.toJson(frames), new File(outDir, archive.getArchiveId() + ".json"), Charset.defaultCharset()); - ++count; - } - } - - logger.info("Dumped {} frames to {}", count, outDir); - } -} diff --git a/cache/src/test/java/net/runelite/cache/FramemapDumper.java b/cache/src/test/java/net/runelite/cache/FramemapDumper.java deleted file mode 100644 index 4513bf3dfb..0000000000 --- a/cache/src/test/java/net/runelite/cache/FramemapDumper.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * 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 com.google.common.io.Files; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import java.io.File; -import java.io.IOException; -import java.nio.charset.Charset; -import net.runelite.cache.definitions.FramemapDefinition; -import net.runelite.cache.definitions.loaders.FramemapLoader; -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 org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class FramemapDumper -{ - private static final Logger logger = LoggerFactory.getLogger(FramemapDumper.class); - - @Rule - public TemporaryFolder folder = StoreLocation.getTemporaryFolder(); - - private final Gson gson = new GsonBuilder().setPrettyPrinting().create(); - - @Test - public void extract() throws IOException - { - File base = StoreLocation.LOCATION, - outDir = folder.newFolder(); - - int count = 0; - - try (Store store = new Store(base)) - { - store.load(); - - Storage storage = store.getStorage(); - Index index = store.getIndex(IndexType.FRAMEMAPS); - - for (Archive archive : index.getArchives()) - { - byte[] archiveData = storage.loadArchive(archive); - byte[] contents = archive.decompress(archiveData); - - FramemapLoader loader = new FramemapLoader(); - FramemapDefinition framemap = loader.load(0, contents); - - Files.write(gson.toJson(framemap), new File(outDir, archive.getArchiveId() + ".json"), Charset.defaultCharset()); - ++count; - } - } - - logger.info("Dumped {} framemaps to {}", count, outDir); - } -} diff --git a/cache/src/test/java/net/runelite/cache/HeightMapDumperTest.java b/cache/src/test/java/net/runelite/cache/HeightMapDumperTest.java deleted file mode 100644 index 92327f50d7..0000000000 --- a/cache/src/test/java/net/runelite/cache/HeightMapDumperTest.java +++ /dev/null @@ -1,65 +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.cache; - -import java.awt.image.BufferedImage; -import java.io.File; -import java.io.IOException; -import javax.imageio.ImageIO; -import net.runelite.cache.fs.Store; -import org.junit.Rule; -import org.junit.rules.TemporaryFolder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class HeightMapDumperTest -{ - private static final Logger logger = LoggerFactory.getLogger(HeightMapDumperTest.class); - - @Rule - public TemporaryFolder folder = StoreLocation.getTemporaryFolder(); - - //@Test - public void extract() throws IOException - { - File base = StoreLocation.LOCATION, - outDir = folder.newFolder(); - - try (Store store = new Store(base)) - { - store.load(); - - HeightMapDumper dumper = new HeightMapDumper(store); - dumper.load(); - - BufferedImage image = dumper.drawHeightMap(0); - - File imageFile = new File(outDir, "heightmap-0.png"); - - ImageIO.write(image, "png", imageFile); - logger.info("Wrote image {}", imageFile); - } - } -} diff --git a/cache/src/test/java/net/runelite/cache/InterfaceManagerTest.java b/cache/src/test/java/net/runelite/cache/InterfaceManagerTest.java deleted file mode 100644 index 060aae5d57..0000000000 --- a/cache/src/test/java/net/runelite/cache/InterfaceManagerTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class InterfaceManagerTest -{ - private static final Logger logger = LoggerFactory.getLogger(InterfaceManagerTest.class); - - @Rule - public TemporaryFolder folder = StoreLocation.getTemporaryFolder(); - - @Test - public void test() throws IOException - { - File dumpDir = folder.newFolder(), - javaDir = folder.newFolder(); - - Store store = new Store(StoreLocation.LOCATION); - store.load(); - - InterfaceManager dumper = new InterfaceManager( - store - ); - dumper.load(); - dumper.export(dumpDir); - dumper.java(javaDir); - - logger.info("Dumped to {}, java {}", dumpDir, javaDir); - } - -} diff --git a/cache/src/test/java/net/runelite/cache/InventoryDumper.java b/cache/src/test/java/net/runelite/cache/InventoryDumper.java deleted file mode 100644 index 4caf464141..0000000000 --- a/cache/src/test/java/net/runelite/cache/InventoryDumper.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * 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 com.google.common.io.Files; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import java.io.File; -import java.io.IOException; -import java.nio.charset.Charset; -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; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class InventoryDumper -{ - private static final Logger logger = LoggerFactory.getLogger(InventoryDumper.class); - - @Rule - public TemporaryFolder folder = StoreLocation.getTemporaryFolder(); - - private final Gson gson = new GsonBuilder().setPrettyPrinting().create(); - - @Test - public void extract() throws IOException - { - File base = StoreLocation.LOCATION, - outDir = folder.newFolder(); - - int count = 0; - - try (Store store = new Store(base)) - { - store.load(); - - Storage storage = store.getStorage(); - Index index = store.getIndex(IndexType.CONFIGS); - Archive archive = index.getArchive(ConfigType.INV.getId()); - - byte[] archiveData = storage.loadArchive(archive); - ArchiveFiles files = archive.getFiles(archiveData); - - for (FSFile file : files.getFiles()) - { - InventoryLoader loader = new InventoryLoader(); - InventoryDefinition inv = loader.load(file.getFileId(), file.getContents()); - - Files.write(gson.toJson(inv), new File(outDir, inv.id + ".json"), Charset.defaultCharset()); - ++count; - } - } - - logger.info("Dumped {} inventories to {}", count, outDir); - } -} diff --git a/cache/src/test/java/net/runelite/cache/ItemManagerTest.java b/cache/src/test/java/net/runelite/cache/ItemManagerTest.java deleted file mode 100644 index e3ac0b3324..0000000000 --- a/cache/src/test/java/net/runelite/cache/ItemManagerTest.java +++ /dev/null @@ -1,63 +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.cache; - -import java.io.File; -import java.io.IOException; -import net.runelite.cache.fs.Store; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class ItemManagerTest -{ - private static final Logger logger = LoggerFactory.getLogger(ItemManagerTest.class); - - @Rule - public TemporaryFolder folder = StoreLocation.getTemporaryFolder(); - - @Test - public void test() throws IOException - { - File dumpDir = folder.newFolder(), - javaDir = folder.newFolder(); - - Store store = new Store(StoreLocation.LOCATION); - store.load(); - - ItemManager dumper = new ItemManager( - store - ); - dumper.load(); - dumper.export(dumpDir); - dumper.java(javaDir); - - logger.info("Dumped to {}, java {}", dumpDir, javaDir); - } - -} diff --git a/cache/src/test/java/net/runelite/cache/KitDumperTest.java b/cache/src/test/java/net/runelite/cache/KitDumperTest.java deleted file mode 100644 index 286ca6ea8e..0000000000 --- a/cache/src/test/java/net/runelite/cache/KitDumperTest.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * 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 com.google.common.io.Files; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import java.io.File; -import java.io.IOException; -import java.nio.charset.Charset; -import net.runelite.cache.definitions.KitDefinition; -import net.runelite.cache.definitions.loaders.KitLoader; -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 org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class KitDumperTest -{ - private static final Logger logger = LoggerFactory.getLogger(KitDumperTest.class); - - private Gson gson = new GsonBuilder().setPrettyPrinting().create(); - - @Rule - public TemporaryFolder folder = StoreLocation.getTemporaryFolder(); - - @Test - public void test() throws IOException - { - File dumpDir = folder.newFolder(); - int count = 0; - - try (Store store = new Store(StoreLocation.LOCATION)) - { - store.load(); - - Storage storage = store.getStorage(); - Index index = store.getIndex(IndexType.CONFIGS); - Archive archive = index.getArchive(ConfigType.IDENTKIT.getId()); - - KitLoader loader = new KitLoader(); - - byte[] archiveData = storage.loadArchive(archive); - ArchiveFiles files = archive.getFiles(archiveData); - - for (FSFile file : files.getFiles()) - { - byte[] b = file.getContents(); - - KitDefinition def = loader.load(file.getFileId(), b); - - Files.write(gson.toJson(def), new File(dumpDir, file.getFileId() + ".json"), Charset.defaultCharset()); - ++count; - } - } - - logger.info("Dumped {} kits to {}", count, dumpDir); - } -} diff --git a/cache/src/test/java/net/runelite/cache/MapDumperTest.java b/cache/src/test/java/net/runelite/cache/MapDumperTest.java deleted file mode 100644 index 70d20dcb0f..0000000000 --- a/cache/src/test/java/net/runelite/cache/MapDumperTest.java +++ /dev/null @@ -1,196 +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.cache; - -import com.google.common.io.Files; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import java.io.File; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import java.util.Map.Entry; -import net.runelite.cache.definitions.LocationsDefinition; -import net.runelite.cache.definitions.MapDefinition; -import net.runelite.cache.definitions.loaders.LocationsLoader; -import net.runelite.cache.definitions.loaders.MapLoader; -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.util.XteaKeyManager; -import org.junit.Ignore; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class MapDumperTest -{ - private static final Logger logger = LoggerFactory.getLogger(MapDumperTest.class); - - private static final int MAX_REGIONS = 32768; - private final Gson gson = new GsonBuilder().setPrettyPrinting().create(); - - @Rule - public TemporaryFolder folder = StoreLocation.getTemporaryFolder(); - - @Test - @Ignore - public void dumpRaw() throws IOException - { - File base = StoreLocation.LOCATION, - outDir = folder.newFolder(); - XteaKeyManager keyManager = new XteaKeyManager(); - keyManager.loadKeys(); - - try (Store store = new Store(base)) - { - store.load(); - - Storage storage = store.getStorage(); - Index index = store.getIndex(IndexType.MAPS); - - for (int i = 0; i < MAX_REGIONS; i++) - { - int[] keys = keyManager.getKeys(i); - - int x = i >> 8; - int y = i & 0xFF; - - Archive map = index.findArchiveByName("m" + x + "_" + y); - Archive land = index.findArchiveByName("l" + x + "_" + y); - - assert (map == null) == (land == null); - - if (map == null || land == null) - { - continue; - } - - byte[] data = map.decompress(storage.loadArchive(map)); - - Files.write(data, new File(outDir, "m" + x + "_" + y + ".dat")); - - if (keys != null) - { - try - { - data = land.decompress(storage.loadArchive(land), keys); - } - catch (IOException ex) - { - logger.info("Unable to decompress and load land " + x + "," + y + " (bad keys?)", ex); - continue; - } - - logger.info("Decrypted region {} coords {},{}", i, x, y); - - Files.write(data, new File(outDir, "l" + x + "_" + y + ".dat")); - } - } - } - } - - private Map loadRegions(Store store) throws IOException - { - Map mapMap = new HashMap<>(); - Storage storage = store.getStorage(); - Index index = store.getIndex(IndexType.MAPS); - XteaKeyManager keyManager = new XteaKeyManager(); - keyManager.loadKeys(); - - for (int i = 0; i < MAX_REGIONS; ++i) - { - int x = i >> 8; - int y = i & 0xFF; - - Archive map = index.findArchiveByName("m" + x + "_" + y); - Archive land = index.findArchiveByName("l" + x + "_" + y); - - assert (map == null) == (land == null); - - if (map == null || land == null) - { - continue; - } - - byte[] data = map.decompress(storage.loadArchive(map)); - MapDefinition mapDef = new MapLoader().load(x, y, data); - LocationsDefinition locDef = null; - - int[] keys = keyManager.getKeys(i); - if (keys != null) - { - try - { - data = land.decompress(storage.loadArchive(land), keys); - } - catch (IOException ex) - { - continue; - } - - locDef = new LocationsLoader().load(x, y, data); - } - - mapMap.put(mapDef, locDef); - } - - return mapMap; - } - - @Test - @Ignore - public void dunpJson() throws IOException - { - File base = StoreLocation.LOCATION, - outDir = folder.newFolder(); - - try (Store store = new Store(base)) - { - store.load(); - - Map regions = loadRegions(store); - - for (Entry entry : regions.entrySet()) - { - MapDefinition key = entry.getKey(); - LocationsDefinition value = entry.getValue(); - - int x = key.getRegionX(); - int y = key.getRegionY(); - Files.write(gson.toJson(key).getBytes(), new File(outDir, "m" + x + "_" + y + ".json")); - if (value != null) - { - Files.write(gson.toJson(value).getBytes(), new File(outDir, "l" + x + "_" + y + ".json")); - } - } - } - - logger.info("Dumped regions to {}", outDir); - } -} diff --git a/cache/src/test/java/net/runelite/cache/MapImageDumperTest.java b/cache/src/test/java/net/runelite/cache/MapImageDumperTest.java deleted file mode 100644 index 7491e54b58..0000000000 --- a/cache/src/test/java/net/runelite/cache/MapImageDumperTest.java +++ /dev/null @@ -1,100 +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.cache; - -import java.awt.image.BufferedImage; -import java.io.File; -import java.io.IOException; -import javax.imageio.ImageIO; -import net.runelite.cache.fs.Store; -import net.runelite.cache.region.Region; -import net.runelite.cache.region.RegionLoader; -import org.junit.Ignore; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class MapImageDumperTest -{ - private static final Logger logger = LoggerFactory.getLogger(MapImageDumperTest.class); - - @Rule - public TemporaryFolder folder = StoreLocation.getTemporaryFolder(); - - @Test - @Ignore - public void dumpMap() throws IOException - { - File base = StoreLocation.LOCATION, - outDir = folder.newFolder(); - - try (Store store = new Store(base)) - { - store.load(); - - MapImageDumper dumper = new MapImageDumper(store); - dumper.load(); - - for (int i = 0; i < Region.Z; ++i) - { - BufferedImage image = dumper.drawMap(i); - - File imageFile = new File(outDir, "img-" + i + ".png"); - - ImageIO.write(image, "png", imageFile); - logger.info("Wrote image {}", imageFile); - } - } - } - - @Test - @Ignore - public void dumpRegions() throws Exception - { - File base = StoreLocation.LOCATION, - outDir = folder.newFolder(); - - try (Store store = new Store(base)) - { - store.load(); - - RegionLoader regionLoader = new RegionLoader(store); - regionLoader.loadRegions(); - - MapImageDumper dumper = new MapImageDumper(store); - dumper.load(); - - int z = 0; - for (Region region : regionLoader.getRegions()) - { - File imageFile = new File(outDir, "img-" + z + "-" + region.getRegionID() + ".png"); - BufferedImage image = dumper.drawRegion(region, z); - ImageIO.write(image, "png", imageFile); - } - } - } -} diff --git a/cache/src/test/java/net/runelite/cache/ModelDumperTest.java b/cache/src/test/java/net/runelite/cache/ModelDumperTest.java deleted file mode 100644 index 32f5879ac1..0000000000 --- a/cache/src/test/java/net/runelite/cache/ModelDumperTest.java +++ /dev/null @@ -1,77 +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.cache; - - -import com.google.common.io.Files; -import java.io.File; -import java.io.IOException; -import net.runelite.cache.definitions.loaders.ModelLoader; -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 org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class ModelDumperTest -{ - private static final Logger logger = LoggerFactory.getLogger(ModelDumperTest.class); - - @Rule - public TemporaryFolder folder = StoreLocation.getTemporaryFolder(); - - @Test - public void test() throws IOException - { - File modelDir = folder.newFolder("models"); - int count = 0; - - try (Store store = new Store(StoreLocation.LOCATION)) - { - store.load(); - - Storage storage = store.getStorage(); - Index index = store.getIndex(IndexType.MODELS); - - for (Archive archive : index.getArchives()) - { - byte[] contents = archive.decompress(storage.loadArchive(archive)); - - ModelLoader loader = new ModelLoader(); - loader.load(archive.getArchiveId(), contents); - - Files.write(contents, new File(modelDir, archive.getArchiveId() + ".model")); - ++count; - } - } - - logger.info("Dumped {} models to {}", count, modelDir); - } -} diff --git a/cache/src/test/java/net/runelite/cache/NpcManagerTest.java b/cache/src/test/java/net/runelite/cache/NpcManagerTest.java deleted file mode 100644 index cdccac0cfb..0000000000 --- a/cache/src/test/java/net/runelite/cache/NpcManagerTest.java +++ /dev/null @@ -1,64 +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.cache; - -import java.io.File; -import java.io.IOException; -import net.runelite.cache.fs.Store; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class NpcManagerTest -{ - private static final Logger logger = LoggerFactory.getLogger(NpcManagerTest.class); - - @Rule - public TemporaryFolder folder = StoreLocation.getTemporaryFolder(); - - @Test - public void test() throws IOException - { - File dumpDir = folder.newFolder(), - javaDir = folder.newFolder(); - - try (Store store = new Store(StoreLocation.LOCATION)) - { - store.load(); - - NpcManager dumper = new NpcManager( - store - ); - dumper.load(); - dumper.dump(dumpDir); - dumper.java(javaDir); - } - - logger.info("Dumped to {}, java {}", dumpDir, javaDir); - } - -} diff --git a/cache/src/test/java/net/runelite/cache/ObjectManagerTest.java b/cache/src/test/java/net/runelite/cache/ObjectManagerTest.java deleted file mode 100644 index f50196734e..0000000000 --- a/cache/src/test/java/net/runelite/cache/ObjectManagerTest.java +++ /dev/null @@ -1,64 +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.cache; - -import java.io.File; -import java.io.IOException; -import net.runelite.cache.fs.Store; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class ObjectManagerTest -{ - private static final Logger logger = LoggerFactory.getLogger(ObjectManagerTest.class); - - @Rule - public TemporaryFolder folder = StoreLocation.getTemporaryFolder(); - - @Test - public void test() throws IOException - { - File dumpDir = folder.newFolder(), - javaDir = folder.newFolder(); - - try (Store store = new Store(StoreLocation.LOCATION)) - { - store.load(); - - ObjectManager dumper = new ObjectManager( - store - ); - dumper.load(); - dumper.dump(dumpDir); - dumper.java(javaDir); - } - - logger.info("Dumped to {}, java {}", dumpDir, javaDir); - } - -} diff --git a/cache/src/test/java/net/runelite/cache/OverlayDumper.java b/cache/src/test/java/net/runelite/cache/OverlayDumper.java deleted file mode 100644 index 4ac4b53a7c..0000000000 --- a/cache/src/test/java/net/runelite/cache/OverlayDumper.java +++ /dev/null @@ -1,87 +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.cache; - -import com.google.common.io.Files; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import java.io.File; -import java.io.IOException; -import java.nio.charset.Charset; -import net.runelite.cache.definitions.OverlayDefinition; -import net.runelite.cache.definitions.loaders.OverlayLoader; -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 org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class OverlayDumper -{ - private static final Logger logger = LoggerFactory.getLogger(OverlayDumper.class); - - @Rule - public TemporaryFolder folder = StoreLocation.getTemporaryFolder(); - - private final Gson gson = new GsonBuilder().setPrettyPrinting().create(); - - @Test - public void extract() throws IOException - { - File base = StoreLocation.LOCATION, - outDir = folder.newFolder(); - - int count = 0; - - try (Store store = new Store(base)) - { - store.load(); - - 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()); - - Files.write(gson.toJson(overlay), new File(outDir, file.getFileId() + ".json"), Charset.defaultCharset()); - ++count; - } - } - - logger.info("Dumped {} overlays to {}", count, outDir); - } -} diff --git a/cache/src/test/java/net/runelite/cache/SequenceDumper.java b/cache/src/test/java/net/runelite/cache/SequenceDumper.java deleted file mode 100644 index 94dd175bbb..0000000000 --- a/cache/src/test/java/net/runelite/cache/SequenceDumper.java +++ /dev/null @@ -1,87 +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.cache; - -import com.google.common.io.Files; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import java.io.File; -import java.io.IOException; -import java.nio.charset.Charset; -import net.runelite.cache.definitions.SequenceDefinition; -import net.runelite.cache.definitions.loaders.SequenceLoader; -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 org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class SequenceDumper -{ - private static final Logger logger = LoggerFactory.getLogger(SequenceDumper.class); - - @Rule - public TemporaryFolder folder = StoreLocation.getTemporaryFolder(); - - private final Gson gson = new GsonBuilder().setPrettyPrinting().create(); - - @Test - public void extract() throws IOException - { - File base = StoreLocation.LOCATION, - outDir = folder.newFolder(); - - int count = 0; - - try (Store store = new Store(base)) - { - store.load(); - - Storage storage = store.getStorage(); - Index index = store.getIndex(IndexType.CONFIGS); - Archive archive = index.getArchive(ConfigType.SEQUENCE.getId()); - - byte[] archiveData = storage.loadArchive(archive); - ArchiveFiles files = archive.getFiles(archiveData); - - for (FSFile file : files.getFiles()) - { - SequenceLoader loader = new SequenceLoader(); - SequenceDefinition seq = loader.load(file.getFileId(), file.getContents()); - - Files.write(gson.toJson(seq), new File(outDir, file.getFileId() + ".json"), Charset.defaultCharset()); - ++count; - } - } - - logger.info("Dumped {} sequences to {}", count, outDir); - } -} diff --git a/cache/src/test/java/net/runelite/cache/SoundEffectsDumperTest.java b/cache/src/test/java/net/runelite/cache/SoundEffectsDumperTest.java deleted file mode 100644 index c2a420c0de..0000000000 --- a/cache/src/test/java/net/runelite/cache/SoundEffectsDumperTest.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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 com.google.common.io.Files; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import java.io.File; -import java.io.IOException; -import java.nio.charset.Charset; -import net.runelite.cache.definitions.loaders.sound.SoundEffectLoader; -import net.runelite.cache.definitions.sound.SoundEffectDefinition; -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 org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class SoundEffectsDumperTest -{ - private static final Logger logger = LoggerFactory.getLogger(SoundEffectsDumperTest.class); - - private final Gson gson = new GsonBuilder().setPrettyPrinting().create(); - - @Rule - public TemporaryFolder folder = StoreLocation.getTemporaryFolder(); - - @Test - public void test() throws IOException - { - File dumpDir = folder.newFolder(); - int count = 0; - - try (Store store = new Store(StoreLocation.LOCATION)) - { - store.load(); - - Storage storage = store.getStorage(); - Index index = store.getIndex(IndexType.SOUNDEFFECTS); - - for (Archive archive : index.getArchives()) - { - byte[] contents = archive.decompress(storage.loadArchive(archive)); - - SoundEffectLoader soundEffectLoader = new SoundEffectLoader(); - SoundEffectDefinition soundEffect = soundEffectLoader.load(contents); - - Files.write(gson.toJson(soundEffect), new File(dumpDir, archive.getArchiveId() + ".json"), Charset.defaultCharset()); - ++count; - } - } - - logger.info("Dumped {} sound effects to {}", count, dumpDir); - } -} diff --git a/cache/src/test/java/net/runelite/cache/StoreLocation.java b/cache/src/test/java/net/runelite/cache/StoreLocation.java deleted file mode 100644 index 890e43e5eb..0000000000 --- a/cache/src/test/java/net/runelite/cache/StoreLocation.java +++ /dev/null @@ -1,109 +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.cache; - -import com.google.common.base.Strings; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.nio.file.Files; -import org.junit.rules.TemporaryFolder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class StoreLocation -{ - private static final Logger logger = LoggerFactory.getLogger(StoreLocation.class); - - private static final int NUM_INDEXES = 16; - - public static File LOCATION; - private static File TMP; - - static - { - String cacheTmpDir = System.getProperty("cache.tmpdir"); - if (!Strings.isNullOrEmpty(cacheTmpDir)) - { - System.setProperty("java.io.tmpdir", cacheTmpDir); - TMP = new File(cacheTmpDir); - } - - try - { - LOCATION = setupCacheDir(); - } - catch (IOException ex) - { - logger.warn("unable to initialize cache tmp area", ex); - } - } - - private static File setupCacheDir() throws IOException - { - File file = new File(System.getProperty("java.io.tmpdir"), "cache-" + CacheProperties.getCacheVersion()); - - if (file.exists()) - { - logger.info("Using preexisting cache working directory {}", file); - return file; - } - - file.mkdir(); - - // Copy over files - InputStream in = StoreLocation.class.getResourceAsStream("/main_file_cache.dat2"); - Files.copy(in, new File(file, "main_file_cache.dat2").toPath()); - - in = StoreLocation.class.getResourceAsStream("/main_file_cache.idx255"); - Files.copy(in, new File(file, "main_file_cache.idx255").toPath()); - - for (int i = 0; i <= NUM_INDEXES; ++i) - { - in = StoreLocation.class.getResourceAsStream("/main_file_cache.idx" + i); - Files.copy(in, new File(file, "main_file_cache.idx" + i).toPath()); - } - - logger.info("Set up cache working directory to {}", file); - - return file; - } - - public static TemporaryFolder getTemporaryFolder() - { - return new TemporaryFolder() - { - @Override - public void after() - { - // don't cleanup if using cache tmpdir - if (TMP == null) - { - super.after(); - } - } - }; - } -} diff --git a/cache/src/test/java/net/runelite/cache/StructManagerTest.java b/cache/src/test/java/net/runelite/cache/StructManagerTest.java deleted file mode 100644 index 470df61bc0..0000000000 --- a/cache/src/test/java/net/runelite/cache/StructManagerTest.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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 com.google.common.io.Files; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import java.io.File; -import java.io.IOException; -import java.nio.charset.Charset; -import java.util.Map; -import net.runelite.cache.definitions.StructDefinition; -import net.runelite.cache.fs.Store; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class StructManagerTest -{ - private static final Logger logger = LoggerFactory.getLogger(StructManagerTest.class); - - private final Gson gson = new GsonBuilder().setPrettyPrinting().create(); - - @Rule - public TemporaryFolder folder = StoreLocation.getTemporaryFolder(); - - @Test - public void test() throws IOException - { - File dumpDir = folder.newFolder(); - int count = 0; - - try (Store store = new Store(StoreLocation.LOCATION)) - { - store.load(); - StructManager loader = new StructManager(store); - loader.load(); - - for (Map.Entry struct : loader.getStructs().entrySet()) - { - StructDefinition def = struct.getValue(); - - Files.write(gson.toJson(def), new File(dumpDir, struct.getKey() + ".json"), Charset.defaultCharset()); - ++count; - } - } - - logger.info("Dumped {} structs to {}", count, dumpDir); - } -} diff --git a/cache/src/test/java/net/runelite/cache/TitleDumper.java b/cache/src/test/java/net/runelite/cache/TitleDumper.java deleted file mode 100644 index c611ddf04a..0000000000 --- a/cache/src/test/java/net/runelite/cache/TitleDumper.java +++ /dev/null @@ -1,67 +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.cache; - -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; -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 org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TitleDumper -{ - private static final Logger logger = LoggerFactory.getLogger(TitleDumper.class); - - @Rule - public TemporaryFolder folder = StoreLocation.getTemporaryFolder(); - - @Test - public void extract() throws IOException - { - File base = StoreLocation.LOCATION, - outFile = folder.newFolder(); - - try (Store store = new Store(base)) - { - store.load(); - - Storage storage = store.getStorage(); - Index index = store.getIndex(IndexType.BINARY); - Archive archive = index.findArchiveByName("title.jpg"); - byte[] contents = archive.decompress(storage.loadArchive(archive)); - - Files.write(outFile.toPath(), contents); - } - - logger.info("Dumped to {}", outFile); - } -} diff --git a/cache/src/test/java/net/runelite/cache/TrackDumperTest.java b/cache/src/test/java/net/runelite/cache/TrackDumperTest.java deleted file mode 100644 index dc70a798ef..0000000000 --- a/cache/src/test/java/net/runelite/cache/TrackDumperTest.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * 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 com.google.common.io.Files; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import javax.sound.midi.MidiSystem; -import javax.sound.midi.Sequencer; -import net.runelite.cache.definitions.TrackDefinition; -import net.runelite.cache.definitions.loaders.TrackLoader; -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.util.Djb2Manager; -import org.junit.Ignore; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TrackDumperTest -{ - private static final Logger logger = LoggerFactory.getLogger(TrackDumperTest.class); - - @Rule - public TemporaryFolder folder = StoreLocation.getTemporaryFolder(); - - private final Djb2Manager djb2 = new Djb2Manager(); - - @Test - public void test() throws IOException - { - File dumpDir1 = folder.newFolder(), - dumpDir2 = folder.newFolder(); - int idx1 = 0, idx2 = 0; - - djb2.load(); - - try (Store store = new Store(StoreLocation.LOCATION)) - { - store.load(); - - Storage storage = store.getStorage(); - Index index = store.getIndex(IndexType.TRACK1); - Index index2 = store.getIndex(IndexType.TRACK2); - - for (Archive archive : index.getArchives()) - { - dumpTrackArchive(dumpDir1, storage, archive); - ++idx1; - } - - for (Archive archive : index2.getArchives()) - { - dumpTrackArchive(dumpDir2, storage, archive); - ++idx2; - } - } - - logger.info("Dumped {} sound tracks ({} idx1, {} idx2) to {} and {}", idx1 + idx2, idx1, idx2, dumpDir1, dumpDir2); - } - - private void dumpTrackArchive(File dumpDir, Storage storage, Archive archive) throws IOException - { - byte[] contents = archive.decompress(storage.loadArchive(archive)); - - if (contents == null) - { - return; - } - - TrackLoader loader = new TrackLoader(); - TrackDefinition def = loader.load(contents); - - String name; - if (archive.getNameHash() != 0) - { - name = djb2.getName(archive.getNameHash()); - if (name == null) - { - name = "name-" + archive.getNameHash(); - } - } - else - { - name = "archive-" + archive.getArchiveId(); - } - - File dest = new File(dumpDir, name + ".midi"); - assert !dest.exists(); - - Files.write(def.midi, dest); - } - - @Test - @Ignore - public void play() throws Exception - { - // Obtains the default Sequencer connected to a default device. - Sequencer sequencer = MidiSystem.getSequencer(); - - // Opens the device, indicating that it should now acquire any - // system resources it requires and become operational. - sequencer.open(); - - try - { - // create a stream from a file - java.io.InputStream is = new FileInputStream(new File("D:\\rs\\07\\cache\\track1\\name-687938017.midi")); - - // Sets the current sequence on which the sequencer operates. - // The stream must point to MIDI file data. - sequencer.setSequence(is); - - // Starts playback of the MIDI data in the currently loaded sequence. - sequencer.start(); - - while (sequencer.isRunning()) - { - Thread.sleep(1000L); - } - } - finally - { - sequencer.close(); - } - } -} diff --git a/cache/src/test/java/net/runelite/cache/UnderlayDumper.java b/cache/src/test/java/net/runelite/cache/UnderlayDumper.java deleted file mode 100644 index db735d40cf..0000000000 --- a/cache/src/test/java/net/runelite/cache/UnderlayDumper.java +++ /dev/null @@ -1,87 +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.cache; - -import com.google.common.io.Files; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import java.io.File; -import java.io.IOException; -import java.nio.charset.Charset; -import net.runelite.cache.definitions.UnderlayDefinition; -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 org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class UnderlayDumper -{ - private static final Logger logger = LoggerFactory.getLogger(UnderlayDumper.class); - - @Rule - public TemporaryFolder folder = StoreLocation.getTemporaryFolder(); - - private final Gson gson = new GsonBuilder().setPrettyPrinting().create(); - - @Test - public void extract() throws IOException - { - File base = StoreLocation.LOCATION, - outDir = folder.newFolder(); - - int count = 0; - - try (Store store = new Store(base)) - { - store.load(); - - 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()); - - Files.write(gson.toJson(underlay), new File(outDir, file.getFileId() + ".json"), Charset.defaultCharset()); - ++count; - } - } - - logger.info("Dumped {} underlays to {}", count, outDir); - } -} diff --git a/cache/src/test/java/net/runelite/cache/VarbitDumper.java b/cache/src/test/java/net/runelite/cache/VarbitDumper.java deleted file mode 100644 index 5f75c7a157..0000000000 --- a/cache/src/test/java/net/runelite/cache/VarbitDumper.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * 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 com.google.common.io.Files; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import java.io.File; -import java.io.IOException; -import java.nio.charset.Charset; -import net.runelite.cache.definitions.VarbitDefinition; -import net.runelite.cache.definitions.loaders.VarbitLoader; -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 org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class VarbitDumper -{ - private static final Logger logger = LoggerFactory.getLogger(VarbitDumper.class); - - @Rule - public TemporaryFolder folder = StoreLocation.getTemporaryFolder(); - - private final Gson gson = new GsonBuilder().setPrettyPrinting().create(); - - @Test - public void extract() throws IOException - { - File base = StoreLocation.LOCATION, - outDir = folder.newFolder(); - - int count = 0; - - try (Store store = new Store(base)) - { - store.load(); - - Storage storage = store.getStorage(); - Index index = store.getIndex(IndexType.CONFIGS); - Archive archive = index.getArchive(ConfigType.VARBIT.getId()); - - byte[] archiveData = storage.loadArchive(archive); - ArchiveFiles files = archive.getFiles(archiveData); - - for (FSFile file : files.getFiles()) - { - VarbitLoader loader = new VarbitLoader(); - VarbitDefinition varbit = loader.load(file.getFileId(), file.getContents()); - - Files.write(gson.toJson(varbit), new File(outDir, file.getFileId() + ".json"), Charset.defaultCharset()); - ++count; - } - } - - logger.info("Dumped {} varbits to {}", count, outDir); - } -} diff --git a/cache/src/test/java/net/runelite/cache/WorldMapDumperTest.java b/cache/src/test/java/net/runelite/cache/WorldMapDumperTest.java deleted file mode 100644 index 8d8dd956c4..0000000000 --- a/cache/src/test/java/net/runelite/cache/WorldMapDumperTest.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * 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 com.google.common.io.Files; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import java.io.File; -import java.io.IOException; -import java.nio.charset.Charset; -import net.runelite.cache.definitions.WorldMapDefinition; -import net.runelite.cache.definitions.loaders.WorldMapLoader; -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 org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class WorldMapDumperTest -{ - private static final Logger logger = LoggerFactory.getLogger(WorldMapDumperTest.class); - - @Rule - public TemporaryFolder folder = StoreLocation.getTemporaryFolder(); - - private final Gson gson = new GsonBuilder().setPrettyPrinting().create(); - - @Test - public void extract() throws IOException - { - File base = StoreLocation.LOCATION, - outDir = folder.newFolder(); - - int count = 0; - - try (Store store = new Store(base)) - { - store.load(); - - Storage storage = store.getStorage(); - Index index = store.getIndex(IndexType.WORLDMAP); - Archive archive = index.getArchive(0); // there is also archive 1/2, but their data format is not this - - byte[] archiveData = storage.loadArchive(archive); - ArchiveFiles files = archive.getFiles(archiveData); - - for (FSFile file : files.getFiles()) - { - WorldMapLoader loader = new WorldMapLoader(); - WorldMapDefinition def = loader.load(file.getContents(), file.getFileId()); - - Files.write(gson.toJson(def), new File(outDir, file.getFileId() + ".json"), Charset.defaultCharset()); - ++count; - } - } - - logger.info("Dumped {} world map data to {}", count, outDir); - } -} diff --git a/cache/src/test/java/net/runelite/cache/definitions/savers/InterfaceSaverTest.java b/cache/src/test/java/net/runelite/cache/definitions/savers/InterfaceSaverTest.java deleted file mode 100644 index 6d95f445a9..0000000000 --- a/cache/src/test/java/net/runelite/cache/definitions/savers/InterfaceSaverTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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.savers; - -import java.io.File; -import net.runelite.cache.IndexType; -import net.runelite.cache.StoreLocation; -import net.runelite.cache.definitions.InterfaceDefinition; -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 static org.junit.Assert.assertArrayEquals; -import org.junit.Test; - -public class InterfaceSaverTest -{ - @Test - public void testSave() throws Exception - { - File base = StoreLocation.LOCATION; - try (Store store = new Store(base)) - { - store.load(); - - Storage storage = store.getStorage(); - Index index = store.getIndex(IndexType.INTERFACES); - Archive archive = index.getArchive(31); - byte[] archiveData = storage.loadArchive(archive); - ArchiveFiles files = archive.getFiles(archiveData); - FSFile file = files.findFile(76); - byte[] contents = file.getContents(); - - InterfaceDefinition def = new InterfaceLoader().load(0, contents); - byte[] b = new InterfaceSaver().save(def); - assertArrayEquals(contents, b); - } - } - -} diff --git a/cache/src/test/java/net/runelite/cache/definitions/savers/ScriptSaverTest.java b/cache/src/test/java/net/runelite/cache/definitions/savers/ScriptSaverTest.java deleted file mode 100644 index a2b55676bd..0000000000 --- a/cache/src/test/java/net/runelite/cache/definitions/savers/ScriptSaverTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * 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.savers; - -import java.io.IOException; -import net.runelite.cache.definitions.ScriptDefinition; -import net.runelite.cache.definitions.loaders.ScriptLoader; -import net.runelite.cache.script.Instructions; -import net.runelite.cache.script.assembler.Assembler; -import static org.junit.Assert.assertEquals; -import org.junit.Test; - -/** - * - * @author Adam - */ -public class ScriptSaverTest -{ - private static final String SCRIPT_RESOURCE = "/net/runelite/cache/script/assembler/91.rs2asm"; - private static final String SCRIPT_RESOURCE_UNICODE = "/net/runelite/cache/script/assembler/Unicode.rs2asm"; - - @Test - public void testSave() throws IOException - { - Instructions instructions = new Instructions(); - instructions.init(); - ScriptDefinition script = new Assembler(instructions).assemble(getClass().getResourceAsStream(SCRIPT_RESOURCE)); - byte[] saved = new ScriptSaver().save(script); - ScriptDefinition loadedScripot = new ScriptLoader().load(91, saved); - assertEquals(script, loadedScripot); - } - - @Test - public void testSaveUnicode() throws IOException - { - Instructions instructions = new Instructions(); - instructions.init(); - ScriptDefinition script = new Assembler(instructions).assemble(getClass().getResourceAsStream(SCRIPT_RESOURCE_UNICODE)); - byte[] saved = new ScriptSaver().save(script); - ScriptDefinition loadedScripot = new ScriptLoader().load(1001, saved); - assertEquals(script, loadedScripot); - } - -} diff --git a/cache/src/test/java/net/runelite/cache/fs/ContainerTest.java b/cache/src/test/java/net/runelite/cache/fs/ContainerTest.java deleted file mode 100644 index 1aca0df4ba..0000000000 --- a/cache/src/test/java/net/runelite/cache/fs/ContainerTest.java +++ /dev/null @@ -1,55 +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.cache.fs; - -import java.io.IOException; -import java.util.Random; -import static net.runelite.cache.fs.jagex.CompressionType.GZ; -import static org.junit.Assert.assertArrayEquals; -import org.junit.Test; - -public class ContainerTest -{ - - @Test - public void testCompress() throws IOException - { - int[] keys = new int[] - { - 4, 8, 15, 16 - }; - Random random = new Random(42L); - byte[] data = new byte[1024]; - random.nextBytes(data); - - Container container = new Container(GZ, -1); - container.compress(data, keys); - byte[] compressedData = container.data; - - container = Container.decompress(compressedData, keys); - assertArrayEquals(data, container.data); - } - -} diff --git a/cache/src/test/java/net/runelite/cache/fs/StoreLoadTest.java b/cache/src/test/java/net/runelite/cache/fs/StoreLoadTest.java deleted file mode 100644 index 91bbc3c3f0..0000000000 --- a/cache/src/test/java/net/runelite/cache/fs/StoreLoadTest.java +++ /dev/null @@ -1,80 +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.cache.fs; - -import com.google.common.io.Files; -import java.io.File; -import java.io.IOException; -import net.runelite.cache.StoreLocation; -import org.junit.Assert; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; - -public class StoreLoadTest -{ - @Rule - public TemporaryFolder folder = StoreLocation.getTemporaryFolder(); - - @Test - public void testLoad() throws IOException - { - try (Store store = new Store(StoreLocation.LOCATION)) - { - store.load(); - } - } - - @Test - public void testSave() throws IOException - { - try (Store store = new Store(StoreLocation.LOCATION)) - { - store.load(); - - File testStoreFile = folder.newFolder(); - for (File f : StoreLocation.LOCATION.listFiles()) - { - Files.copy(f, new File(testStoreFile, f.getName())); - } - - try (Store testStore = new Store(testStoreFile)) - { - testStore.load(); - - Assert.assertTrue(store.equals(testStore)); - - testStore.save(); - } - - try (Store testStore = new Store(testStoreFile)) - { - testStore.load(); - - Assert.assertTrue(store.equals(testStore)); - } - } - } -} diff --git a/cache/src/test/java/net/runelite/cache/fs/StoreTest.java b/cache/src/test/java/net/runelite/cache/fs/StoreTest.java deleted file mode 100644 index 8953d481cf..0000000000 --- a/cache/src/test/java/net/runelite/cache/fs/StoreTest.java +++ /dev/null @@ -1,151 +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.cache.fs; - -import java.io.File; -import java.io.IOException; -import java.util.Random; -import net.runelite.cache.StoreLocation; -import net.runelite.cache.index.FileData; -import org.junit.Assert; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; - -public class StoreTest -{ - private static final int NUMBER_OF_FILES = 1024; - - @Rule - public TemporaryFolder folder = StoreLocation.getTemporaryFolder(); - - @Test - public void testOneFile() throws IOException - { - try (Store store = new Store(folder.getRoot())) - { - Index index = store.addIndex(0); - Archive archive = index.addArchive(0); - archive.setFileData(new FileData[1]); - FileData fileData = archive.getFileData()[0] = new FileData(); - fileData.setId(42); - fileData.setNameHash(7); - - store.save(); - - try (Store store2 = new Store(folder.getRoot())) - { - store2.load(); - - Assert.assertEquals(store, store2); - } - } - } - - @Test - public void testManyFiles() throws IOException - { - Random random = new Random(42L); - File root = folder.newFolder(); - - try (Store store = new Store(root)) - { - Index index = store.addIndex(0); - Archive archive = index.addArchive(0); - archive.setNameHash(random.nextInt()); - archive.setFileData(new FileData[NUMBER_OF_FILES]); - - for (int i = 0; i < NUMBER_OF_FILES; ++i) - { - FileData[] fileData = archive.getFileData(); - FileData file = fileData[i] = new FileData(); - file.setId(i); - file.setNameHash(random.nextInt()); - } - - store.save(); - - try (Store store2 = new Store(root)) - { - store2.load(); - - Assert.assertEquals(store, store2); - } - } - } - - @Test - public void testMultipleArchives() throws IOException - { - Random random = new Random(43L); - File root = folder.newFolder(); - - try (Store store = new Store(root)) - { - Index index = store.addIndex(0); - Index index2 = store.addIndex(1); - - Archive archive = index.addArchive(0); - archive.setNameHash(random.nextInt(Integer.MAX_VALUE)); - archive.setFileData(new FileData[NUMBER_OF_FILES]); - - Archive archive2 = index.addArchive(1); - archive2.setFileData(new FileData[NUMBER_OF_FILES]); - - Archive archive3 = index2.addArchive(0); - archive3.setFileData(new FileData[NUMBER_OF_FILES]); - - for (int i = 0; i < NUMBER_OF_FILES; ++i) - { - FileData[] fileData = archive.getFileData(); - FileData file = fileData[i] = new FileData(); - file.setNameHash(random.nextInt(Integer.MAX_VALUE)); - } - - for (int i = 0; i < NUMBER_OF_FILES; ++i) - { - FileData[] fileData = archive2.getFileData(); - FileData file = fileData[i] = new FileData(); - file.setNameHash(random.nextInt(Integer.MAX_VALUE)); - } - - for (int i = 0; i < NUMBER_OF_FILES; ++i) - { - FileData[] fileData = archive3.getFileData(); - FileData file = fileData[i] = new FileData(); - file.setNameHash(random.nextInt(Integer.MAX_VALUE)); - } - - store.save(); - - try (Store store2 = new Store(root)) - { - store2.load(); - - Assert.assertEquals(store, store2); - } - } - } -} diff --git a/cache/src/test/java/net/runelite/cache/fs/flat/FlatStorageTest.java b/cache/src/test/java/net/runelite/cache/fs/flat/FlatStorageTest.java deleted file mode 100644 index 37eb72c8c4..0000000000 --- a/cache/src/test/java/net/runelite/cache/fs/flat/FlatStorageTest.java +++ /dev/null @@ -1,101 +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.cache.fs.flat; - -import java.io.File; -import net.runelite.cache.fs.Archive; -import net.runelite.cache.fs.Container; -import net.runelite.cache.fs.Index; -import net.runelite.cache.fs.Store; -import net.runelite.cache.fs.jagex.DiskStorage; -import net.runelite.cache.index.FileData; -import org.junit.Test; -import static org.junit.Assert.*; -import org.junit.Rule; -import org.junit.rules.TemporaryFolder; - -public class FlatStorageTest -{ - @Rule - public TemporaryFolder folder = new TemporaryFolder(); - - @Test - public void testSaveArchive() throws Exception - { - File file = folder.newFolder(); - DiskStorage storage = new DiskStorage(file); - Archive archive; - Archive archive2; - try (Store store = new Store(storage)) - { - Index index = store.addIndex(0); - archive = index.addArchive(0); - archive2 = index.addArchive(1); - - FileData[] fileData = new FileData[1]; - archive.setFileData(fileData); - fileData[0] = new FileData(); - - FileData[] fileData2 = new FileData[1]; - archive2.setFileData(fileData2); - fileData2[0] = new FileData(); - - byte[] data = "test".getBytes(); - Container container = new Container(archive.getCompression(), -1); - container.compress(data, null); - byte[] compressedData = container.data; - storage.saveArchive(archive, compressedData); - - container = new Container(archive.getCompression(), 42); - container.compress(data, null); - compressedData = container.data; - archive2.setRevision(42); - storage.saveArchive(archive2, compressedData); - - store.save(); - } - - storage = new DiskStorage(file); - try (Store store = new Store(storage)) - { - store.load(); - Index index = store.findIndex(0); - Archive archive2_1 = index.getArchive(0); - Archive archive2_2 = index.getArchive(1); - - byte[] comprsesedData = storage.loadArchive(archive2_1); - byte[] data = archive2_1.decompress(comprsesedData); - assertArrayEquals("test".getBytes(), data); - assertEquals(archive.getCrc(), archive2_1.getCrc()); - assertEquals(archive.getRevision(), archive2_1.getRevision()); - - comprsesedData = storage.loadArchive(archive2_2); - data = archive2_2.decompress(comprsesedData); - assertArrayEquals("test".getBytes(), data); - assertEquals(archive2.getCrc(), archive2_2.getCrc()); - assertEquals(archive2.getRevision(), archive2_2.getRevision()); - } - } -} diff --git a/cache/src/test/java/net/runelite/cache/fs/jagex/DataFileTest.java b/cache/src/test/java/net/runelite/cache/fs/jagex/DataFileTest.java deleted file mode 100644 index 7e66d0b1e9..0000000000 --- a/cache/src/test/java/net/runelite/cache/fs/jagex/DataFileTest.java +++ /dev/null @@ -1,170 +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.cache.fs.jagex; - -import java.io.File; -import java.io.IOException; -import net.runelite.cache.StoreLocation; -import net.runelite.cache.fs.Container; -import org.junit.Assert; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; - -public class DataFileTest -{ - @Rule - public TemporaryFolder folder = StoreLocation.getTemporaryFolder(); - - @Test - public void test1() throws IOException - { - File file = folder.newFile(); - DataFile df = new DataFile(file); - - Container container = new Container(CompressionType.NONE, 0); - container.compress("test".getBytes(), null); - byte[] compressedData = container.data; - DataFileWriteResult res = df.write(42, 3, compressedData); - - compressedData = df.read(42, 3, res.sector, res.compressedLength); - Container res2 = Container.decompress(compressedData, null); - - byte[] buf = res2.data; - String str = new String(buf); - Assert.assertEquals("test", str); - } - - @Test - public void test2() throws IOException - { - byte[] b = new byte[1024]; - for (int i = 0; i < 1024; ++i) - { - b[i] = (byte) i; - } - - File file = folder.newFile(); - - DataFile df = new DataFile(file); - - Container container = new Container(CompressionType.BZ2, 42); - container.compress(b, null); - byte[] compressedData = container.data; - DataFileWriteResult res = df.write(42, 0x1FFFF, compressedData); - - compressedData = df.read(42, 0x1FFFF, res.sector, res.compressedLength); - Container res2 = Container.decompress(compressedData, null); - - byte[] buf = res2.data; - Assert.assertArrayEquals(b, buf); - } - - @Test - public void testGZipCompression() throws IOException - { - DataFile df = new DataFile(folder.newFile()); - - Container container = new Container(CompressionType.GZ, 0); - container.compress("test".getBytes(), null); - byte[] compressedData = container.data; - DataFileWriteResult res = df.write(41, 4, compressedData); - - compressedData = df.read(41, 4, res.sector, res.compressedLength); - Container res2 = Container.decompress(compressedData, null); - - byte[] buf = res2.data; - String str = new String(buf); - Assert.assertEquals("test", str); - } - - @Test - public void testBZip2Compression() throws IOException - { - DataFile df = new DataFile(folder.newFile()); - - Container container = new Container(CompressionType.BZ2, 5); - container.compress("test".getBytes(), null); - byte[] compressedData = container.data; - DataFileWriteResult res = df.write(41, 4, compressedData); - - compressedData = df.read(41, 4, res.sector, res.compressedLength); - Container res2 = Container.decompress(compressedData, null); - - byte[] buf = res2.data; - String str = new String(buf); - Assert.assertEquals("test", str); - } - - @Test - public void testEnc() throws IOException - { - File file = folder.newFile(); - int[] keys = new int[] - { - 4, 8, 15, 16 - }; - - DataFile df = new DataFile(file); - - Container container = new Container(CompressionType.NONE, 42); - container.compress("testtesttesttest1".getBytes(), keys); - byte[] compressedData = container.data; - DataFileWriteResult res = df.write(42, 3, compressedData); - - compressedData = df.read(42, 3, res.sector, res.compressedLength); - Container res2 = Container.decompress(compressedData, keys); - - byte[] buf = res2.data; - String str = new String(buf); - Assert.assertEquals("testtesttesttest1", str); - Assert.assertEquals(42, res2.revision); - } - - @Test - public void testEncGz() throws IOException - { - File file = folder.newFile(); - int[] keys = new int[] - { - 4, 8, 15, 16 - }; - - DataFile df = new DataFile(file); - - Container container = new Container(CompressionType.GZ, 42); - container.compress("testtesttesttest1".getBytes(), keys); - byte[] compressedData = container.data; - DataFileWriteResult res = df.write(42, 3, compressedData); - - compressedData = df.read(42, 3, res.sector, res.compressedLength); - Container res2 = Container.decompress(compressedData, keys); - - byte[] buf = res2.data; - String str = new String(buf); - Assert.assertEquals("testtesttesttest1", str); - Assert.assertEquals(42, res2.revision); - } -} diff --git a/cache/src/test/java/net/runelite/cache/fs/jagex/DiskStorageTest.java b/cache/src/test/java/net/runelite/cache/fs/jagex/DiskStorageTest.java deleted file mode 100644 index 6d6035a61e..0000000000 --- a/cache/src/test/java/net/runelite/cache/fs/jagex/DiskStorageTest.java +++ /dev/null @@ -1,102 +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.cache.fs.jagex; - -import java.io.File; -import net.runelite.cache.StoreLocation; -import net.runelite.cache.fs.Archive; -import net.runelite.cache.fs.Container; -import net.runelite.cache.fs.Index; -import net.runelite.cache.fs.Store; -import net.runelite.cache.index.FileData; -import org.junit.Test; -import static org.junit.Assert.*; -import org.junit.Rule; -import org.junit.rules.TemporaryFolder; - -public class DiskStorageTest -{ - @Rule - public TemporaryFolder folder = StoreLocation.getTemporaryFolder(); - - @Test - public void testSaveArchive() throws Exception - { - File file = folder.newFolder(); - DiskStorage storage = new DiskStorage(file); - Archive archive; - Archive archive2; - try (Store store = new Store(storage)) - { - Index index = store.addIndex(0); - archive = index.addArchive(0); - archive2 = index.addArchive(1); - - FileData[] fileData = new FileData[1]; - archive.setFileData(fileData); - fileData[0] = new FileData(); - - FileData[] fileData2 = new FileData[1]; - archive2.setFileData(fileData2); - fileData2[0] = new FileData(); - - byte[] data = "test".getBytes(); - Container container = new Container(archive.getCompression(), -1); - container.compress(data, null); - byte[] compressedData = container.data; - storage.saveArchive(archive, compressedData); - - container = new Container(archive.getCompression(), 42); - container.compress(data, null); - compressedData = container.data; - archive2.setRevision(42); - storage.saveArchive(archive2, compressedData); - - store.save(); - } - - storage = new DiskStorage(file); - try (Store store = new Store(storage)) - { - store.load(); - Index index = store.findIndex(0); - Archive archive2_1 = index.getArchive(0); - Archive archive2_2 = index.getArchive(1); - - byte[] comprsesedData = storage.loadArchive(archive2_1); - byte[] data = archive2_1.decompress(comprsesedData); - assertArrayEquals("test".getBytes(), data); - assertEquals(archive.getCrc(), archive2_1.getCrc()); - assertEquals(archive.getRevision(), archive2_1.getRevision()); - - comprsesedData = storage.loadArchive(archive2_2); - data = archive2_2.decompress(comprsesedData); - assertArrayEquals("test".getBytes(), data); - assertEquals(archive2.getCrc(), archive2_2.getCrc()); - assertEquals(archive2.getRevision(), archive2_2.getRevision()); - } - } - -} diff --git a/cache/src/test/java/net/runelite/cache/fs/jagex/IndexFileTest.java b/cache/src/test/java/net/runelite/cache/fs/jagex/IndexFileTest.java deleted file mode 100644 index e07c6b4771..0000000000 --- a/cache/src/test/java/net/runelite/cache/fs/jagex/IndexFileTest.java +++ /dev/null @@ -1,50 +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.cache.fs.jagex; - -import java.io.File; -import java.io.IOException; -import net.runelite.cache.StoreLocation; -import org.junit.Assert; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; - -public class IndexFileTest -{ - @Rule - public TemporaryFolder folder = StoreLocation.getTemporaryFolder(); - - @Test - public void test() throws IOException - { - File file = folder.newFile(); - IndexFile index = new IndexFile(5, file); - IndexEntry entry = new IndexEntry(index, 7, 8, 9); - index.write(entry); - IndexEntry entry2 = index.read(7); - Assert.assertEquals(entry, entry2); - } -} diff --git a/cache/src/test/java/net/runelite/cache/io/OutputStreamTest.java b/cache/src/test/java/net/runelite/cache/io/OutputStreamTest.java deleted file mode 100644 index 42bbc238bb..0000000000 --- a/cache/src/test/java/net/runelite/cache/io/OutputStreamTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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.io; - -import static org.junit.Assert.assertEquals; -import org.junit.Test; - -public class OutputStreamTest -{ - @Test - public void testWriteBigSmart() - { - OutputStream os = new OutputStream(); - os.writeBigSmart(42); - os.writeBigSmart(70000); - os.writeBigSmart(65535); - - InputStream is = new InputStream(os.getArray()); - assertEquals(42, is.readBigSmart()); - assertEquals(70000, is.readBigSmart()); - assertEquals(65535, is.readBigSmart()); - } - - @Test - public void testWriteString() - { - char[] c = new char[]{32, 160}; - String str = new String(c, 0, c.length); - - OutputStream os = new OutputStream(); - os.writeString(str); - - // 1 byte length + 32 + 160 - assertEquals(3, os.getOffset()); - } - -} diff --git a/cache/src/test/java/net/runelite/cache/item/ItemSpriteFactoryTest.java b/cache/src/test/java/net/runelite/cache/item/ItemSpriteFactoryTest.java deleted file mode 100644 index 30fb140a1b..0000000000 --- a/cache/src/test/java/net/runelite/cache/item/ItemSpriteFactoryTest.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * 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.item; - -import java.awt.image.BufferedImage; -import java.io.File; -import java.io.IOException; -import javax.imageio.ImageIO; -import lombok.extern.slf4j.Slf4j; -import net.runelite.cache.IndexType; -import net.runelite.cache.ItemManager; -import net.runelite.cache.SpriteManager; -import net.runelite.cache.StoreLocation; -import net.runelite.cache.TextureManager; -import net.runelite.cache.definitions.ItemDefinition; -import net.runelite.cache.definitions.ModelDefinition; -import net.runelite.cache.definitions.loaders.ModelLoader; -import net.runelite.cache.definitions.providers.ModelProvider; -import net.runelite.cache.fs.Archive; -import net.runelite.cache.fs.Index; -import net.runelite.cache.fs.Store; -import org.junit.Ignore; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; - -@Slf4j -public class ItemSpriteFactoryTest -{ - @Rule - public TemporaryFolder folder = StoreLocation.getTemporaryFolder(); - - @Test - @Ignore - public void test() throws IOException - { - File base = StoreLocation.LOCATION, - outDir = folder.newFolder(); - - int count = 0; - - try (Store store = new Store(base)) - { - store.load(); - - ItemManager itemManager = new ItemManager(store); - itemManager.load(); - - ModelProvider modelProvider = new ModelProvider() - { - @Override - public ModelDefinition provide(int modelId) throws IOException - { - Index models = store.getIndex(IndexType.MODELS); - Archive archive = models.getArchive(modelId); - - byte[] data = archive.decompress(store.getStorage().loadArchive(archive)); - ModelDefinition inventoryModel = new ModelLoader().load(modelId, data); - return inventoryModel; - } - }; - - SpriteManager spriteManager = new SpriteManager(store); - spriteManager.load(); - - TextureManager textureManager = new TextureManager(store); - textureManager.load(); - - for (ItemDefinition itemDef : itemManager.getItems()) - { - if (itemDef.name == null || itemDef.name.equalsIgnoreCase("null")) - { - continue; - } - - try - { - BufferedImage sprite = ItemSpriteFactory.createSprite(itemManager, modelProvider, spriteManager, textureManager, - itemDef.id, 1, 1, 3153952, false); - - File out = new File(outDir, itemDef.id + ".png"); - BufferedImage img = sprite; - ImageIO.write(img, "PNG", out); - - ++count; - } - catch (Exception ex) - { - log.warn("error dumping item {}", itemDef.id, ex); - } - } - } - - log.info("Dumped {} item images to {}", count, outDir); - } -} \ No newline at end of file diff --git a/cache/src/test/java/net/runelite/cache/models/ObjExporterTest.java b/cache/src/test/java/net/runelite/cache/models/ObjExporterTest.java deleted file mode 100644 index c7b0aa85f7..0000000000 --- a/cache/src/test/java/net/runelite/cache/models/ObjExporterTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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.models; - -import java.io.File; -import java.io.FileWriter; -import java.io.PrintWriter; -import java.nio.file.Files; -import net.runelite.cache.StoreLocation; -import net.runelite.cache.TextureManager; -import net.runelite.cache.definitions.ModelDefinition; -import net.runelite.cache.definitions.loaders.ModelLoader; -import net.runelite.cache.fs.Store; -import org.junit.Ignore; -import org.junit.Test; - -public class ObjExporterTest -{ - @Test - @Ignore - public void testExport() throws Exception - { - try (Store store = new Store(StoreLocation.LOCATION)) - { - store.load(); - - TextureManager tm = new TextureManager(store); - tm.load(); - - ModelLoader loader = new ModelLoader(); - ModelDefinition model = loader.load(9638, Files.readAllBytes(new File("D:\\rs\\07\\cache\\models\\9638.model").toPath())); - - ObjExporter exporter = new ObjExporter(tm, model); - try (PrintWriter objWriter = new PrintWriter(new FileWriter(new File("D:\\rs\\07\\temp\\9638.obj"))); - PrintWriter mtlWriter = new PrintWriter(new FileWriter(new File("D:\\rs\\07\\temp\\9638.mtl")))) - { - exporter.export(objWriter, mtlWriter); - } - } - } -} diff --git a/cache/src/test/java/net/runelite/cache/script/InstructionsTest.java b/cache/src/test/java/net/runelite/cache/script/InstructionsTest.java deleted file mode 100644 index 477845c5e8..0000000000 --- a/cache/src/test/java/net/runelite/cache/script/InstructionsTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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.script; - -import org.junit.Test; - -public class InstructionsTest -{ - @Test - public void testInit() - { - new Instructions().init(); - } - -} diff --git a/cache/src/test/java/net/runelite/cache/script/assembler/AssemblerTest.java b/cache/src/test/java/net/runelite/cache/script/assembler/AssemblerTest.java deleted file mode 100644 index 0e5dccd4f1..0000000000 --- a/cache/src/test/java/net/runelite/cache/script/assembler/AssemblerTest.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * 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.script.assembler; - -import java.io.InputStream; -import net.runelite.cache.definitions.ScriptDefinition; -import net.runelite.cache.script.Instructions; -import net.runelite.cache.script.disassembler.Disassembler; -import org.apache.commons.compress.utils.IOUtils; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; -import org.junit.runners.Parameterized.Parameter; -import org.junit.runners.Parameterized.Parameters; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@RunWith(Parameterized.class) -public class AssemblerTest -{ - private static final Logger logger = LoggerFactory.getLogger(AssemblerTest.class); - - @Parameter - public String script; - - @Parameters - public static String[] scripts() - { - return new String[] - { - "91.rs2asm", - "681.rs2asm", - "Unicode.rs2asm" - }; - } - - @Test - public void testAssemble() throws Exception - { - InputStream in = AssemblerTest.class.getResourceAsStream(script); - Assert.assertNotNull(in); - - Instructions instructions = new Instructions(); - instructions.init(); - - Assembler assembler = new Assembler(instructions); - ScriptDefinition script = assembler.assemble(in); - - // compare with disassembler - Disassembler disassembler = new Disassembler(); - String out = disassembler.disassemble(script); - - in = AssemblerTest.class.getResourceAsStream(this.script); - Assert.assertNotNull(in); - - String original = new String(IOUtils.toByteArray(in)).replaceAll("\r\n", "\n"); - - logger.info(original); - logger.info("-----------------------"); - logger.info(out); - - Assert.assertEquals(original, out); - } - -} diff --git a/cache/src/test/java/net/runelite/cache/script/disassembler/DisassemblerTest.java b/cache/src/test/java/net/runelite/cache/script/disassembler/DisassemblerTest.java deleted file mode 100644 index a97ca27586..0000000000 --- a/cache/src/test/java/net/runelite/cache/script/disassembler/DisassemblerTest.java +++ /dev/null @@ -1,89 +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.cache.script.disassembler; - -import com.google.common.io.Files; -import java.io.File; -import java.io.IOException; -import net.runelite.cache.IndexType; -import net.runelite.cache.StoreLocation; -import net.runelite.cache.definitions.ScriptDefinition; -import net.runelite.cache.definitions.loaders.ScriptLoader; -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 org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class DisassemblerTest -{ - private static final Logger logger = LoggerFactory.getLogger(DisassemblerTest.class); - - @Rule - public TemporaryFolder folder = StoreLocation.getTemporaryFolder(); - - @Test - public void test() throws IOException - { - File outDir = folder.newFolder(); - int count = 0; - - try (Store store = new Store(StoreLocation.LOCATION)) - { - store.load(); - - Storage storage = store.getStorage(); - Index index = store.getIndex(IndexType.CLIENTSCRIPT); - ScriptLoader loader = new ScriptLoader(); - - for (Archive archive : index.getArchives()) - { - byte[] contents = archive.decompress(storage.loadArchive(archive)); - - if (contents == null) - { - continue; - } - - ScriptDefinition script = loader.load(archive.getArchiveId(), contents); - - File outFile = new File(outDir, archive.getArchiveId() + ".rs2asm"); - - Disassembler disassembler = new Disassembler(); - String out = disassembler.disassemble(script); - - Files.write(out.getBytes(), outFile); - - ++count; - } - } - - logger.info("Dumped {} scripts to {}", count, outDir); - } -} diff --git a/cache/src/test/java/net/runelite/cache/util/Djb2Test.java b/cache/src/test/java/net/runelite/cache/util/Djb2Test.java deleted file mode 100644 index 5c3933b69d..0000000000 --- a/cache/src/test/java/net/runelite/cache/util/Djb2Test.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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.util; - -import org.junit.Test; -import static org.junit.Assert.*; - -public class Djb2Test -{ - - @Test - public void testHash() - { - int hash = Djb2.hash("l49_52"); - assertEquals(-1153204821, hash); - } - -} diff --git a/cache/src/test/resources/cache.properties b/cache/src/test/resources/cache.properties deleted file mode 100644 index 03e58d141f..0000000000 --- a/cache/src/test/resources/cache.properties +++ /dev/null @@ -1,3 +0,0 @@ -rs.version=${rs.version} -cache.version=${cache.version} - diff --git a/cache/src/test/resources/net/runelite/cache/script/assembler/681.rs2asm b/cache/src/test/resources/net/runelite/cache/script/assembler/681.rs2asm deleted file mode 100644 index a5f4222fdb..0000000000 --- a/cache/src/test/resources/net/runelite/cache/script/assembler/681.rs2asm +++ /dev/null @@ -1,275 +0,0 @@ -.id 681 -.int_stack_count 0 -.string_stack_count 0 -.int_var_count 2 -.string_var_count 1 - get_varc_int 5 - iconst 14 - if_icmpeq LABEL4 - jump LABEL7 -LABEL4: - iconst 1 - set_varc_int 66 - return -LABEL7: - iconst -1 - istore 0 - sconst "" - sstore 0 - get_varc_string_old 22 - string_length - istore 1 - iload 1 - iconst 0 - if_icmpgt LABEL18 - jump LABEL193 -LABEL18: - get_varc_int 5 - switch - 1: LABEL21 - 2: LABEL44 - 3: LABEL44 - 4: LABEL23 - 5: LABEL23 - 6: LABEL44 - 7: LABEL110 - 8: LABEL114 - 9: LABEL120 - 10: LABEL123 - 11: LABEL185 - 12: LABEL142 - 13: LABEL160 - 15: LABEL120 - 16: LABEL190 - jump LABEL192 -LABEL21: - return - jump LABEL192 -LABEL23: - ignore_count - iconst 0 - if_icmplt LABEL27 - jump LABEL30 -LABEL27: - sconst "Unable to update ignore list - system busy." - mes - jump LABEL43 -LABEL30: - get_varc_int 5 - iconst 4 - if_icmpeq LABEL34 - jump LABEL37 -LABEL34: - get_varc_string_old 22 - ignore_add - jump LABEL43 -LABEL37: - get_varc_int 5 - iconst 5 - if_icmpeq LABEL41 - jump LABEL43 -LABEL41: - get_varc_string_old 22 - ignore_del -LABEL43: - jump LABEL192 -LABEL44: - friend_count - iconst 0 - if_icmplt LABEL48 - jump LABEL51 -LABEL48: - sconst "Unable to complete action - system busy." - mes - jump LABEL109 -LABEL51: - get_varc_int 5 - iconst 2 - if_icmpeq LABEL55 - jump LABEL58 -LABEL55: - get_varc_string_old 22 - friend_add - jump LABEL109 -LABEL58: - get_varc_int 5 - iconst 3 - if_icmpeq LABEL62 - jump LABEL65 -LABEL62: - get_varc_string_old 22 - friend_del - jump LABEL109 -LABEL65: - get_varc_int 5 - iconst 6 - if_icmpeq LABEL69 - jump LABEL109 -LABEL69: - get_varc_int 203 - iconst 0 - if_icmpeq LABEL76 - get_varc_int 203 - iconst -1 - if_icmpeq LABEL76 - jump LABEL82 -LABEL76: - iconst 1 - iconst 1 - invoke 299 - sconst "You must set a name before you can chat." - mes - return -LABEL82: - chat_getfilter_private - iconst 2 - if_icmpeq LABEL86 - jump LABEL97 -LABEL86: - chat_getfilter_public - iconst 1 - chat_getfilter_trade - chat_setfilter - invoke 178 - invoke 553 - istore 0 - iload 0 - invoke 84 - iload 0 - invoke 89 -LABEL97: - get_varbit 4394 - iconst 1 - if_icmpeq LABEL101 - jump LABEL104 -LABEL101: - get_varc_string_old 23 - friend_del - jump LABEL107 -LABEL104: - get_varc_string_old 23 - get_varc_string_old 22 - chat_sendprivate -LABEL107: - clientclock - set_varc_int 61 -LABEL109: - jump LABEL192 -LABEL110: - get_varc_string_old 22 - invoke 212 - resume_countdialog - jump LABEL192 -LABEL114: - get_varc_string_old 22 - removetags - set_varc_string_old 128 - get_varc_string_old 22 - resume_namedialog - jump LABEL192 -LABEL120: - get_varc_string_old 22 - resume_stringdialog - jump LABEL192 -LABEL123: - get_varc_int 203 - iconst 0 - if_icmpeq LABEL130 - get_varc_int 203 - iconst -1 - if_icmpeq LABEL130 - jump LABEL136 -LABEL130: - iconst 1 - iconst 1 - invoke 299 - sconst "You must set a name before you can chat." - mes - return -LABEL136: - get_varc_string_old 22 - removetags - set_varc_string_old 129 - get_varc_string_old 22 - clan_joinchat - jump LABEL192 -LABEL142: - iload 1 - iconst 10 - if_icmpgt LABEL146 - jump LABEL152 -LABEL146: - get_varc_string_old 22 - iconst 0 - iconst 9 - substring - sstore 0 - jump LABEL154 -LABEL152: - get_varc_string_old 22 - sstore 0 -LABEL154: - sload 0 - lowercase - chat_setmessagefilter - invoke 553 - invoke 84 - jump LABEL192 -LABEL160: - get_varc_int 203 - iconst 0 - if_icmpeq LABEL167 - get_varc_int 203 - iconst -1 - if_icmpeq LABEL167 - jump LABEL173 -LABEL167: - iconst 1 - iconst 1 - invoke 299 - sconst "You must set a name before you can chat." - mes - return -LABEL173: - get_varc_string_old 22 - iconst 0 - set_varc_int 62 - set_varc_string_old 28 - invoke 95 - iconst 552 - iconst -2147483645 - iconst 1 - sconst "I1" - iconst 10616843 - if_setontimer - jump LABEL192 -LABEL185: - iconst 0 - iconst 1 - invoke 299 - return - jump LABEL192 -LABEL190: - get_varc_string_old 22 - invoke 2061 -LABEL192: - jump LABEL199 -LABEL193: - get_varc_int 5 - switch - 16: LABEL198 - 7: LABEL196 - 8: LABEL196 - 9: LABEL196 - 15: LABEL196 - jump LABEL199 -LABEL196: - return - jump LABEL199 -LABEL198: - return -LABEL199: - iconst 1 - iconst 1 - invoke 299 - return diff --git a/cache/src/test/resources/net/runelite/cache/script/assembler/91.rs2asm b/cache/src/test/resources/net/runelite/cache/script/assembler/91.rs2asm deleted file mode 100644 index 25a749a77b..0000000000 --- a/cache/src/test/resources/net/runelite/cache/script/assembler/91.rs2asm +++ /dev/null @@ -1,122 +0,0 @@ -.id 91 -.int_stack_count 2 -.string_stack_count 1 -.int_var_count 2 -.string_var_count 1 - iload 0 - switch - 3: LABEL20 - 5: LABEL54 - 6: LABEL54 - 7: LABEL3 - jump LABEL84 -LABEL3: - iload 1 - get_varc_int 175 - if_icmplt LABEL7 - jump LABEL9 -LABEL7: - iconst 0 - return -LABEL9: - sload 0 - removetags - ignore_test - iconst 1 - if_icmpeq LABEL15 - jump LABEL17 -LABEL15: - iconst 0 - return -LABEL17: - iconst 1 - return - jump LABEL84 -LABEL20: - iload 1 - get_varc_int 175 - if_icmplt LABEL24 - jump LABEL26 -LABEL24: - iconst 0 - return -LABEL26: - sload 0 - removetags - ignore_test - iconst 1 - if_icmpeq LABEL32 - jump LABEL34 -LABEL32: - iconst 0 - return -LABEL34: - chat_getfilter_private - iconst 0 - if_icmpeq LABEL38 - jump LABEL40 -LABEL38: - iconst 1 - return -LABEL40: - chat_getfilter_private - iconst 1 - if_icmpeq LABEL44 - jump LABEL51 -LABEL44: - sload 0 - friend_test - iconst 1 - if_icmpeq LABEL49 - jump LABEL51 -LABEL49: - iconst 1 - return -LABEL51: - iconst 0 - return - jump LABEL84 -LABEL54: - iload 1 - get_varc_int 175 - if_icmplt LABEL58 - jump LABEL60 -LABEL58: - iconst 0 - return -LABEL60: - iload 0 - iconst 5 - if_icmpeq LABEL64 - jump LABEL76 -LABEL64: - get_varbit 1627 - iconst 0 - if_icmpeq LABEL68 - jump LABEL76 -LABEL68: - clientclock - iload 1 - sub - iconst 500 - if_icmpge LABEL74 - jump LABEL76 -LABEL74: - iconst 0 - return -LABEL76: - chat_getfilter_private - iconst 2 - if_icmpne LABEL80 - jump LABEL82 -LABEL80: - iconst 1 - return -LABEL82: - iconst 0 - return -LABEL84: - iconst 0 - return - iconst -1 - return diff --git a/cache/src/test/resources/net/runelite/cache/script/assembler/Unicode.rs2asm b/cache/src/test/resources/net/runelite/cache/script/assembler/Unicode.rs2asm deleted file mode 100644 index a1fc0a62e1..0000000000 --- a/cache/src/test/resources/net/runelite/cache/script/assembler/Unicode.rs2asm +++ /dev/null @@ -1,7 +0,0 @@ -.id 1001 -.int_stack_count 0 -.string_stack_count 0 -.int_var_count 0 -.string_var_count 0 - sconst ": " - return diff --git a/cache/src/test/resources/simplelogger.properties b/cache/src/test/resources/simplelogger.properties deleted file mode 100644 index 895eeb2715..0000000000 --- a/cache/src/test/resources/simplelogger.properties +++ /dev/null @@ -1 +0,0 @@ -org.slf4j.simpleLogger.defaultLogLevel=INFO \ No newline at end of file diff --git a/checkstyle.xml b/checkstyle.xml deleted file mode 100644 index e8669a742c..0000000000 --- a/checkstyle.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/deobfuscator/pom.xml b/deobfuscator/pom.xml new file mode 100644 index 0000000000..5012e4bfff --- /dev/null +++ b/deobfuscator/pom.xml @@ -0,0 +1,169 @@ + + + + 4.0.0 + + + com.runeswag + runeswag-parent + 1.0-SNAPSHOT + + + deobfuscator + Deobfuscator + + + + com.runeswag + api + 1.0-SNAPSHOT + + + net.runelite + fernflower + 20171017 + + + + com.google.guava + guava + 27.1-jre + + + org.slf4j + slf4j-api + 1.8.0-beta4 + + + org.slf4j + slf4j-simple + 1.7.12 + + + com.google.code.gson + gson + 2.8.5 + + + org.ow2.asm + asm-debug-all + 5.2 + + + + com.runeswag.rs + client + 1.0-SNAPSHOT + test + + + net.runelite.rs + vanilla + 180 + test + + + junit + junit + 4.12 + test + + + org.mockito + mockito-all + 1.10.19 + test + + + + + + + src/main/resources + true + + + + + src/test/resources + true + + + + + org.apache.maven.plugins + maven-dependency-plugin + 2.3 + + + generate-sources + + + properties + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.16 + + true + -Xmx2048m + + + + maven-assembly-plugin + + + jar-with-dependencies + + + + + make-assembly + package + + single + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + test-jar + + + + + + + diff --git a/deobfuscator/src/main/java/net/runelite/asm/ClassFile.java b/deobfuscator/src/main/java/net/runelite/asm/ClassFile.java new file mode 100644 index 0000000000..dcbbd91bac --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/ClassFile.java @@ -0,0 +1,420 @@ +/* + * 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.asm; + +import java.util.ArrayList; +import java.util.List; +import net.runelite.asm.attributes.Annotations; +import net.runelite.asm.attributes.annotation.Annotation; +import net.runelite.asm.pool.Class; +import net.runelite.asm.signature.Signature; +import org.objectweb.asm.AnnotationVisitor; +import org.objectweb.asm.ClassVisitor; +import org.objectweb.asm.FieldVisitor; +import org.objectweb.asm.MethodVisitor; +import org.objectweb.asm.Opcodes; + +public class ClassFile +{ + private ClassGroup group; + + private ClassFile parent; // super class + private final List children = new ArrayList<>(); // classes which inherit from this + + private int version; + private int access; + private Class name; + private Class super_class; + private String source; + private final Interfaces interfaces; + private final List fields = new ArrayList<>(); + private final List methods = new ArrayList<>(); + private final Annotations annotations; + + public ClassFile(ClassGroup group) + { + this.group = group; + + interfaces = new Interfaces(this); + annotations = new Annotations(); + } + + public ClassFile() + { + this(null); + } + + @Override + public String toString() + { + return "ClassFile{" + "name=" + name + '}'; + } + + public int getVersion() + { + return version; + } + + public void setVersion(int version) + { + this.version = version; + } + + public int getAccess() + { + return access; + } + + public void setAccess(int access) + { + this.access = access; + } + + public void accept(ClassVisitor visitor) + { + String[] ints = interfaces.getInterfaces().stream().map(i -> i.getName()).toArray(String[]::new); + + visitor.visit(version, access, name.getName(), null, super_class.getName(), ints); + visitor.visitSource(source, null); + + for (Annotation annotation : annotations.getAnnotations()) + { + AnnotationVisitor av = visitor.visitAnnotation(annotation.getType().toString(), true); + annotation.accept(av); + } + + for (Field field : fields) + { + FieldVisitor fv = visitor.visitField(field.getAccessFlags(), field.getName(), field.getType().toString(), null, field.getValue()); + field.accept(fv); + } + + for (Method method : methods) + { + String[] exceptions = method.getExceptions().getExceptions().stream().map(cl -> cl.getName()).toArray(String[]::new); + if (exceptions.length == 0) + { + exceptions = null; + } + + MethodVisitor mv = visitor.visitMethod(method.getAccessFlags(), method.getName(), method.getDescriptor().toString(), null, exceptions); + method.accept(mv); + } + + visitor.visitEnd(); + } + + public ClassGroup getGroup() + { + return group; + } + + public void setGroup(ClassGroup group) + { + this.group = group; + } + + public Interfaces getInterfaces() + { + return interfaces; + } + + public List getFields() + { + return fields; + } + + public void addField(Field field) + { + fields.add(field); + } + + public void removeField(Field field) + { + fields.remove(field); + } + + public List getMethods() + { + return methods; + } + + public void addMethod(Method method) + { + methods.add(method); + } + + public void removeMethod(Method method) + { + methods.remove(method); + } + + public Annotations getAnnotations() + { + return annotations; + } + + public String getName() + { + return name.getName(); + } + + public void setName(String name) + { + // Must be removed from the class group map first + assert group == null || this.name == null || group.findClass(this.name.getName()) == null; + + this.name = new Class(name); + } + + public String getClassName() + { + String n = getName(); + int i = n.lastIndexOf('/'); + return n.substring(i + 1); + } + + public String getSuperName() + { + return super_class.getName(); + } + + public void setSuperName(String name) + { + super_class = new Class(name); + } + + public String getSource() + { + return source; + } + + public void setSource(String source) + { + this.source = source; + } + + public Class getParentClass() + { + return this.super_class; + } + + public void setParentClass(Class c) + { + super_class = c; + } + + public ClassFile getParent() + { + return parent; + } + + public List getChildren() + { + return children; + } + + public Field findField(String name, Type type) + { + for (Field f : fields) + { + if (f.getName().equals(name) && f.getType().equals(type)) + { + return f; + } + } + return null; + } + + public Field findField(String name) + { + for (Field f : fields) + { + if (f.getName().equals(name)) + { + return f; + } + } + return null; + } + + public Class getPoolClass() + { + return name; + } + + public Field findFieldDeep(String name, Type type) + { + Field f = findField(name, type); + if (f != null) + { + return f; + } + + ClassFile parent = getParent(); + if (parent != null) + { + return parent.findFieldDeep(name, type); + } + + return null; + } + + public Method findMethod(String name, Signature type) + { + for (Method m : methods) + { + if (m.getName().equals(name) && m.getDescriptor().equals(type)) + { + return m; + } + } + return null; + } + + public Method findMethod(String name) + { + for (Method m : methods) + { + if (m.getName().equals(name)) + { + return m; + } + } + return null; + } + + public Method findMethodDeep(String name, Signature type) + { + Method m = findMethod(name, type); + if (m != null) + { + return m; + } + + ClassFile parent = getParent(); + if (parent != null) + { + return parent.findMethodDeep(name, type); + } + + return null; + } + + public Method findMethodDeepStatic(String name, Signature type) + { + Method m = findMethod(name, type); + if (m != null && m.isStatic()) + { + return m; + } + + ClassFile parent = getParent(); + if (parent != null) + { + return parent.findMethodDeepStatic(name, type); + } + + return null; + } + + public Method findMethodDeep(String name) + { + Method m = findMethod(name); + if (m != null) + { + return m; + } + + ClassFile parent = getParent(); + if (parent != null) + { + return parent.findMethodDeep(name); + } + + return null; + } + + public void clearClassGraph() + { + parent = null; + children.clear(); + } + + public void buildClassGraph() + { + ClassFile other = group.findClass(super_class.getName()); + if (other != null) + { + this.parent = other; + parent.children.add(this); + } + + for (ClassFile i : interfaces.getMyInterfaces()) + { + i.children.add(this); + } + } + + public boolean instanceOf(ClassFile other) + { + return this == other || interfaces.instanceOf(other) || (getParent() != null && getParent().instanceOf(other)); + } + + public boolean isAbstract() + { + return (this.access & Opcodes.ACC_ABSTRACT) != 0; + } + + public boolean isFinal() + { + return (this.access & Opcodes.ACC_FINAL) != 0; + } + + public boolean isInterface() + { + return (this.access & Opcodes.ACC_INTERFACE) != 0; + } + + public boolean isEnum() + { + return (this.access & Opcodes.ACC_ENUM) != 0; + } + + public void setEnum() + { + this.access |= Opcodes.ACC_ENUM; + } + + public void clearFinal() + { + this.access &= ~Opcodes.ACC_FINAL; + } + + public void clearAbstract() + { + this.access &= ~Opcodes.ACC_ABSTRACT; + } +} diff --git a/cache/src/main/java/net/runelite/cache/InventoryManager.java b/deobfuscator/src/main/java/net/runelite/asm/ClassGroup.java similarity index 52% rename from cache/src/main/java/net/runelite/cache/InventoryManager.java rename to deobfuscator/src/main/java/net/runelite/asm/ClassGroup.java index 772d48b1a9..2c6ba531a5 100644 --- a/cache/src/main/java/net/runelite/cache/InventoryManager.java +++ b/deobfuscator/src/main/java/net/runelite/asm/ClassGroup.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Adam + * Copyright (c) 2016-2017, Adam * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -22,63 +22,89 @@ * (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; +package net.runelite.asm; -import java.io.IOException; import java.util.ArrayList; import java.util.Collections; +import java.util.HashMap; import java.util.List; -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; +import java.util.Map; +import net.runelite.asm.attributes.Code; -public class InventoryManager +public class ClassGroup { - private final Store store; - private final List inventories = new ArrayList<>(); + private final List classes = new ArrayList<>(); // to keep order + private final Map classMap = new HashMap<>(); - public InventoryManager(Store store) + public void addClass(ClassFile cf) { - this.store = store; + assert cf.getGroup() == this || cf.getGroup() == null; + cf.setGroup(this); + + classes.add(cf); + classMap.put(cf.getName(), cf); } - public void load() throws IOException + public void removeClass(ClassFile cf) { - InventoryLoader loader = new InventoryLoader(); + classes.remove(cf); + classMap.remove(cf.getName()); + } - Storage storage = store.getStorage(); - Index index = store.getIndex(IndexType.CONFIGS); - Archive archive = index.getArchive(ConfigType.INV.getId()); + public void renameClass(ClassFile cf, String newName) + { + assert classes.contains(cf); + assert classMap.get(cf.getName()) == cf; - byte[] archiveData = storage.loadArchive(archive); - ArchiveFiles files = archive.getFiles(archiveData); + classMap.remove(cf.getName()); + cf.setName(newName); + classMap.put(cf.getName(), cf); + } - for (FSFile file : files.getFiles()) + 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) { - InventoryDefinition inv = loader.load(file.getFileId(), file.getContents()); - inventories.add(inv); + c.clearClassGraph(); + } + + for (ClassFile c : classes) + { + c.buildClassGraph(); } } - public List getInventories() + public void lookup() { - return Collections.unmodifiableList(inventories); - } - - public InventoryDefinition findInventory(int id) - { - for (InventoryDefinition def : inventories) + for (ClassFile cf : this.getClasses()) { - if (def.id == id) + for (Method m : cf.getMethods()) { - return def; + Code code = m.getCode(); + + if (code == null) + { + continue; + } + + code.getInstructions().lookup(); } } - return null; } } diff --git a/deobfuscator/src/main/java/net/runelite/asm/Field.java b/deobfuscator/src/main/java/net/runelite/asm/Field.java new file mode 100644 index 0000000000..8d70053adb --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/Field.java @@ -0,0 +1,163 @@ +/* + * 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.asm; + +import net.runelite.asm.attributes.Annotations; +import net.runelite.asm.attributes.annotation.Annotation; +import org.objectweb.asm.AnnotationVisitor; +import org.objectweb.asm.FieldVisitor; +import org.objectweb.asm.Opcodes; + +import static org.objectweb.asm.Opcodes.ACC_PRIVATE; +import static org.objectweb.asm.Opcodes.ACC_PROTECTED; +import static org.objectweb.asm.Opcodes.ACC_PUBLIC; + +public class Field +{ + public static final int ACCESS_MODIFIERS = ACC_PUBLIC | ACC_PRIVATE | ACC_PROTECTED; + + private final ClassFile classFile; + + private int accessFlags; + private String name; + private Type type; + private Object value; // ConstantValue + private final Annotations annotations; + + public Field(ClassFile classFile, String name, Type type) + { + this.classFile = classFile; + this.name = name; + this.type = type; + + annotations = new Annotations(); + } + + public void accept(FieldVisitor visitor) + { + for (Annotation annotation : annotations.getAnnotations()) + { + AnnotationVisitor av = visitor.visitAnnotation(annotation.getType().toString(), true); + annotation.accept(av); + } + + visitor.visitEnd(); + } + + public ClassFile getClassFile() + { + return classFile; + } + + public int getAccessFlags() + { + return accessFlags; + } + + public void setAccessFlags(int accessFlags) + { + this.accessFlags = accessFlags; + } + + public boolean isPublic() + { + return (accessFlags & Opcodes.ACC_PUBLIC) != 0; + } + + public void setPublic() + { + accessFlags = (short) ((accessFlags & ~ACCESS_MODIFIERS) | ACC_PUBLIC); + } + + public boolean isStatic() + { + return (accessFlags & Opcodes.ACC_STATIC) != 0; + } + + public void setStatic() + { + accessFlags |= Opcodes.ACC_STATIC; + } + + public boolean isSynthetic() + { + return (accessFlags & Opcodes.ACC_SYNTHETIC) != 0; + } + + public void setEnum() + { + accessFlags |= Opcodes.ACC_ENUM; + } + + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name = name; + } + + public Type getType() + { + return type; + } + + public void setType(Type type) + { + this.type = type; + } + + public Object getValue() + { + return value; + } + + public void setValue(Object value) + { + this.value = value; + } + + public Annotations getAnnotations() + { + return annotations; + } + + public net.runelite.asm.pool.Field getPoolField() + { + return new net.runelite.asm.pool.Field( + new net.runelite.asm.pool.Class(classFile.getName()), + this.getName(), + this.getType() + ); + } + + @Override + public String toString() + { + return (this.isStatic() ? "static " : "") + this.type + " " + classFile.getName() + "." + this.getName(); + } +} diff --git a/deobfuscator/src/main/java/net/runelite/asm/Interfaces.java b/deobfuscator/src/main/java/net/runelite/asm/Interfaces.java new file mode 100644 index 0000000000..a372f9d68c --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/Interfaces.java @@ -0,0 +1,92 @@ +/* + * 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.asm; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; +import net.runelite.asm.pool.Class; + +public class Interfaces +{ + private final ClassFile classFile; + + private final List interfaces = new ArrayList<>(); + + Interfaces(ClassFile c) + { + classFile = c; + } + + public void addInterface(Class clazz) + { + if (!interfaces.contains(clazz)) + { + interfaces.add(clazz); + } + } + + public List getInterfaces() + { + return interfaces; + } + + public void clear() + { + interfaces.clear(); + } + + public List getMyInterfaces() + { + List l = new ArrayList<>(); + for (Class clazz : interfaces) + { + ClassFile iface = classFile.getGroup().findClass(clazz.getName()); + if (iface != null) + { + l.add(iface); + } + } + return l; + } + + public List getNonMyInterfaces() + { + return interfaces.stream().filter(clazz -> classFile.getGroup().findClass(clazz.getName()) == null).collect(Collectors.toList()); + } + + public boolean instanceOf(ClassFile cf) + { + for (Class clazz : interfaces) + { + ClassFile iface = classFile.getGroup().findClass(clazz.getName()); + if (iface.instanceOf(cf)) + { + return true; + } + } + return false; + } +} diff --git a/deobfuscator/src/main/java/net/runelite/asm/Method.java b/deobfuscator/src/main/java/net/runelite/asm/Method.java new file mode 100644 index 0000000000..bc2c8b305b --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/Method.java @@ -0,0 +1,314 @@ +/* + * 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.asm; + +import java.util.ArrayList; +import java.util.List; +import net.runelite.asm.attributes.Annotations; +import net.runelite.asm.attributes.Code; +import net.runelite.asm.attributes.Exceptions; +import net.runelite.asm.attributes.annotation.Annotation; +import net.runelite.asm.attributes.code.Instruction; +import net.runelite.asm.attributes.code.LocalVariable; +import net.runelite.asm.attributes.code.Parameter; +import net.runelite.asm.attributes.code.instruction.types.LVTInstruction; +import net.runelite.asm.signature.Signature; +import org.objectweb.asm.AnnotationVisitor; +import org.objectweb.asm.Label; +import org.objectweb.asm.MethodVisitor; +import static org.objectweb.asm.Opcodes.ACC_FINAL; +import static org.objectweb.asm.Opcodes.ACC_NATIVE; +import static org.objectweb.asm.Opcodes.ACC_PRIVATE; +import static org.objectweb.asm.Opcodes.ACC_PROTECTED; +import static org.objectweb.asm.Opcodes.ACC_PUBLIC; +import static org.objectweb.asm.Opcodes.ACC_STATIC; +import static org.objectweb.asm.Opcodes.ACC_SYNCHRONIZED; + +public class Method +{ + public static final int ACCESS_MODIFIERS = ACC_PUBLIC | ACC_PRIVATE | ACC_PROTECTED; + + private final ClassFile classFile; + + private int accessFlags; + private String name; + private Signature arguments; + private Exceptions exceptions; + private Annotations annotations; + private List parameters; + private Code code; + + public Method(ClassFile classFile, String name, Signature signature) + { + this.classFile = classFile; + this.name = name; + this.arguments = signature; + exceptions = new Exceptions(); + annotations = new Annotations(); + parameters = new ArrayList<>(); + } + + public ClassFile getClassFile() + { + return classFile; + } + + @Override + public String toString() + { + return (this.isStatic() ? "static " : "") + classFile.getName() + "." + this.name + this.arguments; + } + + public void accept(MethodVisitor visitor) + { + //This is required to name unused parameters + for (Parameter p : parameters) + { + visitor.visitParameter(p.getName(), p.getAccess()); + } + + for (Annotation annotation : annotations.getAnnotations()) + { + AnnotationVisitor av = visitor.visitAnnotation(annotation.getType().toString(), true); + annotation.accept(av); + } + + if (code != null) + { + code.getInstructions().rebuildLabels(); + + visitor.visitCode(); + + net.runelite.asm.attributes.code.Exceptions exceptions = code.getExceptions(); + for (net.runelite.asm.attributes.code.Exception exception : exceptions.getExceptions()) + { + assert exception.getStart().getLabel() != null; + assert exception.getEnd().getLabel() != null; + assert exception.getHandler().getLabel() != null; + + int idxStart = code.getInstructions().getInstructions().indexOf(exception.getStart()); + int idxEnd = code.getInstructions().getInstructions().indexOf(exception.getEnd()); + + assert idxStart != -1; + assert idxEnd != -1; + assert code.getInstructions().getInstructions().contains(exception.getHandler()); + + assert idxEnd > idxStart; + + visitor.visitTryCatchBlock( + exception.getStart().getLabel(), + exception.getEnd().getLabel(), + exception.getHandler().getLabel(), + exception.getCatchType() != null ? exception.getCatchType().getName() : null + ); + } + + for (Instruction i : code.getInstructions().getInstructions()) + { + i.accept(visitor); + } + + //Find first and last label for this method + if (parameters.size() > 0) + { + Label startLabel = null; + Label endLabel = null; + for (Instruction i : code.getInstructions().getInstructions()) + { + if (i instanceof net.runelite.asm.attributes.code.Label) + { + if (startLabel == null) + { + startLabel = ((net.runelite.asm.attributes.code.Label) i).getLabel(); + } + endLabel = ((net.runelite.asm.attributes.code.Label) i).getLabel(); + } + } + + for (Parameter p : parameters) + { + LocalVariable lv = p.getLocalVariable(); + if (lv != null) + { + visitor.visitLocalVariable(lv.getName(), lv.getDesc(), lv.getSignature(), startLabel, endLabel, lv.getIndex()); + } + } + } + + visitor.visitMaxs(code.getMaxStack(), code.getMaxLocals()); + } + + visitor.visitEnd(); + } + + public int getAccessFlags() + { + return accessFlags; + } + + public void setAccessFlags(int accessFlags) + { + this.accessFlags = accessFlags; + } + + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name = name; + } + + public Signature getDescriptor() + { + return arguments; + } + + public void setDescriptor(Signature signature) + { + this.arguments = signature; + } + + public boolean isNative() + { + return (accessFlags & ACC_NATIVE) != 0; + } + + public boolean isStatic() + { + return (accessFlags & ACC_STATIC) != 0; + } + + public void setStatic() + { + accessFlags |= ACC_STATIC; + } + + public boolean isSynchronized() + { + return (accessFlags & ACC_SYNCHRONIZED) != 0; + } + + public boolean isFinal() + { + return (accessFlags & ACC_FINAL) != 0; + } + + public void setFinal(boolean f) + { + if (f) + { + accessFlags |= ACC_FINAL; + } + else + { + accessFlags &= ~ACC_FINAL; + } + } + + public boolean isPrivate() + { + return (accessFlags & ACC_PRIVATE) != 0; + } + + public void setPrivate() + { + accessFlags = (short) ((accessFlags & ~ACCESS_MODIFIERS) | ACC_PRIVATE); + } + + public void setPublic() + { + accessFlags = (short) ((accessFlags & ~ACCESS_MODIFIERS) | ACC_PUBLIC); + } + + public Exceptions getExceptions() + { + return exceptions; + } + + public Code getCode() + { + return code; + } + + public void setCode(Code code) + { + this.code = code; + } + + public Annotations getAnnotations() + { + return annotations; + } + + @SuppressWarnings("unchecked") + public List findLVTInstructionsForVariable(int index) + { + List list = new ArrayList<>(); + + if (getCode() == null) + { + return null; + } + + for (Instruction ins : getCode().getInstructions().getInstructions()) + { + if (ins instanceof LVTInstruction) + { + LVTInstruction lv = (LVTInstruction) ins; + + if (lv.getVariableIndex() != index) + { + continue; + } + + list.add((T) ins); + } + } + + return list; + } + + public net.runelite.asm.pool.Method getPoolMethod() + { + return new net.runelite.asm.pool.Method( + new net.runelite.asm.pool.Class(classFile.getName()), + name, + arguments + ); + } + + public List getParameters() + { + return parameters; + } + + public void setParameters(List parameters) + { + this.parameters = parameters; + } +} diff --git a/deobfuscator/src/main/java/net/runelite/asm/Type.java b/deobfuscator/src/main/java/net/runelite/asm/Type.java new file mode 100644 index 0000000000..68ba6960d4 --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/Type.java @@ -0,0 +1,228 @@ +/* + * 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.asm; + +import net.runelite.asm.pool.Class; + +/** + * Created by Kyle Fricilone on 8/20/2017 + */ +public class Type +{ + + public static final Type VOID = new Type("V"); + public static final Type BOOLEAN = new Type("Z"); + public static final Type CHAR = new Type("C"); + public static final Type BYTE = new Type("B"); + public static final Type SHORT = new Type("S"); + public static final Type INT = new Type("I"); + public static final Type FLOAT = new Type("F"); + public static final Type LONG = new Type("J"); + public static final Type DOUBLE = new Type("D"); + public static final Type OBJECT = new Type("Ljava/lang/Object;"); + public static final Type STRING = new Type("Ljava/lang/String;"); + public static final Type THROWABLE = new Type("Ljava/lang/Throwable;"); + public static final Type EXCEPTION = new Type("Ljava/lang/Exception;"); + + private final String type; + + public Type(String type) + { + this.type = type; + } + + public boolean isPrimitive() + { + return this.equals(BOOLEAN) || this.equals(BYTE) || this.equals(SHORT) || this.equals(CHAR) || this.equals(INT) + || this.equals(VOID) || this.equals(LONG) || this.equals(FLOAT) || this.equals(DOUBLE); + } + + public boolean isObject() + { + return this.equals(OBJECT); + } + + public boolean isArray() + { + return getDimensions() > 0; + } + + public boolean isStackInt() + { + return this.equals(BOOLEAN) || this.equals(BYTE) || this.equals(SHORT) || this.equals(CHAR) || this.equals(INT); + } + + public int getSize() + { + if (this.equals(LONG) || this.equals(DOUBLE)) + { + return 2; + } + + if (this.equals(VOID)) + { + return 0; + } + + return 1; + } + + public int getDimensions() + { + return getDimensions(type); + } + + public Type getSubtype() + { + if (!type.startsWith("[")) + { + throw new IllegalStateException(type + " is not an array"); + } + return new Type(type.substring(1)); + } + + public String getInternalName() + { + String s = type; + while (s.startsWith("[")) + { + s = s.substring(1); + } + if (s.startsWith("L")) + { + return s.substring(1, s.length() - 1); + } + else + { + return s; + } + } + + @Override + public boolean equals(Object o) + { + if (!(o instanceof Type)) + { + return false; + } + + Type other = (Type) o; + return type.equals(other.type); + } + + @Override + public int hashCode() + { + return type.hashCode(); + } + + @Override + public String toString() + { + return type; + } + + public String toAsmString() + { + if (type.startsWith("L") && type.endsWith(";")) + { + return type.substring(1, type.length() - 1); + } + else + { + return type; + } + } + + public static Type fromAsmString(String str) + { + if (str.startsWith("[")) + { + // array type + return new Type(str); + } + else + { + // object type + return new Type("L" + str + ";"); + } + } + + private static int getDimensions(String type) + { + if (!type.startsWith("[")) + { + return 0; + } + + return (int) type.chars().filter(i -> i == '[').count(); + } + + public static Type getType(String type, int dims) + { + StringBuilder builder = new StringBuilder(); + for (int i = 0; i < dims; i++) + { + builder.append('['); + } + return new Type(builder.append(type).toString()); + } + + public static Type getType(Object object) + { + Type type; + + if (object instanceof Double) + { + type = DOUBLE; + } + else if (object instanceof Float) + { + type = FLOAT; + } + else if (object instanceof Integer) + { + type = INT; + } + else if (object instanceof Long) + { + type = LONG; + } + else if (object instanceof String) + { + type = STRING; + } + else if (object instanceof Class) + { + type = new Type("L" + ((Class) object).getName() + ";"); + } + else + { + throw new IllegalArgumentException("Unexpected object type: " + object.getClass()); + } + + return type; + } +} diff --git a/cache-client/src/main/java/net/runelite/cache/client/FileResult.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/Annotations.java similarity index 56% rename from cache-client/src/main/java/net/runelite/cache/client/FileResult.java rename to deobfuscator/src/main/java/net/runelite/asm/attributes/Annotations.java index 2c5046af62..b14d761c28 100644 --- a/cache-client/src/main/java/net/runelite/cache/client/FileResult.java +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/Annotations.java @@ -22,71 +22,64 @@ * (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.IOException; -import net.runelite.cache.fs.Container; +package net.runelite.asm.attributes; -public class FileResult +import java.util.ArrayList; +import java.util.List; + +import net.runelite.asm.Type; +import net.runelite.asm.attributes.annotation.Annotation; +import net.runelite.asm.attributes.annotation.Element; + +public class Annotations { - private final int index; - private final int fileId; - private final byte[] compressedData; + private final List annotations = new ArrayList<>(); - 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) + public List getAnnotations() { - this.index = index; - this.fileId = fileId; - this.compressedData = compressedData; + return annotations; + } + + public void addAnnotation(Annotation annotation) + { + annotations.add(annotation); } - public int getIndex() + public void removeAnnotation(Annotation annotation) { - return index; + annotations.remove(annotation); } - public int getFileId() + public void clearAnnotations() { - return fileId; + annotations.clear(); + } + + public Annotation find(Type type) + { + for (Annotation a : annotations) + if (a.getType().equals(type)) + return a; + return null; } - public byte[] getCompressedData() + public int size() { - return compressedData; + return annotations.size(); } - - public void decompress(int[] keys) throws IOException + + public Annotation addAnnotation(Type type, String name, Object value) { - Container res = Container.decompress(compressedData, keys); + Annotation annotation = new Annotation(this); + annotation.setType(type); + addAnnotation(annotation); + + Element element = new Element(annotation); + element.setName(name); + element.setValue(value); + annotation.addElement(element); - contents = res.data; - revision = res.revision; - crc = res.crc; - compression = res.compression; - } - - public byte[] getContents() - { - return contents; - } - - public int getRevision() - { - return revision; - } - - public int getCrc() - { - return crc; - } - - public int getCompression() - { - return compression; + return annotation; } } diff --git a/deobfuscator/src/main/java/net/runelite/asm/attributes/Code.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/Code.java new file mode 100644 index 0000000000..2a3f08126c --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/Code.java @@ -0,0 +1,113 @@ +/* + * 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.asm.attributes; + +import net.runelite.asm.Method; +import net.runelite.asm.attributes.code.Exceptions; +import net.runelite.asm.attributes.code.Instruction; +import net.runelite.asm.attributes.code.Instructions; +import net.runelite.asm.attributes.code.instruction.types.LVTInstruction; +import net.runelite.asm.signature.Signature; + +public class Code +{ + private Method method; + private int maxStack; + private Instructions instructions; + private final Exceptions exceptions; + + public Code(Method method) + { + this.method = method; + + exceptions = new Exceptions(this); + instructions = new Instructions(this); + } + + public Method getMethod() + { + return method; + } + + public int getMaxStack() + { + return maxStack; + } + + public void setMaxStack(int maxStack) + { + this.maxStack = maxStack; + } + + private int getMaxLocalsFromSig() + { + Method m = getMethod(); + int num = m.isStatic() ? 0 : 1; + Signature sig = m.getDescriptor(); + for (int i = 0; i < sig.size(); ++i) + num += sig.getTypeOfArg(i).getSize(); + return num; + } + + /** + * calculates the size of the lvt required for this method + * @return + */ + public int getMaxLocals() + { + int max = -1; + + for (Instruction ins : instructions.getInstructions()) + { + if (ins instanceof LVTInstruction) + { + LVTInstruction lvt = (LVTInstruction) ins; + + int sizeRequired = lvt.getVariableIndex() + lvt.type().getSlots(); + if (sizeRequired > max) + { + max = sizeRequired; + } + } + } + + int fromSig = getMaxLocalsFromSig(); + if (fromSig > max) + max = fromSig; + + return max; + } + + public Exceptions getExceptions() + { + return exceptions; + } + + public Instructions getInstructions() + { + return instructions; + } +} diff --git a/http-api/src/main/java/net/runelite/http/api/xtea/XteaRequest.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/Exceptions.java similarity index 70% rename from http-api/src/main/java/net/runelite/http/api/xtea/XteaRequest.java rename to deobfuscator/src/main/java/net/runelite/asm/attributes/Exceptions.java index f84c85b83b..0b12c513fd 100644 --- a/http-api/src/main/java/net/runelite/http/api/xtea/XteaRequest.java +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/Exceptions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Adam + * Copyright (c) 2016-2017, Adam * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -22,33 +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.http.api.xtea; + +package net.runelite.asm.attributes; import java.util.ArrayList; import java.util.List; +import net.runelite.asm.ClassFile; +import net.runelite.asm.pool.Class; -public class XteaRequest +public class Exceptions { - private int revision; - private List keys = new ArrayList<>(); + private final List classes = new ArrayList<>(); - public int getRevision() + public void addException(Class cl) { - return revision; + classes.add(cl); } - public void setRevision(int revision) + public List getExceptions() { - this.revision = revision; + return classes; } - - public List getKeys() + + public void renameClass(ClassFile cf, String name) { - return keys; - } - - public void addKey(XteaKey key) - { - keys.add(key); + 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)); + } + } } } diff --git a/http-service/src/main/java/net/runelite/http/service/examine/ExamineEntry.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/annotation/Annotation.java similarity index 60% rename from http-service/src/main/java/net/runelite/http/service/examine/ExamineEntry.java rename to deobfuscator/src/main/java/net/runelite/asm/attributes/annotation/Annotation.java index 5222ef3059..7c727eb788 100644 --- a/http-service/src/main/java/net/runelite/http/service/examine/ExamineEntry.java +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/annotation/Annotation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Adam + * Copyright (c) 2016-2017, Adam * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -22,65 +22,61 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.http.service.examine; -import java.time.Instant; +package net.runelite.asm.attributes.annotation; -public class ExamineEntry +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 { - private ExamineType type; - private int id; - private Instant time; - private int count; - private String text; + private final Annotations annotations; + private Type type; + private final List elements = new ArrayList<>(); - public ExamineType getType() + public Annotation(Annotations annotations) { - return type; + this.annotations = annotations; } - public void setType(ExamineType type) + public Annotations getAnnotations() + { + return annotations; + } + + public void setType(Type type) { this.type = type; } - public int getId() + public Type getType() { - return id; + return type; } - public void setId(int id) + public List getElements() { - this.id = id; + return elements; } - - public Instant getTime() + + public Element getElement() { - return time; + return elements.get(0); } - - public void setTime(Instant time) + + public void addElement(Element element) { - this.time = time; + elements.add(element); } - - public int getCount() + + public void accept(AnnotationVisitor visitor) { - return count; - } - - public void setCount(int count) - { - this.count = count; - } - - public String getText() - { - return text; - } - - public void setText(String text) - { - this.text = text; + for (Element element : elements) + visitor.visit(element.getName(), element.getValue()); + visitor.visitEnd(); } } diff --git a/cache-client/src/main/java/net/runelite/cache/client/PendingFileRequest.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/annotation/Element.java similarity index 72% rename from cache-client/src/main/java/net/runelite/cache/client/PendingFileRequest.java rename to deobfuscator/src/main/java/net/runelite/asm/attributes/annotation/Element.java index d07dc4f606..18fdfa33f4 100644 --- a/cache-client/src/main/java/net/runelite/cache/client/PendingFileRequest.java +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/annotation/Element.java @@ -22,35 +22,47 @@ * (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.util.concurrent.CompletableFuture; +package net.runelite.asm.attributes.annotation; -public class PendingFileRequest +public class Element { - private final int index; - private final int archive; - private final CompletableFuture future; - - public PendingFileRequest(int index, int archive, CompletableFuture future) + private final Annotation annotation; + private String name; + private Object value; + + public Element(Annotation annotation) { - this.index = index; - this.archive = archive; - this.future = future; + this.annotation = annotation; } - public int getIndex() + public Annotation getAnnotation() { - return index; + return annotation; } - public int getArchive() + public String getName() { - return archive; + return name; } - public CompletableFuture getFuture() + public void setName(String name) { - return future; + this.name = name; + } + + public Object getValue() + { + return value; + } + + public void setValue(Object value) + { + this.value = value; + } + + public String getString() + { + return value.toString(); } } diff --git a/deobfuscator/src/main/java/net/runelite/asm/attributes/code/Exception.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/Exception.java new file mode 100644 index 0000000000..b1209a6631 --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/Exception.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.asm.attributes.code; + +import net.runelite.asm.ClassFile; +import net.runelite.asm.pool.Class; + +public class Exception implements Cloneable +{ + private Exceptions exceptions; + + private Label start, end, handler; + private Class catchType; + + public Exception(Exceptions exceptions) + { + this.exceptions = exceptions; + } + + @Override + public Exception clone() + { + try + { + return (Exception) super.clone(); + } + catch (CloneNotSupportedException ex) + { + throw new RuntimeException(); + } + } + + public Exceptions getExceptions() + { + return exceptions; + } + + public void setExceptions(Exceptions exceptions) + { + this.exceptions = exceptions; + } + + public Label getStart() + { + return start; + } + + public void setStart(Label ins) + { + start = ins; + } + + public Label getEnd() + { + return end; + } + + public void setEnd(Label end) + { + this.end = end; + } + + public Label getHandler() + { + return handler; + } + + public void setHandler(Label handler) + { + this.handler = handler; + } + + public Class getCatchType() + { + return catchType; + } + + public void setCatchType(Class catchType) + { + this.catchType = catchType; + } + + public void renameClass(ClassFile cf, String name) + { + if (catchType != null && cf.getName().equals(catchType.getName())) + catchType = new Class(name); + } +} diff --git a/cache/src/main/java/net/runelite/cache/index/ArchiveData.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/Exceptions.java similarity index 67% rename from cache/src/main/java/net/runelite/cache/index/ArchiveData.java rename to deobfuscator/src/main/java/net/runelite/asm/attributes/code/Exceptions.java index 4bc4427cd1..30b00a0115 100644 --- a/cache/src/main/java/net/runelite/cache/index/ArchiveData.java +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/Exceptions.java @@ -22,63 +22,52 @@ * (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.index; -public class ArchiveData +package net.runelite.asm.attributes.code; + +import java.util.ArrayList; +import java.util.List; +import net.runelite.asm.ClassFile; +import net.runelite.asm.attributes.Code; + +public class Exceptions { - int id; - int nameHash; - int crc; - int revision; - FileData[] files; + private Code code; + private List exceptions = new ArrayList(); - public int getId() + public Exceptions(Code code) { - return id; + this.code = code; } - public void setId(int id) + public void add(Exception e) { - this.id = id; + exceptions.add(e); + } + + public void remove(Exception e) + { + exceptions.remove(e); } - public int getNameHash() + public void clear() { - return nameHash; + exceptions.clear(); } - - public void setNameHash(int nameHash) + + public Code getCode() { - this.nameHash = nameHash; + return code; } - - public int getCrc() + + public List getExceptions() { - return crc; + return exceptions; } - - public void setCrc(int crc) + + public void renameClass(ClassFile cf, String name) { - this.crc = crc; + for (Exception e : exceptions) + e.renameClass(cf, name); } - - public int getRevision() - { - return revision; - } - - public void setRevision(int revision) - { - this.revision = revision; - } - - public FileData[] getFiles() - { - return files; - } - - public void setFiles(FileData[] files) - { - this.files = files; - } -} +} \ No newline at end of file diff --git a/deobfuscator/src/main/java/net/runelite/asm/attributes/code/Instruction.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/Instruction.java new file mode 100644 index 0000000000..bf8e64535e --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/Instruction.java @@ -0,0 +1,144 @@ +/* + * 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.asm.attributes.code; + +import net.runelite.asm.Method; +import net.runelite.asm.execution.Frame; +import net.runelite.asm.execution.InstructionContext; +import org.objectweb.asm.MethodVisitor; + +public abstract class Instruction implements Cloneable +{ + private Instructions instructions; + private InstructionType type; + + public Instruction(Instructions instructions, InstructionType type) + { + this.instructions = instructions; + this.type = type; + } + + @Override + public String toString() + { + if (this.getInstructions() != null) + { + Method m = this.getInstructions().getCode().getMethod(); + return super.toString() + " in " + m;// + " at pc 0x" + Integer.toHexString(this.getPc()); + } + else + { + return super.toString() + " "; + } + } + + @Override + public Instruction clone() + { + Instruction i; + try + { + i = (Instruction) super.clone(); + } + catch (CloneNotSupportedException ex) + { + throw new RuntimeException(ex); + } + + return i; + } + + protected void remove() + { + Exceptions exceptions = instructions.getCode().getExceptions(); + for (Exception e : exceptions.getExceptions()) + { + assert this != e.getStart(); + assert this != e.getEnd(); + assert this != e.getHandler(); + } + } + + public boolean removeStack() + { + assert instructions != null; + + this.getInstructions().remove(this); // calls remove() + + return true; + } + + // resolve jumps + public void resolve() + { + } + + public void accept(MethodVisitor visitor) + { + visitor.visitInsn(this.getType().getCode()); + } + + public Instructions getInstructions() + { + return instructions; + } + + public void setInstructions(Instructions instructions) + { + this.instructions = instructions; + } + + public InstructionType getType() + { + return type; + } + + protected void setType(InstructionType type) + { + this.type = type; + } + + public abstract InstructionContext execute(Frame e); + + /* does this terminate a block? */ + public boolean isTerminal() + { + return false; + } + + // look up symbols from pool + public void lookup() + { + } + + // instructions keep resolved method/field/class names, this updates the pool value (if the underlying resolved object changes) + public void regeneratePool() + { + } + + public void renameClass(String oldName, String newName) + { + } +} diff --git a/deobfuscator/src/main/java/net/runelite/asm/attributes/code/InstructionType.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/InstructionType.java new file mode 100644 index 0000000000..919da1bb02 --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/InstructionType.java @@ -0,0 +1,350 @@ +/* + * 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.asm.attributes.code; + +import net.runelite.asm.attributes.code.instructions.AALoad; +import net.runelite.asm.attributes.code.instructions.AAStore; +import net.runelite.asm.attributes.code.instructions.AConstNull; +import net.runelite.asm.attributes.code.instructions.ALoad; +import net.runelite.asm.attributes.code.instructions.ANewArray; +import net.runelite.asm.attributes.code.instructions.AStore; +import net.runelite.asm.attributes.code.instructions.AThrow; +import net.runelite.asm.attributes.code.instructions.ArrayLength; +import net.runelite.asm.attributes.code.instructions.BALoad; +import net.runelite.asm.attributes.code.instructions.BAStore; +import net.runelite.asm.attributes.code.instructions.BiPush; +import net.runelite.asm.attributes.code.instructions.CALoad; +import net.runelite.asm.attributes.code.instructions.CAStore; +import net.runelite.asm.attributes.code.instructions.CheckCast; +import net.runelite.asm.attributes.code.instructions.D2F; +import net.runelite.asm.attributes.code.instructions.D2I; +import net.runelite.asm.attributes.code.instructions.D2L; +import net.runelite.asm.attributes.code.instructions.DALoad; +import net.runelite.asm.attributes.code.instructions.DAStore; +import net.runelite.asm.attributes.code.instructions.DAdd; +import net.runelite.asm.attributes.code.instructions.DCmpG; +import net.runelite.asm.attributes.code.instructions.DCmpL; +import net.runelite.asm.attributes.code.instructions.DDiv; +import net.runelite.asm.attributes.code.instructions.DLoad; +import net.runelite.asm.attributes.code.instructions.DMul; +import net.runelite.asm.attributes.code.instructions.DNeg; +import net.runelite.asm.attributes.code.instructions.DRem; +import net.runelite.asm.attributes.code.instructions.DStore; +import net.runelite.asm.attributes.code.instructions.DSub; +import net.runelite.asm.attributes.code.instructions.Dup; +import net.runelite.asm.attributes.code.instructions.Dup2; +import net.runelite.asm.attributes.code.instructions.Dup2_X1; +import net.runelite.asm.attributes.code.instructions.Dup2_X2; +import net.runelite.asm.attributes.code.instructions.Dup_X1; +import net.runelite.asm.attributes.code.instructions.Dup_X2; +import net.runelite.asm.attributes.code.instructions.F2D; +import net.runelite.asm.attributes.code.instructions.F2I; +import net.runelite.asm.attributes.code.instructions.F2L; +import net.runelite.asm.attributes.code.instructions.FALoad; +import net.runelite.asm.attributes.code.instructions.FAStore; +import net.runelite.asm.attributes.code.instructions.FAdd; +import net.runelite.asm.attributes.code.instructions.FCmpG; +import net.runelite.asm.attributes.code.instructions.FCmpL; +import net.runelite.asm.attributes.code.instructions.FDiv; +import net.runelite.asm.attributes.code.instructions.FLoad; +import net.runelite.asm.attributes.code.instructions.FMul; +import net.runelite.asm.attributes.code.instructions.FNeg; +import net.runelite.asm.attributes.code.instructions.FRem; +import net.runelite.asm.attributes.code.instructions.FStore; +import net.runelite.asm.attributes.code.instructions.FSub; +import net.runelite.asm.attributes.code.instructions.GetField; +import net.runelite.asm.attributes.code.instructions.GetStatic; +import net.runelite.asm.attributes.code.instructions.Goto; +import net.runelite.asm.attributes.code.instructions.GotoW; +import net.runelite.asm.attributes.code.instructions.I2B; +import net.runelite.asm.attributes.code.instructions.I2C; +import net.runelite.asm.attributes.code.instructions.I2D; +import net.runelite.asm.attributes.code.instructions.I2F; +import net.runelite.asm.attributes.code.instructions.I2L; +import net.runelite.asm.attributes.code.instructions.I2S; +import net.runelite.asm.attributes.code.instructions.IALoad; +import net.runelite.asm.attributes.code.instructions.IAStore; +import net.runelite.asm.attributes.code.instructions.IAdd; +import net.runelite.asm.attributes.code.instructions.IAnd; +import net.runelite.asm.attributes.code.instructions.IConstZero; +import net.runelite.asm.attributes.code.instructions.IDiv; +import net.runelite.asm.attributes.code.instructions.IInc; +import net.runelite.asm.attributes.code.instructions.ILoad; +import net.runelite.asm.attributes.code.instructions.IMul; +import net.runelite.asm.attributes.code.instructions.INeg; +import net.runelite.asm.attributes.code.instructions.IOr; +import net.runelite.asm.attributes.code.instructions.IRem; +import net.runelite.asm.attributes.code.instructions.IShL; +import net.runelite.asm.attributes.code.instructions.IShR; +import net.runelite.asm.attributes.code.instructions.IStore; +import net.runelite.asm.attributes.code.instructions.ISub; +import net.runelite.asm.attributes.code.instructions.IUShR; +import net.runelite.asm.attributes.code.instructions.IXor; +import net.runelite.asm.attributes.code.instructions.IfACmpEq; +import net.runelite.asm.attributes.code.instructions.IfACmpNe; +import net.runelite.asm.attributes.code.instructions.IfCmpGe; +import net.runelite.asm.attributes.code.instructions.IfCmpGt; +import net.runelite.asm.attributes.code.instructions.IfCmpLe; +import net.runelite.asm.attributes.code.instructions.IfCmpLt; +import net.runelite.asm.attributes.code.instructions.IfEq; +import net.runelite.asm.attributes.code.instructions.IfGe; +import net.runelite.asm.attributes.code.instructions.IfGt; +import net.runelite.asm.attributes.code.instructions.IfICmpEq; +import net.runelite.asm.attributes.code.instructions.IfICmpNe; +import net.runelite.asm.attributes.code.instructions.IfLe; +import net.runelite.asm.attributes.code.instructions.IfLt; +import net.runelite.asm.attributes.code.instructions.IfNe; +import net.runelite.asm.attributes.code.instructions.IfNonNull; +import net.runelite.asm.attributes.code.instructions.IfNull; +import net.runelite.asm.attributes.code.instructions.InstanceOf; +import net.runelite.asm.attributes.code.instructions.InvokeDynamic; +import net.runelite.asm.attributes.code.instructions.InvokeInterface; +import net.runelite.asm.attributes.code.instructions.InvokeSpecial; +import net.runelite.asm.attributes.code.instructions.InvokeStatic; +import net.runelite.asm.attributes.code.instructions.InvokeVirtual; +import net.runelite.asm.attributes.code.instructions.L2D; +import net.runelite.asm.attributes.code.instructions.L2F; +import net.runelite.asm.attributes.code.instructions.L2I; +import net.runelite.asm.attributes.code.instructions.LALoad; +import net.runelite.asm.attributes.code.instructions.LAStore; +import net.runelite.asm.attributes.code.instructions.LAdd; +import net.runelite.asm.attributes.code.instructions.LAnd; +import net.runelite.asm.attributes.code.instructions.LCmp; +import net.runelite.asm.attributes.code.instructions.LDC; +import net.runelite.asm.attributes.code.instructions.LDiv; +import net.runelite.asm.attributes.code.instructions.LLoad; +import net.runelite.asm.attributes.code.instructions.LMul; +import net.runelite.asm.attributes.code.instructions.LNeg; +import net.runelite.asm.attributes.code.instructions.LOr; +import net.runelite.asm.attributes.code.instructions.LRem; +import net.runelite.asm.attributes.code.instructions.LShL; +import net.runelite.asm.attributes.code.instructions.LShR; +import net.runelite.asm.attributes.code.instructions.LStore; +import net.runelite.asm.attributes.code.instructions.LSub; +import net.runelite.asm.attributes.code.instructions.LUShR; +import net.runelite.asm.attributes.code.instructions.LXor; +import net.runelite.asm.attributes.code.instructions.LookupSwitch; +import net.runelite.asm.attributes.code.instructions.MonitorEnter; +import net.runelite.asm.attributes.code.instructions.MonitorExit; +import net.runelite.asm.attributes.code.instructions.MultiANewArray; +import net.runelite.asm.attributes.code.instructions.NOP; +import net.runelite.asm.attributes.code.instructions.New; +import net.runelite.asm.attributes.code.instructions.NewArray; +import net.runelite.asm.attributes.code.instructions.Pop; +import net.runelite.asm.attributes.code.instructions.Pop2; +import net.runelite.asm.attributes.code.instructions.PutField; +import net.runelite.asm.attributes.code.instructions.PutStatic; +import net.runelite.asm.attributes.code.instructions.Return; +import net.runelite.asm.attributes.code.instructions.SALoad; +import net.runelite.asm.attributes.code.instructions.SAStore; +import net.runelite.asm.attributes.code.instructions.SiPush; +import net.runelite.asm.attributes.code.instructions.Swap; +import net.runelite.asm.attributes.code.instructions.TableSwitch; +import net.runelite.asm.attributes.code.instructions.VReturn; + +public enum InstructionType +{ + NOP(0x00, "nop", NOP.class), + ACONST_NULL(0x01, "aconst_null", AConstNull.class), + ICONST_0(0x03, "iconst_0", IConstZero.class), + BIPUSH(0x10, "bipush", BiPush.class), + SIPUSH(0x11, "sipush", SiPush.class), + LDC(-1, "ldc", LDC.class), + ILOAD(0x15, "iload", ILoad.class), + LLOAD(0x16, "lload", LLoad.class), + FLOAD(0x17, "fload", FLoad.class), + DLOAD(0x18, "dload", DLoad.class), + ALOAD(0x19, "aload", ALoad.class), + IALOAD(0x2e, "iaload", IALoad.class), + LALOAD(0x2f, "laload", LALoad.class), + FALOAD(0x30, "faload", FALoad.class), + DALOAD(0x31, "daload", DALoad.class), + AALOAD(0x32, "aaload", AALoad.class), + BALOAD(0x33, "baload", BALoad.class), + CALOAD(0x34, "caload", CALoad.class), + SALOAD(0x35, "saload", SALoad.class), + ISTORE(0x36, "istore", IStore.class), + LSTORE(0x37, "lstore", LStore.class), + FSTORE(0x38, "fstore", FStore.class), + DSTORE(0x39, "dstore", DStore.class), + ASTORE(0x3a, "astore", AStore.class), + IASTORE(0x4f, "iastore", IAStore.class), + LASTORE(0x50, "lastore", LAStore.class), + FASTORE(0x51, "fastore", FAStore.class), + DASTORE(0x52, "dastore", DAStore.class), + AASTORE(0x53, "aastore", AAStore.class), + BASTORE(0x54, "bastore", BAStore.class), + CASTORE(0x55, "castore", CAStore.class), + SASTORE(0x56, "sastore", SAStore.class), + POP(0x57, "pop", Pop.class), + POP2(0x58, "pop2", Pop2.class), + DUP(0x59, "dup", Dup.class), + DUP_X1(0x5a, "dup_x1", Dup_X1.class), + DUP_X2(0x5b, "dup_x2", Dup_X2.class), + DUP2(0x5c, "dup2", Dup2.class), + DUP2_X1(0x5d, "dup2_x1", Dup2_X1.class), + DUP2_X2(0x5e, "dup2_x2", Dup2_X2.class), + SWAP(0x5f, "swap", Swap.class), + IADD(0x60, "iadd", IAdd.class), + LADD(0x61, "ladd", LAdd.class), + FADD(0x62, "fadd", FAdd.class), + DADD(0x63, "dadd", DAdd.class), + ISUB(0x64, "isub", ISub.class), + LSUB(0x65, "lsub", LSub.class), + FSUB(0x66, "fsub", FSub.class), + DSUB(0x67, "dsub", DSub.class), + IMUL(0x68, "imul", IMul.class), + LMUL(0x69, "lmul", LMul.class), + FMUL(0x6a, "fmul", FMul.class), + DMUL(0x6b, "dmul", DMul.class), + IDIV(0x6c, "idiv", IDiv.class), + LDIV(0x6d, "ldiv", LDiv.class), + FDIV(0x6e, "fdiv", FDiv.class), + DDIV(0x6f, "ddiv", DDiv.class), + IREM(0x70, "irem", IRem.class), + LREM(0x71, "lrem", LRem.class), + FREM(0x72, "frem", FRem.class), + DREM(0x73, "drem", DRem.class), + INEG(0x74, "ineg", INeg.class), + LNEG(0x75, "lneg", LNeg.class), + FNEG(0x76, "fneg", FNeg.class), + DNEG(0x77, "dneg", DNeg.class), + ISHL(0x78, "ishl", IShL.class), + LSHL(0x79, "lshl", LShL.class), + ISHR(0x7a, "ishr", IShR.class), + LSHR(0x7b, "lshr", LShR.class), + IUSHR(0x7c, "iushr", IUShR.class), + LUSHR(0x7d, "lushr", LUShR.class), + IAND(0x7e, "iand", IAnd.class), + LAND(0x7f, "land", LAnd.class), + IOR(0x80, "ior", IOr.class), + LOR(0x81, "lor", LOr.class), + IXOR(0x82, "ixor", IXor.class), + LXOR(0x83, "lxor", LXor.class), + IINC(0x84, "iinc", IInc.class), + I2L(0x85, "i2l", I2L.class), + I2F(0x86, "i2f", I2F.class), + I2D(0x87, "i2d", I2D.class), + L2I(0x88, "l2i", L2I.class), + L2F(0x89, "l2f", L2F.class), + L2D(0x8a, "l2d", L2D.class), + F2I(0x8b, "f2i", F2I.class), + F2L(0x8c, "f2l", F2L.class), + F2D(0x8d, "f2d", F2D.class), + D2I(0x8e, "d2i", D2I.class), + D2L(0x8f, "d2l", D2L.class), + D2F(0x90, "d2f", D2F.class), + I2B(0x91, "i2b", I2B.class), + I2C(0x92, "i2c", I2C.class), + I2S(0x93, "i2s", I2S.class), + LCMP(0x94, "lcmp", LCmp.class), + FCMPL(0x95, "fcmpl", FCmpL.class), + FCMPG(0x96, "fcmpg", FCmpG.class), + DCMPL(0x97, "dcmpl", DCmpL.class), + DCMPG(0x98, "dcmpg", DCmpG.class), + IFEQ(0x99, "ifeq", IfEq.class), + IFNE(0x9a, "ifne", IfNe.class), + IFLT(0x9b, "iflt", IfLt.class), + IFGE(0x9c, "ifge", IfGe.class), + IFGT(0x9d, "ifgt", IfGt.class), + IFLE(0x9e, "ifle", IfLe.class), + IF_ICMPEQ(0x9f, "if_icmpeq", IfICmpEq.class), + IF_ICMPNE(0xa0, "if_icmpne", IfICmpNe.class), + IF_ICMPLT(0xa1, "if_cmplt", IfCmpLt.class), + IF_ICMPGE(0xa2, "if_icmpge", IfCmpGe.class), + IF_ICMPGT(0xa3, "if_icmpgt", IfCmpGt.class), + IF_ICMPLE(0xa4, "if_icmple", IfCmpLe.class), + IF_ACMPEQ(0xa5, "if_acmpeq", IfACmpEq.class), + IF_ACMPNE(0xa6, "if_acmpne", IfACmpNe.class), + GOTO(0xa7, "goto", Goto.class), + TABLESWITCH(0xaa, "tableswitch", TableSwitch.class), + LOOKUPSWITCH(0xab, "lookupswitch", LookupSwitch.class), + IRETURN(0xac, "ireturn", Return.class), + LRETURN(0xad, "lreturn", Return.class), + FRETURN(0xae, "freturn", Return.class), + DRETURN(0xaf, "dreturn", Return.class), + ARETURN(0xb0, "areturn", Return.class), + RETURN(0xb1, "return", VReturn.class), + GETSTATIC(0xb2, "getstatic", GetStatic.class), + PUTSTATIC(0xb3, "putstatic", PutStatic.class), + GETFIELD(0xb4, "getfield", GetField.class), + PUTFIELD(0xb5, "putfield", PutField.class), + INVOKEVIRTUAL(0xb6, "invokevirtual", InvokeVirtual.class), + INVOKESPECIAL(0xb7, "invokespecial", InvokeSpecial.class), + INVOKESTATIC(0xb8, "invokestatic", InvokeStatic.class), + INVOKEINTERFACE(0xb9, "invokeinterface", InvokeInterface.class), + INVOKEDYNAMIC(0xba, "invokedynamic", InvokeDynamic.class), + NEW(0xbb, "new", New.class), + NEWARRAY(0xbc, "newarray", NewArray.class), + ANEWARRAY(0xbd, "anewarray", ANewArray.class), + ARRAYLENGTH(0xbe, "arraylength", ArrayLength.class), + ATHROW(0xbf, "athrow", AThrow.class), + CHECKCAST(0xc0, "checkcast", CheckCast.class), + INSTANCEOf(0xc1, "instanceof", InstanceOf.class), + MONITORENTER(0xc2, "monitorenter", MonitorEnter.class), + MONITOREXIT(0xc3, "monitorexit", MonitorExit.class), + MULTIANEWARRAY(0xc5, "multianewarray", MultiANewArray.class), + IFNULL(0xc6, "ifnull", IfNull.class), + IFNONNULL(0xc7, "ifnonnull", IfNonNull.class), + GOTO_W(0xc8, "goto_w", GotoW.class); + + private final int code; + private final String name; + private final Class clazz; + + InstructionType(int op, String name, Class clazz) + { + this.code = op; + this.name = name; + this.clazz = clazz; + } + + public int getCode() + { + return code; + } + + public String getName() + { + return name; + } + + public Class getInstructionClass() + { + return clazz; + } + + public static InstructionType findInstructionFromCode(int code) + { + for (InstructionType t : InstructionType.values()) + { + if (t.getCode() == code) + { + return t; + } + } + return null; + } +} diff --git a/deobfuscator/src/main/java/net/runelite/asm/attributes/code/Instructions.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/Instructions.java new file mode 100644 index 0000000000..a528950d0a --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/Instructions.java @@ -0,0 +1,189 @@ +/* + * 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.asm.attributes.code; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import net.runelite.asm.attributes.Code; + +public class Instructions +{ + private final Code code; + private final List instructions = new ArrayList<>(); + private final Map labelMap = new HashMap<>(); + + public Instructions(Code code) + { + this.code = code; + } + + public Label createLabelFor(Instruction target) + { + return createLabelFor(target, false); + } + + public Label createLabelFor(Instruction target, boolean forceCreate) + { + assert target.getInstructions() == this; + assert instructions.contains(target); + + if (target instanceof Label) + { + return (Label) target; + } + + int i = instructions.indexOf(target); + if (i > 0) + { + Instruction before = instructions.get(i - 1); + + if (!forceCreate && before instanceof Label) + { + return (Label) before; + } + } + + Label label = new Label(this); + label.setLabel(new org.objectweb.asm.Label()); + instructions.add(i, label); + labelMap.put(label.getLabel(), label); + return label; + } + + public Label findLabel(org.objectweb.asm.Label l) + { + Label label = labelMap.get(l); + assert label != null; + return label; + } + + public Label findOrCreateLabel(org.objectweb.asm.Label l) + { + Label label = labelMap.get(l); + if (label != null) + { + return label; + } + + label = new Label(this, l); + labelMap.put(l, label); + + return label; + } + + public void rebuildLabels() + { + labelMap.clear(); + + // ow2 asm requires new Labels each time you write out a class + // with ClassWriter, or else it crytpically fails + for (Instruction i : instructions) + { + if (i instanceof Label) + { + org.objectweb.asm.Label label = new org.objectweb.asm.Label(); + ((Label) i).setLabel(label); + + labelMap.put(label, (Label) i); + } + } + } + + public List getInstructions() + { + return instructions; + } + + public void addInstruction(Instruction i) + { + assert i.getInstructions() == this; + instructions.add(i); + } + + public void addInstruction(int idx, Instruction i) + { + assert i.getInstructions() == this; + instructions.add(idx, i); + } + + public void remove(Instruction ins) + { + assert ins.getInstructions() == this; + ins.remove(); + instructions.remove(ins); + ins.setInstructions(null); + } + + public void clear() + { + for (Instruction ins : instructions) + { + ins.remove(); + ins.setInstructions(null); + } + instructions.clear(); + } + + public Code getCode() + { + return code; + } + + public void lookup() + { + for (Instruction i : instructions) + { + i.lookup(); + } + } + + public void regeneratePool() + { + for (Instruction i : instructions) + { + i.regeneratePool(); + } + } + + public int replace(Instruction oldi, Instruction newi) + { + assert oldi != newi; + + assert oldi.getInstructions() == this; + assert newi.getInstructions() == this; + + assert instructions.contains(oldi); + assert !instructions.contains(newi); + + int i = instructions.indexOf(oldi); + instructions.remove(oldi); + oldi.setInstructions(null); + instructions.add(i, newi); + + return i; + } +} diff --git a/deobfuscator/src/main/java/net/runelite/asm/attributes/code/Label.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/Label.java new file mode 100644 index 0000000000..7f2cd70ffd --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/Label.java @@ -0,0 +1,128 @@ +/* + * 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.asm.attributes.code; + +import net.runelite.asm.attributes.code.instructions.NOP; +import org.objectweb.asm.MethodVisitor; + +public class Label extends NOP +{ + private org.objectweb.asm.Label label; + private Integer lineNumber; + + public Label(Instructions instructions) + { + super(instructions); + } + + public Label(Instructions instructions, org.objectweb.asm.Label label) + { + super(instructions); + this.label = label; + } + + @Override + public String toString() + { + String string; + + if (this.getInstructions() == null) + { + string = "label "; + } + else + { + Instruction next = next(); + + if (next == null) + { + string = "label with no next instruction"; + } + else + { + string = "label " + next.toString(); + } + } + + if (lineNumber != null) + { + string += " on line number " + lineNumber; + } + + return string; + } + + @Override + public Instruction clone() + { + Label l = (Label) super.clone(); + l.label = new org.objectweb.asm.Label(); + l.lineNumber = lineNumber; + return l; + } + + @Override + public void accept(MethodVisitor visitor) + { + visitor.visitLabel(label); + + if (lineNumber != null) + { + visitor.visitLineNumber(lineNumber, label); + } + } + + public org.objectweb.asm.Label getLabel() + { + return label; + } + + public void setLabel(org.objectweb.asm.Label label) + { + this.label = label; + } + + public void setLineNumber(Integer lineNumber) + { + this.lineNumber = lineNumber; + } + + public Instruction next() + { + Instructions ins = this.getInstructions(); + int i = ins.getInstructions().indexOf(this); + assert i != -1; + + Instruction next; + do + { + next = ins.getInstructions().get(i + 1); + ++i; + } + while (next instanceof Label); + + return next; + } +} diff --git a/protocol-api/src/main/java/net/runelite/protocol/api/update/ArchiveRequestPacket.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/LocalVariable.java similarity index 65% rename from protocol-api/src/main/java/net/runelite/protocol/api/update/ArchiveRequestPacket.java rename to deobfuscator/src/main/java/net/runelite/asm/attributes/code/LocalVariable.java index fd545b8745..3956b453d1 100644 --- a/protocol-api/src/main/java/net/runelite/protocol/api/update/ArchiveRequestPacket.java +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/LocalVariable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Adam + * Copyright (c) 2018 Morgan Lewis * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -22,47 +22,56 @@ * (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.protocol.api.update; +package net.runelite.asm.attributes.code; -public class ArchiveRequestPacket +import org.objectweb.asm.Label; + +public class LocalVariable { - private boolean priority; - private int index; - private int archive; + private final String name; + private final String desc; + private final String signature; + private final Label start; + private final Label end; + private final int index; - @Override - public String toString() + public LocalVariable(String name, String desc, String signature, Label start, Label end, int index) { - return "ArchiveRequestPacket{" + "priority=" + priority + ", index=" + index + ", archive=" + archive + '}'; + this.name = name; + this.desc = desc; + this.signature = signature; + this.start = start; + this.end = end; + this.index = index; } - public boolean isPriority() + public String getName() { - return priority; + return name; } - public void setPriority(boolean priority) + public String getDesc() { - this.priority = priority; + return desc; + } + + public String getSignature() + { + return signature; + } + + public Label getStart() + { + return start; + } + + public Label getEnd() + { + return end; } public int getIndex() { return index; } - - public void setIndex(int index) - { - this.index = index; - } - - public int getArchive() - { - return archive; - } - - public void setArchive(int archive) - { - this.archive = archive; - } } diff --git a/http-service/src/main/java/net/runelite/http/service/account/State.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/Parameter.java similarity index 73% rename from http-service/src/main/java/net/runelite/http/service/account/State.java rename to deobfuscator/src/main/java/net/runelite/asm/attributes/code/Parameter.java index 50b47b2c19..b42a41a4b5 100644 --- a/http-service/src/main/java/net/runelite/http/service/account/State.java +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/Parameter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Adam + * Copyright (c) 2018 Morgan Lewis * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -22,32 +22,37 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.http.service.account; +package net.runelite.asm.attributes.code; -import java.util.UUID; - -public class State +public class Parameter { - private UUID uuid; - private String apiVersion; + private final String name; + private final int access; + private LocalVariable localVariable; - public UUID getUuid() + public Parameter(String name, int access) { - return uuid; + this.name = name; + this.access = access; } - public void setUuid(UUID uuid) + public String getName() { - this.uuid = uuid; + return name; } - public String getApiVersion() + public int getAccess() { - return apiVersion; + return access; } - public void setApiVersion(String apiVersion) + public LocalVariable getLocalVariable() { - this.apiVersion = apiVersion; + return localVariable; + } + + public void setLocalVariable(LocalVariable localVariable) + { + this.localVariable = localVariable; } } diff --git a/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/AdditionInstruction.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/AdditionInstruction.java new file mode 100644 index 0000000000..0fbb69ab1d --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/AdditionInstruction.java @@ -0,0 +1,121 @@ +/* + * 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.asm.attributes.code.instruction.types; + +import net.runelite.asm.Field; +import net.runelite.asm.attributes.code.Instruction; +import net.runelite.asm.execution.InstructionContext; +import net.runelite.asm.execution.StackContext; +import net.runelite.deob.deobfuscators.mapping.MappingExecutorUtil; +import net.runelite.deob.deobfuscators.mapping.ParallelExecutorMapping; + +public interface AdditionInstruction extends MappableInstruction +{ + default InstructionContext findArrayLoad(InstructionContext ic1, InstructionContext ic2) + { + Instruction i1 = ic1.getInstruction(); + Instruction i2 = ic2.getInstruction(); + + if (i1 instanceof ArrayLoad && !(i2 instanceof ArrayLoad)) + { + return ic1; + } + if (i2 instanceof ArrayLoad && !(i1 instanceof ArrayLoad)) + { + return ic2; + } + + return null; + } + + @Override + default void map(ParallelExecutorMapping mappings, InstructionContext ctx, InstructionContext other) + { + /* lhs/rhs of addition instructions are randomally swapped, but + * we still map if each side is recognizable + * + * N.B. since the lhs/rhs of nested iadds can be swapped, and + * the mapper maps the first that it encounters, this can certainly + * attempt to map the wrong instructions even when mapping the correct + * method, so be careful. + */ + StackContext ctx1 = ctx.getPops().get(0); + StackContext ctx2 = ctx.getPops().get(1); + + StackContext other1 = other.getPops().get(0); + StackContext other2 = other.getPops().get(1); + + InstructionContext rc1 = ctx1.getPushed().resolve(ctx1); + InstructionContext rc2 = ctx2.getPushed().resolve(ctx2); //iaload + + InstructionContext ro1 = other1.getPushed().resolve(other1); + InstructionContext ro2 = other2.getPushed().resolve(other2); //iaload + + // There are a couple static final arrays that are only ever read from 1 or 2 places.. and never written + InstructionContext al1 = findArrayLoad(rc1, rc2); + InstructionContext al2 = findArrayLoad(ro1, ro2); + + if (al1 == null || al2 == null) + { + return; + } + + StackContext array1 = al1.getPops().get(1); + StackContext array2 = al2.getPops().get(1); + + InstructionContext field1 = array1.getPushed().resolve(array1); + InstructionContext field2 = array2.getPushed().resolve(array2); + + if (!(field1.getInstruction() instanceof GetFieldInstruction) || !(field2.getInstruction() instanceof GetFieldInstruction)) + { + return; + } + + GetFieldInstruction gf1 = (GetFieldInstruction) field1.getInstruction(); + GetFieldInstruction gf2 = (GetFieldInstruction) field2.getInstruction(); + + Field f1 = gf1.getMyField(); + Field f2 = gf2.getMyField(); + + if (f1 == null || f2 == null || !MappingExecutorUtil.isMaybeEqual(f1, f2)) + { + return; + } + + mappings.map((Instruction) this, f1, f2); + } + + @Override + default boolean isSame(InstructionContext thisIc, InstructionContext otherIc) + { + return this.getClass() == otherIc.getInstruction().getClass(); + } + + @Override + default boolean canMap(InstructionContext thisIc) + { + return true; + } +} diff --git a/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/ArrayLoad.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/ArrayLoad.java new file mode 100644 index 0000000000..da196f0056 --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/ArrayLoad.java @@ -0,0 +1,84 @@ +/* + * 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.asm.attributes.code.instruction.types; + +import net.runelite.asm.attributes.code.Instruction; +import net.runelite.asm.execution.InstructionContext; +import net.runelite.asm.execution.StackContext; +import net.runelite.deob.deobfuscators.mapping.MappingExecutorUtil; +import net.runelite.deob.deobfuscators.mapping.ParallelExecutorMapping; + +public interface ArrayLoad extends MappableInstruction +{ + @Override + default void map(ParallelExecutorMapping mappings, InstructionContext ctx, InstructionContext other) + { + StackContext index1 = ctx.getPops().get(0), + index2 = other.getPops().get(0); + + InstructionContext ctx1 = MappingExecutorUtil.resolve(index1.getPushed(), index1), + ctx2 = MappingExecutorUtil.resolve(index2.getPushed(), index2); + + assert ctx1.getInstruction() instanceof GetFieldInstruction; + assert ctx2.getInstruction() instanceof GetFieldInstruction; + + GetFieldInstruction gf1 = (GetFieldInstruction) ctx1.getInstruction(); + GetFieldInstruction gf2 = (GetFieldInstruction) ctx2.getInstruction(); + mappings.map((Instruction) this, gf1.getMyField(), gf2.getMyField()); + } + + @Override + default boolean isSame(InstructionContext thisIc, InstructionContext otherIc) + { + if (thisIc.getInstruction().getType() != otherIc.getInstruction().getType()) + { + return false; + } + + StackContext index1 = thisIc.getPops().get(0), + index2 = otherIc.getPops().get(0); + + InstructionContext ctx1 = MappingExecutorUtil.resolve(index1.getPushed(), index1), + ctx2 = MappingExecutorUtil.resolve(index2.getPushed(), index2); + + assert ctx1.getInstruction() instanceof GetFieldInstruction; + assert ctx2.getInstruction() instanceof GetFieldInstruction; + + GetFieldInstruction gf1 = (GetFieldInstruction) ctx1.getInstruction(); + GetFieldInstruction gf2 = (GetFieldInstruction) ctx2.getInstruction(); + + return MappingExecutorUtil.isMaybeEqual(gf1.getMyField(), gf2.getMyField()); + } + + @Override + default boolean canMap(InstructionContext thisIc) + { + // assume that obfuscation can't remove a load with a variable + // index. map field access. + StackContext index = thisIc.getPops().get(0); + InstructionContext ctx = MappingExecutorUtil.resolve(index.getPushed(), index); + return ctx.getInstruction() instanceof GetFieldInstruction; + } +} diff --git a/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/ArrayStoreInstruction.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/ArrayStoreInstruction.java new file mode 100644 index 0000000000..de019ce9e0 --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/ArrayStoreInstruction.java @@ -0,0 +1,31 @@ +/* + * 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.asm.attributes.code.instruction.types; + +public interface ArrayStoreInstruction extends MappableInstruction +{ + +} diff --git a/runescape-api/src/main/java/net/runelite/rs/api/RSSprite.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/ComparisonInstruction.java similarity index 93% rename from runescape-api/src/main/java/net/runelite/rs/api/RSSprite.java rename to deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/ComparisonInstruction.java index 6f6cd9b67c..25e0cdf1da 100644 --- a/runescape-api/src/main/java/net/runelite/rs/api/RSSprite.java +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/ComparisonInstruction.java @@ -22,8 +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.rs.api; -public interface RSSprite +package net.runelite.asm.attributes.code.instruction.types; + +public interface ComparisonInstruction { + } diff --git a/cache/src/main/java/net/runelite/cache/fs/jagex/DataFileWriteResult.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/ConversionInstruction.java similarity index 92% rename from cache/src/main/java/net/runelite/cache/fs/jagex/DataFileWriteResult.java rename to deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/ConversionInstruction.java index 7a7d651d74..099b281725 100644 --- a/cache/src/main/java/net/runelite/cache/fs/jagex/DataFileWriteResult.java +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/ConversionInstruction.java @@ -23,9 +23,9 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.cache.fs.jagex; +package net.runelite.asm.attributes.code.instruction.types; -public class DataFileWriteResult +public interface ConversionInstruction { - public int sector, compressedLength; + } diff --git a/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/DivisionInstruction.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/DivisionInstruction.java new file mode 100644 index 0000000000..f682748a65 --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/DivisionInstruction.java @@ -0,0 +1,86 @@ +/* + * 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.asm.attributes.code.instruction.types; + +import net.runelite.asm.Field; +import net.runelite.asm.attributes.code.Instruction; +import net.runelite.asm.execution.InstructionContext; +import net.runelite.asm.execution.StackContext; +import net.runelite.deob.deobfuscators.mapping.MappingExecutorUtil; +import net.runelite.deob.deobfuscators.mapping.ParallelExecutorMapping; + +public interface DivisionInstruction extends MappableInstruction +{ + @Override + default void map(ParallelExecutorMapping mappings, InstructionContext ctx, InstructionContext other) + { + StackContext s1 = ctx.getPops().get(0), + s2 = ctx.getPops().get(1); + + StackContext o1 = other.getPops().get(0), + o2 = other.getPops().get(1); + + InstructionContext i1 = MappingExecutorUtil.resolve(s1.getPushed(), s1); + InstructionContext i2 = MappingExecutorUtil.resolve(s2.getPushed(), s2); + + InstructionContext io1 = MappingExecutorUtil.resolve(o1.getPushed(), o1); + InstructionContext io2 = MappingExecutorUtil.resolve(o2.getPushed(), o2); + + if (i1.getInstruction() instanceof GetFieldInstruction && io1.getInstruction() instanceof GetFieldInstruction) + { + GetFieldInstruction f1 = (GetFieldInstruction) i1.getInstruction(); + GetFieldInstruction f2 = (GetFieldInstruction) io1.getInstruction(); + + Field fi1 = f1.getMyField(), fi2 = f2.getMyField(); + + if (fi1 != null && fi2 != null) + mappings.map((Instruction) this, fi1, fi2); + } + + if (i2.getInstruction() instanceof GetFieldInstruction && io2.getInstruction() instanceof GetFieldInstruction) + { + GetFieldInstruction f1 = (GetFieldInstruction) i2.getInstruction(); + GetFieldInstruction f2 = (GetFieldInstruction) io2.getInstruction(); + + Field fi1 = f1.getMyField(), fi2 = f2.getMyField(); + + if (fi1 != null && fi2 != null) + mappings.map((Instruction) this, fi1, fi2); + } + } + + @Override + default boolean isSame(InstructionContext thisIc, InstructionContext otherIc) + { + return this.getClass() == otherIc.getInstruction().getClass(); + } + + @Override + default boolean canMap(InstructionContext thisIc) + { + return true; + } +} diff --git a/runescape-api/src/main/java/net/runelite/rs/api/RSItem.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/DupInstruction.java similarity index 68% rename from runescape-api/src/main/java/net/runelite/rs/api/RSItem.java rename to deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/DupInstruction.java index 4f451cf028..93ccb70e45 100644 --- a/runescape-api/src/main/java/net/runelite/rs/api/RSItem.java +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/DupInstruction.java @@ -22,39 +22,30 @@ * (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.rs.api; -import net.runelite.api.Item; -import net.runelite.api.Tile; -import net.runelite.mapping.Import; +package net.runelite.asm.attributes.code.instruction.types; -public interface RSItem extends RSRenderable, Item +import java.util.List; +import net.runelite.asm.execution.InstructionContext; +import net.runelite.asm.execution.StackContext; + +public interface DupInstruction { - @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); + StackContext getOriginal(StackContext sctx); + + StackContext getOtherBranch(StackContext sctx); /** - * Get the tile this item is on + * get the duplicated stackcontexts (which is popped from this) + * @param ictx instruction context for this instruction * @return */ - Tile getTile(); + List getDuplicated(InstructionContext ictx); + + /** + * get the copied stackcontexts (pushed from this) + * @param ictx + * @return + */ + List getCopies(InstructionContext ictx); } diff --git a/cache/src/main/java/net/runelite/cache/region/Location.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/FieldInstruction.java similarity index 86% rename from cache/src/main/java/net/runelite/cache/region/Location.java rename to deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/FieldInstruction.java index 7cf59f8e1c..e9ed4999ff 100644 --- a/cache/src/main/java/net/runelite/cache/region/Location.java +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/FieldInstruction.java @@ -22,16 +22,15 @@ * (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.attributes.code.instruction.types; -package net.runelite.cache.region; +import net.runelite.asm.pool.Field; -import lombok.Value; - -@Value -public class Location +public interface FieldInstruction { - private final int id; - private final int type; - private final int orientation; - private final Position position; + Field getField(); + + void setField(Field field); + + net.runelite.asm.Field getMyField(); } diff --git a/runescape-api/src/main/java/net/runelite/rs/api/RSFriend.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/GetFieldInstruction.java similarity index 91% rename from runescape-api/src/main/java/net/runelite/rs/api/RSFriend.java rename to deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/GetFieldInstruction.java index 0948c5fc85..f5a5af480a 100644 --- a/runescape-api/src/main/java/net/runelite/rs/api/RSFriend.java +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/GetFieldInstruction.java @@ -22,10 +22,9 @@ * (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.rs.api; -import net.runelite.api.Friend; +package net.runelite.asm.attributes.code.instruction.types; -public interface RSFriend extends Friend, RSChatPlayer +public interface GetFieldInstruction extends FieldInstruction { } diff --git a/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/IntInstruction.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/IntInstruction.java new file mode 100644 index 0000000000..2bc361ef44 --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/IntInstruction.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.asm.attributes.code.instruction.types; + +public interface IntInstruction +{ + int getOperand(); + + void setOperand(int operand); +} diff --git a/runescape-api/src/main/java/net/runelite/rs/api/RSNPC.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/InvokeInstruction.java similarity index 80% rename from runescape-api/src/main/java/net/runelite/rs/api/RSNPC.java rename to deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/InvokeInstruction.java index fc4bfcc714..9396f974de 100644 --- a/runescape-api/src/main/java/net/runelite/rs/api/RSNPC.java +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/InvokeInstruction.java @@ -22,21 +22,18 @@ * (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.rs.api; +package net.runelite.asm.attributes.code.instruction.types; -import net.runelite.api.NPC; -import net.runelite.mapping.Import; +import java.util.List; +import net.runelite.asm.Method; -public interface RSNPC extends RSActor, NPC +public interface InvokeInstruction extends MappableInstruction { - @Import("composition") - @Override - RSNPCComposition getComposition(); + void removeParameter(int idx); - @Override - int getIndex(); + net.runelite.asm.pool.Method getMethod(); - void setIndex(int id); + void setMethod(net.runelite.asm.pool.Method method); - void setDead(boolean dead); + List getMethods(); } diff --git a/runescape-api/src/main/java/net/runelite/rs/api/RSBuffer.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/JumpingInstruction.java similarity index 83% rename from runescape-api/src/main/java/net/runelite/rs/api/RSBuffer.java rename to deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/JumpingInstruction.java index 0c357c3fee..fc1dda4b3a 100644 --- a/runescape-api/src/main/java/net/runelite/rs/api/RSBuffer.java +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/JumpingInstruction.java @@ -22,15 +22,16 @@ * (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.rs.api; +package net.runelite.asm.attributes.code.instruction.types; -import net.runelite.mapping.Import; +import java.util.List; +import net.runelite.asm.attributes.code.Label; -public interface RSBuffer extends RSNode +public interface JumpingInstruction { - @Import("payload") - byte[] getPayload(); + List