commit 558636579c2c2df5941525d9af1f6e5a4ef658cc Author: noil Date: Sun Oct 27 11:45:44 2019 -0400 First commit to new GitHub repo. diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2c770e0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,22 @@ +# eclipse +bin +*.launch +.settings +.metadata +.classpath +.project + +# idea +out +*.ipr +*.iws +*.iml +.idea + +# gradle +build +.gradle + +# other +eclipse +run diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..701fa55 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,31 @@ +image: java:8 + +# Disable the Gradle daemon for Continuous Integration servers as correctness +# is usually a priority over speed in CI environments. Using a fresh +# runtime for each build is more reliable since the runtime is completely +# isolated from any previous builds. + +# TODO: work out shadowjar nonsense +variables: + GRADLE_OPTS: "-Dorg.gradle.daemon=false" + +before_script: + - export GRADLE_USER_HOME=`pwd`/.gradle + +build: + stage: build + script: + - sed -i 's/IDE/RELEASE/g' src/main/java/me/rigamortis/seppuku/impl/fml/core/SeppukuClassTransformer.java + - chmod +x gradlew + - ./gradlew setupDecompWorkspace + - ./gradlew build + artifacts: + paths: + - build/libs/*.jar + expire_in: 1 month + cache: + key: "$CI_COMMIT_REF_NAME" + policy: push + paths: + - build + - .gradle diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..3e4674c --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is 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. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + 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. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + 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 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. Use with the GNU Affero General Public License. + + 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 Affero 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 special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU 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 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 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 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. + + Seppuku-MC 1.12.2 + Copyright (C) 2019 riga + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Seppuku-MC 1.12.2 Copyright (C) 2019 riga + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + 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 GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/README.md b/README.md new file mode 100644 index 0000000..e428049 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +strong hack \ No newline at end of file diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..42c1b62 --- /dev/null +++ b/build.gradle @@ -0,0 +1,120 @@ +buildscript { + repositories { + jcenter() + + maven { + url = "http://files.minecraftforge.net/maven" + } + } + + dependencies { + classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT' + classpath "com.github.jengelman.gradle.plugins:shadow:1.2.3" + } +} + +apply plugin: 'net.minecraftforge.gradle.forge' +//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. + +apply plugin: "com.github.johnrengelman.shadow" + +version = "1.0" +group = "com.yourname.modid" // http://maven.apache.org/guides/mini/guide-naming-conventions.html +archivesBaseName = "seppuku-1.12.2" + +sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. +compileJava { + sourceCompatibility = targetCompatibility = '1.8' +} + +minecraft { + version = "1.12.2-14.23.5.2768" + runDir = "run" + + // the mappings can be changed at any time, and must be in the following format. + // snapshot_YYYYMMDD snapshot are built nightly. + // stable_# stables are built at the discretion of the MCP team. + // Use non-default mappings at your own risk. they may not always work. + // simply re-run your setup task after changing the mappings to update your workspace. + mappings = "snapshot_20171003" + // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. +} + +dependencies { + compile files('lib/json-simple-1.1.1.jar') +} + +jar { + manifest { + attributes 'FMLCorePlugin': 'me.rigamortis.seppuku.impl.fml.core.SeppukuLoadingPlugin' + attributes 'FMLCorePluginContainsFMLMod': 'true' + attributes 'FMLAT': 'seppuku_at.cfg' + } +} + +reobf { + jar { + mappingType = 'SEARGE' + } + + shadowJar { + //mappingType = 'NOTCH' + mappingType = 'SEARGE' + classpath = sourceSets.main.compileClasspath + } +} + +shadowJar { + dependencies { + include(dependency('org.json.simple:parser')) + include(dependency('net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT')) + } + + manifest { + attributes 'FMLCorePlugin': 'me.rigamortis.seppuku.impl.fml.core.SeppukuLoadingPlugin' + attributes 'FMLCorePluginContainsFMLMod': 'true' + attributes 'FMLAT': 'seppuku_at.cfg' + } + + exclude 'dummyThing' + exclude 'LICENSE.txt' + classifier = 'full' +} + +task signJar(type: SignJar, dependsOn: reobfJar) { + onlyIf { + project.hasProperty('keyStore') + } + + keyStore = project.findProperty('keyStore') + alias = project.findProperty('keyStoreAlias') + storePass = project.findProperty('keyStorePass') + keyPass = project.findProperty('keyStoreKeyPass') + inputFile = jar.archivePath + outputFile = jar.archivePath +} + +build.dependsOn {[ + 'shadowJar', + 'reobfShadowJar', + 'signJar' +]} + +processResources { + // this will ensure that this task is redone when the versions change. + inputs.property "version", project.version + inputs.property "mcversion", project.minecraft.version + + // replace stuff in mcmod.info, nothing else + from(sourceSets.main.resources.srcDirs) { + include 'mcmod.info' + + // replace version and mcversion + expand 'version':project.version, 'mcversion':project.minecraft.version + } + + // copy everything else except the mcmod.info + from(sourceSets.main.resources.srcDirs) { + exclude 'mcmod.info' + } +} diff --git a/classes/production/seppuku-1.12.2_main/mcmod.info b/classes/production/seppuku-1.12.2_main/mcmod.info new file mode 100644 index 0000000..7f2f84a --- /dev/null +++ b/classes/production/seppuku-1.12.2_main/mcmod.info @@ -0,0 +1,16 @@ +[ +{ + "modid": "seppukumod", + "name": "Seppuku", + "description": "Seppuku is a hacked client built on forge", + "version": "${version}", + "mcversion": "${mcversion}", + "url": "http://seppuku.pw", + "updateUrl": "http://seppuku.pw", + "authorList": ["Riga"], + "credits": "Riga, Dan, Noil, D3x, TheCyberBrick, Hal", + "logoFile": "", + "screenshots": [], + "dependencies": [] +} +] diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/Seppuku.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/Seppuku.class new file mode 100644 index 0000000..b230263 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/Seppuku.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/command/Command.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/command/Command.class new file mode 100644 index 0000000..3487037 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/command/Command.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/config/Configurable.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/config/Configurable.class new file mode 100644 index 0000000..4a56e4d Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/config/Configurable.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/EventCancellable.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/EventCancellable.class new file mode 100644 index 0000000..d147c3b Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/EventCancellable.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/EventStageable$EventStage.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/EventStageable$EventStage.class new file mode 100644 index 0000000..218d2e7 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/EventStageable$EventStage.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/EventStageable.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/EventStageable.class new file mode 100644 index 0000000..d6a56b7 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/EventStageable.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/entity/EventHorseSaddled.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/entity/EventHorseSaddled.class new file mode 100644 index 0000000..00834f1 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/entity/EventHorseSaddled.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/entity/EventSteerEntity.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/entity/EventSteerEntity.class new file mode 100644 index 0000000..26f023c Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/entity/EventSteerEntity.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/gui/EventBookPage.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/gui/EventBookPage.class new file mode 100644 index 0000000..67ff8fe Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/gui/EventBookPage.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/gui/EventBookTitle.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/gui/EventBookTitle.class new file mode 100644 index 0000000..bafa96a Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/gui/EventBookTitle.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/gui/EventRenderHelmet.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/gui/EventRenderHelmet.class new file mode 100644 index 0000000..7d00ddc Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/gui/EventRenderHelmet.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/gui/EventRenderPortal.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/gui/EventRenderPortal.class new file mode 100644 index 0000000..dcf2dc4 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/gui/EventRenderPortal.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/gui/EventRenderPotions.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/gui/EventRenderPotions.class new file mode 100644 index 0000000..0d1a511 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/gui/EventRenderPotions.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/minecraft/EventDisplayGui.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/minecraft/EventDisplayGui.class new file mode 100644 index 0000000..2455091 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/minecraft/EventDisplayGui.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/minecraft/EventKeyPress.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/minecraft/EventKeyPress.class new file mode 100644 index 0000000..e1d2059 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/minecraft/EventKeyPress.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/minecraft/EventRunTick.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/minecraft/EventRunTick.class new file mode 100644 index 0000000..b1c4eaf Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/minecraft/EventRunTick.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/minecraft/EventUpdateFramebufferSize.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/minecraft/EventUpdateFramebufferSize.class new file mode 100644 index 0000000..242b6c4 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/minecraft/EventUpdateFramebufferSize.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/network/EventReceivePacket.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/network/EventReceivePacket.class new file mode 100644 index 0000000..d22c10e Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/network/EventReceivePacket.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/network/EventSendPacket.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/network/EventSendPacket.class new file mode 100644 index 0000000..2e10d8e Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/network/EventSendPacket.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventApplyCollision.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventApplyCollision.class new file mode 100644 index 0000000..854d92b Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventApplyCollision.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventClickBlock.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventClickBlock.class new file mode 100644 index 0000000..78af619 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventClickBlock.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventCloseScreen.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventCloseScreen.class new file mode 100644 index 0000000..964dd7c Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventCloseScreen.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventDestroyBlock.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventDestroyBlock.class new file mode 100644 index 0000000..87753c6 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventDestroyBlock.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventExtendedReach.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventExtendedReach.class new file mode 100644 index 0000000..34dfb15 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventExtendedReach.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventGetBlockReachDistance.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventGetBlockReachDistance.class new file mode 100644 index 0000000..8255fc5 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventGetBlockReachDistance.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventHittingPosition.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventHittingPosition.class new file mode 100644 index 0000000..56bff43 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventHittingPosition.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventMove.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventMove.class new file mode 100644 index 0000000..1d3293c Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventMove.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventPlayerDamageBlock.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventPlayerDamageBlock.class new file mode 100644 index 0000000..0f18a14 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventPlayerDamageBlock.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventPlayerUpdate.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventPlayerUpdate.class new file mode 100644 index 0000000..3c09076 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventPlayerUpdate.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventPushOutOfBlocks.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventPushOutOfBlocks.class new file mode 100644 index 0000000..c5806dc Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventPushOutOfBlocks.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventPushedByWater.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventPushedByWater.class new file mode 100644 index 0000000..79da8bb Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventPushedByWater.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventResetBlockRemoving.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventResetBlockRemoving.class new file mode 100644 index 0000000..b1291a7 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventResetBlockRemoving.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventRightClick.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventRightClick.class new file mode 100644 index 0000000..000915f Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventRightClick.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventRightClickBlock.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventRightClickBlock.class new file mode 100644 index 0000000..4c06849 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventRightClickBlock.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventSendChatMessage.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventSendChatMessage.class new file mode 100644 index 0000000..ad344a1 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventSendChatMessage.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventStep.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventStep.class new file mode 100644 index 0000000..f2271c0 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventStep.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventSwingArm.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventSwingArm.class new file mode 100644 index 0000000..23e6006 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventSwingArm.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventUpdateInput.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventUpdateInput.class new file mode 100644 index 0000000..78f1a42 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventUpdateInput.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventUpdateWalkingPlayer.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventUpdateWalkingPlayer.class new file mode 100644 index 0000000..c120e5c Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/player/EventUpdateWalkingPlayer.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/render/EventHurtCamEffect.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/render/EventHurtCamEffect.class new file mode 100644 index 0000000..c3651aa Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/render/EventHurtCamEffect.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/render/EventRender2D.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/render/EventRender2D.class new file mode 100644 index 0000000..0d4b406 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/render/EventRender2D.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/render/EventRender3D.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/render/EventRender3D.class new file mode 100644 index 0000000..cb21f8a Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/render/EventRender3D.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/render/EventRenderBlockModel.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/render/EventRenderBlockModel.class new file mode 100644 index 0000000..986fabb Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/render/EventRenderBlockModel.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/render/EventRenderBlockSide.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/render/EventRenderBlockSide.class new file mode 100644 index 0000000..9efcbdd Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/render/EventRenderBlockSide.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/render/EventRenderEntity.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/render/EventRenderEntity.class new file mode 100644 index 0000000..c848c64 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/render/EventRenderEntity.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/render/EventRenderFluid.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/render/EventRenderFluid.class new file mode 100644 index 0000000..c2e9b08 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/render/EventRenderFluid.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/render/EventRenderLivingEntity.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/render/EventRenderLivingEntity.class new file mode 100644 index 0000000..2967b19 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/render/EventRenderLivingEntity.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/render/EventRenderName.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/render/EventRenderName.class new file mode 100644 index 0000000..a5b7ff8 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/render/EventRenderName.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/render/EventRenderOverlay$OverlayType.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/render/EventRenderOverlay$OverlayType.class new file mode 100644 index 0000000..be59842 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/render/EventRenderOverlay$OverlayType.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/render/EventRenderOverlay.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/render/EventRenderOverlay.class new file mode 100644 index 0000000..d8023c8 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/render/EventRenderOverlay.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/world/EventAddCollisionBox.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/world/EventAddCollisionBox.class new file mode 100644 index 0000000..336e11a Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/world/EventAddCollisionBox.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/world/EventCollideSoulSand.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/world/EventCollideSoulSand.class new file mode 100644 index 0000000..fb56376 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/world/EventCollideSoulSand.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/world/EventGetBlockLayer.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/world/EventGetBlockLayer.class new file mode 100644 index 0000000..859e3c1 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/world/EventGetBlockLayer.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/world/EventLandOnSlime.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/world/EventLandOnSlime.class new file mode 100644 index 0000000..e75cd2f Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/world/EventLandOnSlime.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/world/EventLightUpdate.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/world/EventLightUpdate.class new file mode 100644 index 0000000..1044f72 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/world/EventLightUpdate.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/world/EventLiquidCollisionBB.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/world/EventLiquidCollisionBB.class new file mode 100644 index 0000000..7f2da72 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/world/EventLiquidCollisionBB.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/world/EventSetOpaqueCube.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/world/EventSetOpaqueCube.class new file mode 100644 index 0000000..77d5aaf Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/world/EventSetOpaqueCube.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/world/EventWalkOnSlime.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/world/EventWalkOnSlime.class new file mode 100644 index 0000000..7bcd457 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/event/world/EventWalkOnSlime.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/friend/Friend.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/friend/Friend.class new file mode 100644 index 0000000..4d7c113 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/friend/Friend.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/logging/SeppukuFormatter.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/logging/SeppukuFormatter.class new file mode 100644 index 0000000..a38ffb4 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/logging/SeppukuFormatter.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/macro/Macro.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/macro/Macro.class new file mode 100644 index 0000000..d602df1 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/macro/Macro.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/module/Module$ModuleType.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/module/Module$ModuleType.class new file mode 100644 index 0000000..cde1eda Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/module/Module$ModuleType.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/module/Module.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/module/Module.class new file mode 100644 index 0000000..f7d53f2 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/module/Module.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/patch/ClassPatch.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/patch/ClassPatch.class new file mode 100644 index 0000000..afa52c0 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/patch/ClassPatch.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/patch/MethodPatch.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/patch/MethodPatch.class new file mode 100644 index 0000000..481caf5 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/patch/MethodPatch.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/util/ASMUtil.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/util/ASMUtil.class new file mode 100644 index 0000000..a980578 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/util/ASMUtil.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/util/GLUProjection$ClampMode.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/util/GLUProjection$ClampMode.class new file mode 100644 index 0000000..97187b7 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/util/GLUProjection$ClampMode.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/util/GLUProjection$Line.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/util/GLUProjection$Line.class new file mode 100644 index 0000000..4245745 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/util/GLUProjection$Line.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/util/GLUProjection$Projection$Type.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/util/GLUProjection$Projection$Type.class new file mode 100644 index 0000000..90ca9aa Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/util/GLUProjection$Projection$Type.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/util/GLUProjection$Projection.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/util/GLUProjection$Projection.class new file mode 100644 index 0000000..1cb2288 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/util/GLUProjection$Projection.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/util/GLUProjection$Vector3D.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/util/GLUProjection$Vector3D.class new file mode 100644 index 0000000..b86ce79 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/util/GLUProjection$Vector3D.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/util/GLUProjection.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/util/GLUProjection.class new file mode 100644 index 0000000..746606d Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/util/GLUProjection.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/util/MathUtil.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/util/MathUtil.class new file mode 100644 index 0000000..e81bba3 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/util/MathUtil.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/util/ReflectionUtil.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/util/ReflectionUtil.class new file mode 100644 index 0000000..b45f363 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/util/ReflectionUtil.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/util/RenderUtil.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/util/RenderUtil.class new file mode 100644 index 0000000..20007c2 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/util/RenderUtil.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/util/StringUtil.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/util/StringUtil.class new file mode 100644 index 0000000..e7c679d Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/util/StringUtil.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/util/Timer.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/util/Timer.class new file mode 100644 index 0000000..40cc546 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/util/Timer.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/value/BooleanValue.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/value/BooleanValue.class new file mode 100644 index 0000000..ef0c483 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/value/BooleanValue.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/value/NumberValue.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/value/NumberValue.class new file mode 100644 index 0000000..b069a15 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/value/NumberValue.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/value/OptionalValue.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/value/OptionalValue.class new file mode 100644 index 0000000..9882564 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/value/OptionalValue.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/value/StringValue.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/value/StringValue.class new file mode 100644 index 0000000..d3db5fb Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/value/StringValue.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/value/Value.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/value/Value.class new file mode 100644 index 0000000..4154338 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/api/value/Value.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/BindCommand.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/BindCommand.class new file mode 100644 index 0000000..03c7ab4 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/BindCommand.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/ColorCommand.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/ColorCommand.class new file mode 100644 index 0000000..e2d7b79 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/ColorCommand.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/ConnectCommand.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/ConnectCommand.class new file mode 100644 index 0000000..2bbb4c0 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/ConnectCommand.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/CoordsCommand.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/CoordsCommand.class new file mode 100644 index 0000000..8e2c041 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/CoordsCommand.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/DisconnectCommand.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/DisconnectCommand.class new file mode 100644 index 0000000..529b363 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/DisconnectCommand.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/DupeCommand.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/DupeCommand.class new file mode 100644 index 0000000..9350d01 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/DupeCommand.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/FriendCommand.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/FriendCommand.class new file mode 100644 index 0000000..bed615f Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/FriendCommand.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/HClipCommand.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/HClipCommand.class new file mode 100644 index 0000000..ee34912 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/HClipCommand.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/HelpCommand.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/HelpCommand.class new file mode 100644 index 0000000..b5be24d Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/HelpCommand.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/HideCommand.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/HideCommand.class new file mode 100644 index 0000000..031c25d Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/HideCommand.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/IPCommand.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/IPCommand.class new file mode 100644 index 0000000..33588db Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/IPCommand.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/InvSeeCommand.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/InvSeeCommand.class new file mode 100644 index 0000000..db98c1f Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/InvSeeCommand.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/MacroCommand.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/MacroCommand.class new file mode 100644 index 0000000..bf82e8c Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/MacroCommand.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/ModuleCommand.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/ModuleCommand.class new file mode 100644 index 0000000..0b4a0a0 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/ModuleCommand.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/NameCommand.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/NameCommand.class new file mode 100644 index 0000000..6c5f013 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/NameCommand.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/PeekCommand.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/PeekCommand.class new file mode 100644 index 0000000..9a8048d Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/PeekCommand.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/PitchCommand.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/PitchCommand.class new file mode 100644 index 0000000..dc1988b Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/PitchCommand.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/ReloadCommand.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/ReloadCommand.class new file mode 100644 index 0000000..6b4213f Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/ReloadCommand.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/SayCommand.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/SayCommand.class new file mode 100644 index 0000000..dd4bfba Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/SayCommand.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/SpectateCommand.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/SpectateCommand.class new file mode 100644 index 0000000..dc9a307 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/SpectateCommand.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/ToggleCommand.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/ToggleCommand.class new file mode 100644 index 0000000..a6b82c8 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/ToggleCommand.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/UnloadCommand.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/UnloadCommand.class new file mode 100644 index 0000000..81fd982 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/UnloadCommand.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/VClipCommand.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/VClipCommand.class new file mode 100644 index 0000000..749f532 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/VClipCommand.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/WaypointsCommand.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/WaypointsCommand.class new file mode 100644 index 0000000..d52ec48 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/WaypointsCommand.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/XrayCommand.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/XrayCommand.class new file mode 100644 index 0000000..acef5cc Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/XrayCommand.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/YawCommand.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/YawCommand.class new file mode 100644 index 0000000..e928024 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/command/YawCommand.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/config/BindConfig.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/config/BindConfig.class new file mode 100644 index 0000000..9af6b4e Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/config/BindConfig.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/config/ColorConfig.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/config/ColorConfig.class new file mode 100644 index 0000000..cdcc493 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/config/ColorConfig.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/config/FriendConfig.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/config/FriendConfig.class new file mode 100644 index 0000000..4cf4e56 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/config/FriendConfig.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/config/HiddenConfig.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/config/HiddenConfig.class new file mode 100644 index 0000000..4914ff3 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/config/HiddenConfig.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/config/MacroConfig.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/config/MacroConfig.class new file mode 100644 index 0000000..42435ac Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/config/MacroConfig.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/config/ToggledConfig.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/config/ToggledConfig.class new file mode 100644 index 0000000..d933dee Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/config/ToggledConfig.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/config/ValueConfig.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/config/ValueConfig.class new file mode 100644 index 0000000..84241be Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/config/ValueConfig.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/config/WaypointsConfig.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/config/WaypointsConfig.class new file mode 100644 index 0000000..de3846e Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/config/WaypointsConfig.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/config/XrayConfig.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/config/XrayConfig.class new file mode 100644 index 0000000..7526f77 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/config/XrayConfig.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/fml/SeppukuMod.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/fml/SeppukuMod.class new file mode 100644 index 0000000..0d37c84 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/fml/SeppukuMod.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/fml/core/SeppukuAccessTransformer.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/fml/core/SeppukuAccessTransformer.class new file mode 100644 index 0000000..9d029c6 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/fml/core/SeppukuAccessTransformer.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/fml/core/SeppukuClassTransformer.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/fml/core/SeppukuClassTransformer.class new file mode 100644 index 0000000..8902e60 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/fml/core/SeppukuClassTransformer.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/fml/core/SeppukuLoadingPlugin.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/fml/core/SeppukuLoadingPlugin.class new file mode 100644 index 0000000..8a0ed70 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/fml/core/SeppukuLoadingPlugin.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/management/ChatManager.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/management/ChatManager.class new file mode 100644 index 0000000..4f33d88 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/management/ChatManager.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/management/CommandManager$1.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/management/CommandManager$1.class new file mode 100644 index 0000000..07888d5 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/management/CommandManager$1.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/management/CommandManager.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/management/CommandManager.class new file mode 100644 index 0000000..e952221 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/management/CommandManager.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/management/ConfigManager.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/management/ConfigManager.class new file mode 100644 index 0000000..c2f814d Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/management/ConfigManager.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/management/FriendManager.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/management/FriendManager.class new file mode 100644 index 0000000..daea7e4 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/management/FriendManager.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/management/MacroManager.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/management/MacroManager.class new file mode 100644 index 0000000..e396c7f Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/management/MacroManager.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/management/ModuleManager.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/management/ModuleManager.class new file mode 100644 index 0000000..5cbe264 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/management/ModuleManager.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/management/PatchManager$Environment.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/management/PatchManager$Environment.class new file mode 100644 index 0000000..10ec369 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/management/PatchManager$Environment.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/management/PatchManager.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/management/PatchManager.class new file mode 100644 index 0000000..9dfdb2c Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/management/PatchManager.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/management/RotationManager.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/management/RotationManager.class new file mode 100644 index 0000000..6b03a17 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/management/RotationManager.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/management/TickRateManager.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/management/TickRateManager.class new file mode 100644 index 0000000..932c50b Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/management/TickRateManager.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/management/WaypointManager.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/management/WaypointManager.class new file mode 100644 index 0000000..cb07c6e Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/management/WaypointManager.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/combat/AutoArmorModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/combat/AutoArmorModule.class new file mode 100644 index 0000000..8f96065 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/combat/AutoArmorModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/combat/AutoTotemModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/combat/AutoTotemModule.class new file mode 100644 index 0000000..d671e12 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/combat/AutoTotemModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/combat/BowBombModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/combat/BowBombModule.class new file mode 100644 index 0000000..856f4ce Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/combat/BowBombModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/combat/CriticalsModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/combat/CriticalsModule.class new file mode 100644 index 0000000..2981efc Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/combat/CriticalsModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/combat/CrystalAuraModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/combat/CrystalAuraModule.class new file mode 100644 index 0000000..7ed8035 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/combat/CrystalAuraModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/combat/FastBowModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/combat/FastBowModule.class new file mode 100644 index 0000000..ae3cb91 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/combat/FastBowModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/combat/KillAuraModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/combat/KillAuraModule.class new file mode 100644 index 0000000..4cef027 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/combat/KillAuraModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/combat/NoCrystalModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/combat/NoCrystalModule.class new file mode 100644 index 0000000..37a9144 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/combat/NoCrystalModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/combat/RespawnModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/combat/RespawnModule.class new file mode 100644 index 0000000..a7dc4b9 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/combat/RespawnModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/combat/VelocityModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/combat/VelocityModule.class new file mode 100644 index 0000000..749af34 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/combat/VelocityModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/hidden/CommandsModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/hidden/CommandsModule.class new file mode 100644 index 0000000..e8ce379 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/hidden/CommandsModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/hidden/KeybindsModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/hidden/KeybindsModule.class new file mode 100644 index 0000000..97bba13 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/hidden/KeybindsModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/hidden/MacroModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/hidden/MacroModule.class new file mode 100644 index 0000000..ddab76e Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/hidden/MacroModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/AutoFishModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/AutoFishModule.class new file mode 100644 index 0000000..d99589a Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/AutoFishModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/BreedModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/BreedModule.class new file mode 100644 index 0000000..8ff62e7 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/BreedModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/ChatMutatorModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/ChatMutatorModule.class new file mode 100644 index 0000000..5cd18fe Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/ChatMutatorModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/ColoredBooksModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/ColoredBooksModule.class new file mode 100644 index 0000000..6f03cec Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/ColoredBooksModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/ColoredSignsModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/ColoredSignsModule.class new file mode 100644 index 0000000..c7bc2d2 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/ColoredSignsModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/CoordLoggerModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/CoordLoggerModule.class new file mode 100644 index 0000000..0d8cfc2 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/CoordLoggerModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/DyeModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/DyeModule.class new file mode 100644 index 0000000..b20c023 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/DyeModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/GreeterModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/GreeterModule.class new file mode 100644 index 0000000..8028e62 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/GreeterModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/LaggerModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/LaggerModule.class new file mode 100644 index 0000000..0b49a18 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/LaggerModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/MiddleClickFriendsModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/MiddleClickFriendsModule.class new file mode 100644 index 0000000..a5ea064 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/MiddleClickFriendsModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/MoreInvModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/MoreInvModule.class new file mode 100644 index 0000000..a4e0300 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/MoreInvModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/NoHandShakeModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/NoHandShakeModule.class new file mode 100644 index 0000000..fc286d7 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/NoHandShakeModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/NoRotateModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/NoRotateModule.class new file mode 100644 index 0000000..535b04e Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/NoRotateModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/PortalGuiModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/PortalGuiModule.class new file mode 100644 index 0000000..5f5d160 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/PortalGuiModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/ReconnectModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/ReconnectModule.class new file mode 100644 index 0000000..f223feb Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/ReconnectModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/ShearModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/ShearModule.class new file mode 100644 index 0000000..7e5fb56 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/ShearModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/TimeStampModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/TimeStampModule.class new file mode 100644 index 0000000..cc1fd00 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/misc/TimeStampModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/movement/ElytraFlyModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/movement/ElytraFlyModule.class new file mode 100644 index 0000000..08c9e5a Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/movement/ElytraFlyModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/movement/FlightModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/movement/FlightModule.class new file mode 100644 index 0000000..110c500 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/movement/FlightModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/movement/HorseJumpModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/movement/HorseJumpModule.class new file mode 100644 index 0000000..c325acc Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/movement/HorseJumpModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/movement/SafeWalkModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/movement/SafeWalkModule.class new file mode 100644 index 0000000..e596258 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/movement/SafeWalkModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/movement/SpeedModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/movement/SpeedModule.class new file mode 100644 index 0000000..a13b095 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/movement/SpeedModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/movement/SprintModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/movement/SprintModule.class new file mode 100644 index 0000000..25a45ce Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/movement/SprintModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/player/BlinkModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/player/BlinkModule.class new file mode 100644 index 0000000..a039d2b Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/player/BlinkModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/player/GodModeModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/player/GodModeModule.class new file mode 100644 index 0000000..d9c3d62 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/player/GodModeModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/player/InteractModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/player/InteractModule.class new file mode 100644 index 0000000..07a2bd5 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/player/InteractModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/player/ItemSpoofModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/player/ItemSpoofModule.class new file mode 100644 index 0000000..55d9eab Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/player/ItemSpoofModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/player/NoHungerModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/player/NoHungerModule.class new file mode 100644 index 0000000..61be8eb Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/player/NoHungerModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/player/NoPushModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/player/NoPushModule.class new file mode 100644 index 0000000..6799836 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/player/NoPushModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/player/NoSwingModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/player/NoSwingModule.class new file mode 100644 index 0000000..03310cf Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/player/NoSwingModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/player/RotationLock.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/player/RotationLock.class new file mode 100644 index 0000000..22a8deb Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/player/RotationLock.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/render/BrightnessModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/render/BrightnessModule.class new file mode 100644 index 0000000..889342a Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/render/BrightnessModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/render/ChamsModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/render/ChamsModule.class new file mode 100644 index 0000000..ce9cfbd Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/render/ChamsModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/render/HudModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/render/HudModule.class new file mode 100644 index 0000000..678fce8 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/render/HudModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/render/NoOverlayModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/render/NoOverlayModule.class new file mode 100644 index 0000000..6926e19 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/render/NoOverlayModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/render/StorageESPModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/render/StorageESPModule.class new file mode 100644 index 0000000..2ef1eca Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/render/StorageESPModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/render/TracersModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/render/TracersModule.class new file mode 100644 index 0000000..53fcb65 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/render/TracersModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/render/WallHackModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/render/WallHackModule.class new file mode 100644 index 0000000..a26a9b7 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/render/WallHackModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/render/XrayModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/render/XrayModule.class new file mode 100644 index 0000000..319ea44 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/render/XrayModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/world/AutoToolModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/world/AutoToolModule.class new file mode 100644 index 0000000..72ff376 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/world/AutoToolModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/world/FastPlaceModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/world/FastPlaceModule.class new file mode 100644 index 0000000..9bdf40c Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/world/FastPlaceModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/world/PhaseModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/world/PhaseModule.class new file mode 100644 index 0000000..5c361a0 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/world/PhaseModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/world/SpeedMineModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/world/SpeedMineModule.class new file mode 100644 index 0000000..331edd2 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/world/SpeedMineModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/world/TimerModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/world/TimerModule.class new file mode 100644 index 0000000..fb47f87 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/world/TimerModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/world/WaypointsModule$WaypointData.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/world/WaypointsModule$WaypointData.class new file mode 100644 index 0000000..5de759b Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/world/WaypointsModule$WaypointData.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/world/WaypointsModule.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/world/WaypointsModule.class new file mode 100644 index 0000000..dd8d4a1 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/module/world/WaypointsModule.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/AbstractHorsePatch.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/AbstractHorsePatch.class new file mode 100644 index 0000000..46532b5 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/AbstractHorsePatch.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/ActiveRenderInfoPatch.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/ActiveRenderInfoPatch.class new file mode 100644 index 0000000..08983a6 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/ActiveRenderInfoPatch.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/BlockFencePatch.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/BlockFencePatch.class new file mode 100644 index 0000000..6d78b40 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/BlockFencePatch.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/BlockFluidRendererPatch.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/BlockFluidRendererPatch.class new file mode 100644 index 0000000..e2332a2 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/BlockFluidRendererPatch.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/BlockLiquidPatch.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/BlockLiquidPatch.class new file mode 100644 index 0000000..5ba4807 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/BlockLiquidPatch.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/BlockModelRendererPatch.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/BlockModelRendererPatch.class new file mode 100644 index 0000000..5230abc Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/BlockModelRendererPatch.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/BlockPanePatch.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/BlockPanePatch.class new file mode 100644 index 0000000..90432e7 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/BlockPanePatch.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/BlockPatch.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/BlockPatch.class new file mode 100644 index 0000000..118e111 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/BlockPatch.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/BlockSlimePatch.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/BlockSlimePatch.class new file mode 100644 index 0000000..1e8d8f1 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/BlockSlimePatch.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/BlockSoulSandPatch.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/BlockSoulSandPatch.class new file mode 100644 index 0000000..ec0dab1 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/BlockSoulSandPatch.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/BlockStairsPatch.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/BlockStairsPatch.class new file mode 100644 index 0000000..3e79967 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/BlockStairsPatch.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/EntityLlamaPatch.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/EntityLlamaPatch.class new file mode 100644 index 0000000..7fc6a7c Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/EntityLlamaPatch.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/EntityPatch.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/EntityPatch.class new file mode 100644 index 0000000..f82c1d6 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/EntityPatch.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/EntityPigPatch.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/EntityPigPatch.class new file mode 100644 index 0000000..312c3a7 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/EntityPigPatch.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/EntityPlayerPatch.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/EntityPlayerPatch.class new file mode 100644 index 0000000..085213c Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/EntityPlayerPatch.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/EntityPlayerSPPatch.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/EntityPlayerSPPatch.class new file mode 100644 index 0000000..6e55153 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/EntityPlayerSPPatch.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/EntityRendererPatch.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/EntityRendererPatch.class new file mode 100644 index 0000000..68a9313 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/EntityRendererPatch.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/GuiIngameForgePatch.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/GuiIngameForgePatch.class new file mode 100644 index 0000000..07bba36 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/GuiIngameForgePatch.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/GuiScreenBookPatch.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/GuiScreenBookPatch.class new file mode 100644 index 0000000..6f6b659 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/GuiScreenBookPatch.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/ItemRendererPatch.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/ItemRendererPatch.class new file mode 100644 index 0000000..304da91 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/ItemRendererPatch.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/KeyBindingPatch.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/KeyBindingPatch.class new file mode 100644 index 0000000..7cd35ec Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/KeyBindingPatch.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/MinecraftPatch.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/MinecraftPatch.class new file mode 100644 index 0000000..93d6eaa Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/MinecraftPatch.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/NetworkManagerPatch.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/NetworkManagerPatch.class new file mode 100644 index 0000000..543b603 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/NetworkManagerPatch.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/PlayerControllerMPPatch.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/PlayerControllerMPPatch.class new file mode 100644 index 0000000..8954e9b Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/PlayerControllerMPPatch.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/RenderLivingBasePatch.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/RenderLivingBasePatch.class new file mode 100644 index 0000000..87d5e4c Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/RenderLivingBasePatch.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/RenderManagerPatch.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/RenderManagerPatch.class new file mode 100644 index 0000000..1f6495f Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/RenderManagerPatch.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/VisGraphPatch.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/VisGraphPatch.class new file mode 100644 index 0000000..ccbdf9d Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/VisGraphPatch.class differ diff --git a/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/WorldPatch.class b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/WorldPatch.class new file mode 100644 index 0000000..bb11761 Binary files /dev/null and b/classes/production/seppuku-1.12.2_main/me/rigamortis/seppuku/impl/patch/WorldPatch.class differ diff --git a/classes/production/seppuku-1.12.2_main/pack.mcmeta b/classes/production/seppuku-1.12.2_main/pack.mcmeta new file mode 100644 index 0000000..4018267 --- /dev/null +++ b/classes/production/seppuku-1.12.2_main/pack.mcmeta @@ -0,0 +1,7 @@ +{ + "pack": { + "description": "examplemod resources", + "pack_format": 3, + "_comment": "A pack_format of 3 should be used starting with Minecraft 1.11. All resources, including language files, should be lowercase (eg: en_us.lang). A pack_format of 2 will load your mod resources with LegacyV2Adapter, which requires language files to have uppercase letters (eg: en_US.lang)." + } +} diff --git a/classes/production/seppuku-1.12.2_main/seppuku_at.cfg b/classes/production/seppuku-1.12.2_main/seppuku_at.cfg new file mode 100644 index 0000000..898a960 --- /dev/null +++ b/classes/production/seppuku-1.12.2_main/seppuku_at.cfg @@ -0,0 +1,114 @@ +public net.minecraft.network.play.client.CPacketCloseWindow field_149556_a + #windowId + public-f net.minecraft.entity.EntityLivingBase field_110157_c + #x + public net.minecraft.network.play.client.CPacketPlayer field_149479_a + #y + public net.minecraft.network.play.client.CPacketPlayer field_149477_b + #z + public net.minecraft.network.play.client.CPacketPlayer field_149478_c + #yaw + public net.minecraft.network.play.client.CPacketPlayer field_149476_e + #pitch + public net.minecraft.network.play.client.CPacketPlayer field_149473_f + #onGround + public net.minecraft.network.play.client.CPacketPlayer field_149474_g + #ip + public net.minecraft.network.handshake.client.C00Handshake field_149598_b + #port + public net.minecraft.network.handshake.client.C00Handshake field_149599_c + #flying + public net.minecraft.network.play.client.CPacketPlayerAbilities field_149498_b + #flySpeed + public net.minecraft.network.play.client.CPacketPlayerAbilities field_149497_e + #profile + public net.minecraft.network.login.client.CPacketLoginStart field_149305_a + #session + public-f net.minecraft.client.Minecraft field_71449_j + #timer + public-f net.minecraft.client.Minecraft field_71428_T + #rightClickDelayTimer + public net.minecraft.client.Minecraft field_71467_ac + #curBlockDamageMP + public net.minecraft.client.multiplayer.PlayerControllerMP field_78770_f + #blockHitDelay + public net.minecraft.client.multiplayer.PlayerControllerMP field_78781_i + #motionX + public net.minecraft.network.play.server.SPacketEntityVelocity field_149415_b + #motionY + public net.minecraft.network.play.server.SPacketEntityVelocity field_149416_c + #motionZ + public net.minecraft.network.play.server.SPacketEntityVelocity field_149414_d + #isHittingBlock + public net.minecraft.client.multiplayer.PlayerControllerMP field_78778_j + #lines + public net.minecraft.network.play.client.CPacketUpdateSign field_149590_d + #x + public net.minecraft.network.play.client.CPacketVehicleMove field_187007_a + #y + public net.minecraft.network.play.client.CPacketVehicleMove field_187008_b + #z + public net.minecraft.network.play.client.CPacketVehicleMove field_187009_c + #yaw + public net.minecraft.network.play.client.CPacketVehicleMove field_187010_d + #pitch + public net.minecraft.network.play.client.CPacketVehicleMove field_187011_e + #horseJumpPower + public net.minecraft.client.entity.EntityPlayerSP field_110321_bQ + #horseJumpPowerCounter + public net.minecraft.client.entity.EntityPlayerSP field_110320_a + #auxData + public net.minecraft.network.play.client.CPacketEntityAction field_149516_c + #yaw + public net.minecraft.network.play.server.SPacketPlayerPosLook field_148936_d + #pitch + public net.minecraft.network.play.server.SPacketPlayerPosLook field_148937_e + #pressed + public net.minecraft.client.settings.KeyBinding field_74513_e + #hand + public net.minecraft.network.play.client.CPacketPlayerTryUseItem field_187029_a + #data + public net.minecraft.network.play.client.CPacketCustomPayload field_149561_c + #entityId + public net.minecraft.network.play.client.CPacketUseEntity field_149567_a + #hand + public net.minecraft.network.play.client.CPacketUseEntity field_186995_d + #hitVec + public net.minecraft.network.play.client.CPacketUseEntity field_179713_c + #action + public net.minecraft.network.play.client.CPacketUseEntity field_149566_b + public net.minecraft.entity.Entity func_70052_a(IZ)V + #setFlag + public net.minecraft.entity.Entity func_70083_f(I)Z + #getFlag + public net.minecraft.network.play.client.CPacketClientSettings field_149528_b + #view + public net.minecraft.util.Timer field_194149_e + #tickLength + public net.minecraft.network.play.server.SPacketExplosion field_149152_f #motionX + public net.minecraft.network.play.server.SPacketExplosion field_149153_g #motionY + public net.minecraft.network.play.server.SPacketExplosion field_149159_h #motionZ + public net.minecraft.entity.Entity field_71087_bX #inPortal + public net.minecraft.client.renderer.EntityRenderer func_78479_a(FI)V # setupCameraTransform + public net.minecraft.network.play.client.CPacketKeepAlive field_149461_a # key + public net.minecraft.network.play.client.CPacketTabComplete field_149420_a # message + public net.minecraft.entity.Entity field_70134_J # isInWeb + public net.minecraft.network.play.client.CPacketChatMessage field_149440_a # message + public net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock field_179725_b # position + public net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock field_149579_d # placedBlockDirection + public net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock field_187027_c # hand + public net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock field_149577_f # facingX + public net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock field_149578_g # facingY + public net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock field_149584_h # facingZ + public net.minecraft.client.renderer.entity.RenderManager field_78725_b # renderPosX + public net.minecraft.client.renderer.entity.RenderManager field_78726_c # renderPosY + public net.minecraft.client.renderer.entity.RenderManager field_78723_d # renderPosZ + public net.minecraft.client.renderer.EntityRenderer func_78467_g(F)V # orientCamera + public net.minecraft.network.play.client.CPacketPlayerDigging field_179717_a # position + public net.minecraft.network.play.client.CPacketPlayerDigging field_179716_b # facing + public net.minecraft.network.play.client.CPacketPlayerDigging field_149508_e # action + public net.minecraft.network.play.server.SPacketChat field_148919_a # chatComponent + public net.minecraft.client.gui.inventory.GuiEditSign field_146848_f # tileSign + public-f net.minecraft.tileentity.TileEntitySign field_145915_a # signText + public net.minecraft.client.entity.AbstractClientPlayer func_175155_b()Lnet/minecraft/client/network/NetworkPlayerInfo; # getPlayerInfo + public-f net.minecraft.util.text.TextComponentString field_150267_b # text \ No newline at end of file diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..e9b9fd5 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,3 @@ +# Sets default memory used for gradle commands. Can be overridden by user or command line properties. +# This is required to provide enough memory for the Minecraft decompilation process. +org.gradle.jvmargs=-Xmx3G diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..758de96 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..04de9fd --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Tue Oct 22 11:12:30 MDT 2019 +distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-all.zip +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStorePath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew new file mode 100644 index 0000000..cccdd3d --- /dev/null +++ b/gradlew @@ -0,0 +1,172 @@ +#!/usr/bin/env sh + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..f955316 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,84 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/lib/json-simple-1.1.1.jar b/lib/json-simple-1.1.1.jar new file mode 100644 index 0000000..dfd5856 Binary files /dev/null and b/lib/json-simple-1.1.1.jar differ diff --git a/src/main/java/me/rigamortis/seppuku/Seppuku.java b/src/main/java/me/rigamortis/seppuku/Seppuku.java new file mode 100644 index 0000000..eb177cf --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/Seppuku.java @@ -0,0 +1,319 @@ +package me.rigamortis.seppuku; + +import me.rigamortis.seppuku.api.event.client.EventLoad; +import me.rigamortis.seppuku.api.event.client.EventReload; +import me.rigamortis.seppuku.api.event.client.EventUnload; +import me.rigamortis.seppuku.api.logging.SeppukuFormatter; +import me.rigamortis.seppuku.impl.gui.menu.GuiSeppukuMainMenu; +import me.rigamortis.seppuku.impl.management.*; +import net.minecraft.client.Minecraft; +import net.minecraft.util.text.TextComponentString; +import net.minecraftforge.fml.common.Loader; +import net.minecraftforge.fml.common.ModContainer; +import org.lwjgl.opengl.Display; +import team.stiff.pomelo.EventManager; +import team.stiff.pomelo.impl.annotated.AnnotatedEventManager; + +import java.util.logging.ConsoleHandler; +import java.util.logging.Logger; + +/** + * Author Seth + * 4/4/2019 @ 10:21 PM. + */ +public final class Seppuku { + + public static final Seppuku INSTANCE = new Seppuku(); + + private Logger logger; + + private String prevTitle; + + private EventManager eventManager; + + private ModuleManager moduleManager; + + private CommandManager commandManager; + + private FriendManager friendManager; + + private ConfigManager configManager; + + private RotationManager rotationManager; + + private MacroManager macroManager; + + private WaypointManager waypointManager; + + private TickRateManager tickRateManager; + + private ChatManager chatManager; + + private WorldManager worldManager; + + private IgnoredManager ignoredManager; + + private CapeManager capeManager; + + private PositionManager positionManager; + + private JoinLeaveManager joinLeaveManager; + + private HudManager hudManager; + + private AnimationManager animationManager; + + private NotificationManager notificationManager; + + private GuiSeppukuMainMenu seppukuMainMenu; + + /** + * The initialization point of the client + * this is called post launch + */ + public void init() { + this.initLogger(); + this.eventManager = new AnnotatedEventManager(); + this.moduleManager = new ModuleManager(); + this.commandManager = new CommandManager(); + this.friendManager = new FriendManager(); + this.rotationManager = new RotationManager(); + this.macroManager = new MacroManager(); + this.waypointManager = new WaypointManager(); + this.tickRateManager = new TickRateManager(); + this.chatManager = new ChatManager(); + this.worldManager = new WorldManager(); + this.ignoredManager = new IgnoredManager(); + this.capeManager = new CapeManager(); + this.positionManager = new PositionManager(); + this.joinLeaveManager = new JoinLeaveManager(); + this.hudManager = new HudManager(); + this.animationManager = new AnimationManager(); + this.notificationManager = new NotificationManager(); + //this.seppukuMainMenu = new GuiSeppukuMainMenu(); + + this.configManager = new ConfigManager(); // Keep last, so we load configs after everything inits + + this.prevTitle = Display.getTitle(); + Display.setTitle("Seppuku 1.12.2"); + + this.getEventManager().dispatchEvent(new EventLoad()); + + this.logger.info("Loaded"); + } + + public void errorChat(String message) { + Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(new TextComponentString("\2477[Seppuku]\247c " + message)); + } + + public void errorfChat(String format, Object... objects) { + errorChat(String.format(format, objects)); + } + + public void logChat(String message) { + Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(new TextComponentString("\2477[Seppuku]\247f " + message)); + } + + public void logfChat(String format, Object... objects) { + logChat(String.format(format, objects)); + } + + public void unload() { + this.moduleManager.unload(); + this.commandManager.unload(); + this.friendManager.unload(); + this.waypointManager.unload(); + this.macroManager.unload(); + this.tickRateManager.unload(); + this.chatManager.unload(); + this.ignoredManager.unload(); + this.capeManager.unload(); + this.joinLeaveManager.unload(); + this.hudManager.unload(); + this.animationManager.unload(); + this.notificationManager.unload(); + this.seppukuMainMenu.unload(); + + this.getEventManager().dispatchEvent(new EventUnload()); + + ModContainer seppukuModContainer = null; + + for (ModContainer modContainer : Loader.instance().getActiveModList()) { + if (modContainer.getModId().equals("seppukumod")) { + seppukuModContainer = modContainer; + } + } + + if (seppukuModContainer != null) { + Loader.instance().getActiveModList().remove(seppukuModContainer); + } + + Display.setTitle(this.prevTitle); + Minecraft.getMinecraft().ingameGUI.getChatGUI().clearChatMessages(true); + System.gc(); + } + + //TODO fix multi event firing when reloading modules + public void reload() { + this.waypointManager.getWaypointDataList().clear(); + this.friendManager.getFriendList().clear(); + this.macroManager.getMacroList().clear(); + this.worldManager.getWorldDataList().clear(); + this.ignoredManager.getIgnoredList().clear(); + + this.capeManager.getCapeUserList().clear(); + this.capeManager.getCapesMap().clear(); + this.capeManager = new CapeManager(); + + this.configManager.getConfigurableList().clear(); + this.configManager = new ConfigManager(); + + this.getEventManager().dispatchEvent(new EventReload()); + } + + /** + * Setup a logger and set the format + */ + private void initLogger() { + this.logger = Logger.getLogger(Seppuku.class.getName()); + logger.setUseParentHandlers(false); + final ConsoleHandler handler = new ConsoleHandler(); + handler.setFormatter(new SeppukuFormatter()); + logger.addHandler(handler); + } + + public EventManager getEventManager() { + if (this.eventManager == null) { + this.eventManager = new AnnotatedEventManager(); + } + + return this.eventManager; + } + + public ModuleManager getModuleManager() { + if (this.moduleManager == null) { + this.moduleManager = new ModuleManager(); + } + return this.moduleManager; + } + + public CommandManager getCommandManager() { + if (this.commandManager == null) { + this.commandManager = new CommandManager(); + } + return this.commandManager; + } + + public FriendManager getFriendManager() { + if (this.friendManager == null) { + this.friendManager = new FriendManager(); + } + return this.friendManager; + } + + public ConfigManager getConfigManager() { + if (this.configManager == null) { + this.configManager = new ConfigManager(); + } + return this.configManager; + } + + public RotationManager getRotationManager() { + if (this.rotationManager == null) { + this.rotationManager = new RotationManager(); + } + return this.rotationManager; + } + + public MacroManager getMacroManager() { + if (this.macroManager == null) { + this.macroManager = new MacroManager(); + } + return this.macroManager; + } + + public WaypointManager getWaypointManager() { + if (this.waypointManager == null) { + this.waypointManager = new WaypointManager(); + } + return this.waypointManager; + } + + public TickRateManager getTickRateManager() { + if (this.tickRateManager == null) { + this.tickRateManager = new TickRateManager(); + } + return this.tickRateManager; + } + + public ChatManager getChatManager() { + if (this.chatManager == null) { + this.chatManager = new ChatManager(); + } + return this.chatManager; + } + + public WorldManager getWorldManager() { + if (this.worldManager == null) { + this.worldManager = new WorldManager(); + } + return this.worldManager; + } + + public IgnoredManager getIgnoredManager() { + if (this.ignoredManager == null) { + this.ignoredManager = new IgnoredManager(); + } + return this.ignoredManager; + } + + public CapeManager getCapeManager() { + if (this.capeManager == null) { + this.capeManager = new CapeManager(); + } + return this.capeManager; + } + + public PositionManager getPositionManager() { + if (this.positionManager == null) { + this.positionManager = new PositionManager(); + } + return this.positionManager; + } + + public JoinLeaveManager getJoinLeaveManager() { + if (this.joinLeaveManager == null) { + this.joinLeaveManager = new JoinLeaveManager(); + } + return this.joinLeaveManager; + } + + public HudManager getHudManager() { + if (this.hudManager == null) { + this.hudManager = new HudManager(); + } + return this.hudManager; + } + + public AnimationManager getAnimationManager() { + if (this.animationManager == null) { + this.animationManager = new AnimationManager(); + } + return this.animationManager; + } + + public NotificationManager getNotificationManager() { + if (this.notificationManager == null) { + this.notificationManager = new NotificationManager(); + } + return this.notificationManager; + } + + public GuiSeppukuMainMenu getSeppukuMainMenu() { + if(this.seppukuMainMenu == null) { + this.seppukuMainMenu = new GuiSeppukuMainMenu(); + } + return this.seppukuMainMenu; + } + +} diff --git a/src/main/java/me/rigamortis/seppuku/api/animation/Animation.java b/src/main/java/me/rigamortis/seppuku/api/animation/Animation.java new file mode 100644 index 0000000..6514f28 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/animation/Animation.java @@ -0,0 +1,9 @@ +package me.rigamortis.seppuku.api.animation; + +/** + * created by noil on 8/17/2019 at 4:18 PM + */ +public interface Animation { + + void update(); +} diff --git a/src/main/java/me/rigamortis/seppuku/api/cape/CapeUser.java b/src/main/java/me/rigamortis/seppuku/api/cape/CapeUser.java new file mode 100644 index 0000000..2f330c7 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/cape/CapeUser.java @@ -0,0 +1,32 @@ +package me.rigamortis.seppuku.api.cape; + +/** + * Author Seth + * 7/9/2019 @ 5:46 PM. + */ +public class CapeUser { + + private String uuid; + private String cape; + + public CapeUser(String uuid, String cape) { + this.uuid = uuid; + this.cape = cape; + } + + public String getCape() { + return cape; + } + + public void setCape(String cape) { + this.cape = cape; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/command/Command.java b/src/main/java/me/rigamortis/seppuku/api/command/Command.java new file mode 100644 index 0000000..519b03c --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/command/Command.java @@ -0,0 +1,100 @@ +package me.rigamortis.seppuku.api.command; + +import me.rigamortis.seppuku.Seppuku; + +/** + * Author Seth + * 4/16/2019 @ 8:27 AM. + */ +public abstract class Command { + + private String displayName; + private String[] alias; + private String desc; + private String usage; + + public Command() { + + } + + public Command(String displayName, String[] alias, String desc, String usage) { + this.displayName = displayName; + this.alias = alias; + this.desc = desc; + this.usage = usage; + } + + public abstract void exec(String input); + + public boolean clamp(String input, int min, int max) { + String[] split = input.split(" "); + if(split.length > max) { + Seppuku.INSTANCE.errorChat("Too much input"); + return false; + } + if(split.length < min) { + Seppuku.INSTANCE.errorChat("Not enough input"); + return false; + } + return true; + } + + public boolean clamp(String input, int min) { + String[] split = input.split(" "); + if(split.length < min) { + Seppuku.INSTANCE.errorChat("Not enough input"); + return false; + } + return true; + } + + public boolean equals(String[] list, String input) { + for (String s : list) { + if (s.equalsIgnoreCase(input)) { + return true; + } + } + return false; + } + + public void printUsage() { + final String[] usage = this.getUsage().split("\n"); + Seppuku.INSTANCE.logChat("Usage: "); + + for(String u : usage) { + Seppuku.INSTANCE.logChat(u); + } + } + + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(String displayName) { + this.displayName = displayName; + } + + public String[] getAlias() { + return alias; + } + + public void setAlias(String[] alias) { + this.alias = alias; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public String getUsage() { + return usage; + } + + public void setUsage(String usage) { + this.usage = usage; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/config/Configurable.java b/src/main/java/me/rigamortis/seppuku/api/config/Configurable.java new file mode 100644 index 0000000..3b1f830 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/config/Configurable.java @@ -0,0 +1,27 @@ +package me.rigamortis.seppuku.api.config; + +/** + * Author Seth + * 4/18/2019 @ 7:02 AM. + */ +public abstract class Configurable { + + private String path; + + public Configurable(String path) { + this.path = path; + } + + public abstract void load(); + + public abstract void save(); + + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/EventCancellable.java b/src/main/java/me/rigamortis/seppuku/api/event/EventCancellable.java new file mode 100644 index 0000000..74699dc --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/EventCancellable.java @@ -0,0 +1,31 @@ +package me.rigamortis.seppuku.api.event; + +/** + * Author Seth + * 4/6/2019 @ 1:27 AM. + */ + +public class EventCancellable extends EventStageable { + + private boolean canceled; + + public EventCancellable() { + } + + public EventCancellable(EventStage stage) { + super(stage); + } + + public EventCancellable(EventStage stage, boolean canceled) { + super(stage); + this.canceled = canceled; + } + + public boolean isCanceled() { + return canceled; + } + + public void setCanceled(boolean canceled) { + this.canceled = canceled; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/EventStageable.java b/src/main/java/me/rigamortis/seppuku/api/event/EventStageable.java new file mode 100644 index 0000000..ebc99b4 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/EventStageable.java @@ -0,0 +1,31 @@ +package me.rigamortis.seppuku.api.event; + +/** + * Author Seth + * 4/5/2019 @ 6:37 PM. + */ +public class EventStageable { + + private EventStage stage; + + public EventStageable() { + + } + + public EventStageable(EventStage stage) { + this.stage = stage; + } + + public EventStage getStage() { + return stage; + } + + public void setStage(EventStage stage) { + this.stage = stage; + } + + public enum EventStage { + PRE, POST + } + +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/client/EventLoad.java b/src/main/java/me/rigamortis/seppuku/api/event/client/EventLoad.java new file mode 100644 index 0000000..9c06702 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/client/EventLoad.java @@ -0,0 +1,7 @@ +package me.rigamortis.seppuku.api.event.client; + +/** + * created by noil on 10/24/2019 at 7:19 PM + */ +public final class EventLoad { +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/client/EventReload.java b/src/main/java/me/rigamortis/seppuku/api/event/client/EventReload.java new file mode 100644 index 0000000..5366f08 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/client/EventReload.java @@ -0,0 +1,8 @@ +package me.rigamortis.seppuku.api.event.client; + +/** + * Author Seth + * 7/19/2019 @ 9:46 PM. + */ +public final class EventReload { +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/client/EventUnload.java b/src/main/java/me/rigamortis/seppuku/api/event/client/EventUnload.java new file mode 100644 index 0000000..1e6b41d --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/client/EventUnload.java @@ -0,0 +1,8 @@ +package me.rigamortis.seppuku.api.event.client; + +/** + * Author Seth + * 7/19/2019 @ 9:44 PM. + */ +public final class EventUnload { +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/command/EventCommandLoad.java b/src/main/java/me/rigamortis/seppuku/api/event/command/EventCommandLoad.java new file mode 100644 index 0000000..f09a283 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/command/EventCommandLoad.java @@ -0,0 +1,24 @@ +package me.rigamortis.seppuku.api.event.command; + +import me.rigamortis.seppuku.api.command.Command; + +/** + * Author Seth + * 6/10/2019 @ 2:37 PM. + */ +public class EventCommandLoad { + + private Command command; + + public EventCommandLoad(Command command) { + this.command = command; + } + + public Command getCommand() { + return command; + } + + public void setCommand(Command command) { + this.command = command; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/entity/EventHorseSaddled.java b/src/main/java/me/rigamortis/seppuku/api/event/entity/EventHorseSaddled.java new file mode 100644 index 0000000..bdcaad2 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/entity/EventHorseSaddled.java @@ -0,0 +1,10 @@ +package me.rigamortis.seppuku.api.event.entity; + +import me.rigamortis.seppuku.api.event.EventCancellable; + +/** + * Author Seth + * 4/9/2019 @ 11:53 AM. + */ +public class EventHorseSaddled extends EventCancellable { +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/entity/EventPigTravel.java b/src/main/java/me/rigamortis/seppuku/api/event/entity/EventPigTravel.java new file mode 100644 index 0000000..d64965d --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/entity/EventPigTravel.java @@ -0,0 +1,10 @@ +package me.rigamortis.seppuku.api.event.entity; + +import me.rigamortis.seppuku.api.event.EventCancellable; + +/** + * Author Seth + * 6/27/2019 @ 6:30 AM. + */ +public class EventPigTravel extends EventCancellable { +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/entity/EventSteerEntity.java b/src/main/java/me/rigamortis/seppuku/api/event/entity/EventSteerEntity.java new file mode 100644 index 0000000..83f4c8f --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/entity/EventSteerEntity.java @@ -0,0 +1,10 @@ +package me.rigamortis.seppuku.api.event.entity; + +import me.rigamortis.seppuku.api.event.EventCancellable; + +/** + * Author Seth + * 4/9/2019 @ 11:42 AM. + */ +public class EventSteerEntity extends EventCancellable { +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/gui/EventBookPage.java b/src/main/java/me/rigamortis/seppuku/api/event/gui/EventBookPage.java new file mode 100644 index 0000000..94761f5 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/gui/EventBookPage.java @@ -0,0 +1,22 @@ +package me.rigamortis.seppuku.api.event.gui; + +/** + * Author Seth + * 4/8/2019 @ 7:59 PM. + */ +public class EventBookPage { + + private String page; + + public EventBookPage(String page) { + this.page = page; + } + + public String getPage() { + return page; + } + + public void setPage(String page) { + this.page = page; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/gui/EventBookTitle.java b/src/main/java/me/rigamortis/seppuku/api/event/gui/EventBookTitle.java new file mode 100644 index 0000000..fd29822 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/gui/EventBookTitle.java @@ -0,0 +1,22 @@ +package me.rigamortis.seppuku.api.event.gui; + +/** + * Author Seth + * 4/8/2019 @ 7:58 PM. + */ +public class EventBookTitle { + + public String title; + + public EventBookTitle(String title) { + this.title = title; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/gui/EventRenderHelmet.java b/src/main/java/me/rigamortis/seppuku/api/event/gui/EventRenderHelmet.java new file mode 100644 index 0000000..c5c0e77 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/gui/EventRenderHelmet.java @@ -0,0 +1,10 @@ +package me.rigamortis.seppuku.api.event.gui; + +import me.rigamortis.seppuku.api.event.EventCancellable; + +/** + * Author Seth + * 4/8/2019 @ 8:19 PM. + */ +public class EventRenderHelmet extends EventCancellable { +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/gui/EventRenderPortal.java b/src/main/java/me/rigamortis/seppuku/api/event/gui/EventRenderPortal.java new file mode 100644 index 0000000..bff7c24 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/gui/EventRenderPortal.java @@ -0,0 +1,10 @@ +package me.rigamortis.seppuku.api.event.gui; + +import me.rigamortis.seppuku.api.event.EventCancellable; + +/** + * Author Seth + * 4/8/2019 @ 8:06 PM. + */ +public class EventRenderPortal extends EventCancellable { +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/gui/EventRenderPotions.java b/src/main/java/me/rigamortis/seppuku/api/event/gui/EventRenderPotions.java new file mode 100644 index 0000000..cb029d6 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/gui/EventRenderPotions.java @@ -0,0 +1,10 @@ +package me.rigamortis.seppuku.api.event.gui; + +import me.rigamortis.seppuku.api.event.EventCancellable; + +/** + * Author Seth + * 4/8/2019 @ 8:19 PM. + */ +public class EventRenderPotions extends EventCancellable { +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/minecraft/EventDisplayGui.java b/src/main/java/me/rigamortis/seppuku/api/event/minecraft/EventDisplayGui.java new file mode 100644 index 0000000..2f9e05c --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/minecraft/EventDisplayGui.java @@ -0,0 +1,25 @@ +package me.rigamortis.seppuku.api.event.minecraft; + +import me.rigamortis.seppuku.api.event.EventCancellable; +import net.minecraft.client.gui.GuiScreen; + +/** + * Author Seth + * 4/6/2019 @ 1:27 AM. + */ +public class EventDisplayGui extends EventCancellable { + + private GuiScreen screen; + + public EventDisplayGui(GuiScreen screen) { + this.screen = screen; + } + + public GuiScreen getScreen() { + return screen; + } + + public void setScreen(GuiScreen screen) { + this.screen = screen; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/minecraft/EventKeyPress.java b/src/main/java/me/rigamortis/seppuku/api/event/minecraft/EventKeyPress.java new file mode 100644 index 0000000..83b4852 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/minecraft/EventKeyPress.java @@ -0,0 +1,22 @@ +package me.rigamortis.seppuku.api.event.minecraft; + +/** + * Author Seth + * 4/6/2019 @ 1:18 AM. + */ +public class EventKeyPress { + + private int key; + + public EventKeyPress(int key) { + this.key = key; + } + + public int getKey() { + return key; + } + + public void setKey(int key) { + this.key = key; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/minecraft/EventRunTick.java b/src/main/java/me/rigamortis/seppuku/api/event/minecraft/EventRunTick.java new file mode 100644 index 0000000..5e05b98 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/minecraft/EventRunTick.java @@ -0,0 +1,15 @@ +package me.rigamortis.seppuku.api.event.minecraft; + +import me.rigamortis.seppuku.api.event.EventStageable; + +/** + * Author Seth + * 4/5/2019 @ 6:24 PM. + */ +public class EventRunTick extends EventStageable { + + public EventRunTick(EventStage stage) { + super(stage); + } + +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/minecraft/EventUpdateFramebufferSize.java b/src/main/java/me/rigamortis/seppuku/api/event/minecraft/EventUpdateFramebufferSize.java new file mode 100644 index 0000000..5ecb2b3 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/minecraft/EventUpdateFramebufferSize.java @@ -0,0 +1,9 @@ +package me.rigamortis.seppuku.api.event.minecraft; + +/** + * Author Seth + * 4/4/2019 @ 11:41 PM. + */ +public class EventUpdateFramebufferSize { + +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/module/EventModuleLoad.java b/src/main/java/me/rigamortis/seppuku/api/event/module/EventModuleLoad.java new file mode 100644 index 0000000..db64688 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/module/EventModuleLoad.java @@ -0,0 +1,24 @@ +package me.rigamortis.seppuku.api.event.module; + +import me.rigamortis.seppuku.api.module.Module; + +/** + * Author Seth + * 6/10/2019 @ 2:36 PM. + */ +public class EventModuleLoad { + + private Module mod; + + public EventModuleLoad(Module mod) { + this.mod = mod; + } + + public Module getMod() { + return mod; + } + + public void setMod(Module mod) { + this.mod = mod; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/network/EventReceivePacket.java b/src/main/java/me/rigamortis/seppuku/api/event/network/EventReceivePacket.java new file mode 100644 index 0000000..edea298 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/network/EventReceivePacket.java @@ -0,0 +1,26 @@ +package me.rigamortis.seppuku.api.event.network; + +import me.rigamortis.seppuku.api.event.EventCancellable; +import net.minecraft.network.Packet; + +/** + * Author Seth + * 4/6/2019 @ 1:45 PM. + */ +public class EventReceivePacket extends EventCancellable { + + private Packet packet; + + public EventReceivePacket(EventStage stage, Packet packet) { + super(stage); + this.packet = packet; + } + + public Packet getPacket() { + return packet; + } + + public void setPacket(Packet packet) { + this.packet = packet; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/network/EventSendPacket.java b/src/main/java/me/rigamortis/seppuku/api/event/network/EventSendPacket.java new file mode 100644 index 0000000..7c5fd54 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/network/EventSendPacket.java @@ -0,0 +1,26 @@ +package me.rigamortis.seppuku.api.event.network; + +import me.rigamortis.seppuku.api.event.EventCancellable; +import net.minecraft.network.Packet; + +/** + * Author Seth + * 4/6/2019 @ 1:42 PM. + */ +public final class EventSendPacket extends EventCancellable { + + private Packet packet; + + public EventSendPacket(EventStage stage, Packet packet) { + super(stage); + this.packet = packet; + } + + public Packet getPacket() { + return packet; + } + + public void setPacket(Packet packet) { + this.packet = packet; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/player/EventApplyCollision.java b/src/main/java/me/rigamortis/seppuku/api/event/player/EventApplyCollision.java new file mode 100644 index 0000000..463df5a --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/player/EventApplyCollision.java @@ -0,0 +1,10 @@ +package me.rigamortis.seppuku.api.event.player; + +import me.rigamortis.seppuku.api.event.EventCancellable; + +/** + * Author Seth + * 4/8/2019 @ 6:50 PM. + */ +public class EventApplyCollision extends EventCancellable { +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/player/EventClickBlock.java b/src/main/java/me/rigamortis/seppuku/api/event/player/EventClickBlock.java new file mode 100644 index 0000000..775dd2a --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/player/EventClickBlock.java @@ -0,0 +1,36 @@ +package me.rigamortis.seppuku.api.event.player; + +import me.rigamortis.seppuku.api.event.EventCancellable; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; + +/** + * Author Seth + * 4/6/2019 @ 6:20 PM. + */ +public class EventClickBlock extends EventCancellable { + + private BlockPos pos; + private EnumFacing face; + + public EventClickBlock(BlockPos pos, EnumFacing face) { + this.pos = pos; + this.face = face; + } + + public BlockPos getPos() { + return pos; + } + + public void setPos(BlockPos pos) { + this.pos = pos; + } + + public EnumFacing getFace() { + return face; + } + + public void setFace(EnumFacing face) { + this.face = face; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/player/EventCloseScreen.java b/src/main/java/me/rigamortis/seppuku/api/event/player/EventCloseScreen.java new file mode 100644 index 0000000..8ca6291 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/player/EventCloseScreen.java @@ -0,0 +1,10 @@ +package me.rigamortis.seppuku.api.event.player; + +import me.rigamortis.seppuku.api.event.EventCancellable; + +/** + * Author Seth + * 4/8/2019 @ 4:34 PM. + */ +public class EventCloseScreen extends EventCancellable { +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/player/EventDestroyBlock.java b/src/main/java/me/rigamortis/seppuku/api/event/player/EventDestroyBlock.java new file mode 100644 index 0000000..9372eb3 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/player/EventDestroyBlock.java @@ -0,0 +1,25 @@ +package me.rigamortis.seppuku.api.event.player; + +import me.rigamortis.seppuku.api.event.EventCancellable; +import net.minecraft.util.math.BlockPos; + +/** + * Author Seth + * 4/6/2019 @ 6:16 PM. + */ +public class EventDestroyBlock extends EventCancellable { + + private BlockPos pos; + + public EventDestroyBlock(BlockPos pos) { + this.pos = pos; + } + + public BlockPos getPos() { + return pos; + } + + public void setPos(BlockPos pos) { + this.pos = pos; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/player/EventExtendedReach.java b/src/main/java/me/rigamortis/seppuku/api/event/player/EventExtendedReach.java new file mode 100644 index 0000000..880b682 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/player/EventExtendedReach.java @@ -0,0 +1,10 @@ +package me.rigamortis.seppuku.api.event.player; + +import me.rigamortis.seppuku.api.event.EventCancellable; + +/** + * Author Seth + * 4/7/2019 @ 3:07 PM. + */ +public class EventExtendedReach extends EventCancellable { +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/player/EventGetBlockReachDistance.java b/src/main/java/me/rigamortis/seppuku/api/event/player/EventGetBlockReachDistance.java new file mode 100644 index 0000000..4155ebd --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/player/EventGetBlockReachDistance.java @@ -0,0 +1,25 @@ +package me.rigamortis.seppuku.api.event.player; + +/** + * Author Seth + * 4/6/2019 @ 6:35 PM. + */ +public class EventGetBlockReachDistance { + + private float distance; + + public EventGetBlockReachDistance() { + } + + public EventGetBlockReachDistance(float distance) { + this.distance = distance; + } + + public float getDistance() { + return distance; + } + + public void setDistance(float distance) { + this.distance = distance; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/player/EventHittingPosition.java b/src/main/java/me/rigamortis/seppuku/api/event/player/EventHittingPosition.java new file mode 100644 index 0000000..5bb49c2 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/player/EventHittingPosition.java @@ -0,0 +1,25 @@ +package me.rigamortis.seppuku.api.event.player; + +import me.rigamortis.seppuku.api.event.EventCancellable; +import net.minecraft.util.math.BlockPos; + +/** + * Author Seth + * 4/24/2019 @ 1:36 PM. + */ +public class EventHittingPosition extends EventCancellable { + + private BlockPos blockPos; + + public EventHittingPosition(BlockPos blockPos) { + this.blockPos = blockPos; + } + + public BlockPos getBlockPos() { + return blockPos; + } + + public void setBlockPos(BlockPos blockPos) { + this.blockPos = blockPos; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/player/EventMove.java b/src/main/java/me/rigamortis/seppuku/api/event/player/EventMove.java new file mode 100644 index 0000000..68d1baf --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/player/EventMove.java @@ -0,0 +1,56 @@ +package me.rigamortis.seppuku.api.event.player; + +import me.rigamortis.seppuku.api.event.EventCancellable; +import net.minecraft.entity.MoverType; + +/** + * Author Seth + * 4/25/2019 @ 7:01 PM. + */ +public class EventMove extends EventCancellable { + + private MoverType moverType; + + private double x; + private double y; + private double z; + + public EventMove(MoverType moverType, double x, double y, double z) { + this.moverType = moverType; + this.x = x; + this.y = y; + this.z = z; + } + + public MoverType getMoverType() { + return moverType; + } + + public void setMoverType(MoverType moverType) { + this.moverType = moverType; + } + + public double getX() { + return x; + } + + public void setX(double x) { + this.x = x; + } + + public double getY() { + return y; + } + + public void setY(double y) { + this.y = y; + } + + public double getZ() { + return z; + } + + public void setZ(double z) { + this.z = z; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/player/EventPlayerDamageBlock.java b/src/main/java/me/rigamortis/seppuku/api/event/player/EventPlayerDamageBlock.java new file mode 100644 index 0000000..d4bafc7 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/player/EventPlayerDamageBlock.java @@ -0,0 +1,36 @@ +package me.rigamortis.seppuku.api.event.player; + +import me.rigamortis.seppuku.api.event.EventCancellable; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; + +/** + * Author Seth + * 4/6/2019 @ 6:31 PM. + */ +public class EventPlayerDamageBlock extends EventCancellable { + + private BlockPos pos; + private EnumFacing face; + + public EventPlayerDamageBlock(BlockPos pos, EnumFacing face) { + this.pos = pos; + this.face = face; + } + + public BlockPos getPos() { + return pos; + } + + public void setPos(BlockPos pos) { + this.pos = pos; + } + + public EnumFacing getFace() { + return face; + } + + public void setFace(EnumFacing face) { + this.face = face; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/player/EventPlayerJoin.java b/src/main/java/me/rigamortis/seppuku/api/event/player/EventPlayerJoin.java new file mode 100644 index 0000000..15bd6d7 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/player/EventPlayerJoin.java @@ -0,0 +1,32 @@ +package me.rigamortis.seppuku.api.event.player; + +/** + * Author Seth + * 7/23/2019 @ 7:41 AM. + */ +public class EventPlayerJoin { + + private String name; + private String uuid; + + public EventPlayerJoin(String name, String uuid) { + this.name = name; + this.uuid = uuid; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/player/EventPlayerLeave.java b/src/main/java/me/rigamortis/seppuku/api/event/player/EventPlayerLeave.java new file mode 100644 index 0000000..4b79171 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/player/EventPlayerLeave.java @@ -0,0 +1,33 @@ +package me.rigamortis.seppuku.api.event.player; + +/** + * Author Seth + * 7/23/2019 @ 7:41 AM. + */ +public class EventPlayerLeave { + + private String name; + private String uuid; + + public EventPlayerLeave(String name, String uuid) { + this.name = name; + this.uuid = uuid; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/player/EventPlayerUpdate.java b/src/main/java/me/rigamortis/seppuku/api/event/player/EventPlayerUpdate.java new file mode 100644 index 0000000..d3bf308 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/player/EventPlayerUpdate.java @@ -0,0 +1,15 @@ +package me.rigamortis.seppuku.api.event.player; + +import me.rigamortis.seppuku.api.event.EventCancellable; + +/** + * Author Seth + * 4/8/2019 @ 3:03 AM. + */ +public class EventPlayerUpdate extends EventCancellable { + + public EventPlayerUpdate(EventStage stage) { + super(stage); + } + +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/player/EventPushOutOfBlocks.java b/src/main/java/me/rigamortis/seppuku/api/event/player/EventPushOutOfBlocks.java new file mode 100644 index 0000000..c3a9f03 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/player/EventPushOutOfBlocks.java @@ -0,0 +1,10 @@ +package me.rigamortis.seppuku.api.event.player; + +import me.rigamortis.seppuku.api.event.EventCancellable; + +/** + * Author Seth + * 4/8/2019 @ 4:39 PM. + */ +public class EventPushOutOfBlocks extends EventCancellable { +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/player/EventPushedByWater.java b/src/main/java/me/rigamortis/seppuku/api/event/player/EventPushedByWater.java new file mode 100644 index 0000000..ac81a0b --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/player/EventPushedByWater.java @@ -0,0 +1,10 @@ +package me.rigamortis.seppuku.api.event.player; + +import me.rigamortis.seppuku.api.event.EventCancellable; + +/** + * Author Seth + * 4/8/2019 @ 6:50 PM. + */ +public class EventPushedByWater extends EventCancellable { +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/player/EventResetBlockRemoving.java b/src/main/java/me/rigamortis/seppuku/api/event/player/EventResetBlockRemoving.java new file mode 100644 index 0000000..da7e95e --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/player/EventResetBlockRemoving.java @@ -0,0 +1,10 @@ +package me.rigamortis.seppuku.api.event.player; + +import me.rigamortis.seppuku.api.event.EventCancellable; + +/** + * Author Seth + * 4/6/2019 @ 6:27 PM. + */ +public class EventResetBlockRemoving extends EventCancellable { +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/player/EventRightClick.java b/src/main/java/me/rigamortis/seppuku/api/event/player/EventRightClick.java new file mode 100644 index 0000000..00c9597 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/player/EventRightClick.java @@ -0,0 +1,25 @@ +package me.rigamortis.seppuku.api.event.player; + +import me.rigamortis.seppuku.api.event.EventCancellable; +import net.minecraft.util.EnumHand; + +/** + * Author Seth + * 4/7/2019 @ 4:51 PM. + */ +public class EventRightClick extends EventCancellable { + + private EnumHand hand; + + public EventRightClick(EnumHand hand) { + this.hand = hand; + } + + public EnumHand getHand() { + return hand; + } + + public void setHand(EnumHand hand) { + this.hand = hand; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/player/EventRightClickBlock.java b/src/main/java/me/rigamortis/seppuku/api/event/player/EventRightClickBlock.java new file mode 100644 index 0000000..e9a33c6 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/player/EventRightClickBlock.java @@ -0,0 +1,58 @@ +package me.rigamortis.seppuku.api.event.player; + +import me.rigamortis.seppuku.api.event.EventCancellable; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.EnumHand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Vec3d; + +/** + * Author Seth + * 4/7/2019 @ 3:18 PM. + */ +public class EventRightClickBlock extends EventCancellable { + + private BlockPos pos; + private EnumFacing facing; + private Vec3d vec; + private EnumHand hand; + + public EventRightClickBlock(BlockPos pos, EnumFacing facing, Vec3d vec, EnumHand hand) { + this.pos = pos; + this.facing = facing; + this.vec = vec; + this.hand = hand; + } + + public BlockPos getPos() { + return pos; + } + + public void setPos(BlockPos pos) { + this.pos = pos; + } + + public EnumFacing getFacing() { + return facing; + } + + public void setFacing(EnumFacing facing) { + this.facing = facing; + } + + public Vec3d getVec() { + return vec; + } + + public void setVec(Vec3d vec) { + this.vec = vec; + } + + public EnumHand getHand() { + return hand; + } + + public void setHand(EnumHand hand) { + this.hand = hand; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/player/EventSendChatMessage.java b/src/main/java/me/rigamortis/seppuku/api/event/player/EventSendChatMessage.java new file mode 100644 index 0000000..bf3e620 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/player/EventSendChatMessage.java @@ -0,0 +1,24 @@ +package me.rigamortis.seppuku.api.event.player; + +import me.rigamortis.seppuku.api.event.EventCancellable; + +/** + * Author Seth + * 4/8/2019 @ 3:57 AM. + */ +public class EventSendChatMessage extends EventCancellable { + + private String message; + + public EventSendChatMessage(String message) { + this.message = message; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/player/EventStep.java b/src/main/java/me/rigamortis/seppuku/api/event/player/EventStep.java new file mode 100644 index 0000000..f084467 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/player/EventStep.java @@ -0,0 +1,8 @@ +package me.rigamortis.seppuku.api.event.player; + +/** + * Author Seth + * 5/24/2019 @ 3:47 AM. + */ +public class EventStep { +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/player/EventSwingArm.java b/src/main/java/me/rigamortis/seppuku/api/event/player/EventSwingArm.java new file mode 100644 index 0000000..044cccd --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/player/EventSwingArm.java @@ -0,0 +1,25 @@ +package me.rigamortis.seppuku.api.event.player; + +import me.rigamortis.seppuku.api.event.EventCancellable; +import net.minecraft.util.EnumHand; + +/** + * Author Seth + * 4/8/2019 @ 3:57 AM. + */ +public class EventSwingArm extends EventCancellable { + + private EnumHand hand; + + public EventSwingArm(EnumHand hand) { + this.hand = hand; + } + + public EnumHand getHand() { + return hand; + } + + public void setHand(EnumHand hand) { + this.hand = hand; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/player/EventUpdateInput.java b/src/main/java/me/rigamortis/seppuku/api/event/player/EventUpdateInput.java new file mode 100644 index 0000000..ef8500d --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/player/EventUpdateInput.java @@ -0,0 +1,8 @@ +package me.rigamortis.seppuku.api.event.player; + +/** + * Author Seth + * 4/10/2019 @ 3:15 AM. + */ +public class EventUpdateInput { +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/player/EventUpdateWalkingPlayer.java b/src/main/java/me/rigamortis/seppuku/api/event/player/EventUpdateWalkingPlayer.java new file mode 100644 index 0000000..5d33098 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/player/EventUpdateWalkingPlayer.java @@ -0,0 +1,15 @@ +package me.rigamortis.seppuku.api.event.player; + +import me.rigamortis.seppuku.api.event.EventCancellable; + +/** + * Author Seth + * 4/8/2019 @ 3:50 AM. + */ +public class EventUpdateWalkingPlayer extends EventCancellable { + + public EventUpdateWalkingPlayer(EventStage stage) { + super(stage); + } + +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/render/EventHurtCamEffect.java b/src/main/java/me/rigamortis/seppuku/api/event/render/EventHurtCamEffect.java new file mode 100644 index 0000000..50cfd00 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/render/EventHurtCamEffect.java @@ -0,0 +1,10 @@ +package me.rigamortis.seppuku.api.event.render; + +import me.rigamortis.seppuku.api.event.EventCancellable; + +/** + * Author Seth + * 4/9/2019 @ 12:41 AM. + */ +public class EventHurtCamEffect extends EventCancellable { +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/render/EventOrientCamera.java b/src/main/java/me/rigamortis/seppuku/api/event/render/EventOrientCamera.java new file mode 100644 index 0000000..a43bc80 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/render/EventOrientCamera.java @@ -0,0 +1,10 @@ +package me.rigamortis.seppuku.api.event.render; + +import me.rigamortis.seppuku.api.event.EventCancellable; + +/** + * Author Seth + * 7/22/2019 @ 8:26 AM. + */ +public class EventOrientCamera extends EventCancellable { +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/render/EventRender2D.java b/src/main/java/me/rigamortis/seppuku/api/event/render/EventRender2D.java new file mode 100644 index 0000000..bb53620 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/render/EventRender2D.java @@ -0,0 +1,34 @@ +package me.rigamortis.seppuku.api.event.render; + +import net.minecraft.client.gui.ScaledResolution; + +/** + * Author Seth + * 4/6/2019 @ 1:08 PM. + */ +public class EventRender2D { + + private float partialTicks; + private ScaledResolution scaledResolution; + + public EventRender2D(float partialTicks, ScaledResolution scaledResolution) { + this.partialTicks = partialTicks; + this.scaledResolution = scaledResolution; + } + + public float getPartialTicks() { + return partialTicks; + } + + public void setPartialTicks(float partialTicks) { + this.partialTicks = partialTicks; + } + + public ScaledResolution getScaledResolution() { + return scaledResolution; + } + + public void setScaledResolution(ScaledResolution scaledResolution) { + this.scaledResolution = scaledResolution; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/render/EventRender3D.java b/src/main/java/me/rigamortis/seppuku/api/event/render/EventRender3D.java new file mode 100644 index 0000000..7c8fe2d --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/render/EventRender3D.java @@ -0,0 +1,22 @@ +package me.rigamortis.seppuku.api.event.render; + +/** + * Author Seth + * 4/6/2019 @ 1:20 PM. + */ +public class EventRender3D { + + private float partialTicks; + + public EventRender3D(float partialTicks) { + this.partialTicks = partialTicks; + } + + public float getPartialTicks() { + return partialTicks; + } + + public void setPartialTicks(float partialTicks) { + this.partialTicks = partialTicks; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/render/EventRenderBlockModel.java b/src/main/java/me/rigamortis/seppuku/api/event/render/EventRenderBlockModel.java new file mode 100644 index 0000000..dec4fcd --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/render/EventRenderBlockModel.java @@ -0,0 +1,98 @@ +package me.rigamortis.seppuku.api.event.render; + +import me.rigamortis.seppuku.api.event.EventCancellable; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.BufferBuilder; +import net.minecraft.client.renderer.block.model.IBakedModel; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; + +/** + * Author Seth + * 4/10/2019 @ 4:10 PM. + */ +public class EventRenderBlockModel extends EventCancellable { + + private IBlockAccess blockAccess; + private IBakedModel bakedModel; + private IBlockState blockState; + private BlockPos blockPos; + private BufferBuilder bufferBuilder; + private boolean checkSides; + private long rand; + private boolean renderable; + + public EventRenderBlockModel(IBlockAccess blockAccess, IBakedModel bakedModel, IBlockState blockState, BlockPos blockPos, BufferBuilder bufferBuilder, boolean checkSides, long rand) { + this.blockAccess = blockAccess; + this.bakedModel = bakedModel; + this.blockState = blockState; + this.blockPos = blockPos; + this.bufferBuilder = bufferBuilder; + this.checkSides = checkSides; + this.rand = rand; + } + + public IBlockAccess getBlockAccess() { + return blockAccess; + } + + public void setBlockAccess(IBlockAccess blockAccess) { + this.blockAccess = blockAccess; + } + + public IBakedModel getBakedModel() { + return bakedModel; + } + + public void setBakedModel(IBakedModel bakedModel) { + this.bakedModel = bakedModel; + } + + public IBlockState getBlockState() { + return blockState; + } + + public void setBlockState(IBlockState blockState) { + this.blockState = blockState; + } + + public BlockPos getBlockPos() { + return blockPos; + } + + public void setBlockPos(BlockPos blockPos) { + this.blockPos = blockPos; + } + + public BufferBuilder getBufferBuilder() { + return bufferBuilder; + } + + public void setBufferBuilder(BufferBuilder bufferBuilder) { + this.bufferBuilder = bufferBuilder; + } + + public boolean isCheckSides() { + return checkSides; + } + + public void setCheckSides(boolean checkSides) { + this.checkSides = checkSides; + } + + public long getRand() { + return rand; + } + + public void setRand(long rand) { + this.rand = rand; + } + + public boolean isRenderable() { + return renderable; + } + + public void setRenderable(boolean renderable) { + this.renderable = renderable; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/render/EventRenderBlockSide.java b/src/main/java/me/rigamortis/seppuku/api/event/render/EventRenderBlockSide.java new file mode 100644 index 0000000..9ecb857 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/render/EventRenderBlockSide.java @@ -0,0 +1,34 @@ +package me.rigamortis.seppuku.api.event.render; + +import me.rigamortis.seppuku.api.event.EventCancellable; +import net.minecraft.block.Block; + +/** + * Author Seth + * 4/9/2019 @ 12:21 PM. + */ +public class EventRenderBlockSide extends EventCancellable { + + private Block block; + private boolean renderable; + + public EventRenderBlockSide(Block block) { + this.block = block; + } + + public Block getBlock() { + return block; + } + + public void setBlock(Block block) { + this.block = block; + } + + public boolean isRenderable() { + return renderable; + } + + public void setRenderable(boolean renderable) { + this.renderable = renderable; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/render/EventRenderBossHealth.java b/src/main/java/me/rigamortis/seppuku/api/event/render/EventRenderBossHealth.java new file mode 100644 index 0000000..20b4b31 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/render/EventRenderBossHealth.java @@ -0,0 +1,10 @@ +package me.rigamortis.seppuku.api.event.render; + +import me.rigamortis.seppuku.api.event.EventCancellable; + +/** + * Author Seth + * 9/30/2019 @ 6:45 AM. + */ +public class EventRenderBossHealth extends EventCancellable { +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/render/EventRenderEntity.java b/src/main/java/me/rigamortis/seppuku/api/event/render/EventRenderEntity.java new file mode 100644 index 0000000..ebaa745 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/render/EventRenderEntity.java @@ -0,0 +1,76 @@ +package me.rigamortis.seppuku.api.event.render; + +import me.rigamortis.seppuku.api.event.EventCancellable; +import net.minecraft.entity.Entity; + +/** + * Author Seth + * 4/9/2019 @ 10:43 AM. + */ +public class EventRenderEntity extends EventCancellable { + + private Entity entity; + private double x; + private double y; + private double z; + private float yaw; + private float partialTicks; + + public EventRenderEntity(EventStage stage, Entity entity, double x, double y, double z, float yaw, float partialTicks) { + super(stage); + this.entity = entity; + this.x = x; + this.y = y; + this.z = z; + this.yaw = yaw; + this.partialTicks = partialTicks; + } + + public Entity getEntity() { + return entity; + } + + public void setEntity(Entity entity) { + this.entity = entity; + } + + public double getX() { + return x; + } + + public void setX(double x) { + this.x = x; + } + + public double getY() { + return y; + } + + public void setY(double y) { + this.y = y; + } + + public double getZ() { + return z; + } + + public void setZ(double z) { + this.z = z; + } + + public float getYaw() { + return yaw; + } + + public void setYaw(float yaw) { + this.yaw = yaw; + } + + public float getPartialTicks() { + return partialTicks; + } + + public void setPartialTicks(float partialTicks) { + this.partialTicks = partialTicks; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/render/EventRenderFluid.java b/src/main/java/me/rigamortis/seppuku/api/event/render/EventRenderFluid.java new file mode 100644 index 0000000..c013e8a --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/render/EventRenderFluid.java @@ -0,0 +1,67 @@ +package me.rigamortis.seppuku.api.event.render; + +import me.rigamortis.seppuku.api.event.EventCancellable; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.BufferBuilder; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; + +/** + * Author Seth + * 4/11/2019 @ 3:21 AM. + */ +public class EventRenderFluid extends EventCancellable { + + private IBlockAccess blockAccess; + private IBlockState blockState; + private BlockPos blockPos; + private BufferBuilder bufferBuilder; + private boolean renderable; + + public EventRenderFluid(IBlockAccess blockAccess, IBlockState blockState, BlockPos blockPos, BufferBuilder bufferBuilder) { + this.blockAccess = blockAccess; + this.blockState = blockState; + this.blockPos = blockPos; + this.bufferBuilder = bufferBuilder; + } + + public IBlockAccess getBlockAccess() { + return blockAccess; + } + + public void setBlockAccess(IBlockAccess blockAccess) { + this.blockAccess = blockAccess; + } + + public IBlockState getBlockState() { + return blockState; + } + + public void setBlockState(IBlockState blockState) { + this.blockState = blockState; + } + + public BlockPos getBlockPos() { + return blockPos; + } + + public void setBlockPos(BlockPos blockPos) { + this.blockPos = blockPos; + } + + public BufferBuilder getBufferBuilder() { + return bufferBuilder; + } + + public void setBufferBuilder(BufferBuilder bufferBuilder) { + this.bufferBuilder = bufferBuilder; + } + + public boolean isRenderable() { + return renderable; + } + + public void setRenderable(boolean renderable) { + this.renderable = renderable; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/render/EventRenderLivingEntity.java b/src/main/java/me/rigamortis/seppuku/api/event/render/EventRenderLivingEntity.java new file mode 100644 index 0000000..d49b5e9 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/render/EventRenderLivingEntity.java @@ -0,0 +1,26 @@ +package me.rigamortis.seppuku.api.event.render; + +import me.rigamortis.seppuku.api.event.EventCancellable; +import net.minecraft.entity.EntityLivingBase; + +/** + * Author Seth + * 4/23/2019 @ 12:41 PM. + */ +public class EventRenderLivingEntity extends EventCancellable { + + private EntityLivingBase entity; + + public EventRenderLivingEntity(EventStage stage, EntityLivingBase entity) { + super(stage); + this.entity = entity; + } + + public EntityLivingBase getEntity() { + return entity; + } + + public void setEntity(EntityLivingBase entity) { + this.entity = entity; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/render/EventRenderName.java b/src/main/java/me/rigamortis/seppuku/api/event/render/EventRenderName.java new file mode 100644 index 0000000..f417353 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/render/EventRenderName.java @@ -0,0 +1,25 @@ +package me.rigamortis.seppuku.api.event.render; + +import me.rigamortis.seppuku.api.event.EventCancellable; +import net.minecraft.entity.EntityLivingBase; + +/** + * Author Seth + * 4/9/2019 @ 11:01 AM. + */ +public class EventRenderName extends EventCancellable { + + private EntityLivingBase entity; + + public EventRenderName(EntityLivingBase entity) { + this.entity = entity; + } + + public EntityLivingBase getEntity() { + return entity; + } + + public void setEntity(EntityLivingBase entity) { + this.entity = entity; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/render/EventRenderOverlay.java b/src/main/java/me/rigamortis/seppuku/api/event/render/EventRenderOverlay.java new file mode 100644 index 0000000..977fd2d --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/render/EventRenderOverlay.java @@ -0,0 +1,31 @@ +package me.rigamortis.seppuku.api.event.render; + +import me.rigamortis.seppuku.api.event.EventCancellable; + +/** + * Author Seth + * 4/9/2019 @ 12:33 AM. + */ +public class EventRenderOverlay extends EventCancellable { + + private OverlayType type; + + public EventRenderOverlay(OverlayType type) { + this.type = type; + } + + public OverlayType getType() { + return type; + } + + public void setType(OverlayType type) { + this.type = type; + } + + public enum OverlayType { + BLOCK, + LIQUID, + FIRE + } + +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/world/EventAddCollisionBox.java b/src/main/java/me/rigamortis/seppuku/api/event/world/EventAddCollisionBox.java new file mode 100644 index 0000000..94409dc --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/world/EventAddCollisionBox.java @@ -0,0 +1,36 @@ +package me.rigamortis.seppuku.api.event.world; + +import me.rigamortis.seppuku.api.event.EventCancellable; +import net.minecraft.entity.Entity; +import net.minecraft.util.math.BlockPos; + +/** + * Author Seth + * 4/10/2019 @ 2:08 AM. + */ +public class EventAddCollisionBox extends EventCancellable { + + private BlockPos pos; + private Entity entity; + + public EventAddCollisionBox(BlockPos pos, Entity entity) { + this.pos = pos; + this.entity = entity; + } + + public BlockPos getPos() { + return pos; + } + + public void setPos(BlockPos pos) { + this.pos = pos; + } + + public Entity getEntity() { + return entity; + } + + public void setEntity(Entity entity) { + this.entity = entity; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/world/EventCanCollide.java b/src/main/java/me/rigamortis/seppuku/api/event/world/EventCanCollide.java new file mode 100644 index 0000000..874b00d --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/world/EventCanCollide.java @@ -0,0 +1,10 @@ +package me.rigamortis.seppuku.api.event.world; + +import me.rigamortis.seppuku.api.event.EventCancellable; + +/** + * Author Seth + * 6/5/2019 @ 10:52 PM. + */ +public class EventCanCollide extends EventCancellable { +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/world/EventCollideSoulSand.java b/src/main/java/me/rigamortis/seppuku/api/event/world/EventCollideSoulSand.java new file mode 100644 index 0000000..cc925a5 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/world/EventCollideSoulSand.java @@ -0,0 +1,10 @@ +package me.rigamortis.seppuku.api.event.world; + +import me.rigamortis.seppuku.api.event.EventCancellable; + +/** + * Author Seth + * 4/10/2019 @ 2:53 AM. + */ +public class EventCollideSoulSand extends EventCancellable { +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/world/EventFoliageColor.java b/src/main/java/me/rigamortis/seppuku/api/event/world/EventFoliageColor.java new file mode 100644 index 0000000..3bf5add --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/world/EventFoliageColor.java @@ -0,0 +1,23 @@ +package me.rigamortis.seppuku.api.event.world; + +import me.rigamortis.seppuku.api.event.EventCancellable; + +/** + * Author Seth + * 8/11/2019 @ 2:44 AM. + */ +public class EventFoliageColor extends EventCancellable { + + private int color; + + public EventFoliageColor() { + } + + public int getColor() { + return color; + } + + public void setColor(int color) { + this.color = color; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/world/EventGetBlockLayer.java b/src/main/java/me/rigamortis/seppuku/api/event/world/EventGetBlockLayer.java new file mode 100644 index 0000000..08b5e54 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/world/EventGetBlockLayer.java @@ -0,0 +1,36 @@ +package me.rigamortis.seppuku.api.event.world; + +import me.rigamortis.seppuku.api.event.EventCancellable; +import net.minecraft.block.Block; +import net.minecraft.util.BlockRenderLayer; + +/** + * Author Seth + * 4/9/2019 @ 1:54 PM. + */ +public class EventGetBlockLayer extends EventCancellable { + + private Block block; + private BlockRenderLayer layer; + + public EventGetBlockLayer(Block block) { + this.block = block; + } + + public Block getBlock() { + return block; + } + + public void setBlock(Block block) { + this.block = block; + } + + public BlockRenderLayer getLayer() { + return layer; + } + + public void setLayer(BlockRenderLayer layer) { + this.layer = layer; + } +} + diff --git a/src/main/java/me/rigamortis/seppuku/api/event/world/EventGrassColor.java b/src/main/java/me/rigamortis/seppuku/api/event/world/EventGrassColor.java new file mode 100644 index 0000000..c53bce0 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/world/EventGrassColor.java @@ -0,0 +1,23 @@ +package me.rigamortis.seppuku.api.event.world; + +import me.rigamortis.seppuku.api.event.EventCancellable; + +/** + * Author Seth + * 8/11/2019 @ 2:10 AM. + */ +public class EventGrassColor extends EventCancellable { + + private int color; + + public EventGrassColor() { + } + + public int getColor() { + return color; + } + + public void setColor(int color) { + this.color = color; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/world/EventLandOnSlime.java b/src/main/java/me/rigamortis/seppuku/api/event/world/EventLandOnSlime.java new file mode 100644 index 0000000..c6cdec7 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/world/EventLandOnSlime.java @@ -0,0 +1,10 @@ +package me.rigamortis.seppuku.api.event.world; + +import me.rigamortis.seppuku.api.event.EventCancellable; + +/** + * Author Seth + * 4/16/2019 @ 3:54 AM. + */ +public class EventLandOnSlime extends EventCancellable { +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/world/EventLightUpdate.java b/src/main/java/me/rigamortis/seppuku/api/event/world/EventLightUpdate.java new file mode 100644 index 0000000..a0f960a --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/world/EventLightUpdate.java @@ -0,0 +1,15 @@ +package me.rigamortis.seppuku.api.event.world; + +import me.rigamortis.seppuku.api.event.EventCancellable; + +/** + * Author Seth + * 4/6/2019 @ 1:28 PM. + */ +public class EventLightUpdate extends EventCancellable { + + public EventLightUpdate() { + + } + +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/world/EventLiquidCollisionBB.java b/src/main/java/me/rigamortis/seppuku/api/event/world/EventLiquidCollisionBB.java new file mode 100644 index 0000000..88c4455 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/world/EventLiquidCollisionBB.java @@ -0,0 +1,39 @@ +package me.rigamortis.seppuku.api.event.world; + +import me.rigamortis.seppuku.api.event.EventCancellable; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; + +/** + * Author Seth + * 4/16/2019 @ 7:37 AM. + */ +public class EventLiquidCollisionBB extends EventCancellable { + + private AxisAlignedBB boundingBox; + private BlockPos blockPos; + + public EventLiquidCollisionBB() { + + } + + public EventLiquidCollisionBB(BlockPos blockPos) { + this.blockPos = blockPos; + } + + public AxisAlignedBB getBoundingBox() { + return boundingBox; + } + + public void setBoundingBox(AxisAlignedBB boundingBox) { + this.boundingBox = boundingBox; + } + + public BlockPos getBlockPos() { + return blockPos; + } + + public void setBlockPos(BlockPos blockPos) { + this.blockPos = blockPos; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/world/EventSetOpaqueCube.java b/src/main/java/me/rigamortis/seppuku/api/event/world/EventSetOpaqueCube.java new file mode 100644 index 0000000..8395f29 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/world/EventSetOpaqueCube.java @@ -0,0 +1,10 @@ +package me.rigamortis.seppuku.api.event.world; + +import me.rigamortis.seppuku.api.event.EventCancellable; + +/** + * Author Seth + * 4/7/2019 @ 5:03 PM. + */ +public class EventSetOpaqueCube extends EventCancellable { +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/world/EventWalkOnSlime.java b/src/main/java/me/rigamortis/seppuku/api/event/world/EventWalkOnSlime.java new file mode 100644 index 0000000..1775ae1 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/world/EventWalkOnSlime.java @@ -0,0 +1,10 @@ +package me.rigamortis.seppuku.api.event.world; + +import me.rigamortis.seppuku.api.event.EventCancellable; + +/** + * Author Seth + * 4/16/2019 @ 3:42 AM. + */ +public class EventWalkOnSlime extends EventCancellable { +} diff --git a/src/main/java/me/rigamortis/seppuku/api/event/world/EventWaterColor.java b/src/main/java/me/rigamortis/seppuku/api/event/world/EventWaterColor.java new file mode 100644 index 0000000..007b2d9 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/event/world/EventWaterColor.java @@ -0,0 +1,23 @@ +package me.rigamortis.seppuku.api.event.world; + +import me.rigamortis.seppuku.api.event.EventCancellable; + +/** + * Author Seth + * 8/11/2019 @ 2:44 AM. + */ +public class EventWaterColor extends EventCancellable { + + private int color; + + public EventWaterColor() { + } + + public int getColor() { + return color; + } + + public void setColor(int color) { + this.color = color; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/friend/Friend.java b/src/main/java/me/rigamortis/seppuku/api/friend/Friend.java new file mode 100644 index 0000000..780ed24 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/friend/Friend.java @@ -0,0 +1,51 @@ +package me.rigamortis.seppuku.api.friend; + +/** + * Author Seth + * 4/16/2019 @ 11:28 PM. + */ +public final class Friend { + + private String name; + private String uuid; + private String alias; + + public Friend() { + + } + + public Friend(String name, String alias) { + this.name = name; + this.alias = alias; + } + + public Friend(String name, String uuid, String alias) { + this.name = name; + this.uuid = uuid; + this.alias = alias; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public String getAlias() { + return alias; + } + + public void setAlias(String alias) { + this.alias = alias; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/gui/hud/component/DraggableHudComponent.java b/src/main/java/me/rigamortis/seppuku/api/gui/hud/component/DraggableHudComponent.java new file mode 100644 index 0000000..0f91868 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/gui/hud/component/DraggableHudComponent.java @@ -0,0 +1,278 @@ +package me.rigamortis.seppuku.api.gui.hud.component; + +import me.rigamortis.seppuku.Seppuku; +import me.rigamortis.seppuku.api.util.RenderUtil; +import me.rigamortis.seppuku.impl.gui.hud.GuiHudEditor; +import me.rigamortis.seppuku.impl.gui.hud.anchor.AnchorPoint; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.util.math.MathHelper; + +/** + * Author Seth + * 7/25/2019 @ 7:17 AM. + */ +public class DraggableHudComponent extends HudComponent { + + private boolean dragging; + private float deltaX; + private float deltaY; + + private AnchorPoint anchorPoint; + + private DraggableHudComponent glued; + private GlueSide glueSide; + + public DraggableHudComponent(String name) { + this.setName(name); + this.setVisible(false); + this.setX(Minecraft.getMinecraft().displayWidth / 2.0f); + this.setY(Minecraft.getMinecraft().displayHeight / 2.0f); + } + + @Override + public void mouseClick(int mouseX, int mouseY, int button) { + final boolean inside = mouseX >= this.getX() && mouseX <= this.getX() + this.getW() && mouseY >= this.getY() && mouseY <= this.getY() + this.getH(); + + if (inside) { + if (button == 0) { + this.setDragging(true); + this.setDeltaX(mouseX - this.getX()); + this.setDeltaY(mouseY - this.getY()); + Seppuku.INSTANCE.getHudManager().moveToTop(this); + this.anchorPoint = null; + this.glued = null; + this.glueSide = null; + } + } + } + + @Override + public void render(int mouseX, int mouseY, float partialTicks) { + super.render(mouseX, mouseY, partialTicks); + + if (this.isDragging()) { + this.setX(mouseX - this.getDeltaX()); + this.setY(mouseY - this.getDeltaY()); + this.clamp(); + } + + final boolean inside = mouseX >= this.getX() && mouseX <= this.getX() + this.getW() && mouseY >= this.getY() && mouseY <= this.getY() + this.getH(); + if (inside) { + RenderUtil.drawRect(this.getX(), this.getY(), this.getX() + this.getW(), this.getY() + this.getH(), 0x45FFFFFF); + } + + if (Minecraft.getMinecraft().currentScreen instanceof GuiHudEditor) { + RenderUtil.drawRect(this.getX(), this.getY(), this.getX() + this.getW(), this.getY() + this.getH(), 0x75101010); + } + + if (this.glued != null) { + if (this.glued.getAnchorPoint() == null) { + if (this.anchorPoint != null) { + this.anchorPoint = null; + } + } else { + this.anchorPoint = this.glued.getAnchorPoint(); + } + } + + if (this.anchorPoint == null && this.glued != null) { + this.setX(this.glued.getX()); + if (this.glueSide != null) { + switch (this.glueSide) { + case TOP: + this.setY(this.glued.getY() - this.getH()); + break; + case BOTTOM: + this.setY(this.glued.getY() + this.glued.getH()); + break; + } + } + } + + if (!this.isDragging()) { + if (this.anchorPoint != null && this.glued != null) { + switch (this.anchorPoint.getPoint()) { + case TOP_LEFT: + this.setX(this.anchorPoint.getX()); + break; + case BOTTOM_LEFT: + this.setX(this.anchorPoint.getX()); + break; + case TOP_RIGHT: + this.setX(this.anchorPoint.getX() - this.getW()); + break; + case BOTTOM_RIGHT: + this.setX(this.anchorPoint.getX() - this.getW()); + break; + case TOP_CENTER: + this.setX(this.anchorPoint.getX() - (this.getW() / 2)); + break; + } + if (this.glueSide != null) { + switch (this.glueSide) { + case TOP: + this.setY(this.glued.getY() - this.getH()); + break; + case BOTTOM: + this.setY(this.glued.getY() + this.glued.getH()); + break; + } + } + } else if (this.anchorPoint != null) { + switch (this.anchorPoint.getPoint()) { + case TOP_LEFT: + this.setX(this.anchorPoint.getX()); + this.setY(this.anchorPoint.getY()); + break; + case BOTTOM_LEFT: + this.setX(this.anchorPoint.getX()); + this.setY(this.anchorPoint.getY() - this.getH()); + break; + case TOP_RIGHT: + this.setX(this.anchorPoint.getX() - this.getW()); + this.setY(this.anchorPoint.getY()); + break; + case BOTTOM_RIGHT: + this.setX(this.anchorPoint.getX() - this.getW()); + this.setY(this.anchorPoint.getY() - this.getH()); + break; + case TOP_CENTER: + this.setX(this.anchorPoint.getX() - (this.getW() / 2)); + this.setY(this.anchorPoint.getY()); + break; + } + } + } + + this.clamp(); + } + + @Override + public void mouseRelease(int mouseX, int mouseY, int button) { + super.mouseRelease(mouseX, mouseY, button); + + if (button == 0) { + if (this.isDragging()) { + this.anchorPoint = this.findClosest(mouseX, mouseY); + + for (HudComponent component : Seppuku.INSTANCE.getHudManager().getComponentList()) { + if (component instanceof DraggableHudComponent) { + DraggableHudComponent draggable = (DraggableHudComponent) component; + if (draggable != this && this.collidesWith(draggable) && draggable.isVisible()) { + if ((this.getY() + (this.getH() / 2)) < (draggable.getY() + (draggable.getH() / 2))) { // top + this.setY(draggable.getY() - this.getH()); + this.glueSide = GlueSide.TOP; + this.glued = draggable; + if (draggable.getAnchorPoint() != null) { + this.anchorPoint = draggable.getAnchorPoint(); + } + } else if ((this.getY() + (this.getH() / 2)) > (draggable.getY() + (draggable.getH() / 2))) { // bottom + this.setY(draggable.getY() + draggable.getH()); + this.glueSide = GlueSide.BOTTOM; + this.glued = draggable; + if (draggable.getAnchorPoint() != null) { + this.anchorPoint = draggable.getAnchorPoint(); + } + } + } + } + } + } + + this.setDragging(false); + } + } + + private AnchorPoint findClosest(int x, int y) { + AnchorPoint ret = null; + double max = 100; + for (AnchorPoint point : Seppuku.INSTANCE.getHudManager().getAnchorPoints()) { + final double deltaX = x - point.getX(); + final double deltaY = y - point.getY(); + + final double dist = MathHelper.sqrt(deltaX * deltaX + deltaY * deltaY); + if (dist <= max) { + max = dist; + ret = point; + } + } + return ret; + } + + public void clamp() { + if (this.getX() <= 0) { + this.setX(2); + } + + if (this.getY() <= 0) { + this.setY(2); + } + + final ScaledResolution res = new ScaledResolution(Minecraft.getMinecraft()); + + if (this.getX() + this.getW() >= res.getScaledWidth() - 2) { + this.setX(res.getScaledWidth() - 2 - this.getW()); + } + + if (this.getY() + this.getH() >= res.getScaledHeight() - 2) { + this.setY(res.getScaledHeight() - 2 - this.getH()); + } + } + + public boolean collides() { + return false; + } + + public boolean isDragging() { + return dragging; + } + + public void setDragging(boolean dragging) { + this.dragging = dragging; + } + + public float getDeltaX() { + return deltaX; + } + + public void setDeltaX(float deltaX) { + this.deltaX = deltaX; + } + + public float getDeltaY() { + return deltaY; + } + + public void setDeltaY(float deltaY) { + this.deltaY = deltaY; + } + + public AnchorPoint getAnchorPoint() { + return anchorPoint; + } + + public void setAnchorPoint(AnchorPoint anchorPoint) { + this.anchorPoint = anchorPoint; + } + + public HudComponent getGlued() { + return glued; + } + + public void setGlued(DraggableHudComponent glued) { + this.glued = glued; + } + + public GlueSide getGlueSide() { + return glueSide; + } + + public void setGlueSide(GlueSide glueSide) { + this.glueSide = glueSide; + } + + public enum GlueSide { + TOP, BOTTOM + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/gui/hud/component/HudComponent.java b/src/main/java/me/rigamortis/seppuku/api/gui/hud/component/HudComponent.java new file mode 100644 index 0000000..2ea5eb8 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/gui/hud/component/HudComponent.java @@ -0,0 +1,102 @@ +package me.rigamortis.seppuku.api.gui.hud.component; + +/** + * Author Seth + * 7/25/2019 @ 4:14 AM. + */ +public class HudComponent { + + private float x; + private float y; + private float w; + private float h; + + private String name; + private boolean visible; + + public HudComponent() { + + } + + public HudComponent(float x, float y, float w, float h) { + this.x = x; + this.y = y; + this.w = w; + this.h = h; + } + + public void render(int mouseX, int mouseY, float partialTicks) { + + } + + public void mouseClickMove(int mouseX, int mouseY, int button) { + + } + + public void mouseClick(int mouseX, int mouseY, int button) { + + } + + public void mouseRelease(int mouseX, int mouseY, int button) { + + } + + public boolean collidesWith(HudComponent other) { + // Collision x-axis? + boolean collisionX = this.x + this.w > other.x && + other.x + other.w > this.x; + // Collision y-axis? + boolean collisionY = this.y + this.h > other.y && + other.y + other.h > this.y; + // Collision only if on both axes + return collisionX && collisionY; + } + + 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 getW() { + return w; + } + + public void setW(float w) { + this.w = w; + } + + public float getH() { + return h; + } + + public void setH(float h) { + this.h = h; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public boolean isVisible() { + return visible; + } + + public void setVisible(boolean visible) { + this.visible = visible; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/gui/hud/component/HudComponentOptions.java b/src/main/java/me/rigamortis/seppuku/api/gui/hud/component/HudComponentOptions.java new file mode 100644 index 0000000..fa2ae00 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/gui/hud/component/HudComponentOptions.java @@ -0,0 +1,80 @@ +package me.rigamortis.seppuku.api.gui.hud.component; + +import me.rigamortis.seppuku.Seppuku; +import me.rigamortis.seppuku.api.util.RenderUtil; +import net.minecraft.client.Minecraft; + +/** + * created by noil on 8/9/2019 at 9:28 AM + */ +public class HudComponentOptions extends HudComponent { + + private HudComponent parent; + + public HudComponentOptions(HudComponent parent) { + this.parent = parent; + this.setVisible(false); + } + + @Override + public void mouseClick(int mouseX, int mouseY, int button) { + final boolean inside = mouseX >= this.getX() && mouseX <= this.getX() + this.getW() && mouseY >= this.getY() && mouseY <= this.getY() + this.getH(); + if (inside && button == 0) { + Seppuku.INSTANCE.getHudManager().moveToTop(this); + } + } + + @Override + public void render(int mouseX, int mouseY, float partialTicks) { + super.render(mouseX, mouseY, partialTicks); + + if (parent == null) + return; + + this.setX(parent.getX() + parent.getW()); + this.setY(parent.getY()); + + final int parentNameWidth = Minecraft.getMinecraft().fontRenderer.getStringWidth(parent.getName()); + final int visibleStringWidth = Minecraft.getMinecraft().fontRenderer.getStringWidth("Visible"); + int yOffset = 0; + + RenderUtil.drawRect(this.getX(), this.getY(), this.getX() + parentNameWidth, this.getY() + Minecraft.getMinecraft().fontRenderer.FONT_HEIGHT, 0x75505050); + Minecraft.getMinecraft().fontRenderer.drawStringWithShadow(parent.getName(), this.getX(), this.getY(), 0xFFFFFFFF); + + yOffset += Minecraft.getMinecraft().fontRenderer.FONT_HEIGHT; + + RenderUtil.drawRect(this.getX(), this.getY() + yOffset, this.getX() + visibleStringWidth, this.getY() + yOffset + Minecraft.getMinecraft().fontRenderer.FONT_HEIGHT, parent.isVisible() ? 0x7550FF50 : 0x75FF5050); + Minecraft.getMinecraft().fontRenderer.drawStringWithShadow("Visible", this.getX(), this.getY() + yOffset, 0xFFFFFFFF); + + yOffset += Minecraft.getMinecraft().fontRenderer.FONT_HEIGHT; + this.setW(Math.max(parentNameWidth, visibleStringWidth)); + this.setH(yOffset); + } + + @Override + public void mouseRelease(int mouseX, int mouseY, int button) { + if (button == 0) { + if ((mouseX > this.getX()) && (mouseX < this.getX() + Minecraft.getMinecraft().fontRenderer.getStringWidth("Visible"))) { + if (mouseY > (this.getY() + Minecraft.getMinecraft().fontRenderer.FONT_HEIGHT)) { + if (mouseY < (this.getY() + this.getH())) { + parent.setVisible(!parent.isVisible()); + } + } + } + } + + } + + @Override + public void mouseClickMove(int mouseX, int mouseY, int button) { + super.mouseClickMove(mouseX, mouseY, button); + } + + public HudComponent getParent() { + return parent; + } + + public void setParent(HudComponent parent) { + this.parent = parent; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/ignore/Ignored.java b/src/main/java/me/rigamortis/seppuku/api/ignore/Ignored.java new file mode 100644 index 0000000..68d1977 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/ignore/Ignored.java @@ -0,0 +1,23 @@ +package me.rigamortis.seppuku.api.ignore; + +/** + * Author Seth + * 6/29/2019 @ 4:49 AM. + */ +public final class Ignored { + + private String name; + + public Ignored(String name) { + this.name = name; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + +} diff --git a/src/main/java/me/rigamortis/seppuku/api/logging/SeppukuFormatter.java b/src/main/java/me/rigamortis/seppuku/api/logging/SeppukuFormatter.java new file mode 100644 index 0000000..859e06b --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/logging/SeppukuFormatter.java @@ -0,0 +1,22 @@ +package me.rigamortis.seppuku.api.logging; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.logging.*; + +/** + * Author Seth + * 4/4/2019 @ 10:46 PM. + */ +public final class SeppukuFormatter extends Formatter { + + public String format(LogRecord record) { + final StringBuilder sb = new StringBuilder(); + sb.append("[" + new SimpleDateFormat("HH.mm.ss").format(new Date()) + "] "); + sb.append("[Seppuku]: "); + sb.append(formatMessage(record)); + sb.append("\n"); + return sb.toString(); + } + +} \ No newline at end of file diff --git a/src/main/java/me/rigamortis/seppuku/api/macro/Macro.java b/src/main/java/me/rigamortis/seppuku/api/macro/Macro.java new file mode 100644 index 0000000..be4b45c --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/macro/Macro.java @@ -0,0 +1,42 @@ +package me.rigamortis.seppuku.api.macro; + +/** + * Author Seth + * 5/7/2019 @ 4:22 AM. + */ +public final class Macro { + + private String name; + private String key; + private String macro; + + public Macro(String name, String key, String macro) { + this.name = name; + this.key = key; + this.macro = macro; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getMacro() { + return macro; + } + + public void setMacro(String macro) { + this.macro = macro; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/module/Module.java b/src/main/java/me/rigamortis/seppuku/api/module/Module.java new file mode 100644 index 0000000..229d2c7 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/module/Module.java @@ -0,0 +1,216 @@ +package me.rigamortis.seppuku.api.module; + +import me.rigamortis.seppuku.Seppuku; +import me.rigamortis.seppuku.api.value.*; + +import java.util.ArrayList; +import java.util.List; + +/** + * Author Seth + * 4/7/2019 @ 10:02 PM. + */ +public class Module { + + private String displayName; + private String[] alias; + private String desc; + private String key; + private int color; + private boolean hidden; + private boolean enabled; + private ModuleType type; + + private List valueList = new ArrayList(); + + public Module() { + + } + + public Module(String displayName, String[] alias, String desc, String key, int color, boolean hidden, boolean enabled, ModuleType type) { + this.displayName = displayName; + this.alias = alias; + this.desc = desc; + this.key = key; + this.color = color; + this.hidden = hidden; + this.enabled = enabled; + this.type = type; + } + + public Module(String displayName, String[] alias, String desc, String key, int color, ModuleType type) { + this.displayName = displayName; + this.alias = alias; + this.desc = desc; + this.key = key; + this.color = color; + this.type = type; + } + + public Module(String displayName, String[] alias, String key, int color, ModuleType type) { + this.displayName = displayName; + this.alias = alias; + this.key = key; + this.color = color; + this.type = type; + } + + public void onEnable() { + Seppuku.INSTANCE.getEventManager().addEventListener(this); + } + + public void onDisable() { + Seppuku.INSTANCE.getEventManager().removeEventListener(this); + } + + public void onToggle() { + + } + + public void toggle() { + this.setEnabled(!this.isEnabled()); + if(this.isEnabled()) { + this.onEnable(); + }else{ + this.onDisable(); + } + this.onToggle(); + } + + public String getMetaData() { + return null; + } + + public String toUsageString() { + if(this.valueList.size() <= 0) { + return null; + } + + final StringBuilder sb = new StringBuilder(); + + for(Value v : this.getValueList()) { + if(v instanceof BooleanValue) { + sb.append(v.getDisplayName() + "\n"); + } + if(v instanceof NumberValue && !(v instanceof OptionalValue)) { + sb.append(v.getDisplayName() + " \n"); + } + if(v instanceof StringValue) { + sb.append(v.getDisplayName() + " \n"); + } + if(v instanceof OptionalValue) { + final OptionalValue val = (OptionalValue) v; + + final StringBuilder options = new StringBuilder(); + + final int size = val.getOptions().length; + + for(int i = 0; i < val.getOptions().length; i++) { + final String option = val.getOptions()[i]; + + options.append(option + ((i == size - 1) ? "" : "|")); + } + + sb.append(v.getDisplayName() + " <" + options.toString() + ">\n"); + } + } + + final String s = sb.toString(); + + return s.substring(0, s.length() - 1); + } + + public Value find(String alias) { + for(Value v : this.getValueList()) { + for(String s : v.getAlias()) { + if(alias.equalsIgnoreCase(s)) { + return v; + } + } + if(v.getDisplayName().equalsIgnoreCase(alias)) { + return v; + } + } + return null; + } + + public void unload() { + this.valueList.clear(); + } + + public enum ModuleType { + COMBAT, MOVEMENT, RENDER, PLAYER, WORLD, MISC, HIDDEN, UI + } + + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(String displayName) { + this.displayName = displayName; + } + + public String[] getAlias() { + return alias; + } + + public void setAlias(String[] alias) { + this.alias = alias; + } + + public String getDesc() { + return desc; + } + + public void setDesc(String desc) { + this.desc = desc; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public int getColor() { + return color; + } + + public void setColor(int color) { + this.color = color; + } + + public boolean isHidden() { + return hidden; + } + + public void setHidden(boolean hidden) { + this.hidden = hidden; + } + + public boolean isEnabled() { + return enabled; + } + + public void setEnabled(boolean enabled) { + this.enabled = enabled; + } + + public ModuleType getType() { + return type; + } + + public void setType(ModuleType type) { + this.type = type; + } + + public List getValueList() { + return valueList; + } + + public void setValueList(List valueList) { + this.valueList = valueList; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/notification/Notification.java b/src/main/java/me/rigamortis/seppuku/api/notification/Notification.java new file mode 100644 index 0000000..cca721c --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/notification/Notification.java @@ -0,0 +1,145 @@ +package me.rigamortis.seppuku.api.notification; + +import me.rigamortis.seppuku.Seppuku; +import me.rigamortis.seppuku.api.util.MathUtil; +import me.rigamortis.seppuku.api.util.Timer; +import me.rigamortis.seppuku.impl.gui.hud.component.NotificationsComponent; + +/** + * created by noil on 8/17/2019 at 3:15 PM + */ +public final class Notification { + + private final String title; + + private String text; + + private float x = 0, y = 0, width = 0, height = 0; + + private final Type type; + + private int duration; // milliseconds + + private final int maxDuration; + + private float transitionX = 0, transitionY = 0; + + private final Timer timer = new Timer(); + + public Notification(String title, String text, Type type, int duration) { + this.title = title; + this.text = text; + this.type = type; + this.duration = duration; + this.maxDuration = duration; + + final NotificationsComponent notificationsComponent = (NotificationsComponent) Seppuku.INSTANCE.getHudManager().findComponent(NotificationsComponent.class); + if (notificationsComponent != null) { + this.setX(notificationsComponent.getX()); + this.setY(notificationsComponent.getY()); + this.transitionX = notificationsComponent.getX(); + this.transitionY = notificationsComponent.getY(); + } + + this.timer.reset(); + } + + public Notification(String title, String text) { + this(title, text, Type.INFO, 3000); + } + + public void update() { + int incline = 10; + this.transitionX = (float) MathUtil.parabolic(this.transitionX, this.x, incline); + this.transitionY = (float) MathUtil.parabolic(this.transitionY, this.y, incline); + if (this.timer.passed((this.duration))) { + Seppuku.INSTANCE.getNotificationManager().removeNotification(this); + } + } + + public String getTitle() { + return title; + } + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + 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 getWidth() { + return width; + } + + public void setWidth(float width) { + this.width = width; + } + + public float getHeight() { + return height; + } + + public void setHeight(float height) { + this.height = height; + } + + public void setHeight(int height) { + this.height = height; + } + + public Type getType() { + return type; + } + + public int getDuration() { + return duration; + } + + public void setDuration(int duration) { + this.duration = duration; + } + + public int getMaxDuration() { + return maxDuration; + } + + public float getTransitionX() { + return transitionX; + } + + public float getTransitionY() { + return transitionY; + } + + public enum Type { + INFO(0xFF909090), SUCCESS(0xFF10FF10), WARNING(0xFFFFFF10), ERROR(0xFFFF1010), QUESTION(0xFF10FFFF), MISC(0xFFFFFFFF); + + private int color; + + Type(int color) { + this.color = color; + } + + public int getColor() { + return color; + } + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/patch/ClassPatch.java b/src/main/java/me/rigamortis/seppuku/api/patch/ClassPatch.java new file mode 100644 index 0000000..d7674ef --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/patch/ClassPatch.java @@ -0,0 +1,56 @@ +package me.rigamortis.seppuku.api.patch; + +import me.rigamortis.seppuku.api.patch.access.AccessPatch; + +/** + * Author Seth + * 4/4/2019 @ 11:23 PM. + */ +public class ClassPatch { + + private String mcpName; + private String notchName; + private boolean debug; + private AccessPatch accessPatch; + + public ClassPatch(String mcpName) { + this.mcpName = mcpName; + } + + public ClassPatch(String mcpName, String notchName) { + this.mcpName = mcpName; + this.notchName = notchName; + } + + public String getMcpName() { + return mcpName; + } + + public void setMcpName(String mcpName) { + this.mcpName = mcpName; + } + + public String getNotchName() { + return notchName; + } + + public void setNotchName(String notchName) { + this.notchName = notchName; + } + + public boolean isDebug() { + return debug; + } + + public void setDebug(boolean debug) { + this.debug = debug; + } + + public AccessPatch getAccessPatch() { + return accessPatch; + } + + public void setAccessPatch(AccessPatch accessPatch) { + this.accessPatch = accessPatch; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/patch/MethodPatch.java b/src/main/java/me/rigamortis/seppuku/api/patch/MethodPatch.java new file mode 100644 index 0000000..cbfd636 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/patch/MethodPatch.java @@ -0,0 +1,24 @@ +package me.rigamortis.seppuku.api.patch; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Author Seth + * 4/4/2019 @ 11:24 PM. + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.METHOD) +public @interface MethodPatch { + + String mcpName() default ""; + + String notchName() default ""; + + String mcpDesc() default ""; + + String notchDesc() default ""; + +} diff --git a/src/main/java/me/rigamortis/seppuku/api/patch/access/AccessPatch.java b/src/main/java/me/rigamortis/seppuku/api/patch/access/AccessPatch.java new file mode 100644 index 0000000..31fdabb --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/patch/access/AccessPatch.java @@ -0,0 +1,22 @@ +package me.rigamortis.seppuku.api.patch.access; + +/** + * Author Seth + * 6/27/2019 @ 2:22 AM. + */ +public class AccessPatch { + + private String file; + + public AccessPatch(String file) { + this.file = file; + } + + public String getFile() { + return file; + } + + public void setFile(String file) { + this.file = file; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/util/ASMUtil.java b/src/main/java/me/rigamortis/seppuku/api/util/ASMUtil.java new file mode 100644 index 0000000..cad2e5f --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/util/ASMUtil.java @@ -0,0 +1,79 @@ +package me.rigamortis.seppuku.api.util; + +import org.objectweb.asm.ClassReader; +import org.objectweb.asm.ClassWriter; +import org.objectweb.asm.tree.*; + +import static org.objectweb.asm.ClassWriter.COMPUTE_FRAMES; +import static org.objectweb.asm.ClassWriter.COMPUTE_MAXS; + +/** + * Author Seth + * 4/4/2019 @ 11:22 PM. + */ +public final class ASMUtil { + + public static MethodNode findMethod(ClassNode classNode, String name, String desc) { + for (MethodNode methodNode : classNode.methods) { + if (methodNode.name.equals(name) && methodNode.desc.equals(desc)) { + return methodNode; + } + } + return null; + } + + public static AbstractInsnNode findMethodInsn(MethodNode mn, int opcode, String owner, String name, String desc) { + for(AbstractInsnNode insn : mn.instructions.toArray()) { + if(insn instanceof MethodInsnNode) { + final MethodInsnNode method = (MethodInsnNode)insn; + if(method.getOpcode() == opcode && method.owner.equals(owner) && method.name.equals(name) && method.desc.equals(desc)) { + return insn; + } + } + } + return null; + } + + public static AbstractInsnNode findPatternInsn(MethodNode mn, int[] pattern) { + for(AbstractInsnNode insn : mn.instructions.toArray()) { + for (final int opcode : pattern) { + if (opcode == insn.getOpcode()) { + return insn; + } + } + } + return null; + } + + public static AbstractInsnNode findInsnLdc(MethodNode mn, String s) { + for(AbstractInsnNode insn : mn.instructions.toArray()) { + if(insn instanceof LdcInsnNode) { + final LdcInsnNode ldc = (LdcInsnNode)insn; + if(ldc.cst instanceof String) { + String var = (String)ldc.cst; + if(var.equals(s)) { + return insn; + } + } + } + } + return null; + } + + public static AbstractInsnNode bottom(MethodNode method) { + return method.instructions.get(method.instructions.size() - 2); + } + + public static ClassNode getNode(byte[] classBuffer) { + ClassNode classNode = new ClassNode(); + ClassReader reader = new ClassReader(classBuffer); + reader.accept(classNode, 0); + return classNode; + } + + public static byte[] toBytes(ClassNode classNode) { + ClassWriter writer = new ClassWriter(COMPUTE_MAXS | COMPUTE_FRAMES); + classNode.accept(writer); + return writer.toByteArray(); + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/util/ColorUtil.java b/src/main/java/me/rigamortis/seppuku/api/util/ColorUtil.java new file mode 100644 index 0000000..a9b09b4 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/util/ColorUtil.java @@ -0,0 +1,21 @@ +package me.rigamortis.seppuku.api.util; + +/** + * created by noil on 9/22/2019 at 1:22 PM + */ +public final class ColorUtil { + + public static int changeAlpha(int origColor, int userInputedAlpha) { + origColor = origColor & 0x00FFFFFF; + return (userInputedAlpha << 24) | origColor; + } + + public static int getRandomColor() { + String[] letters = "0123456789ABCDEF".split(""); + StringBuilder color = new StringBuilder(); + for (int i = 0; i < 6; i++) + color.append(letters[(int) Math.round(Math.random() * 15)]); + + return Integer.parseInt(color.toString(), 16); + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/util/GLUProjection.java b/src/main/java/me/rigamortis/seppuku/api/util/GLUProjection.java new file mode 100644 index 0000000..5e85bab --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/util/GLUProjection.java @@ -0,0 +1,596 @@ +package me.rigamortis.seppuku.api.util; + +import org.lwjgl.BufferUtils; +import org.lwjgl.util.glu.GLU; +import org.lwjgl.util.vector.Matrix4f; + +import java.nio.FloatBuffer; +import java.nio.IntBuffer; + +/** + * Helper class to project world space coordinates to screen space coordinates with {@link GLU#gluProject(float, float, float, FloatBuffer, FloatBuffer, IntBuffer, FloatBuffer)} + * Author TheCyberBrick + */ +public final class GLUProjection { + public static class Line { + public Vector3D sourcePoint = new Vector3D(0, 0, 0); + public Vector3D direction = new Vector3D(0, 0, 0); + + public Line(double sx, double sy, double sz, double dx, double dy, double dz) { + this.sourcePoint.x = sx; + this.sourcePoint.y = sy; + this.sourcePoint.z = sz; + this.direction.x = dx; + this.direction.y = dy; + this.direction.z = dz; + } + + public Vector3D intersect(Line line) { + double a = this.sourcePoint.x; + double b = this.direction.x; + double c = line.sourcePoint.x; + double d = line.direction.x; + double e = this.sourcePoint.y; + double f = this.direction.y; + double g = line.sourcePoint.y; + double h = line.direction.y; + double te = -(a * h - c * h - d * (e - g)); + double be = b * h - d * f; + if (be == 0) { + return this.intersectXZ(line); + } + double t = te / be; + Vector3D result = new Vector3D(0, 0, 0); + result.x = this.sourcePoint.x + this.direction.x * t; + result.y = this.sourcePoint.y + this.direction.y * t; + result.z = this.sourcePoint.z + this.direction.z * t; + return result; + } + + private Vector3D intersectXZ(Line line) { + double a = this.sourcePoint.x; + double b = this.direction.x; + double c = line.sourcePoint.x; + double d = line.direction.x; + double e = this.sourcePoint.z; + double f = this.direction.z; + double g = line.sourcePoint.z; + double h = line.direction.z; + double te = -(a * h - c * h - d * (e - g)); + double be = b * h - d * f; + if (be == 0) { + return this.intersectYZ(line); + } + double t = te / be; + Vector3D result = new Vector3D(0, 0, 0); + result.x = this.sourcePoint.x + this.direction.x * t; + result.y = this.sourcePoint.y + this.direction.y * t; + result.z = this.sourcePoint.z + this.direction.z * t; + return result; + } + + private Vector3D intersectYZ(Line line) { + double a = this.sourcePoint.y; + double b = this.direction.y; + double c = line.sourcePoint.y; + double d = line.direction.y; + double e = this.sourcePoint.z; + double f = this.direction.z; + double g = line.sourcePoint.z; + double h = line.direction.z; + double te = -(a * h - c * h - d * (e - g)); + double be = b * h - d * f; + if (be == 0) { + return null; + } + double t = te / be; + Vector3D result = new Vector3D(0, 0, 0); + result.x = this.sourcePoint.x + this.direction.x * t; + result.y = this.sourcePoint.y + this.direction.y * t; + result.z = this.sourcePoint.z + this.direction.z * t; + return result; + } + + public Vector3D intersectPlane(Vector3D pointOnPlane, Vector3D planeNormal) { + Vector3D result = new Vector3D(this.sourcePoint.x, this.sourcePoint.y, this.sourcePoint.z); + double d = pointOnPlane.sub(this.sourcePoint).dot(planeNormal) / this.direction.dot(planeNormal); + result.sadd(this.direction.mul(d)); + if (this.direction.dot(planeNormal) == 0.0D) { + return null; + } + return result; + } + } + + public static class Vector3D { + public double x, y, z; + + public Vector3D(double x, double y, double z) { + this.x = x; + this.y = y; + this.z = z; + } + + public Vector3D add(Vector3D v) { + return new Vector3D(this.x + v.x, this.y + v.y, this.z + v.z); + } + + public Vector3D add(double x, double y, double z) { + return new Vector3D(this.x + x, this.y + y, this.z + z); + } + + public Vector3D sub(Vector3D v) { + return new Vector3D(this.x - v.x, this.y - v.y, this.z - v.z); + } + + public Vector3D sub(double x, double y, double z) { + return new Vector3D(this.x - x, this.y - y, this.z - z); + } + + public Vector3D normalized() { + double len = (double) Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); + return new Vector3D(this.x / len, this.y / len, this.z / len); + } + + public double dot(Vector3D v) { + return this.x * v.x + this.y * v.y + this.z * v.z; + } + + public Vector3D cross(Vector3D v) { + return new Vector3D(this.y * v.z - this.z * v.y, this.z * v.x - this.x * v.z, this.x * v.y - this.y * v.x); + } + + public Vector3D mul(double m) { + return new Vector3D(this.x * m, this.y * m, this.z * m); + } + + public Vector3D div(double d) { + return new Vector3D(this.x / d, this.y / d, this.z / d); + } + + public double length() { + return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); + } + + public Vector3D sadd(Vector3D v) { + this.x += v.x; + this.y += v.y; + this.z += v.z; + return this; + } + + public Vector3D sadd(double x, double y, double z) { + this.x += x; + this.y += y; + this.z += z; + return this; + } + + public Vector3D ssub(Vector3D v) { + this.x -= v.x; + this.y -= v.y; + this.z -= v.z; + return this; + } + + public Vector3D ssub(double x, double y, double z) { + this.x -= x; + this.y -= y; + this.z -= z; + return this; + } + + public Vector3D snormalize() { + double len = (double) Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); + this.x /= len; + this.y /= len; + this.z /= len; + return this; + } + + public Vector3D scross(Vector3D v) { + this.x = this.y * v.z - this.z * v.y; + this.y = this.z * v.x - this.x * v.z; + this.z = this.x * v.y - this.y * v.x; + return this; + } + + public Vector3D smul(double m) { + this.x *= m; + this.y *= m; + this.z *= m; + return this; + } + + public Vector3D sdiv(double d) { + this.x /= d; + this.y /= d; + this.z /= d; + return this; + } + + @Override + public String toString() { + return "(X: " + this.x + " Y: " + this.y + " Z: " + this.z + ")"; + } + } + + public static class Projection { + public static enum Type { + INSIDE, OUTSIDE, INVERTED, FAIL + } + + private final double x; + private final double y; + private final Type t; + + public Projection(double x, double y, Type t) { + this.x = x; + this.y = y; + this.t = t; + } + + public double getX() { + return this.x; + } + + public double getY() { + return this.y; + } + + public Type getType() { + return this.t; + } + + public boolean isType(Type type) { + return this.t == type; + } + } + + public static enum ClampMode {ORTHOGONAL, DIRECT, NONE} + + private GLUProjection() { + } + + private static GLUProjection instance; + + public static GLUProjection getInstance() { + if (instance == null) { + instance = new GLUProjection(); + } + return instance; + } + + private IntBuffer viewport; + private FloatBuffer modelview; + private FloatBuffer projection; + private FloatBuffer coords = BufferUtils.createFloatBuffer(3); + private Vector3D frustumPos; + private Vector3D[] frustum; + private Vector3D[] invFrustum; + private Vector3D viewVec; + private double displayWidth; + private double displayHeight; + private double widthScale; + private double heightScale; + private double bra, bla, tra, tla; + private Line tb, bb, lb, rb; + private float fovY; + private float fovX; + private Vector3D lookVec; + + /** + * Updates the matrices. Needed whenever the viewport or one of the matrices has changed. + * + * @param viewport Viewport + * @param modelview Modelview matrix + * @param projection Projection matrix + * @param widthScale (GUI Width) / (Display Width) + * @param heightScale (GUI Height) / (Display Height) + */ + public void updateMatrices(IntBuffer viewport, FloatBuffer modelview, FloatBuffer projection, double widthScale, double heightScale) { + this.viewport = viewport; + this.modelview = modelview; + this.projection = projection; + this.widthScale = widthScale; + this.heightScale = heightScale; + + //Get fov and display dimensions + float fov = (float) Math.toDegrees(Math.atan(1.0D / this.projection.get(5)) * 2.0D); + this.fovY = fov; + this.displayWidth = this.viewport.get(2); + this.displayHeight = this.viewport.get(3); + this.fovX = (float) Math.toDegrees(2.0D * Math.atan((this.displayWidth / this.displayHeight) * Math.tan(Math.toRadians(this.fovY) / 2.0D))); + //Getting modelview vectors + Vector3D lv = new Vector3D(this.modelview.get(0), this.modelview.get(1), this.modelview.get(2)); + Vector3D uv = new Vector3D(this.modelview.get(4), this.modelview.get(5), this.modelview.get(6)); + Vector3D fv = new Vector3D(this.modelview.get(8), this.modelview.get(9), this.modelview.get(10)); + //Default axes + Vector3D nuv = new Vector3D(0, 1.0D, 0); + Vector3D nlv = new Vector3D(1.0D, 0, 0); + //Calculate yaw and pitch from modelview + double yaw = Math.toDegrees(Math.atan2(nlv.cross(lv).length(), nlv.dot(lv))) + 180.0D; + if (fv.x < 0.0D) { + yaw = 360.0D - yaw; + } + double pitch = 0.0D; + if ((-fv.y > 0.0D && yaw >= 90.0D && yaw < 270.0D) || (fv.y > 0.0D && !(yaw >= 90.0D && yaw < 270.0D))) { + pitch = Math.toDegrees(Math.atan2(nuv.cross(uv).length(), nuv.dot(uv))); + } else { + pitch = -Math.toDegrees(Math.atan2(nuv.cross(uv).length(), nuv.dot(uv))); + } + this.lookVec = this.getRotationVector(yaw, pitch); + //Get modelview matrix and invert it + Matrix4f modelviewMatrix = new Matrix4f(); + modelviewMatrix.load(this.modelview.asReadOnlyBuffer()); + modelviewMatrix.invert(); + //Get frustum position + this.frustumPos = new Vector3D(modelviewMatrix.m30, modelviewMatrix.m31, modelviewMatrix.m32); + this.frustum = this.getFrustum(this.frustumPos.x, this.frustumPos.y, this.frustumPos.z, yaw, pitch, fov, 1.0F, displayWidth / displayHeight); + this.invFrustum = this.getFrustum(this.frustumPos.x, this.frustumPos.y, this.frustumPos.z, yaw - 180, -pitch, fov, 1.0F, displayWidth / displayHeight); + //Set view vec + this.viewVec = this.getRotationVector(yaw, pitch).normalized(); + //Calculate screen border angles + this.bra = Math.toDegrees(Math.acos((displayHeight * heightScale) / Math.sqrt(displayWidth * widthScale * displayWidth * widthScale + displayHeight * heightScale * displayHeight * heightScale))); + this.bla = 360 - this.bra; + this.tra = this.bla - 180; + this.tla = this.bra + 180; + //Create screen border lines + this.rb = new Line(this.displayWidth * this.widthScale, 0, 0, 0, 1, 0); + this.tb = new Line(0, 0, 0, 1, 0, 0); + this.lb = new Line(0, 0, 0, 0, 1, 0); + this.bb = new Line(0, this.displayHeight * this.heightScale, 0, 1, 0, 0); + } + + /** + * Uses {@link GLU#gluProject(float, float, float, FloatBuffer, FloatBuffer, IntBuffer, FloatBuffer)} to project world space coordinates to screen space coordinates. + * + * @param x X position + * @param y Y position + * @param z Z position + * @param clampModeOutside Clamp mode used when the point is outside + * the normal and inverted frustum + * @param extrudeInverted If set to true this extrudes the projected point + * onto the screen borders if the point is inside + * the inverted frustum + * @return + */ + public Projection project(double x, double y, double z, ClampMode clampModeOutside, boolean extrudeInverted) { + if (this.viewport != null && this.modelview != null && this.projection != null) { + Vector3D posVec = new Vector3D(x, y, z); + boolean frustum[] = this.doFrustumCheck(this.frustum, this.frustumPos, x, y, z); + boolean outsideFrustum = frustum[0] || frustum[1] || frustum[2] || frustum[3]; + //Check if point is inside frustum + if (outsideFrustum) { + //Check if point is on opposite side of the near clip plane + boolean opposite = posVec.sub(this.frustumPos).dot(this.viewVec) <= 0.0D; + //Get inverted frustum check + boolean invFrustum[] = this.doFrustumCheck(this.invFrustum, this.frustumPos, x, y, z); + boolean outsideInvertedFrustum = invFrustum[0] || invFrustum[1] || invFrustum[2] || invFrustum[3]; + if ((extrudeInverted && !outsideInvertedFrustum) || (outsideInvertedFrustum && clampModeOutside != ClampMode.NONE)) { + if ((extrudeInverted && !outsideInvertedFrustum) || + (clampModeOutside == ClampMode.DIRECT && outsideInvertedFrustum)) { + //Point in inverted frustum, has to be clamped + double vecX = 0.0D; + double vecY = 0.0D; + if (GLU.gluProject((float) x, (float) y, (float) z, this.modelview, this.projection, this.viewport, this.coords)) { + //Get projected coordinates + if (opposite) { + //Invert coordinates + vecX = this.displayWidth * this.widthScale - (double) this.coords.get(0) * this.widthScale - this.displayWidth * this.widthScale / 2.0F; + vecY = this.displayHeight * this.heightScale - ((double) displayHeight - (double) this.coords.get(1)) * (double) this.heightScale - this.displayHeight * this.heightScale / 2.0F; + } else { + vecX = (double) this.coords.get(0) * this.widthScale - this.displayWidth * this.widthScale / 2.0F; + vecY = ((double) this.displayHeight - (double) this.coords.get(1)) * (double) this.heightScale - this.displayHeight * this.heightScale / 2.0F; + } + } else { + return new Projection(0, 0, Projection.Type.FAIL); + } + //Normalize point direction vector + Vector3D vec = new Vector3D(vecX, vecY, 0).snormalize(); + vecX = vec.x; + vecY = vec.y; + //Get vector line + Line vectorLine = new Line(this.displayWidth * this.widthScale / 2.0F, this.displayHeight * this.heightScale / 2.0F, 0, vecX, vecY, 0); + //Calculate angle of point on 2D plane relative to the screen center + double angle = Math.toDegrees(Math.acos((vec.y) / Math.sqrt(vec.x * vec.x + vec.y * vec.y))); + if (vecX < 0.0D) { + angle = 360.0D - angle; + } + //Calculate screen border intersections + Vector3D intersect = new Vector3D(0, 0, 0); + //Check which screen border to intersect + if (angle >= this.bra && angle < this.tra) { + //Right + intersect = this.rb.intersect(vectorLine); + } else if (angle >= this.tra && angle < this.tla) { + //Top + intersect = this.tb.intersect(vectorLine); + } else if (angle >= this.tla && angle < this.bla) { + //Left + intersect = this.lb.intersect(vectorLine); + } else { + //Bottom + intersect = this.bb.intersect(vectorLine); + } + return new Projection(intersect.x, intersect.y, outsideInvertedFrustum ? Projection.Type.OUTSIDE : Projection.Type.INVERTED); + } else if ((clampModeOutside == ClampMode.ORTHOGONAL && outsideInvertedFrustum)) { + if (GLU.gluProject((float) x, (float) y, (float) z, this.modelview, this.projection, this.viewport, this.coords)) { + //Get projected coordinates + double guiX = (double) this.coords.get(0) * this.widthScale; + double guiY = ((double) this.displayHeight - (double) this.coords.get(1)) * (double) this.heightScale; + if (opposite) { + //Invert coordinates + guiX = this.displayWidth * this.widthScale - guiX; + guiY = this.displayHeight * this.heightScale - guiY; + } + if (guiX < 0) { + guiX = 0; + } else if (guiX > this.displayWidth * this.widthScale) { + guiX = this.displayWidth * this.widthScale; + } + if (guiY < 0) { + guiY = 0; + } else if (guiY > this.displayHeight * this.heightScale) { + guiY = this.displayHeight * this.heightScale; + } + return new Projection(guiX, guiY, outsideInvertedFrustum ? Projection.Type.OUTSIDE : Projection.Type.INVERTED); + } else { + return new Projection(0, 0, Projection.Type.FAIL); + } + } + } else { + //Return point without clamping + if (GLU.gluProject((float) x, (float) y, (float) z, this.modelview, this.projection, this.viewport, this.coords)) { + //Get projected coordinates + double guiX = (double) this.coords.get(0) * this.widthScale; + double guiY = ((double) this.displayHeight - (double) this.coords.get(1)) * (double) this.heightScale; + if (opposite) { + //Invert coordinates + guiX = this.displayWidth * this.widthScale - guiX; + guiY = this.displayHeight * this.heightScale - guiY; + } + return new Projection(guiX, guiY, outsideInvertedFrustum ? Projection.Type.OUTSIDE : Projection.Type.INVERTED); + } else { + return new Projection(0, 0, Projection.Type.FAIL); + } + } + } else { + //Point inside frustum, can be projected normally + if (GLU.gluProject((float) x, (float) y, (float) z, this.modelview, this.projection, this.viewport, this.coords)) { + //Get projected coordinates + double guiX = (double) this.coords.get(0) * this.widthScale; + double guiY = ((double) this.displayHeight - (double) this.coords.get(1)) * (double) this.heightScale; + return new Projection(guiX, guiY, Projection.Type.INSIDE); + } else { + return new Projection(0, 0, Projection.Type.FAIL); + } + } + } + return new Projection(0, 0, Projection.Type.FAIL); + } + + /** + * Performs a frustum check. + * + * @param frustumCorners Frustum corners + * @param frustumPos Frustum position + * @param x X position + * @param y Y position + * @param z Z position + * @return + */ + public boolean[] doFrustumCheck(Vector3D[] frustumCorners, Vector3D frustumPos, double x, double y, double z) { + Vector3D point = new Vector3D(x, y, z); + boolean c1 = crossPlane(new Vector3D[]{frustumPos, frustumCorners[3], frustumCorners[0]}, point); + boolean c2 = crossPlane(new Vector3D[]{frustumPos, frustumCorners[0], frustumCorners[1]}, point); + boolean c3 = crossPlane(new Vector3D[]{frustumPos, frustumCorners[1], frustumCorners[2]}, point); + boolean c4 = crossPlane(new Vector3D[]{frustumPos, frustumCorners[2], frustumCorners[3]}, point); + return new boolean[]{c1, c2, c3, c4}; + } + + /** + * Returns true if the given plane has been crossed by the point. + * + * @param plane Vector3D[] that describes the plane + * @param point Vector3D that describes the point + * @return + */ + public boolean crossPlane(Vector3D[] plane, Vector3D point) { + Vector3D z = new Vector3D(0.0D, 0.0D, 0.0D); + Vector3D e0 = plane[1].sub(plane[0]); + Vector3D e1 = plane[2].sub(plane[0]); + Vector3D normal = e0.cross(e1).snormalize(); + double D = (z.sub(normal)).dot(plane[2]); + double dist = normal.dot(point) + D; + return dist >= 0.0D; + } + + /** + * Returns the frustum corner points + * 0 -------- 3 + * | | + * | | + * 1 -------- 2 + * + * @param x X position + * @param y Y position + * @param z Z position + * @param rotationYaw Yaw + * @param rotationPitch Pitch + * @param fov FOV + * @param farDistance Far plane distance + * @param aspectRatio (Display width) / (Display height) + * @return + */ + public Vector3D[] getFrustum(double x, double y, double z, double rotationYaw, double rotationPitch, double fov, double farDistance, double aspectRatio) { + double hFar = 2D * Math.tan(Math.toRadians(fov / 2D)) * farDistance; + double wFar = hFar * aspectRatio; + Vector3D view = this.getRotationVector(rotationYaw, rotationPitch).snormalize(); + Vector3D up = this.getRotationVector(rotationYaw, rotationPitch - 90).snormalize(); + Vector3D right = this.getRotationVector(rotationYaw + 90, 0).snormalize(); + Vector3D camPos = new Vector3D(x, y, z); + Vector3D view_camPos_product = view.add(camPos); + Vector3D fc = new Vector3D(view_camPos_product.x * farDistance, view_camPos_product.y * farDistance, view_camPos_product.z * farDistance); + Vector3D topLeftfrustum = new Vector3D(fc.x + (up.x * hFar / 2D) - (right.x * wFar / 2D), fc.y + (up.y * hFar / 2D) - (right.y * wFar / 2D), fc.z + (up.z * hFar / 2D) - (right.z * wFar / 2D)); + Vector3D downLeftfrustum = new Vector3D(fc.x - (up.x * hFar / 2D) - (right.x * wFar / 2D), fc.y - (up.y * hFar / 2D) - (right.y * wFar / 2D), fc.z - (up.z * hFar / 2D) - (right.z * wFar / 2D)); + Vector3D topRightfrustum = new Vector3D(fc.x + (up.x * hFar / 2D) + (right.x * wFar / 2D), fc.y + (up.y * hFar / 2D) + (right.y * wFar / 2D), fc.z + (up.z * hFar / 2D) + (right.z * wFar / 2D)); + Vector3D downRightfrustum = new Vector3D(fc.x - (up.x * hFar / 2D) + (right.x * wFar / 2D), fc.y - (up.y * hFar / 2D) + (right.y * wFar / 2D), fc.z - (up.z * hFar / 2D) + (right.z * wFar / 2D)); + return new Vector3D[]{topLeftfrustum, downLeftfrustum, downRightfrustum, topRightfrustum}; + } + + /** + * Returns the frustum that has been constructed with {@link GLUProjection#updateMatrices(IntBuffer, FloatBuffer, FloatBuffer, double, double)} + * 0 -------- 3 + * | | + * | | + * 1 -------- 2 + * + * @return + */ + public Vector3D[] getFrustum() { + return this.frustum; + } + + /** + * Returns the horizontal fov angle + * + * @return + */ + public float getFovX() { + return this.fovX; + } + + /** + * Returns the vertical fov angle + * + * @return + */ + public float getFovY() { + return this.fovY; + } + + /** + * Returns the normalized look vector + * + * @return + */ + public Vector3D getLookVector() { + return this.lookVec; + } + + /** + * Returns a rotated vector with the given yaw and pitch. + * + * @param rotYaw Yaw + * @param rotPitch Pitch + * @return + */ + public Vector3D getRotationVector(double rotYaw, double rotPitch) { + double c = Math.cos(-rotYaw * 0.017453292F - Math.PI); + double s = Math.sin(-rotYaw * 0.017453292F - Math.PI); + double nc = -Math.cos(-rotPitch * 0.017453292F); + double ns = Math.sin(-rotPitch * 0.017453292F); + return new Vector3D((double) (s * nc), (double) ns, (double) (c * nc)); + } +} \ No newline at end of file diff --git a/src/main/java/me/rigamortis/seppuku/api/util/ItemUtil.java b/src/main/java/me/rigamortis/seppuku/api/util/ItemUtil.java new file mode 100644 index 0000000..0449137 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/util/ItemUtil.java @@ -0,0 +1,17 @@ +package me.rigamortis.seppuku.api.util; + +import net.minecraft.enchantment.Enchantment; + +/** + * created by noil on 10/13/2019 at 10:22 AM + */ +public final class ItemUtil { + + public static boolean isIllegalEnchant(Enchantment enc, short lvl) { + final int maxPossibleLevel = enc.getMaxLevel(); + if (lvl == 0 || lvl > maxPossibleLevel) + return true; + + return lvl == Short.MAX_VALUE; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/util/MathUtil.java b/src/main/java/me/rigamortis/seppuku/api/util/MathUtil.java new file mode 100644 index 0000000..629f6aa --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/util/MathUtil.java @@ -0,0 +1,139 @@ +package me.rigamortis.seppuku.api.util; + +import net.minecraft.client.Minecraft; +import net.minecraft.entity.Entity; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.Vec3d; + +import java.math.BigDecimal; +import java.math.RoundingMode; + +/** + * Author Seth + * 4/16/2019 @ 3:26 AM. + */ +public final class MathUtil { + + public static Vec3d interpolateEntity(Entity entity, float time) { + return new Vec3d(entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * time, + entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * time, + entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * time); + } + + public static double radToDeg(double rad) { + return rad * (float) (180.0f / Math.PI); + } + + public static double degToRad(double deg) { + return deg * (float) (Math.PI / 180.0f); + } + + public static Vec3d direction(float yaw) { + return new Vec3d(Math.cos(degToRad(yaw + 90f)), 0, Math.sin(degToRad(yaw + 90f))); + } + + public static float[] calcAngle(Vec3d from, Vec3d to) { + final double difX = to.x - from.x; + final double difY = (to.y - from.y) * -1.0F; + final double difZ = to.z - from.z; + + final double dist = MathHelper.sqrt(difX * difX + difZ * difZ); + + return new float[]{(float) MathHelper.wrapDegrees(Math.toDegrees(Math.atan2(difZ, difX)) - 90.0f), (float) MathHelper.wrapDegrees(Math.toDegrees(Math.atan2(difY, dist)))}; + } + + public static double[] directionSpeed(double speed) { + final Minecraft mc = Minecraft.getMinecraft(); + float forward = mc.player.movementInput.moveForward; + float side = mc.player.movementInput.moveStrafe; + float yaw = mc.player.prevRotationYaw + (mc.player.rotationYaw - mc.player.prevRotationYaw) * mc.getRenderPartialTicks(); + + if (forward != 0) { + if (side > 0) { + yaw += (forward > 0 ? -45 : 45); + } else if (side < 0) { + yaw += (forward > 0 ? 45 : -45); + } + side = 0; + + //forward = clamp(forward, 0, 1); + if (forward > 0) { + forward = 1; + } else if (forward < 0) { + forward = -1; + } + } + + final double sin = Math.sin(Math.toRadians(yaw + 90)); + final double cos = Math.cos(Math.toRadians(yaw + 90)); + final double posX = (forward * speed * cos + side * speed * sin); + final double posZ = (forward * speed * sin - side * speed * cos); + return new double[] { posX, posZ }; + } + + public static Vec3d mult(Vec3d factor, Vec3d multiplier) { + return new Vec3d(factor.x * multiplier.x, factor.y * multiplier.y, factor.z * multiplier.z); + } + + public static Vec3d mult(Vec3d factor, float multiplier) { + return new Vec3d(factor.x * multiplier, factor.y * multiplier, factor.z * multiplier); + } + + public static Vec3d div(Vec3d factor, Vec3d divisor) { + return new Vec3d(factor.x / divisor.x, factor.y / divisor.y, factor.z / divisor.z); + } + + public static Vec3d div(Vec3d factor, float divisor) { + return new Vec3d(factor.x / divisor, factor.y / divisor, factor.z / divisor); + } + + public static double round(double value, int places) { + if (places < 0) { + return value; + } + return new BigDecimal(value).setScale(places, RoundingMode.HALF_UP).doubleValue(); + } + + public static float clamp(float val, float min, float max) { + if (val <= min) { + val = min; + } + if (val >= max) { + val = max; + } + return val; + } + + public static float wrap(float val) { + val = val % 360.0f; + if (val >= 180.0f) + val -= 360.0f; + if (val < -180.0f) + val += 360.0f; + return val; + } + + // linearly maps value from the range (a..b) to (c..d) + public static double map(double value, double a, double b, double c, double d) { + // first map value from (a..b) to (0..1) + value = (value - a) / (b - a); + // then map it from (0..1) to (c..d) and return it + return c + value * (d - c); + } + + public static double linear(double from, double to, double incline) { + return (from < to - incline) ? (from + incline) : ((from > to + incline) ? (from - incline) : to); + } + + public static double parabolic(double from, double to, double incline) { + return from + (to - from) / incline; + } + + public static double getDistance(Vec3d pos, double x, double y, double z) { + final double deltaX = pos.x - x; + final double deltaY = pos.y - y; + final double deltaZ = pos.z - z; + return (double) MathHelper.sqrt(deltaX * deltaX + deltaY * deltaY + deltaZ * deltaZ); + } + +} diff --git a/src/main/java/me/rigamortis/seppuku/api/util/PotionUtil.java b/src/main/java/me/rigamortis/seppuku/api/util/PotionUtil.java new file mode 100644 index 0000000..2169f48 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/util/PotionUtil.java @@ -0,0 +1,25 @@ +package me.rigamortis.seppuku.api.util; + +import net.minecraft.client.resources.I18n; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; + +public final class PotionUtil { + + public static String getFriendlyPotionName(PotionEffect potionEffect) { + String effectName = I18n.format(potionEffect.getPotion().getName()); + if (potionEffect.getAmplifier() == 1) { + effectName = effectName + " " + I18n.format("enchantment.level.2"); + } else if (potionEffect.getAmplifier() == 2) { + effectName = effectName + " " + I18n.format("enchantment.level.3"); + } else if (potionEffect.getAmplifier() == 3) { + effectName = effectName + " " + I18n.format("enchantment.level.4"); + } + + return effectName; + } + + public static String getNameDurationString(PotionEffect potionEffect) { + return String.format("%s (%s)", getFriendlyPotionName(potionEffect), Potion.getPotionDurationString(potionEffect, 1.0F)); + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/util/ReflectionUtil.java b/src/main/java/me/rigamortis/seppuku/api/util/ReflectionUtil.java new file mode 100644 index 0000000..53725cb --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/util/ReflectionUtil.java @@ -0,0 +1,48 @@ +package me.rigamortis.seppuku.api.util; + +import me.rigamortis.seppuku.Seppuku; + +import java.io.File; +import java.net.URL; +import java.net.URLClassLoader; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.List; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; + +/** + * Author Seth + * 4/7/2019 @ 9:13 PM. + */ +public final class ReflectionUtil { + + public static List> getClassesEx(String path) { + final List> classes = new ArrayList<>(); + + try { + final File dir = new File(path); + + for (File file : dir.listFiles()) { + if (file.getName().endsWith(".jar") || file.getName().endsWith(".zip")) { + final ClassLoader classLoader = URLClassLoader.newInstance(new URL[]{file.toURI().toURL()}, Seppuku.class.getClassLoader()); + + final ZipFile zip = new ZipFile(file); + + for (Enumeration list = zip.entries(); list.hasMoreElements(); ) { + final ZipEntry entry = (ZipEntry) list.nextElement(); + + if (entry.getName().contains(".class")) { + classes.add(classLoader.loadClass(entry.getName().substring(0, entry.getName().length() - 6).replace('/', '.'))); + } + } + } + } + } catch (Exception e) { + e.printStackTrace(); + } + + return classes; + } + +} diff --git a/src/main/java/me/rigamortis/seppuku/api/util/RenderUtil.java b/src/main/java/me/rigamortis/seppuku/api/util/RenderUtil.java new file mode 100644 index 0000000..3a557a5 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/util/RenderUtil.java @@ -0,0 +1,352 @@ +package me.rigamortis.seppuku.api.util; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.BufferBuilder; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.util.math.AxisAlignedBB; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL32; + +import java.nio.FloatBuffer; +import java.nio.IntBuffer; + +import static org.lwjgl.opengl.GL11.*; + +/** + * Author Seth + * 4/16/2019 @ 3:28 AM. + */ +public final class RenderUtil { + + private static final IntBuffer VIEWPORT = GLAllocation.createDirectIntBuffer(16); + private static final FloatBuffer MODELVIEW = GLAllocation.createDirectFloatBuffer(16); + private static final FloatBuffer PROJECTION = GLAllocation.createDirectFloatBuffer(16); + + public static void updateModelViewProjectionMatrix() { + glGetFloat(GL_MODELVIEW_MATRIX, MODELVIEW); + glGetFloat(GL_PROJECTION_MATRIX, PROJECTION); + glGetInteger(GL_VIEWPORT, VIEWPORT); + final ScaledResolution res = new ScaledResolution(Minecraft.getMinecraft()); + GLUProjection.getInstance().updateMatrices(VIEWPORT, MODELVIEW, PROJECTION, (float) res.getScaledWidth() / (float) Minecraft.getMinecraft().displayWidth, (float) res.getScaledHeight() / (float) Minecraft.getMinecraft().displayHeight); + } + + public static void drawRect(float x, float y, float w, float h, int color) { + float alpha = (float) (color >> 24 & 255) / 255.0F; + float red = (float) (color >> 16 & 255) / 255.0F; + float green = (float) (color >> 8 & 255) / 255.0F; + float blue = (float) (color & 255) / 255.0F; + final Tessellator tessellator = Tessellator.getInstance(); + final BufferBuilder bufferbuilder = tessellator.getBuffer(); + GlStateManager.enableBlend(); + GlStateManager.disableTexture2D(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + bufferbuilder.begin(7, DefaultVertexFormats.POSITION_COLOR); + bufferbuilder.pos((double) x, (double) h, 0.0D).color(red, green, blue, alpha).endVertex(); + bufferbuilder.pos((double) w, (double) h, 0.0D).color(red, green, blue, alpha).endVertex(); + bufferbuilder.pos((double) w, (double) y, 0.0D).color(red, green, blue, alpha).endVertex(); + bufferbuilder.pos((double) x, (double) y, 0.0D).color(red, green, blue, alpha).endVertex(); + tessellator.draw(); + GlStateManager.enableTexture2D(); + GlStateManager.disableBlend(); + } + + public static void drawGradientRect(float left, float top, float right, float bottom, int startColor, int endColor) { + float f = (float) (startColor >> 24 & 255) / 255.0F; + float f1 = (float) (startColor >> 16 & 255) / 255.0F; + float f2 = (float) (startColor >> 8 & 255) / 255.0F; + float f3 = (float) (startColor & 255) / 255.0F; + float f4 = (float) (endColor >> 24 & 255) / 255.0F; + float f5 = (float) (endColor >> 16 & 255) / 255.0F; + float f6 = (float) (endColor >> 8 & 255) / 255.0F; + float f7 = (float) (endColor & 255) / 255.0F; + GlStateManager.disableTexture2D(); + GlStateManager.enableBlend(); + GlStateManager.disableAlpha(); + GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); + GlStateManager.shadeModel(7425); + Tessellator tessellator = Tessellator.getInstance(); + BufferBuilder bufferbuilder = tessellator.getBuffer(); + bufferbuilder.begin(7, DefaultVertexFormats.POSITION_COLOR); + bufferbuilder.pos((double) right, (double) top, (double) 0).color(f1, f2, f3, f).endVertex(); + bufferbuilder.pos((double) left, (double) top, (double) 0).color(f1, f2, f3, f).endVertex(); + bufferbuilder.pos((double) left, (double) bottom, (double) 0).color(f5, f6, f7, f4).endVertex(); + bufferbuilder.pos((double) right, (double) bottom, (double) 0).color(f5, f6, f7, f4).endVertex(); + tessellator.draw(); + GlStateManager.shadeModel(7424); + GlStateManager.disableBlend(); + GlStateManager.enableAlpha(); + GlStateManager.enableTexture2D(); + } + + public static void drawTriangle(float x, float y, float size, float theta, int color) { + GL11.glTranslated(x, y, 0); + GL11.glRotatef(180 + theta, 0F, 0F, 1.0F); + + float alpha = (float) (color >> 24 & 255) / 255.0F; + float red = (float) (color >> 16 & 255) / 255.0F; + float green = (float) (color >> 8 & 255) / 255.0F; + float blue = (float) (color & 255) / 255.0F; + + GL11.glColor4f(red, green, blue, alpha); + GL11.glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_LINE_SMOOTH); + GL11.glBlendFunc(770, 771); + GL11.glLineWidth(1); + GL11.glBegin(GL11.GL_TRIANGLE_FAN); + + GL11.glVertex2d(0, (1.0F * size)); + GL11.glVertex2d((1 * size), -(1.0F * size)); + GL11.glVertex2d(-(1 * size), -(1.0F * size)); + + GL11.glEnd(); + GL11.glDisable(GL11.GL_LINE_SMOOTH); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_BLEND); + GL11.glRotatef(-180 - theta, 0F, 0F, 1.0F); + GL11.glTranslated(-x, -y, 0); + } + + public static void drawOutlineRect(float x, float y, float w, float h, float thickness, int c) { + drawRect(x, y, x - thickness, h, c); + drawRect(w + thickness, y, w, h, c); + drawRect(x, y, w, y - thickness, c); + drawRect(x, h + thickness, w, h, c); + } + + public static void drawLine(float x, float y, float x1, float y1, float thickness, int hex) { + float red = (hex >> 16 & 0xFF) / 255.0F; + float green = (hex >> 8 & 0xFF) / 255.0F; + float blue = (hex & 0xFF) / 255.0F; + float alpha = (hex >> 24 & 0xFF) / 255.0F; + + GlStateManager.pushMatrix(); + GlStateManager.disableTexture2D(); + GlStateManager.enableBlend(); + GlStateManager.disableAlpha(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GlStateManager.shadeModel(GL_SMOOTH); + glLineWidth(thickness); + glEnable(GL_LINE_SMOOTH); + glHint(GL_LINE_SMOOTH_HINT, GL_NICEST); + final Tessellator tessellator = Tessellator.getInstance(); + final BufferBuilder bufferbuilder = tessellator.getBuffer(); + bufferbuilder.begin(GL_LINE_STRIP, DefaultVertexFormats.POSITION_COLOR); + bufferbuilder.pos((double) x, (double) y, (double) 0).color(red, green, blue, alpha).endVertex(); + bufferbuilder.pos((double) x1, (double) y1, (double) 0).color(red, green, blue, alpha).endVertex(); + tessellator.draw(); + GlStateManager.shadeModel(GL_FLAT); + glDisable(GL_LINE_SMOOTH); + GlStateManager.disableBlend(); + GlStateManager.enableAlpha(); + GlStateManager.enableTexture2D(); + GlStateManager.popMatrix(); + } + + public static void drawLine3D(float x, float y, float z, float x1, float y1, float z1, float thickness, int hex) { + float red = (hex >> 16 & 0xFF) / 255.0F; + float green = (hex >> 8 & 0xFF) / 255.0F; + float blue = (hex & 0xFF) / 255.0F; + float alpha = (hex >> 24 & 0xFF) / 255.0F; + + GlStateManager.pushMatrix(); + GlStateManager.disableTexture2D(); + GlStateManager.enableBlend(); + GlStateManager.disableAlpha(); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + GlStateManager.shadeModel(GL_SMOOTH); + glLineWidth(thickness); + glEnable(GL_LINE_SMOOTH); + glHint(GL_LINE_SMOOTH_HINT, GL_NICEST); + GlStateManager.disableDepth(); + glEnable(GL32.GL_DEPTH_CLAMP); + final Tessellator tessellator = Tessellator.getInstance(); + final BufferBuilder bufferbuilder = tessellator.getBuffer(); + bufferbuilder.begin(GL_LINES, DefaultVertexFormats.POSITION_COLOR); + bufferbuilder.pos((double) x, (double) y, (double) z).color(red, green, blue, alpha).endVertex(); + bufferbuilder.pos((double) x1, (double) y1, (double) z1).color(red, green, blue, alpha).endVertex(); + tessellator.draw(); + GlStateManager.shadeModel(GL_FLAT); + glDisable(GL_LINE_SMOOTH); + GlStateManager.enableDepth(); + glDisable(GL32.GL_DEPTH_CLAMP); + GlStateManager.disableBlend(); + GlStateManager.enableAlpha(); + GlStateManager.enableTexture2D(); + GlStateManager.popMatrix(); + } + + public static void drawBoundingBox(AxisAlignedBB bb, float width, int color) { + GlStateManager.pushMatrix(); + GlStateManager.enableBlend(); + GlStateManager.disableDepth(); + GlStateManager.tryBlendFuncSeparate(770, 771, 0, 1); + GlStateManager.disableTexture2D(); + GlStateManager.depthMask(false); + glEnable(GL_LINE_SMOOTH); + glHint(GL_LINE_SMOOTH_HINT, GL_NICEST); + glLineWidth(width); + + final float alpha = (color >> 24 & 0xFF) / 255.0F; + final float red = (color >> 16 & 0xFF) / 255.0F; + final float green = (color >> 8 & 0xFF) / 255.0F; + final float blue = (color & 0xFF) / 255.0F; + + final Tessellator tessellator = Tessellator.getInstance(); + final BufferBuilder bufferbuilder = tessellator.getBuffer(); + + bufferbuilder.begin(GL_LINE_STRIP, DefaultVertexFormats.POSITION_COLOR); + bufferbuilder.pos(bb.minX, bb.minY, bb.minZ).color(red, green, blue, 0.0F).endVertex(); + bufferbuilder.pos(bb.minX, bb.minY, bb.minZ).color(red, green, blue, alpha).endVertex(); + bufferbuilder.pos(bb.maxX, bb.minY, bb.minZ).color(red, green, blue, alpha).endVertex(); + bufferbuilder.pos(bb.maxX, bb.minY, bb.maxZ).color(red, green, blue, alpha).endVertex(); + bufferbuilder.pos(bb.minX, bb.minY, bb.maxZ).color(red, green, blue, alpha).endVertex(); + bufferbuilder.pos(bb.minX, bb.minY, bb.minZ).color(red, green, blue, alpha).endVertex(); + bufferbuilder.pos(bb.minX, bb.maxY, bb.minZ).color(red, green, blue, alpha).endVertex(); + bufferbuilder.pos(bb.maxX, bb.maxY, bb.minZ).color(red, green, blue, alpha).endVertex(); + bufferbuilder.pos(bb.maxX, bb.maxY, bb.maxZ).color(red, green, blue, alpha).endVertex(); + bufferbuilder.pos(bb.minX, bb.maxY, bb.maxZ).color(red, green, blue, alpha).endVertex(); + bufferbuilder.pos(bb.minX, bb.maxY, bb.minZ).color(red, green, blue, alpha).endVertex(); + bufferbuilder.pos(bb.minX, bb.maxY, bb.maxZ).color(red, green, blue, 0.0F).endVertex(); + bufferbuilder.pos(bb.minX, bb.minY, bb.maxZ).color(red, green, blue, alpha).endVertex(); + bufferbuilder.pos(bb.maxX, bb.maxY, bb.maxZ).color(red, green, blue, 0.0F).endVertex(); + bufferbuilder.pos(bb.maxX, bb.minY, bb.maxZ).color(red, green, blue, alpha).endVertex(); + bufferbuilder.pos(bb.maxX, bb.maxY, bb.minZ).color(red, green, blue, 0.0F).endVertex(); + bufferbuilder.pos(bb.maxX, bb.minY, bb.minZ).color(red, green, blue, alpha).endVertex(); + bufferbuilder.pos(bb.maxX, bb.minY, bb.minZ).color(red, green, blue, 0.0F).endVertex(); + tessellator.draw(); + glDisable(GL_LINE_SMOOTH); + GlStateManager.depthMask(true); + GlStateManager.enableDepth(); + GlStateManager.enableTexture2D(); + GlStateManager.disableBlend(); + GlStateManager.popMatrix(); + } + + public static void drawPlane(double x, double y, double z, AxisAlignedBB bb, float width, int color) { + GL11.glPushMatrix(); + GL11.glTranslated(x, y, z); + drawPlane(bb, width, color); + GL11.glPopMatrix(); + } + + public static void drawPlane(AxisAlignedBB axisalignedbb, float width, int color) { + GlStateManager.pushMatrix(); + GlStateManager.glLineWidth(width); + GlStateManager.enableBlend(); + GlStateManager.disableDepth(); + GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ONE); + GlStateManager.disableTexture2D(); + GlStateManager.depthMask(false); + glEnable(GL_LINE_SMOOTH); + glHint(GL_LINE_SMOOTH_HINT, GL_NICEST); + drawPlane(axisalignedbb, color); + glDisable(GL_LINE_SMOOTH); + GlStateManager.depthMask(true); + GlStateManager.enableDepth(); + GlStateManager.enableTexture2D(); + GlStateManager.disableBlend(); + GlStateManager.popMatrix(); + } + + public static void drawPlane(AxisAlignedBB boundingBox, int color) { + float alpha = (color >> 24 & 0xFF) / 255.0F; + float red = (color >> 16 & 0xFF) / 255.0F; + float green = (color >> 8 & 0xFF) / 255.0F; + float blue = (color & 0xFF) / 255.0F; + + double minX = boundingBox.minX; + double minY = boundingBox.minY; + double minZ = boundingBox.minZ; + + double maxX = boundingBox.maxX; + double maxY = boundingBox.maxY; + double maxZ = boundingBox.maxZ; + + Tessellator tessellator = Tessellator.getInstance(); + BufferBuilder bufferbuilder = tessellator.getBuffer(); + + bufferbuilder.begin(GL_LINE_STRIP, DefaultVertexFormats.POSITION_COLOR); + bufferbuilder.pos(minX, minY, minZ).color(red, green, blue, alpha).endVertex(); + bufferbuilder.pos(maxX, minY, maxZ).color(red, green, blue, alpha).endVertex(); + bufferbuilder.pos(minX, minY, maxZ).color(red, green, blue, 0).endVertex(); + bufferbuilder.pos(maxZ, minY, minZ).color(red, green, blue, alpha).endVertex(); + + tessellator.draw(); + } + + public static void drawFilledBox(AxisAlignedBB bb, int color) { + GlStateManager.pushMatrix(); + GlStateManager.enableBlend(); + GlStateManager.disableDepth(); + GlStateManager.tryBlendFuncSeparate(770, 771, 0, 1); + GlStateManager.disableTexture2D(); + GlStateManager.depthMask(false); + + final float alpha = (color >> 24 & 0xFF) / 255.0F; + final float red = (color >> 16 & 0xFF) / 255.0F; + final float green = (color >> 8 & 0xFF) / 255.0F; + final float blue = (color & 0xFF) / 255.0F; + + final Tessellator tessellator = Tessellator.getInstance(); + final BufferBuilder bufferbuilder = tessellator.getBuffer(); + + bufferbuilder.begin(GL_QUADS, DefaultVertexFormats.POSITION_COLOR); + bufferbuilder.pos(bb.minX, bb.minY, bb.minZ).color(red, green, blue, alpha).endVertex(); + bufferbuilder.pos(bb.maxX, bb.minY, bb.minZ).color(red, green, blue, alpha).endVertex(); + bufferbuilder.pos(bb.maxX, bb.minY, bb.maxZ).color(red, green, blue, alpha).endVertex(); + bufferbuilder.pos(bb.minX, bb.minY, bb.maxZ).color(red, green, blue, alpha).endVertex(); + + bufferbuilder.pos(bb.minX, bb.maxY, bb.minZ).color(red, green, blue, alpha).endVertex(); + bufferbuilder.pos(bb.minX, bb.maxY, bb.maxZ).color(red, green, blue, alpha).endVertex(); + bufferbuilder.pos(bb.maxX, bb.maxY, bb.maxZ).color(red, green, blue, alpha).endVertex(); + bufferbuilder.pos(bb.maxX, bb.maxY, bb.minZ).color(red, green, blue, alpha).endVertex(); + + bufferbuilder.pos(bb.minX, bb.minY, bb.minZ).color(red, green, blue, alpha).endVertex(); + bufferbuilder.pos(bb.minX, bb.maxY, bb.minZ).color(red, green, blue, alpha).endVertex(); + bufferbuilder.pos(bb.maxX, bb.maxY, bb.minZ).color(red, green, blue, alpha).endVertex(); + bufferbuilder.pos(bb.maxX, bb.minY, bb.minZ).color(red, green, blue, alpha).endVertex(); + + bufferbuilder.pos(bb.maxX, bb.minY, bb.minZ).color(red, green, blue, alpha).endVertex(); + bufferbuilder.pos(bb.maxX, bb.maxY, bb.minZ).color(red, green, blue, alpha).endVertex(); + bufferbuilder.pos(bb.maxX, bb.maxY, bb.maxZ).color(red, green, blue, alpha).endVertex(); + bufferbuilder.pos(bb.maxX, bb.minY, bb.maxZ).color(red, green, blue, alpha).endVertex(); + + bufferbuilder.pos(bb.minX, bb.minY, bb.maxZ).color(red, green, blue, alpha).endVertex(); + bufferbuilder.pos(bb.maxX, bb.minY, bb.maxZ).color(red, green, blue, alpha).endVertex(); + bufferbuilder.pos(bb.maxX, bb.maxY, bb.maxZ).color(red, green, blue, alpha).endVertex(); + bufferbuilder.pos(bb.minX, bb.maxY, bb.maxZ).color(red, green, blue, alpha).endVertex(); + + bufferbuilder.pos(bb.minX, bb.minY, bb.minZ).color(red, green, blue, alpha).endVertex(); + bufferbuilder.pos(bb.minX, bb.minY, bb.maxZ).color(red, green, blue, alpha).endVertex(); + bufferbuilder.pos(bb.minX, bb.maxY, bb.maxZ).color(red, green, blue, alpha).endVertex(); + bufferbuilder.pos(bb.minX, bb.maxY, bb.minZ).color(red, green, blue, alpha).endVertex(); + tessellator.draw(); + GlStateManager.depthMask(true); + GlStateManager.enableDepth(); + GlStateManager.enableTexture2D(); + GlStateManager.disableBlend(); + GlStateManager.popMatrix(); + } + + public static void glScissor(float x, float y, float x1, float y1, final ScaledResolution sr) { + GL11.glScissor((int) (x * sr.getScaleFactor()), (int) (Minecraft.getMinecraft().displayHeight - (y1 * sr.getScaleFactor())), (int) ((x1 - x) * sr.getScaleFactor()), (int) ((y1 - y) * sr.getScaleFactor())); + } + + public static void drawTexturedModalRect(float x, float y, float textureX, float textureY, float width, float height) { + float f = 0.00390625F; + float f1 = 0.00390625F; + final Tessellator tessellator = Tessellator.getInstance(); + final BufferBuilder bufferbuilder = tessellator.getBuffer(); + bufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX); + bufferbuilder.pos(x, (y + height), 0.0D).tex((textureX * f), ((textureY + height) * f1)).endVertex(); + bufferbuilder.pos((x + width), (y + height), 0.0D).tex(((textureX + width) * f), ((textureY + height) * f1)).endVertex(); + bufferbuilder.pos((x + width), y, 0.0D).tex(((textureX + width) * f), (textureY * f1)).endVertex(); + bufferbuilder.pos(x, y, 0.0D).tex((textureX * f), (textureY * f1)).endVertex(); + tessellator.draw(); + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/util/StringUtil.java b/src/main/java/me/rigamortis/seppuku/api/util/StringUtil.java new file mode 100644 index 0000000..6c60dbe --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/util/StringUtil.java @@ -0,0 +1,119 @@ +package me.rigamortis.seppuku.api.util; + +/** + * Author Seth + * 4/16/2019 @ 8:32 AM. + */ +public final class StringUtil { + + public static boolean isInt(String s) { + try{ + Integer.parseInt(s); + return true; + }catch (Exception e){ + e.printStackTrace(); + } + return false; + } + + public static boolean isFloat(String s) { + try{ + Float.parseFloat(s); + return true; + }catch (Exception e) { + e.printStackTrace(); + } + return false; + } + + public static boolean isDouble(String s) { + try{ + Double.parseDouble(s); + return true; + }catch (Exception e) { + e.printStackTrace(); + } + return false; + } + + public static boolean isBoolean(String s) { + try{ + Boolean.parseBoolean(s); + return true; + }catch (Exception e){ + e.printStackTrace(); + } + return false; + } + + public static boolean isLong(String s, int radix) { + try{ + Long.parseLong(s, radix); + return true; + }catch (Exception e) { + e.printStackTrace(); + } + return false; + } + + public static boolean isNumber(String s) { + if(isInt(s) || isFloat(s) || isDouble(s) || isLong(s, 16)) { + return true; + } + return false; + } + + public static float similarityLength(String first, String second) { + return (float)Math.abs(first.length() - second.length()) / 100; + } + + public static boolean findMatching(String first, String second) { + return second.toLowerCase().contains(first.toLowerCase()); + } + + /** + * Credits https://stackoverflow.com/questions/955110/similarity-string-comparison-in-java + * @param s1 + * @param s2 + * @return + */ + public static double levenshteinDistance(String s1, String s2) { + String longer = s1, shorter = s2; + if (s1.length() < s2.length()) { + longer = s2; shorter = s1; + } + int longerLength = longer.length(); + if (longerLength == 0) { + return 1.0; + } + return (longerLength - editDistance(longer, shorter)) / (double) longerLength; + } + + public static int editDistance(String s1, String s2) { + s1 = s1.toLowerCase(); + s2 = s2.toLowerCase(); + + int[] costs = new int[s2.length() + 1]; + for (int i = 0; i <= s1.length(); i++) { + int lastValue = i; + for (int j = 0; j <= s2.length(); j++) { + if (i == 0) + costs[j] = j; + else { + if (j > 0) { + int newValue = costs[j - 1]; + if (s1.charAt(i - 1) != s2.charAt(j - 1)) + newValue = Math.min(Math.min(newValue, lastValue), + costs[j]) + 1; + costs[j - 1] = lastValue; + lastValue = newValue; + } + } + } + if (i > 0) + costs[s2.length()] = lastValue; + } + return costs[s2.length()]; + } + +} diff --git a/src/main/java/me/rigamortis/seppuku/api/util/Timer.java b/src/main/java/me/rigamortis/seppuku/api/util/Timer.java new file mode 100644 index 0000000..bdcedd1 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/util/Timer.java @@ -0,0 +1,30 @@ +package me.rigamortis.seppuku.api.util; + +/** + * Author Seth + * 4/29/2019 @ 1:26 AM. + */ +public final class Timer { + + private long time; + + public Timer() { + time = -1; + } + + public boolean passed(double ms) { + return System.currentTimeMillis() - this.time >= ms; + } + + public void reset() { + this.time = System.currentTimeMillis(); + } + + public long getTime() { + return time; + } + + public void setTime(long time) { + this.time = time; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/value/BooleanValue.java b/src/main/java/me/rigamortis/seppuku/api/value/BooleanValue.java new file mode 100644 index 0000000..c5c41a8 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/value/BooleanValue.java @@ -0,0 +1,24 @@ +package me.rigamortis.seppuku.api.value; + +/** + * Author Seth + * 4/17/2019 @ 5:59 AM. + */ +public class BooleanValue extends Value { + + public BooleanValue() { + } + + public BooleanValue(String displayName, String[] alias, Object value) { + super(displayName, alias, value); + } + + public boolean getBoolean() { + return (Boolean) this.getValue(); + } + + public void setBoolean(boolean val) { + this.setValue(val); + } + +} diff --git a/src/main/java/me/rigamortis/seppuku/api/value/NumberValue.java b/src/main/java/me/rigamortis/seppuku/api/value/NumberValue.java new file mode 100644 index 0000000..320f449 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/value/NumberValue.java @@ -0,0 +1,74 @@ +package me.rigamortis.seppuku.api.value; + +/** + * Author Seth + * 4/17/2019 @ 5:59 AM. + */ +public class NumberValue extends Value { + + private T min; + private T max; + private T increment; + + public NumberValue() { + } + + public NumberValue(String displayName, String[] alias, Object value) { + super(displayName, alias, value); + } + + public NumberValue(String displayName, String[] alias, Object value, Object type, T min, T max, T increment) { + super(displayName, alias, value, type); + this.min = min; + this.max = max; + this.increment = increment; + } + + public float getFloat() { + return (Float) this.getValue(); + } + + public void setFloat(float val) { + this.setValue(val); + } + + public int getInt() { + return (Integer) this.getValue(); + } + + public void setInt(int val) { + this.setValue(val); + } + + public double getDouble() { + return (Double) this.getValue(); + } + + public void setDouble(double val) { + this.setValue(val); + } + + public T getMin() { + return min; + } + + public void setMin(T min) { + this.min = min; + } + + public T getMax() { + return max; + } + + public void setMax(T max) { + this.max = max; + } + + public T getIncrement() { + return increment; + } + + public void setIncrement(T increment) { + this.increment = increment; + } +} \ No newline at end of file diff --git a/src/main/java/me/rigamortis/seppuku/api/value/OptionalValue.java b/src/main/java/me/rigamortis/seppuku/api/value/OptionalValue.java new file mode 100644 index 0000000..e847288 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/value/OptionalValue.java @@ -0,0 +1,46 @@ +package me.rigamortis.seppuku.api.value; + +/** + * Author Seth + * 4/17/2019 @ 6:00 AM. + */ +public class OptionalValue extends NumberValue { + + private String[] options; + + public OptionalValue(String[] options) { + this.options = options; + } + + public OptionalValue(String displayName, String[] alias, Object value, String[] options) { + super(displayName, alias, value); + this.options = options; + } + + public OptionalValue(String displayName, String[] alias, Object value, Object type, Object min, Object max, Object increment, String[] options) { + super(displayName, alias, value, type, min, max, increment); + this.options = options; + } + + public int getOption(String input) { + for(int i = 0; i < this.getOptions().length; i++) { + final String s = this.getOptions()[i]; + if(input.equalsIgnoreCase(s)) { + return i; + } + } + return -1; + } + + public String getSelectedOption() { + return this.getOptions()[this.getInt()]; + } + + public String[] getOptions() { + return options; + } + + public void setOptions(String[] options) { + this.options = options; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/api/value/StringValue.java b/src/main/java/me/rigamortis/seppuku/api/value/StringValue.java new file mode 100644 index 0000000..296da76 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/value/StringValue.java @@ -0,0 +1,24 @@ +package me.rigamortis.seppuku.api.value; + +/** + * Author Seth + * 4/17/2019 @ 6:05 AM. + */ +public class StringValue extends Value { + + public StringValue() { + } + + public StringValue(String displayName, String[] alias, Object value) { + super(displayName, alias, value); + } + + public String getString() { + return (String) this.getValue(); + } + + public void setString(String val) { + this.setValue(val); + } + +} diff --git a/src/main/java/me/rigamortis/seppuku/api/value/Value.java b/src/main/java/me/rigamortis/seppuku/api/value/Value.java new file mode 100644 index 0000000..e154228 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/api/value/Value.java @@ -0,0 +1,72 @@ +package me.rigamortis.seppuku.api.value; + +/** + * Author Seth + * 4/17/2019 @ 5:58 AM. + */ +public class Value { + + private String displayName; + private String[] alias; + private T value; + private T type; + + private Value parent; + + public Value() { + + } + + public Value(String displayName, String[] alias, T value) { + this.displayName = displayName; + this.alias = alias; + this.value = value; + } + + public Value(String displayName, String[] alias, T value, T type) { + this.displayName = displayName; + this.alias = alias; + this.value = value; + this.type = type; + } + + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(String displayName) { + this.displayName = displayName; + } + + public String[] getAlias() { + return alias; + } + + public void setAlias(String[] alias) { + this.alias = alias; + } + + public T getValue() { + return value; + } + + public void setValue(T value) { + this.value = value; + } + + public T getType() { + return type; + } + + public void setType(T type) { + this.type = type; + } + + public Value getParent() { + return parent; + } + + public void setParent(Value parent) { + this.parent = parent; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/impl/command/AutoIgnoreCommand.java b/src/main/java/me/rigamortis/seppuku/impl/command/AutoIgnoreCommand.java new file mode 100644 index 0000000..5263514 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/impl/command/AutoIgnoreCommand.java @@ -0,0 +1,128 @@ +package me.rigamortis.seppuku.impl.command; + +import me.rigamortis.seppuku.Seppuku; +import me.rigamortis.seppuku.api.command.Command; +import me.rigamortis.seppuku.impl.module.misc.AutoIgnoreModule; +import net.minecraft.client.Minecraft; +import net.minecraft.util.text.TextComponentString; + +/** + * Author Seth + * 7/1/2019 @ 11:37 PM. + */ +public final class AutoIgnoreCommand extends Command { + + private String[] addAlias = new String[]{"Add", "A"}; + private String[] removeAlias = new String[]{"Remove", "R", "Rem", "Delete", "Del"}; + private String[] listAlias = new String[]{"List", "L"}; + private String[] clearAlias = new String[]{"Clear", "C"}; + + public AutoIgnoreCommand() { + super("AutoIgnore", new String[]{"AutomaticIgnore", "AIG", "AIgnore"}, "Allows you to add or remove phrases from AutoIgnore", "AutoIgnore Add \n" + + "AutoIgnore Remove \n" + + "AutoIgnore List\n" + + "AutoIgnore Clear"); + } + + @Override + public void exec(String input) { + if (!this.clamp(input, 2)) { + this.printUsage(); + return; + } + + final String[] split = input.split(" "); + + final AutoIgnoreModule autoIgnoreModule = (AutoIgnoreModule) Seppuku.INSTANCE.getModuleManager().find(AutoIgnoreModule.class); + + if (autoIgnoreModule == null) { + Seppuku.INSTANCE.errorChat("AutoIgnore is missing"); + return; + } + + if (equals(addAlias, split[1])) { + if (!this.clamp(input, 3)) { + this.printUsage(); + return; + } + final StringBuilder sb = new StringBuilder(); + + for (int i = 2; i < split.length; i++) { + final String s = split[i]; + sb.append(s + (i == split.length - 1 ? "" : " ")); + } + + final String phrase = sb.toString(); + + if (autoIgnoreModule.blacklistContains(phrase.toLowerCase())) { + Seppuku.INSTANCE.logChat("AutoIgnore already contains that phrase"); + } else { + Seppuku.INSTANCE.logChat("Added phrase \"" + phrase + "\""); + autoIgnoreModule.getBlacklist().add(phrase); + Seppuku.INSTANCE.getConfigManager().saveAll(); + } + } else if (equals(removeAlias, split[1])) { + if (!this.clamp(input, 3)) { + this.printUsage(); + return; + } + final StringBuilder sb = new StringBuilder(); + + for (int i = 2; i < split.length; i++) { + final String s = split[i]; + sb.append(s + (i == split.length - 1 ? "" : " ")); + } + + final String phrase = sb.toString(); + + if (autoIgnoreModule.blacklistContains(phrase.toLowerCase())) { + Seppuku.INSTANCE.logChat("Removed phrase \"" + phrase + "\""); + autoIgnoreModule.getBlacklist().remove(phrase); + Seppuku.INSTANCE.getConfigManager().saveAll(); + } else { + Seppuku.INSTANCE.logChat("AutoIgnore does not contain that phrase"); + } + } else if (equals(listAlias, split[1])) { + if (!this.clamp(input, 2, 2)) { + this.printUsage(); + return; + } + + final int size = autoIgnoreModule.getBlacklist().size(); + + if (size > 0) { + final TextComponentString msg = new TextComponentString("\2477Phrases [" + size + "]\247f "); + + for (int i = 0; i < size; i++) { + final String phrase = autoIgnoreModule.getBlacklist().get(i); + if (phrase != null) { + msg.appendSibling(new TextComponentString("\247a" + phrase + "\2477" + ((i == size - 1) ? "" : ", "))); + } + } + + Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(msg); + } else { + Seppuku.INSTANCE.logChat("You don't have any phrases"); + } + } else if (equals(clearAlias, split[1])) { + if (!this.clamp(input, 2, 2)) { + this.printUsage(); + return; + } + + final int size = autoIgnoreModule.getBlacklist().size(); + + if (size > 0) { + Seppuku.INSTANCE.logChat("Removed \247c" + size + "\247f phrase" + (size > 1 ? "s" : "")); + autoIgnoreModule.getBlacklist().clear(); + Seppuku.INSTANCE.getConfigManager().saveAll(); + } else { + Seppuku.INSTANCE.logChat("You don't have any phrases"); + } + + } else { + Seppuku.INSTANCE.errorChat("Unknown input " + "\247f\"" + input + "\""); + this.printUsage(); + } + } +} diff --git a/src/main/java/me/rigamortis/seppuku/impl/command/BindCommand.java b/src/main/java/me/rigamortis/seppuku/impl/command/BindCommand.java new file mode 100644 index 0000000..c79168f --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/impl/command/BindCommand.java @@ -0,0 +1,86 @@ +package me.rigamortis.seppuku.impl.command; + +import me.rigamortis.seppuku.Seppuku; +import me.rigamortis.seppuku.api.command.Command; +import me.rigamortis.seppuku.api.module.Module; +import org.lwjgl.input.Keyboard; + +/** + * Author Seth + * 4/16/2019 @ 10:22 PM. + */ +public final class BindCommand extends Command { + + private String[] clearAlias = new String[]{"Clear", "C"}; + + public BindCommand() { + super("Bind", new String[] {"B"}, "Allows you to change keybinds for modules", "Bind \nBind Clear"); + } + + @Override + public void exec(String input) { + if (!this.clamp(input, 2, 3)) { + this.printUsage(); + return; + } + + final String[] split = input.split(" "); + + if (equals(clearAlias, split[1])) { + if (!this.clamp(input, 2, 2)) { + this.printUsage(); + return; + } + + int count = 0; + + for(Module mod : Seppuku.INSTANCE.getModuleManager().getModuleList()) { + if(mod.getType() != Module.ModuleType.HIDDEN && mod.getKey() != null && !mod.getKey().equals("NONE")) { + count++; + mod.setKey("NONE"); + } + } + + if(count > 0) { + Seppuku.INSTANCE.logChat("Removed " + count + " Bind" + (count > 1 ? "s" : "")); + }else{ + Seppuku.INSTANCE.logChat("You have no binds"); + } + }else{ + if (!this.clamp(input, 3, 3)) { + this.printUsage(); + return; + } + + final Module mod = Seppuku.INSTANCE.getModuleManager().find(split[1]); + + if(mod != null) { + if (mod.getType() == Module.ModuleType.HIDDEN) { + Seppuku.INSTANCE.errorChat("Cannot change bind of " + "\247f\"" + mod.getDisplayName() + "\""); + }else{ + if(split[2].equalsIgnoreCase(mod.getKey())) { + Seppuku.INSTANCE.logChat("\247c" + mod.getDisplayName() + "'s\247f key is already " + split[2].toUpperCase()); + }else{ + if(split[2].equalsIgnoreCase("NONE")) { + Seppuku.INSTANCE.logChat("Bound \247c" + mod.getDisplayName() + "\247f to " + split[2].toUpperCase()); + mod.setKey(split[2].toUpperCase()); + Seppuku.INSTANCE.getConfigManager().saveAll(); + }else if(Keyboard.getKeyIndex(split[2].toUpperCase()) != Keyboard.KEY_NONE) { + Seppuku.INSTANCE.logChat("Bound \247c" + mod.getDisplayName() + "\247f to " + split[2].toUpperCase()); + mod.setKey(split[2].toUpperCase()); + Seppuku.INSTANCE.getConfigManager().saveAll(); + }else{ + Seppuku.INSTANCE.logChat("\247c" + split[2] + "\247f is not a valid key"); + } + } + } + }else{ + Seppuku.INSTANCE.errorChat("Unknown module " + "\247f\"" + split[1] + "\""); + final Module similar = Seppuku.INSTANCE.getModuleManager().findSimilar(split[1]); + if(similar != null) { + Seppuku.INSTANCE.logChat("Did you mean " + "\247c" + similar.getDisplayName() + "\247f?"); + } + } + } + } +} diff --git a/src/main/java/me/rigamortis/seppuku/impl/command/ColorCommand.java b/src/main/java/me/rigamortis/seppuku/impl/command/ColorCommand.java new file mode 100644 index 0000000..ecd1327 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/impl/command/ColorCommand.java @@ -0,0 +1,49 @@ +package me.rigamortis.seppuku.impl.command; + +import me.rigamortis.seppuku.Seppuku; +import me.rigamortis.seppuku.api.command.Command; +import me.rigamortis.seppuku.api.module.Module; +import me.rigamortis.seppuku.api.util.StringUtil; + +/** + * Author Seth + * 4/16/2019 @ 10:17 PM. + */ +public final class ColorCommand extends Command { + + public ColorCommand() { + super("Color", new String[]{"Col", "Colour"}, "Allows you to change arraylist colors", "Color "); + } + + @Override + public void exec(String input) { + if (!this.clamp(input, 3, 3)) { + this.printUsage(); + return; + } + + final String[] split = input.split(" "); + + final Module mod = Seppuku.INSTANCE.getModuleManager().find(split[1]); + + if (mod != null) { + if (mod.getType() == Module.ModuleType.HIDDEN) { + Seppuku.INSTANCE.errorChat("Cannot change color of " + "\247f\"" + mod.getDisplayName() + "\""); + } else { + if (StringUtil.isLong(split[2], 16)) { + Seppuku.INSTANCE.logChat("\247c" + mod.getDisplayName() + "\247f color has been set to " + split[2].toUpperCase()); + mod.setColor((int) Long.parseLong(split[2], 16)); + Seppuku.INSTANCE.getConfigManager().saveAll(); + } else { + Seppuku.INSTANCE.errorChat("Invalid input " + "\"" + split[2] + "\" expected a hex value"); + } + } + } else { + Seppuku.INSTANCE.errorChat("Unknown module " + "\247f\"" + split[1] + "\""); + final Module similar = Seppuku.INSTANCE.getModuleManager().findSimilar(split[1]); + if (similar != null) { + Seppuku.INSTANCE.logChat("Did you mean " + "\247c" + similar.getDisplayName() + "\247f?"); + } + } + } +} diff --git a/src/main/java/me/rigamortis/seppuku/impl/command/ConnectCommand.java b/src/main/java/me/rigamortis/seppuku/impl/command/ConnectCommand.java new file mode 100644 index 0000000..d297c01 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/impl/command/ConnectCommand.java @@ -0,0 +1,47 @@ +package me.rigamortis.seppuku.impl.command; + +import me.rigamortis.seppuku.Seppuku; +import me.rigamortis.seppuku.api.command.Command; +import me.rigamortis.seppuku.api.util.StringUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.GuiConnecting; + +/** + * Author Seth + * 5/24/2019 @ 2:47 AM. + */ +public final class ConnectCommand extends Command { + + public ConnectCommand() { + super("Connect", new String[]{"Con"}, "Connects to a server", "Connect "); + } + + @Override + public void exec(String input) { + if (!this.clamp(input, 2, 2)) { + this.printUsage(); + return; + } + + final String[] split = input.split(" "); + + final String[] host = split[1].split(":"); + + int port = 25565; + + if (host.length > 1) { + if (StringUtil.isInt(host[1])) { + port = Integer.parseInt(host[1]); + }else{ + Seppuku.INSTANCE.errorChat("Invalid port \"" + host[1] + "\""); + } + } + + if(Minecraft.getMinecraft().player.connection.getNetworkManager().channel().isOpen()) { + Minecraft.getMinecraft().player.connection.getNetworkManager().closeChannel(null); + } + + Minecraft.getMinecraft().displayGuiScreen(new GuiConnecting(null, Minecraft.getMinecraft(), host[0], port)); + } + +} diff --git a/src/main/java/me/rigamortis/seppuku/impl/command/CoordsCommand.java b/src/main/java/me/rigamortis/seppuku/impl/command/CoordsCommand.java new file mode 100644 index 0000000..1bb298c --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/impl/command/CoordsCommand.java @@ -0,0 +1,35 @@ +package me.rigamortis.seppuku.impl.command; + +import me.rigamortis.seppuku.Seppuku; +import me.rigamortis.seppuku.api.command.Command; +import net.minecraft.client.Minecraft; + +import java.awt.*; +import java.awt.datatransfer.Clipboard; +import java.awt.datatransfer.StringSelection; +import java.text.DecimalFormat; + +/** + * Author Seth + * 5/23/2019 @ 8:04 AM. + */ +public final class CoordsCommand extends Command { + + public CoordsCommand() { + super("Coords", new String[] {"Coord", "Coordinates", "Coordinate"}, "Copies your coordinates to the clipboard", "Coords"); + } + + @Override + public void exec(String input) { + if (!this.clamp(input, 1, 1)) { + this.printUsage(); + return; + } + + final DecimalFormat format = new DecimalFormat("#.#"); + final StringSelection contents = new StringSelection(format.format(Minecraft.getMinecraft().player.posX) + ", " + format.format(Minecraft.getMinecraft().player.posY) + ", " + format.format(Minecraft.getMinecraft().player.posZ)); + final Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); + clipboard.setContents(contents, null); + Seppuku.INSTANCE.logChat("Copied coordinates to clipboard"); + } +} diff --git a/src/main/java/me/rigamortis/seppuku/impl/command/CrashSlimeCommand.java b/src/main/java/me/rigamortis/seppuku/impl/command/CrashSlimeCommand.java new file mode 100644 index 0000000..24ce7bc --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/impl/command/CrashSlimeCommand.java @@ -0,0 +1,62 @@ +package me.rigamortis.seppuku.impl.command; + +import me.rigamortis.seppuku.Seppuku; +import me.rigamortis.seppuku.api.command.Command; +import net.minecraft.client.Minecraft; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.play.client.CPacketCreativeInventoryAction; + +/** + * Author Seth + * 8/18/2019 @ 9:32 PM. + */ +public final class CrashSlimeCommand extends Command { + + public CrashSlimeCommand() { + super("CrashSlime", new String[] {"CSlime", "CrashS"}, "Gives you a slime spawn egg that crashes the server and nearby players while in creative mode", "CrashSlime"); + } + + @Override + public void exec(String input) { + if (!this.clamp(input, 1, 1)) { + this.printUsage(); + return; + } + + final Minecraft mc = Minecraft.getMinecraft(); + + if (!mc.player.isCreative()) { + Seppuku.INSTANCE.errorChat("Creative mode is required to use this command."); + return; + } + + final ItemStack itemStack = new ItemStack(Item.getItemById(383)); + final NBTTagCompound tagCompound = (itemStack.hasTagCompound()) ? itemStack.getTagCompound() : new NBTTagCompound(); + final NBTTagCompound entityTag = new NBTTagCompound(); + + entityTag.setString("id", "minecraft:slime"); + tagCompound.setTag("EntityTag", entityTag); + entityTag.setInteger("Size", Integer.MAX_VALUE); + itemStack.setTagCompound(tagCompound); + + final int slot = this.findEmptyhotbar(); + + mc.player.connection.sendPacket(new CPacketCreativeInventoryAction(36 + (slot != -1 ? slot : mc.player.inventory.currentItem), itemStack)); + Seppuku.INSTANCE.logChat("Gave you a crash slime spawn egg"); + } + + private int findEmptyhotbar() { + for (int i = 0; i < 9; i++) { + final ItemStack stack = Minecraft.getMinecraft().player.inventory.getStackInSlot(i); + + if (stack.getItem() == Items.AIR) { + return i; + } + } + return -1; + } + +} diff --git a/src/main/java/me/rigamortis/seppuku/impl/command/DisconnectCommand.java b/src/main/java/me/rigamortis/seppuku/impl/command/DisconnectCommand.java new file mode 100644 index 0000000..6cb08f8 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/impl/command/DisconnectCommand.java @@ -0,0 +1,44 @@ +package me.rigamortis.seppuku.impl.command; + +import me.rigamortis.seppuku.api.command.Command; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiMainMenu; +import net.minecraft.client.gui.GuiMultiplayer; +import net.minecraft.client.multiplayer.WorldClient; +import net.minecraft.realms.RealmsBridge; + +/** + * Author Seth + * 5/24/2019 @ 3:04 AM. + */ +public final class DisconnectCommand extends Command { + + public DisconnectCommand() { + super("Disconnect", new String[] {"Discon"}, "Disconnects from the current server", "Disconnect"); + } + + @Override + public void exec(String input) { + if (!this.clamp(input, 1, 1)) { + this.printUsage(); + return; + } + + final Minecraft mc = Minecraft.getMinecraft(); + + boolean flag = mc.isIntegratedServerRunning(); + boolean flag1 = mc.isConnectedToRealms(); + mc.world.sendQuittingDisconnectingPacket(); + mc.loadWorld(null); + + if (flag) { + mc.displayGuiScreen(new GuiMainMenu()); + } + else if (flag1) { + RealmsBridge realmsbridge = new RealmsBridge(); + realmsbridge.switchToRealms(new GuiMainMenu()); + } else { + mc.displayGuiScreen(new GuiMultiplayer(new GuiMainMenu())); + } + } +} diff --git a/src/main/java/me/rigamortis/seppuku/impl/command/DupeCommand.java b/src/main/java/me/rigamortis/seppuku/impl/command/DupeCommand.java new file mode 100644 index 0000000..170c16e --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/impl/command/DupeCommand.java @@ -0,0 +1,35 @@ +package me.rigamortis.seppuku.impl.command; + +import me.rigamortis.seppuku.api.command.Command; +import net.minecraft.client.Minecraft; +import net.minecraft.inventory.ClickType; +import net.minecraft.network.play.client.CPacketUseEntity; + +/** + * Author Seth + * 5/12/2019 @ 8:05 PM. + */ +public final class DupeCommand extends Command { + + public DupeCommand() { + super("Dupe", new String[] {"Dup", "Doop"}, "Allows you to dupe your inventory", "Dupe"); + } + + @Override + public void exec(String input) { + if (!this.clamp(input, 1, 1)) { + this.printUsage(); + return; + } + + final Minecraft mc = Minecraft.getMinecraft(); + + if(mc.player != null) { + for (int i = 0; i <= 45; i++) { + mc.playerController.windowClick(mc.player.inventoryContainer.windowId, i, -1, ClickType.THROW, mc.player); + } + + mc.player.connection.sendPacket(new CPacketUseEntity(mc.player)); + } + } +} diff --git a/src/main/java/me/rigamortis/seppuku/impl/command/EnchantCommand.java b/src/main/java/me/rigamortis/seppuku/impl/command/EnchantCommand.java new file mode 100644 index 0000000..6963326 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/impl/command/EnchantCommand.java @@ -0,0 +1,94 @@ +package me.rigamortis.seppuku.impl.command; + +import me.rigamortis.seppuku.Seppuku; +import me.rigamortis.seppuku.api.command.Command; +import net.minecraft.client.Minecraft; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.network.play.client.CPacketCreativeInventoryAction; + +/** + * created by noil on 8/15/2019 at 7:29 PM + */ +public final class EnchantCommand extends Command { + + public EnchantCommand() { + super("Enchant", new String[]{"Ench"}, "Add enchants to your held item while in creative mode.", "Enchant ([true/false] Disable Curses)"); + } + + @Override + public void exec(String input) { + if (!this.clamp(input, 3, 4)) { + this.printUsage(); + return; + } + + final String[] split = input.split(" "); + + final String enchantToApply = split[1]; + final String levelToApply = split[2]; + + // ensure we got some input to parse + if (enchantToApply != null && levelToApply != null) { + final Minecraft mc = Minecraft.getMinecraft(); + + if (!mc.player.isCreative()) { // need to be in creative + Seppuku.INSTANCE.errorChat("Creative mode is required to use this command."); + return; + } + + final ItemStack itemStack = mc.player.getHeldItemMainhand(); + + if (itemStack.isEmpty()) { // needs an item of some sort to be held + Seppuku.INSTANCE.errorChat("Please hold an item in your main hand to enchant."); + return; + } + + NBTTagCompound tagCompound = itemStack.getTagCompound(); + + if (tagCompound == null) { // we need a tag compound to be valid to do any of this magic, so we'll check for a null compound + tagCompound = new NBTTagCompound(); + itemStack.setTagCompound(tagCompound); + } + + if (!tagCompound.hasKey("ench", 9)) { // check if we have enchantment tag list already or not + tagCompound.setTag("ench", new NBTTagList()); // create new enchantment tag list + } + + NBTTagList enchantments = itemStack.getTagCompound().getTagList("ench", 10); // this is the item's enchant compound list we are going to modify + + // loop thru all the registered enchants and find the ones we need + for (Enchantment enchant : Enchantment.REGISTRY) { + if (enchant == null) + continue; + + // disable curses? (used when doing all enchants) + if (split.length > 3) { + final String disableCurses = split[3]; + if (disableCurses.toLowerCase().equals("true") && enchant.isCurse()) + continue; + } + + final String enchantmentName = enchant.getTranslatedName(0).replaceAll(" ", ""); + + if (enchantToApply.toLowerCase().equals("all") || enchantmentName.toLowerCase().startsWith(enchantToApply.toLowerCase())) { + final NBTTagCompound enchantmentCompound = new NBTTagCompound(); + enchantmentCompound.setShort("id", (short) Enchantment.getEnchantmentID(enchant)); // set the enchant id + if (levelToApply.toLowerCase().startsWith("max")) { + enchantmentCompound.setShort("lvl", Short.MAX_VALUE); // set the level to the max short value + } else { + enchantmentCompound.setShort("lvl", Short.valueOf(levelToApply)); // set the level + } + enchantments.appendTag(enchantmentCompound); // add our new enchantment tag to the enchantment tag list + } + } + + // cr3at1v3 m0d3 0n1y + mc.getConnection().sendPacket(new CPacketCreativeInventoryAction(mc.player.inventory.currentItem, itemStack)); + + Seppuku.INSTANCE.logChat("Enchants have been added to your item."); + } + } +} diff --git a/src/main/java/me/rigamortis/seppuku/impl/command/FakeChatCommand.java b/src/main/java/me/rigamortis/seppuku/impl/command/FakeChatCommand.java new file mode 100644 index 0000000..2337ee7 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/impl/command/FakeChatCommand.java @@ -0,0 +1,36 @@ +package me.rigamortis.seppuku.impl.command; + +import me.rigamortis.seppuku.api.command.Command; +import net.minecraft.client.Minecraft; +import net.minecraft.util.text.TextComponentString; + +/** + * Author Seth + * 8/1/2019 @ 7:22 PM. + */ +public final class FakeChatCommand extends Command { + + public FakeChatCommand() { + super("FakeChat", new String[] {"FChat", "TellRaw"}, "Allows you to add a fake chat message", "FakeChat "); + } + + @Override + public void exec(String input) { + if (!this.clamp(input, 2)) { + this.printUsage(); + return; + } + + final String[] split = input.split(" "); + + final StringBuilder sb = new StringBuilder(); + + for (int i = 1; i < split.length; i++) { + final String s = split[i]; + sb.append(s + (i == split.length - 1 ? "" : " ")); + } + + final String message = sb.toString(); + Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(new TextComponentString(message.replace("&", "\247"))); + } +} diff --git a/src/main/java/me/rigamortis/seppuku/impl/command/FindEntityCommand.java b/src/main/java/me/rigamortis/seppuku/impl/command/FindEntityCommand.java new file mode 100644 index 0000000..64b454c --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/impl/command/FindEntityCommand.java @@ -0,0 +1,34 @@ +package me.rigamortis.seppuku.impl.command; + +import me.rigamortis.seppuku.api.command.Command; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.chunk.Chunk; + +/** + * Author Seth + * 8/6/2019 @ 4:34 PM. + */ +public final class FindEntityCommand extends Command { + + public FindEntityCommand() { + super("FindEntity", new String[]{"FindEnt"}, "Scans nearby chunks for entity spawns", "FindEntity "); + } + + @Override + public void exec(String input) { + if (!this.clamp(input, 2, 2)) { + this.printUsage(); + return; + } + + final Minecraft mc = Minecraft.getMinecraft(); + final BlockPos pos = mc.player.getPosition(); + final Chunk chunk = mc.world.getChunkFromBlockCoords(pos); + final Biome biome = chunk.getBiome(pos, mc.world.getBiomeProvider()); + + System.out.println(biome.getSpawnableList(EnumCreatureType.CREATURE)); + } +} diff --git a/src/main/java/me/rigamortis/seppuku/impl/command/FriendCommand.java b/src/main/java/me/rigamortis/seppuku/impl/command/FriendCommand.java new file mode 100644 index 0000000..ecc1d9c --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/impl/command/FriendCommand.java @@ -0,0 +1,131 @@ +package me.rigamortis.seppuku.impl.command; + +import me.rigamortis.seppuku.Seppuku; +import me.rigamortis.seppuku.api.command.Command; +import me.rigamortis.seppuku.api.friend.Friend; +import me.rigamortis.seppuku.api.macro.Macro; +import net.minecraft.client.Minecraft; +import net.minecraft.util.text.Style; +import net.minecraft.util.text.TextComponentString; +import net.minecraft.util.text.event.HoverEvent; + +/** + * Author Seth + * 4/16/2019 @ 11:45 PM. + */ +public final class FriendCommand extends Command { + + private String[] addAlias = new String[]{"Add", "A"}; + private String[] removeAlias = new String[]{"Remove", "R", "Rem", "Delete", "Del"}; + private String[] listAlias = new String[]{"List", "L"}; + private String[] clearAlias = new String[]{"Clear", "C"}; + + public FriendCommand() { + super("Friend", new String[]{"F"}, "Allows you to add or remove friends", "Friend Add \n" + + "Friend Add \n" + + "Friend Remove \n" + + "Friend Clear"); + } + + @Override + public void exec(String input) { + if (!this.clamp(input, 2, 4)) { + this.printUsage(); + return; + } + + final String[] split = input.split(" "); + + if (equals(addAlias, split[1])) { + if (!this.clamp(input, 3, 4)) { + this.printUsage(); + return; + } + + final String username = split[2]; + final Friend friend = Seppuku.INSTANCE.getFriendManager().find(username); + + if (friend != null) { + Seppuku.INSTANCE.logChat("\247c" + username + " \247fis already your friend"); + } else { + if (split.length > 3) { + if (!this.clamp(input, 4, 4)) { + this.printUsage(); + return; + } + final String alias = split[3]; + Seppuku.INSTANCE.logChat("Added \247c" + username + " \247fas \247c" + alias + "\247f"); + Seppuku.INSTANCE.getFriendManager().add(username, alias, true); + } else { + Seppuku.INSTANCE.logChat("Added \247c" + username + " \247f"); + Seppuku.INSTANCE.getFriendManager().add(username, username, true); + } + } + } else if (equals(removeAlias, split[1])) { + if (!this.clamp(input, 3, 3)) { + this.printUsage(); + return; + } + + final int friends = Seppuku.INSTANCE.getFriendManager().getFriendList().size(); + + if (friends == 0) { + Seppuku.INSTANCE.logChat("You don't have any friends :("); + return; + } + + final String username = split[2]; + final Friend friend = Seppuku.INSTANCE.getFriendManager().find(username); + + if (friend != null) { + Seppuku.INSTANCE.logChat("Removed \247c" + friend.getAlias() + " \247f"); + Seppuku.INSTANCE.getFriendManager().getFriendList().remove(friend); + Seppuku.INSTANCE.getConfigManager().saveAll(); + } else { + Seppuku.INSTANCE.logChat("\247c" + username + " \247fis not your friend"); + } + } else if (equals(listAlias, split[1])) { + if (!this.clamp(input, 2, 2)) { + this.printUsage(); + return; + } + + final int size = Seppuku.INSTANCE.getFriendManager().getFriendList().size(); + + if (size > 0) { + final TextComponentString msg = new TextComponentString("\2477Friends [" + size + "]\247f "); + + for (int i = 0; i < size; i++) { + final Friend friend = Seppuku.INSTANCE.getFriendManager().getFriendList().get(i); + if (friend != null) { + msg.appendSibling(new TextComponentString("\247a" + friend.getAlias() + "\2477" + ((i == size - 1) ? "" : ", ")) + .setStyle(new Style() + .setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponentString("Name: " + friend.getName() + "\n" + "UUID: " + friend.getUuid()))))); + } + } + + Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(msg); + }else{ + Seppuku.INSTANCE.logChat("You don't have any friends :("); + } + } else if (equals(clearAlias, split[1])) { + if (!this.clamp(input, 2, 2)) { + this.printUsage(); + return; + } + + final int friends = Seppuku.INSTANCE.getFriendManager().getFriendList().size(); + + if (friends > 0) { + Seppuku.INSTANCE.logChat("Removed \247c" + friends + "\247f friend" + (friends > 1 ? "s" : "")); + Seppuku.INSTANCE.getFriendManager().getFriendList().clear(); + Seppuku.INSTANCE.getConfigManager().saveAll(); + } else { + Seppuku.INSTANCE.logChat("You don't have any friends :("); + } + } else { + Seppuku.INSTANCE.errorChat("Unknown input " + "\247f\"" + input + "\""); + this.printUsage(); + } + } +} diff --git a/src/main/java/me/rigamortis/seppuku/impl/command/GiveCommand.java b/src/main/java/me/rigamortis/seppuku/impl/command/GiveCommand.java new file mode 100644 index 0000000..b0e2360 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/impl/command/GiveCommand.java @@ -0,0 +1,135 @@ +package me.rigamortis.seppuku.impl.command; + +import me.rigamortis.seppuku.Seppuku; +import me.rigamortis.seppuku.api.command.Command; +import me.rigamortis.seppuku.api.util.StringUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.JsonToNBT; +import net.minecraft.nbt.NBTException; +import net.minecraft.network.play.client.CPacketCreativeInventoryAction; +import net.minecraft.util.ResourceLocation; + +/** + * Author Seth + * 8/18/2019 @ 10:37 PM. + */ +public final class GiveCommand extends Command { + + public GiveCommand() { + super("Give", new String[] {"Giv"}, "Allows you to give yourself any item while in creative", "Give "); + } + + @Override + public void exec(String input) { + if (!this.clamp(input, 2)) { + this.printUsage(); + return; + } + + final Minecraft mc = Minecraft.getMinecraft(); + + if (!mc.player.isCreative()) { + Seppuku.INSTANCE.errorChat("Creative mode is required to use this command."); + return; + } + + final String[] split = input.split(" "); + + final Item item = this.findItem(split[1]); + + if(item != null) { + int amount = 1; + int meta = 0; + + if(split.length >= 3) { + if(StringUtil.isInt(split[2])) { + amount = Integer.parseInt(split[2]); + }else{ + Seppuku.INSTANCE.errorChat("Unknown number " + "\247f\"" + split[2] + "\""); + } + } + + if(split.length >= 4) { + if(StringUtil.isInt(split[3])) { + meta = Integer.parseInt(split[3]); + }else{ + Seppuku.INSTANCE.errorChat("Unknown number " + "\247f\"" + split[3] + "\""); + } + } + + final ItemStack itemStack = new ItemStack(item, amount, meta); + + if(split.length >= 5) { + final String s = this.buildString(split, 4); + + try { + itemStack.setTagCompound(JsonToNBT.getTagFromJson(s)); + } catch (NBTException e) { + e.printStackTrace(); + } + } + + final int slot = this.findEmptyhotbar(); + mc.player.connection.sendPacket(new CPacketCreativeInventoryAction(36 + (slot != -1 ? slot : mc.player.inventory.currentItem), itemStack)); + Seppuku.INSTANCE.logChat("Gave you " + amount + " " + itemStack.getDisplayName()); + }else{ + final ResourceLocation similar = this.findSimilarItem(split[1]); + + if(similar != null) { + Seppuku.INSTANCE.errorChat("Unknown item " + "\247f\"" + split[1] + "\""); + Seppuku.INSTANCE.logChat("Did you mean " + "\247c" + similar.getResourcePath() + "\247f?"); + } + } + } + + private String buildString(String[] args, int startPos) { + final StringBuilder sb = new StringBuilder(); + + for (int i = startPos; i < args.length; ++i) { + if (i > startPos) { + sb.append(" "); + } + + final String s = args[i]; + sb.append(s); + } + + return sb.toString(); + } + + private ResourceLocation findSimilarItem(String name) { + ResourceLocation ret = null; + double similarity = 0.0f; + + for (ResourceLocation res : Item.REGISTRY.getKeys()) { + final double currentSimilarity = StringUtil.levenshteinDistance(name, res.getResourcePath()); + + if (currentSimilarity >= similarity) { + similarity = currentSimilarity; + ret = res; + } + } + + return ret; + } + + private Item findItem(String name) { + final ResourceLocation res = new ResourceLocation(name); + return Item.REGISTRY.getObject(res); + } + + private int findEmptyhotbar() { + for (int i = 0; i < 9; i++) { + final ItemStack stack = Minecraft.getMinecraft().player.inventory.getStackInSlot(i); + + if (stack.getItem() == Items.AIR) { + return i; + } + } + return -1; + } + +} diff --git a/src/main/java/me/rigamortis/seppuku/impl/command/HClipCommand.java b/src/main/java/me/rigamortis/seppuku/impl/command/HClipCommand.java new file mode 100644 index 0000000..6dfd5ac --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/impl/command/HClipCommand.java @@ -0,0 +1,47 @@ +package me.rigamortis.seppuku.impl.command; + +import me.rigamortis.seppuku.Seppuku; +import me.rigamortis.seppuku.api.command.Command; +import me.rigamortis.seppuku.api.util.MathUtil; +import me.rigamortis.seppuku.api.util.StringUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.network.play.client.CPacketEntityAction; +import net.minecraft.util.math.Vec3d; + +/** + * Author Seth + * 4/16/2019 @ 9:11 PM. + */ +public final class HClipCommand extends Command { + + public HClipCommand() { + super("HClip", new String[]{"HC", "HorizontalClip"}, "Allows you to teleport horizontally", "HClip "); + } + + @Override + public void exec(String input) { + if (!this.clamp(input, 2, 2)) { + this.printUsage(); + return; + } + + final String[] split = input.split(" "); + + if (StringUtil.isDouble(split[1])) { + final double num = Double.parseDouble(split[1]); + + final Vec3d dir = MathUtil.direction(Minecraft.getMinecraft().player.rotationYaw); + + if (dir != null) { + if (Minecraft.getMinecraft().player.getRidingEntity() != null) { + Minecraft.getMinecraft().player.getRidingEntity().setPosition(Minecraft.getMinecraft().player.getRidingEntity().posX + dir.x * num, Minecraft.getMinecraft().player.getRidingEntity().posY, Minecraft.getMinecraft().player.getRidingEntity().posZ + dir.z * num); + } else { + Minecraft.getMinecraft().player.setPosition(Minecraft.getMinecraft().player.posX + dir.x * num, Minecraft.getMinecraft().player.posY, Minecraft.getMinecraft().player.posZ + dir.z * num); + } + Seppuku.INSTANCE.logChat("Teleported you " + ((num > 0) ? "forward" : "backward") + " " + num); + } + } else { + Seppuku.INSTANCE.errorChat("Unknown number " + "\247f\"" + split[1] + "\""); + } + } +} diff --git a/src/main/java/me/rigamortis/seppuku/impl/command/HelpCommand.java b/src/main/java/me/rigamortis/seppuku/impl/command/HelpCommand.java new file mode 100644 index 0000000..ea36eec --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/impl/command/HelpCommand.java @@ -0,0 +1,42 @@ +package me.rigamortis.seppuku.impl.command; + +import me.rigamortis.seppuku.Seppuku; +import me.rigamortis.seppuku.api.command.Command; +import net.minecraft.client.Minecraft; +import net.minecraft.util.text.Style; +import net.minecraft.util.text.TextComponentString; +import net.minecraft.util.text.event.HoverEvent; + +/** + * Author Seth + * 4/16/2019 @ 8:39 AM. + */ +public final class HelpCommand extends Command { + + public HelpCommand() { + super("Help", new String[]{"H", "?"}, "Displays all commands", "Help"); + } + + @Override + public void exec(String input) { + if (!this.clamp(input, 1, 1)) { + this.printUsage(); + return; + } + + final int size = Seppuku.INSTANCE.getCommandManager().getCommandList().size(); + + final TextComponentString msg = new TextComponentString("\2477Commands [" + size + "]\247f "); + + for (int i = 0; i < size; i++) { + final Command cmd = Seppuku.INSTANCE.getCommandManager().getCommandList().get(i); + + msg.appendSibling(new TextComponentString("\247a" + cmd.getDisplayName() + "\2477" + ((i == size - 1) ? "" : ", ")) + .setStyle(new Style() + .setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponentString("\2476" + cmd.getDesc() + "\247f") + .appendSibling(new TextComponentString("\n" + cmd.getUsage())))))); + } + + Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(msg); + } +} diff --git a/src/main/java/me/rigamortis/seppuku/impl/command/HideCommand.java b/src/main/java/me/rigamortis/seppuku/impl/command/HideCommand.java new file mode 100644 index 0000000..47db71e --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/impl/command/HideCommand.java @@ -0,0 +1,51 @@ +package me.rigamortis.seppuku.impl.command; + +import me.rigamortis.seppuku.Seppuku; +import me.rigamortis.seppuku.api.command.Command; +import me.rigamortis.seppuku.api.module.Module; + +/** + * Author Seth + * 4/16/2019 @ 10:01 PM. + */ +public final class HideCommand extends Command { + + public HideCommand() { + super("Hide", new String[] {"Hid"}, "Allows you to hide modules from the arraylist", "Hide "); + } + + @Override + public void exec(String input) { + if (!this.clamp(input, 2, 2)) { + this.printUsage(); + return; + } + + final String[] split = input.split(" "); + + final Module mod = Seppuku.INSTANCE.getModuleManager().find(split[1]); + + if(mod != null) { + if(mod.getType() == Module.ModuleType.HIDDEN) { + Seppuku.INSTANCE.errorChat("Cannot hide " + "\247f\"" + mod.getDisplayName() + "\""); + }else{ + mod.setHidden(!mod.isHidden()); + Seppuku.INSTANCE.getConfigManager().saveAll(); + + if(mod.isHidden()) { + Seppuku.INSTANCE.logChat("\247c" + mod.getDisplayName() + "\247f is now hidden"); + }else{ + Seppuku.INSTANCE.logChat("\247c" + mod.getDisplayName() + "\247f is no longer hidden"); + } + } + //TODO config + }else{ + Seppuku.INSTANCE.errorChat("Unknown module " + "\247f\"" + split[1] + "\""); + final Module similar = Seppuku.INSTANCE.getModuleManager().findSimilar(split[1]); + + if(similar != null) { + Seppuku.INSTANCE.logChat("Did you mean " + "\247c" + similar.getDisplayName() + "\247f?"); + } + } + } +} diff --git a/src/main/java/me/rigamortis/seppuku/impl/command/IPCommand.java b/src/main/java/me/rigamortis/seppuku/impl/command/IPCommand.java new file mode 100644 index 0000000..857e170 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/impl/command/IPCommand.java @@ -0,0 +1,39 @@ +package me.rigamortis.seppuku.impl.command; + +import me.rigamortis.seppuku.Seppuku; +import me.rigamortis.seppuku.api.command.Command; +import net.minecraft.client.Minecraft; + +import java.awt.*; +import java.awt.datatransfer.Clipboard; +import java.awt.datatransfer.StringSelection; + +/** + * Author Seth + * 5/23/2019 @ 8:11 AM. + */ +public final class IPCommand extends Command { + + public IPCommand() { + super("IP", new String[] {"IPAddress"}, "Copies the current server ip to your clipboard", "IP"); + } + + @Override + public void exec(String input) { + if (!this.clamp(input, 1, 1)) { + this.printUsage(); + return; + } + + final Minecraft mc = Minecraft.getMinecraft(); + + if(mc.getCurrentServerData() != null) { + final StringSelection contents = new StringSelection(mc.getCurrentServerData().serverIP); + final Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); + clipboard.setContents(contents, null); + Seppuku.INSTANCE.logChat("Copied IP to clipboard"); + }else{ + Seppuku.INSTANCE.errorChat("Error, Join a server"); + } + } +} diff --git a/src/main/java/me/rigamortis/seppuku/impl/command/IgnoreCommand.java b/src/main/java/me/rigamortis/seppuku/impl/command/IgnoreCommand.java new file mode 100644 index 0000000..67d1a40 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/impl/command/IgnoreCommand.java @@ -0,0 +1,113 @@ +package me.rigamortis.seppuku.impl.command; + +import me.rigamortis.seppuku.Seppuku; +import me.rigamortis.seppuku.api.command.Command; +import me.rigamortis.seppuku.api.ignore.Ignored; +import net.minecraft.client.Minecraft; +import net.minecraft.util.text.TextComponentString; + +/** + * Author Seth + * 6/29/2019 @ 5:03 AM. + */ +public final class IgnoreCommand extends Command { + + private String[] addAlias = new String[]{"Add", "A"}; + private String[] removeAlias = new String[]{"Remove", "R", "Rem", "Delete", "Del"}; + private String[] listAlias = new String[]{"List", "L"}; + private String[] clearAlias = new String[]{"Clear", "C"}; + + public IgnoreCommand() { + super("Ignore", new String[]{"Ignor"}, "Allows you to ignore other players", "Ignore Add \n" + + "Ignore Remove \n" + + "Ignore List\n" + + "Ignore Clear"); + } + + @Override + public void exec(String input) { + if (!this.clamp(input, 2, 3)) { + this.printUsage(); + return; + } + + final String[] split = input.split(" "); + + if (equals(addAlias, split[1])) { + if (!this.clamp(input, 3, 3)) { + this.printUsage(); + return; + } + + final Ignored ignored = Seppuku.INSTANCE.getIgnoredManager().find(split[2]); + + if (ignored != null) { + Seppuku.INSTANCE.logChat("\247c" + ignored.getName() + " \247fis already ignored"); + } else { + Seppuku.INSTANCE.logChat("Added \247c" + split[2] + "\247f to your ignore list"); + Seppuku.INSTANCE.getIgnoredManager().add(split[2]); + Seppuku.INSTANCE.getConfigManager().saveAll(); + } + } else if (equals(removeAlias, split[1])) { + if (!this.clamp(input, 3, 3)) { + this.printUsage(); + return; + } + + final int size = Seppuku.INSTANCE.getIgnoredManager().getIgnoredList().size(); + + if (size == 0) { + Seppuku.INSTANCE.logChat("You don't have anyone ignored"); + return; + } + + final Ignored ignored = Seppuku.INSTANCE.getIgnoredManager().find(split[2]); + + if (ignored != null) { + Seppuku.INSTANCE.logChat("Removed \247c" + ignored.getName() + "\247f from your ignore list"); + Seppuku.INSTANCE.getIgnoredManager().getIgnoredList().remove(ignored); + Seppuku.INSTANCE.getConfigManager().saveAll(); + } else { + Seppuku.INSTANCE.logChat("\247c" + split[1] + " \247fis not ignored"); + } + } else if (equals(listAlias, split[1])) { + if (!this.clamp(input, 2, 2)) { + this.printUsage(); + return; + } + final int size = Seppuku.INSTANCE.getIgnoredManager().getIgnoredList().size(); + + if (size > 0) { + final TextComponentString msg = new TextComponentString("\2477Ignored [" + size + "]\247f "); + + for (int i = 0; i < size; i++) { + final Ignored ignored = Seppuku.INSTANCE.getIgnoredManager().getIgnoredList().get(i); + if (ignored != null) { + msg.appendSibling(new TextComponentString("\247a" + ignored.getName() + "\2477" + ((i == size - 1) ? "" : ", "))); + } + } + + Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(msg); + }else{ + Seppuku.INSTANCE.logChat("You don't have anyone ignored"); + } + } else if (equals(clearAlias, split[1])) { + if (!this.clamp(input, 2, 2)) { + this.printUsage(); + return; + } + final int size = Seppuku.INSTANCE.getIgnoredManager().getIgnoredList().size(); + + if (size > 0) { + Seppuku.INSTANCE.logChat("Removed \247c" + size + "\247f ignored player" + (size > 1 ? "s" : "")); + Seppuku.INSTANCE.getIgnoredManager().getIgnoredList().clear(); + Seppuku.INSTANCE.getConfigManager().saveAll(); + } else { + Seppuku.INSTANCE.logChat("You don't have anyone ignored"); + } + } else { + Seppuku.INSTANCE.errorChat("Unknown input " + "\247f\"" + input + "\""); + this.printUsage(); + } + } +} diff --git a/src/main/java/me/rigamortis/seppuku/impl/command/InvSeeCommand.java b/src/main/java/me/rigamortis/seppuku/impl/command/InvSeeCommand.java new file mode 100644 index 0000000..fdcb9f5 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/impl/command/InvSeeCommand.java @@ -0,0 +1,69 @@ +package me.rigamortis.seppuku.impl.command; + +import me.rigamortis.seppuku.Seppuku; +import me.rigamortis.seppuku.api.command.Command; +import me.rigamortis.seppuku.api.event.render.EventRender2D; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import team.stiff.pomelo.impl.annotated.handler.annotation.Listener; + +/** + * Author Seth + * 5/20/2019 @ 12:25 AM. + */ +public final class InvSeeCommand extends Command { + + private String entity; + + public InvSeeCommand() { + super("InvSee", new String[] {"InventorySee"}, "Allows you to see another players inventory", "InvSee "); + } + + @Override + public void exec(String input) { + if (!this.clamp(input, 2, 2)) { + this.printUsage(); + return; + } + + final String[] split = input.split(" "); + + try { + this.entity = split[1]; + Seppuku.INSTANCE.getEventManager().addEventListener(this); + } catch (Exception e) { + e.printStackTrace(); + } + } + + @Listener + public void render(EventRender2D event) { + try{ + final Minecraft mc = Minecraft.getMinecraft(); + + EntityPlayer player = null; + + for(Entity e : mc.world.loadedEntityList) { + if(e != null && e instanceof EntityPlayer) { + if(e.getName().equalsIgnoreCase(this.entity)) { + player = (EntityPlayer)e; + break; + } + } + } + + if(player != null) { + mc.displayGuiScreen(new GuiInventory(player)); + }else{ + Seppuku.INSTANCE.errorChat("\"" + this.entity + "\" is not within range"); + } + }catch (Exception e) { + e.printStackTrace(); + } + + Seppuku.INSTANCE.getEventManager().removeEventListener(this); + } + +} diff --git a/src/main/java/me/rigamortis/seppuku/impl/command/JavaScriptCommand.java b/src/main/java/me/rigamortis/seppuku/impl/command/JavaScriptCommand.java new file mode 100644 index 0000000..62b2da8 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/impl/command/JavaScriptCommand.java @@ -0,0 +1,79 @@ +package me.rigamortis.seppuku.impl.command; + +import me.rigamortis.seppuku.Seppuku; +import me.rigamortis.seppuku.api.command.Command; + +import javax.script.ScriptEngine; +import javax.script.ScriptEngineManager; +import javax.script.ScriptException; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; + +/** + * Author Seth + * 7/27/2019 @ 7:19 PM. + * Credits https://stackoverflow.com/questions/1601246/java-scripting-api-how-to-stop-the-evaluation + */ +public final class JavaScriptCommand extends Command { + + public JavaScriptCommand() { + super("JavaScript", new String[]{"Js"}, "Allows you to execute javascript client-side", "JavaScript "); + } + + @Override + public void exec(String input) { + if (!this.clamp(input, 2)) { + this.printUsage(); + return; + } + + final String[] split = input.split(" "); + + final StringBuilder sb = new StringBuilder(); + + for (int i = 1; i < split.length; i++) { + final String s = split[i]; + sb.append(s + (i == split.length - 1 ? "" : " ")); + } + + final String syntax = sb.toString(); + + try { + Executors.newCachedThreadPool().submit(new ScriptRunnable(syntax)).get(3, TimeUnit.SECONDS); + } catch (TimeoutException e) { + Seppuku.INSTANCE.errorChat("Took too long to execute"); + Executors.newCachedThreadPool().shutdown(); + } catch (InterruptedException e) { + e.printStackTrace(); + Seppuku.INSTANCE.errorChat(e.getMessage()); + } catch (ExecutionException e) { + e.printStackTrace(); + Seppuku.INSTANCE.errorChat(e.getMessage()); + } + } + + public static class ScriptRunnable implements Runnable { + private String syntax; + + public ScriptRunnable(String syntax) { + this.syntax = syntax; + } + + @Override + public void run() { + try { + final long time = System.nanoTime(); + ScriptEngine scriptEngine = new ScriptEngineManager(null).getEngineByName("nashorn"); + Seppuku.INSTANCE.logChat(scriptEngine.eval(syntax).toString()); + Seppuku.INSTANCE.logChat("Execution time: " + (System.nanoTime() - time) / 1000000 + "ms"); + } catch (ScriptException e) { + e.printStackTrace(); + Seppuku.INSTANCE.errorChat(e.getMessage()); + } + } + + } + +} diff --git a/src/main/java/me/rigamortis/seppuku/impl/command/JoinDateCommand.java b/src/main/java/me/rigamortis/seppuku/impl/command/JoinDateCommand.java new file mode 100644 index 0000000..d4442e4 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/impl/command/JoinDateCommand.java @@ -0,0 +1,99 @@ +package me.rigamortis.seppuku.impl.command; + +import me.rigamortis.seppuku.Seppuku; +import me.rigamortis.seppuku.api.command.Command; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.URL; +import java.nio.charset.Charset; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; + +/** + * created by noil on 8/15/2019 at 4:41 PM + */ +public final class JoinDateCommand extends Command { + + public JoinDateCommand() { + super("JoinDate", new String[]{"Jd"}, "Prints a given 9b9t player's join date (via 9b9t.com) in chat.", "JoinDate "); + } + + @Override + public void exec(String input) { + if (!this.clamp(input, 2, 2)) { + this.printUsage(); + return; + } + + final String[] split = input.split(" "); + + final String givenUsername = split[1]; + + if (givenUsername != null) { + + //fuckin newfags these days + if(givenUsername.equalsIgnoreCase("Miniman392")) { + final Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.DAY_OF_YEAR, 1); + final SimpleDateFormat formatter = new SimpleDateFormat("MMMM d, yyyy"); + Seppuku.INSTANCE.logChat(givenUsername + " joined on " + formatter.format(calendar.getTime())); + return; + } + + if(givenUsername.equalsIgnoreCase("iSlime")) { + Seppuku.INSTANCE.errorChat("Invalid username or the website is offline."); + Seppuku.INSTANCE.errorChat("Who the fuck is iSlime?"); + return; + } + + if(givenUsername.equalsIgnoreCase("FlashBak_")) { + Seppuku.INSTANCE.logChat(givenUsername + " joined on 2011"); + return; + } + + new Thread(() -> { + final String date = getJoinDate(givenUsername); + if (date != null) { + Seppuku.INSTANCE.logChat(givenUsername + " joined on " + date); + } else { + Seppuku.INSTANCE.errorChat("Invalid username or the website is offline."); + } + }).start(); + } else { + Seppuku.INSTANCE.errorChat("Error in username format " + "\247f\"" + split[1] + "\""); + this.printUsage(); + } + } + + private String getJoinDate(String username) { + try { + String data = this.getDataFromWebSite("http://9b9t.com/join-date/submit/" + username); + if (data.contains("Join Date:")) { + data = data.substring(data.indexOf("Join Date:")).substring(34); + data = data.substring(0, 10); + SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd"); + Date date = parser.parse(data); + SimpleDateFormat formatter = new SimpleDateFormat("MMMM d, yyyy"); + return formatter.format(date); + } + } catch (Exception e) { + return null; + } + return null; + } + + private String getDataFromWebSite(String site) throws Exception { + URL url = new URL(site); + BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(url.openStream(), Charset.forName("UTF-8"))); + StringBuilder stringBuilder = new StringBuilder(); + String inputLine; + while ((inputLine = bufferedReader.readLine()) != null) { + stringBuilder.append(inputLine); + } + bufferedReader.close(); + return stringBuilder.toString(); + } + +} diff --git a/src/main/java/me/rigamortis/seppuku/impl/command/MacroCommand.java b/src/main/java/me/rigamortis/seppuku/impl/command/MacroCommand.java new file mode 100644 index 0000000..d753c24 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/impl/command/MacroCommand.java @@ -0,0 +1,134 @@ +package me.rigamortis.seppuku.impl.command; + +import me.rigamortis.seppuku.Seppuku; +import me.rigamortis.seppuku.api.command.Command; +import me.rigamortis.seppuku.api.macro.Macro; +import net.minecraft.client.Minecraft; +import net.minecraft.util.text.Style; +import net.minecraft.util.text.TextComponentString; +import net.minecraft.util.text.event.HoverEvent; +import org.lwjgl.input.Keyboard; + +/** + * Author Seth + * 5/7/2019 @ 4:20 AM. + */ +public final class MacroCommand extends Command { + + private String[] addAlias = new String[]{"Add", "A"}; + private String[] removeAlias = new String[]{"Remove", "R", "Rem", "Delete", "Del"}; + private String[] listAlias = new String[]{"List", "L"}; + private String[] clearAlias = new String[]{"Clear", "C"}; + + public MacroCommand() { + super("Macro", new String[]{"Mac"}, "Allows you to create chat macros", "Macro Add \n" + + "Macro Remove \n" + + "Macro List\n" + + "Macro Clear"); + } + + @Override + public void exec(String input) { + if (!this.clamp(input, 2)) { + this.printUsage(); + return; + } + + final String[] split = input.split(" "); + + if (equals(addAlias, split[1])) { + if (!this.clamp(input, 5)) { + this.printUsage(); + return; + } + + final String name = split[2]; + final String key = split[3]; + + final Macro macro = Seppuku.INSTANCE.getMacroManager().find(name); + + if(macro != null) { + Seppuku.INSTANCE.logChat("\247c\"" + name + "\"\247f is already a macro"); + }else{ + if(Keyboard.getKeyIndex(key.toUpperCase()) != Keyboard.KEY_NONE) { + final StringBuilder sb = new StringBuilder(); + + final int size = split.length; + + for (int i = 4; i < size; i++) { + final String arg = split[i]; + sb.append(arg + ((i == size - 1) ? "" : " ")); + } + + Seppuku.INSTANCE.logChat("Added macro \247c" + name + "\247f bound to " + key.toUpperCase()); + Seppuku.INSTANCE.getMacroManager().getMacroList().add(new Macro(name, key.toUpperCase(), sb.toString())); + Seppuku.INSTANCE.getConfigManager().saveAll(); + }else{ + Seppuku.INSTANCE.logChat("\247c" + key + "\247f is not a valid key"); + } + } + } else if (equals(removeAlias, split[1])) { + if (!this.clamp(input, 3, 3)) { + this.printUsage(); + return; + } + + final String name = split[2]; + + final Macro macro = Seppuku.INSTANCE.getMacroManager().find(name); + + if(macro != null) { + Seppuku.INSTANCE.logChat("Removed macro \247c" + macro.getName() + " \247f"); + Seppuku.INSTANCE.getMacroManager().getMacroList().remove(macro); + Seppuku.INSTANCE.getConfigManager().saveAll(); + }else{ + //TODO similar + Seppuku.INSTANCE.errorChat("Unknown macro " + "\247f\"" + name + "\""); + } + } else if (equals(listAlias, split[1])) { + if (!this.clamp(input, 2, 2)) { + this.printUsage(); + return; + } + + final int size = Seppuku.INSTANCE.getMacroManager().getMacroList().size(); + + if(size > 0) { + final TextComponentString msg = new TextComponentString("\2477Macros [" + size + "]\247f "); + + for (int i = 0; i < size; i++) { + final Macro macro = Seppuku.INSTANCE.getMacroManager().getMacroList().get(i); + if (macro != null) { + msg.appendSibling(new TextComponentString("\247a" + macro.getName() + "\2477" + ((i == size - 1) ? "" : ", ")) + .setStyle(new Style() + .setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponentString("Key: " + macro.getKey().toUpperCase() + "\n" + "Macro: " + macro.getMacro()))))); + } + } + + Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(msg); + }else{ + Seppuku.INSTANCE.logChat("You don't have any macros"); + } + } else if (equals(clearAlias, split[1])) { + if (!this.clamp(input, 2, 2)) { + this.printUsage(); + return; + } + + final int macros = Seppuku.INSTANCE.getMacroManager().getMacroList().size(); + + if(macros > 0) { + Seppuku.INSTANCE.logChat("Removed \247c" + macros + "\247f macro" + (macros > 1 ? "s" : "")); + Seppuku.INSTANCE.getMacroManager().getMacroList().clear(); + Seppuku.INSTANCE.getConfigManager().saveAll(); + }else{ + Seppuku.INSTANCE.logChat("You don't have any macros"); + } + } else { + Seppuku.INSTANCE.errorChat("Unknown input " + "\247f\"" + input + "\""); + this.printUsage(); + } + + } + +} diff --git a/src/main/java/me/rigamortis/seppuku/impl/command/ModuleCommand.java b/src/main/java/me/rigamortis/seppuku/impl/command/ModuleCommand.java new file mode 100644 index 0000000..b2fc7bf --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/impl/command/ModuleCommand.java @@ -0,0 +1,48 @@ +package me.rigamortis.seppuku.impl.command; + +import me.rigamortis.seppuku.Seppuku; +import me.rigamortis.seppuku.api.command.Command; +import me.rigamortis.seppuku.api.module.Module; +import me.rigamortis.seppuku.impl.module.hidden.CommandsModule; +import net.minecraft.client.Minecraft; +import net.minecraft.util.text.Style; +import net.minecraft.util.text.TextComponentString; +import net.minecraft.util.text.event.ClickEvent; +import net.minecraft.util.text.event.HoverEvent; + +/** + * Author Seth + * 5/1/2019 @ 7:59 PM. + */ +public final class ModuleCommand extends Command { + + public ModuleCommand() { + super("Modules", new String[]{"Mods"}, "Displays all modules", "Modules"); + } + + @Override + public void exec(String input) { + if (!this.clamp(input, 1, 1)) { + this.printUsage(); + return; + } + + final int size = Seppuku.INSTANCE.getModuleManager().getModuleList().size(); + + final TextComponentString msg = new TextComponentString("\2477Modules [" + size + "]\247f "); + + final CommandsModule commandsModule = (CommandsModule) Seppuku.INSTANCE.getModuleManager().find(CommandsModule.class); + + for (int i = 0; i < size; i++) { + final Module mod = Seppuku.INSTANCE.getModuleManager().getModuleList().get(i); + if (mod != null) { + msg.appendSibling(new TextComponentString((mod.isEnabled() ? "\247a" : "\247c") + mod.getDisplayName() + "\2477" + ((i == size - 1) ? "" : ", ")) + .setStyle(new Style() + .setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponentString("\2476" + (mod.getDesc() == null ? "There is no description for this module" : mod.getDesc()) + "\247f").appendSibling(new TextComponentString((mod.toUsageString() == null ? "" : "\n" + mod.toUsageString()) + "\247f")))) + .setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, commandsModule.getPrefix().getString() + "toggle" + " " + mod.getDisplayName())))); + } + } + + Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(msg); + } +} diff --git a/src/main/java/me/rigamortis/seppuku/impl/command/NameCommand.java b/src/main/java/me/rigamortis/seppuku/impl/command/NameCommand.java new file mode 100644 index 0000000..6d18068 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/impl/command/NameCommand.java @@ -0,0 +1,34 @@ +package me.rigamortis.seppuku.impl.command; + +import me.rigamortis.seppuku.Seppuku; +import me.rigamortis.seppuku.api.command.Command; +import net.minecraft.client.Minecraft; +import net.minecraft.util.Session; + +/** + * Author Seth + * 5/4/2019 @ 3:09 AM. + */ +public final class NameCommand extends Command { + + public NameCommand() { + super("Name", new String[] {"Nam"}, "Allows you to change the case of your name", "Name "); + } + + @Override + public void exec(String input) { + if (!this.clamp(input, 2, 2)) { + this.printUsage(); + return; + } + + final String[] split = input.split(" "); + + if(split[1].equalsIgnoreCase(Minecraft.getMinecraft().session.getUsername())) { + Minecraft.getMinecraft().session = new Session(split[1], Minecraft.getMinecraft().session.getPlayerID(), Minecraft.getMinecraft().session.getToken(), "mojang"); + Seppuku.INSTANCE.logChat("Set username to " + split[1]); + }else{ + Seppuku.INSTANCE.errorChat("Name must match"); + } + } +} diff --git a/src/main/java/me/rigamortis/seppuku/impl/command/PeekCommand.java b/src/main/java/me/rigamortis/seppuku/impl/command/PeekCommand.java new file mode 100644 index 0000000..a292b74 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/impl/command/PeekCommand.java @@ -0,0 +1,151 @@ +package me.rigamortis.seppuku.impl.command; + +import me.rigamortis.seppuku.Seppuku; +import me.rigamortis.seppuku.api.command.Command; +import me.rigamortis.seppuku.api.event.render.EventRender2D; +import net.minecraft.block.Block; +import net.minecraft.block.BlockShulkerBox; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiShulkerBox; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItemFrame; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemShulkerBox; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntityShulkerBox; +import net.minecraft.util.math.RayTraceResult; +import team.stiff.pomelo.impl.annotated.handler.annotation.Listener; + +/** + * Author Seth + * 4/17/2019 @ 12:18 AM. + */ +public final class PeekCommand extends Command { + + private String entity; + + public PeekCommand() { + super("Peek", new String[] {"Pk"}, "Allows you to see inside shulker boxes without having to place them", "Peek \nPeek"); + } + + @Override + public void exec(String input) { + if (!this.clamp(input, 1, 2)) { + this.printUsage(); + return; + } + + final String[] split = input.split(" "); + + if(split.length > 1) { + if (!this.clamp(input, 2, 2)) { + this.printUsage(); + return; + } + this.entity = split[1]; + } + + try { + Seppuku.INSTANCE.getEventManager().addEventListener(this); + } catch (Exception e) { + e.printStackTrace(); + } + } + + @Listener + public void render(EventRender2D event) { + try{ + final Minecraft mc = Minecraft.getMinecraft(); + + ItemStack stack = null; + + if(this.entity != null) { + EntityPlayer target = null; + + for(Entity e : mc.world.loadedEntityList) { + if(e != null) { + if(e instanceof EntityPlayer && e.getName().equalsIgnoreCase(this.entity)) { + target = (EntityPlayer) e; + } + } + } + + if(target != null) { + stack = getHeldShulker(target); + + if(stack == null) { + Seppuku.INSTANCE.errorChat("\"" + target.getName() + "\" is not holding a shulker box"); + this.entity = null; + Seppuku.INSTANCE.getEventManager().removeEventListener(this); + return; + } + }else{ + Seppuku.INSTANCE.errorChat("\"" + this.entity + "\" is not within range"); + } + this.entity = null; + }else{ + final RayTraceResult ray = mc.objectMouseOver; + + if(ray != null) { + if(ray.entityHit != null && ray.entityHit instanceof EntityItemFrame) { + final EntityItemFrame itemFrame = (EntityItemFrame) ray.entityHit; + if(itemFrame.getDisplayedItem() != null && itemFrame.getDisplayedItem().getItem() instanceof ItemShulkerBox) { + stack = itemFrame.getDisplayedItem(); + }else{ + stack = getHeldShulker(mc.player); + } + }else{ + stack = getHeldShulker(mc.player); + } + }else{ + stack = getHeldShulker(mc.player); + } + } + + if(stack != null) { + final Item item = stack.getItem(); + + if (item instanceof ItemShulkerBox) { + if (Block.getBlockFromItem(item) instanceof BlockShulkerBox) { + final BlockShulkerBox shulkerBox = (BlockShulkerBox) Block.getBlockFromItem(item); + if (shulkerBox != null) { + final NBTTagCompound tag = stack.getTagCompound(); + if(tag != null && tag.hasKey("BlockEntityTag", 10)) { + final NBTTagCompound entityTag = tag.getCompoundTag("BlockEntityTag"); + + final TileEntityShulkerBox te = new TileEntityShulkerBox(); + te.setWorld(mc.world); + te.readFromNBT(entityTag); + mc.displayGuiScreen(new GuiShulkerBox(mc.player.inventory, te)); + }else{ + Seppuku.INSTANCE.errorChat("This shulker box is empty"); + } + } + } + + } else { + Seppuku.INSTANCE.errorChat("Please hold a shulker box"); + } + }else{ + Seppuku.INSTANCE.errorChat("Please hold a shulker box"); + } + }catch (Exception e) { + e.printStackTrace(); + } + Seppuku.INSTANCE.getEventManager().removeEventListener(this); + } + + private ItemStack getHeldShulker(EntityPlayer entity) { + if(entity.getHeldItemMainhand() != null && entity.getHeldItemMainhand().getItem() instanceof ItemShulkerBox) { + return entity.getHeldItemMainhand(); + } + if(entity.getHeldItemOffhand() != null && entity.getHeldItemOffhand().getItem() instanceof ItemShulkerBox) { + return entity.getHeldItemOffhand(); + } + return null; + } + +} diff --git a/src/main/java/me/rigamortis/seppuku/impl/command/PitchCommand.java b/src/main/java/me/rigamortis/seppuku/impl/command/PitchCommand.java new file mode 100644 index 0000000..c243dd1 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/impl/command/PitchCommand.java @@ -0,0 +1,40 @@ +package me.rigamortis.seppuku.impl.command; + +import me.rigamortis.seppuku.Seppuku; +import me.rigamortis.seppuku.api.command.Command; +import me.rigamortis.seppuku.api.util.StringUtil; +import net.minecraft.client.Minecraft; + +/** + * Author Seth + * 5/3/2019 @ 5:31 PM. + */ +public final class PitchCommand extends Command { + + public PitchCommand() { + super("Pitch", new String[] {"Pch"}, "Allows you to set your pitch", "Pitch "); + } + + @Override + public void exec(String input) { + if (!this.clamp(input, 2, 2)) { + this.printUsage(); + return; + } + + final String[] split = input.split(" "); + + if (StringUtil.isDouble(split[1])) { + final float num = Float.parseFloat(split[1]); + + Minecraft.getMinecraft().player.rotationPitch = num; + if(Minecraft.getMinecraft().player.getRidingEntity() != null) { + Minecraft.getMinecraft().player.getRidingEntity().rotationPitch = num; + } + + Seppuku.INSTANCE.logChat("Set yaw to " + num); + } else { + Seppuku.INSTANCE.errorChat("Unknown number " + "\247f\"" + split[1] + "\""); + } + } +} diff --git a/src/main/java/me/rigamortis/seppuku/impl/command/ReloadCommand.java b/src/main/java/me/rigamortis/seppuku/impl/command/ReloadCommand.java new file mode 100644 index 0000000..451facc --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/impl/command/ReloadCommand.java @@ -0,0 +1,26 @@ +package me.rigamortis.seppuku.impl.command; + +import me.rigamortis.seppuku.Seppuku; +import me.rigamortis.seppuku.api.command.Command; + +/** + * Author Seth + * 5/12/2019 @ 9:10 AM. + */ +public final class ReloadCommand extends Command { + + public ReloadCommand() { + super("Reload", new String[] {"Rload"}, "Reloads the client", "Reload"); + } + + @Override + public void exec(String input) { + if (!this.clamp(input, 1, 1)) { + this.printUsage(); + return; + } + + Seppuku.INSTANCE.reload(); + Seppuku.INSTANCE.logChat("Client Reloaded"); + } +} diff --git a/src/main/java/me/rigamortis/seppuku/impl/command/RenameCommand.java b/src/main/java/me/rigamortis/seppuku/impl/command/RenameCommand.java new file mode 100644 index 0000000..acfb748 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/impl/command/RenameCommand.java @@ -0,0 +1,66 @@ +package me.rigamortis.seppuku.impl.command; + +import me.rigamortis.seppuku.Seppuku; +import me.rigamortis.seppuku.api.command.Command; +import net.minecraft.client.Minecraft; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.play.client.CPacketCreativeInventoryAction; + +/** + * Author Seth + * 8/15/2019 @ 10:27 PM. + */ +public final class RenameCommand extends Command { + + public RenameCommand() { + super("Rename", new String[]{"Ren"}, "Allows you to rename your held item while in creative mode(Supports color codes)", "Rename "); + } + + @Override + public void exec(String input) { + if (!this.clamp(input, 2)) { + this.printUsage(); + return; + } + + final Minecraft mc = Minecraft.getMinecraft(); + + if (!mc.player.isCreative()) { + Seppuku.INSTANCE.errorChat("Creative mode is required to use this command."); + return; + } + + final ItemStack itemStack = mc.player.getHeldItemMainhand(); + + if (itemStack.isEmpty()) { + Seppuku.INSTANCE.errorChat("Please hold an item in your main hand to enchant."); + return; + } + + final String[] split = input.split(" "); + + final StringBuilder sb = new StringBuilder(); + + final int size = split.length; + + for (int i = 1; i < size; i++) { + final String arg = split[i]; + sb.append(arg + ((i == size - 1) ? "" : " ")); + } + + final String name = sb.toString().replace("&", "\247"); + + NBTTagCompound tagCompound = itemStack.getTagCompound(); + + if (tagCompound == null) { + tagCompound = new NBTTagCompound(); + itemStack.setTagCompound(tagCompound); + } + + itemStack.getOrCreateSubCompound("display").setString("Name", name); + + mc.getConnection().sendPacket(new CPacketCreativeInventoryAction(mc.player.inventory.currentItem, itemStack)); + Seppuku.INSTANCE.logChat("Renamed your item to " + name); + } +} diff --git a/src/main/java/me/rigamortis/seppuku/impl/command/SayCommand.java b/src/main/java/me/rigamortis/seppuku/impl/command/SayCommand.java new file mode 100644 index 0000000..b94ebc9 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/impl/command/SayCommand.java @@ -0,0 +1,28 @@ +package me.rigamortis.seppuku.impl.command; + +import me.rigamortis.seppuku.api.command.Command; +import net.minecraft.client.Minecraft; +import net.minecraft.network.play.client.CPacketChatMessage; + +/** + * Author Seth + * 5/23/2019 @ 8:14 AM. + */ +public final class SayCommand extends Command { + + public SayCommand() { + super("Say", new String[] {"S"}, "Allows you to send a direct chat message", "Say "); + } + + @Override + public void exec(String input) { + if (!this.clamp(input, 2)) { + this.printUsage(); + return; + } + + final String[] split = input.split(" "); + + Minecraft.getMinecraft().player.connection.sendPacket(new CPacketChatMessage(input.substring(split[0].length() + 1))); + } +} diff --git a/src/main/java/me/rigamortis/seppuku/impl/command/SeedCommand.java b/src/main/java/me/rigamortis/seppuku/impl/command/SeedCommand.java new file mode 100644 index 0000000..7f7bd88 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/impl/command/SeedCommand.java @@ -0,0 +1,50 @@ +package me.rigamortis.seppuku.impl.command; + +import me.rigamortis.seppuku.Seppuku; +import me.rigamortis.seppuku.api.command.Command; +import me.rigamortis.seppuku.api.util.StringUtil; +import me.rigamortis.seppuku.impl.management.WorldManager; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.ServerData; + +/** + * Author Seth + * 6/11/2019 @ 7:15 AM. + */ +public final class SeedCommand extends Command { + + public SeedCommand() { + super("Seed", new String[] {"RandomSeed"}, "Sets the client-side seed used by certain features", "Seed "); + } + + @Override + public void exec(String input) { + if (!this.clamp(input, 2, 2)) { + this.printUsage(); + return; + } + + final String[] split = input.split(" "); + + if(StringUtil.isLong(split[1], 10)) { + final ServerData serverData = Minecraft.getMinecraft().getCurrentServerData(); + if(serverData != null) { + final WorldManager.WorldData worldData = Seppuku.INSTANCE.getWorldManager().find(serverData.serverIP); + if(worldData != null) { + final long seed = Long.parseLong(split[1]); + worldData.setSeed(seed); + Seppuku.INSTANCE.logChat("Set " + serverData.serverIP + "'s seed to " + seed); + }else{ + final long seed = Long.parseLong(split[1]); + Seppuku.INSTANCE.getWorldManager().getWorldDataList().add(new WorldManager.WorldData(serverData.serverIP, seed)); + Seppuku.INSTANCE.logChat("Set " + serverData.serverIP + "'s seed to " + seed); + } + Seppuku.INSTANCE.getConfigManager().saveAll(); + }else{ + Seppuku.INSTANCE.errorChat("Cannot set seed for localhost"); + } + }else{ + Seppuku.INSTANCE.errorChat("Unknown number " + "\247f\"" + split[1] + "\""); + } + } +} diff --git a/src/main/java/me/rigamortis/seppuku/impl/command/SignBookCommand.java b/src/main/java/me/rigamortis/seppuku/impl/command/SignBookCommand.java new file mode 100644 index 0000000..e0d293a --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/impl/command/SignBookCommand.java @@ -0,0 +1,49 @@ +package me.rigamortis.seppuku.impl.command; + +import me.rigamortis.seppuku.Seppuku; +import me.rigamortis.seppuku.api.command.Command; +import net.minecraft.client.Minecraft; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemWrittenBook; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagString; +import net.minecraft.network.play.client.CPacketCreativeInventoryAction; + +/** + * Author Seth + * 8/18/2019 @ 9:51 PM. + */ +public final class SignBookCommand extends Command { + + public SignBookCommand() { + super("SignBook", new String[] {"SBook", "SignB"}, "Allows you to change the author of a signed book while in creative", "SignBook "); + } + + @Override + public void exec(String input) { + if (!this.clamp(input, 2, 2)) { + this.printUsage(); + return; + } + + final Minecraft mc = Minecraft.getMinecraft(); + + if (!mc.player.isCreative()) { + Seppuku.INSTANCE.errorChat("Creative mode is required to use this command."); + return; + } + + final ItemStack itemStack = mc.player.inventory.getCurrentItem(); + + final String[] split = input.split(" "); + + if(itemStack.getItem() instanceof ItemWrittenBook) { + final NBTTagCompound tagCompound = (itemStack.hasTagCompound()) ? itemStack.getTagCompound() : new NBTTagCompound(); + tagCompound.setTag("author", new NBTTagString(split[1])); + mc.player.connection.sendPacket(new CPacketCreativeInventoryAction(36 + mc.player.inventory.currentItem, itemStack)); + Seppuku.INSTANCE.logChat("Signed book with username " + split[1]); + }else{ + Seppuku.INSTANCE.errorChat("Please hold a signed book"); + } + } +} diff --git a/src/main/java/me/rigamortis/seppuku/impl/command/SkullCommand.java b/src/main/java/me/rigamortis/seppuku/impl/command/SkullCommand.java new file mode 100644 index 0000000..1a09a4e --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/impl/command/SkullCommand.java @@ -0,0 +1,58 @@ +package me.rigamortis.seppuku.impl.command; + +import me.rigamortis.seppuku.Seppuku; +import me.rigamortis.seppuku.api.command.Command; +import net.minecraft.client.Minecraft; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.play.client.CPacketCreativeInventoryAction; + +/** + * Author Seth + * 8/18/2019 @ 10:29 PM. + */ +public final class SkullCommand extends Command { + + public SkullCommand() { + super("Skull", new String[] {"Skll"}, "Allows you to give yourself any player head while in creative", "Skull "); + } + + @Override + public void exec(String input) { + if (!this.clamp(input, 2, 2)) { + this.printUsage(); + return; + } + + final Minecraft mc = Minecraft.getMinecraft(); + + if (!mc.player.isCreative()) { + Seppuku.INSTANCE.errorChat("Creative mode is required to use this command."); + return; + } + + final String[] split = input.split(" "); + + final ItemStack itemStack = new ItemStack(Items.SKULL); + itemStack.setItemDamage(3); + itemStack.setTagCompound(new NBTTagCompound()); + itemStack.getTagCompound().setString("SkullOwner", split[1]); + + final int slot = this.findEmptyhotbar(); + + mc.player.connection.sendPacket(new CPacketCreativeInventoryAction(36 + (slot != -1 ? slot : mc.player.inventory.currentItem), itemStack)); + Seppuku.INSTANCE.logChat("Gave you skull with username " + split[1]); + } + + private int findEmptyhotbar() { + for (int i = 0; i < 9; i++) { + final ItemStack stack = Minecraft.getMinecraft().player.inventory.getStackInSlot(i); + + if (stack.getItem() == Items.AIR) { + return i; + } + } + return -1; + } +} diff --git a/src/main/java/me/rigamortis/seppuku/impl/command/SpawnEggCommand.java b/src/main/java/me/rigamortis/seppuku/impl/command/SpawnEggCommand.java new file mode 100644 index 0000000..50fffa8 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/impl/command/SpawnEggCommand.java @@ -0,0 +1,143 @@ +package me.rigamortis.seppuku.impl.command; + +import me.rigamortis.seppuku.Seppuku; +import me.rigamortis.seppuku.api.command.Command; +import me.rigamortis.seppuku.api.util.StringUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.EntityList; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.play.client.CPacketCreativeInventoryAction; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.text.TextComponentString; + +import java.util.Iterator; + +/** + * Author Seth + * 8/16/2019 @ 3:30 AM. + */ +public final class SpawnEggCommand extends Command { + + private String[] listAlias = new String[]{"List", "L"}; + private String[] giveAlias = new String[]{"Give", "G"}; + + public SpawnEggCommand() { + super("SpawnEgg", new String[]{"SEgg"}, "Allows you to spawn in any spawn egg while in creative mode", "SpawnEgg Give \n" + + "SpawnEgg List"); + } + + @Override + public void exec(String input) { + if (!this.clamp(input, 2, 3)) { + this.printUsage(); + return; + } + + final String[] split = input.split(" "); + + final Minecraft mc = Minecraft.getMinecraft(); + + if (!mc.player.isCreative()) { + Seppuku.INSTANCE.errorChat("Creative mode is required to use this command."); + return; + } + + if (equals(listAlias, split[1])) { + if (!this.clamp(input, 2, 2)) { + this.printUsage(); + return; + } + + final int size = EntityList.getEntityNameList().size(); + + if (size > 0) { + final TextComponentString msg = new TextComponentString("\2477Entities [" + size + "]\247f "); + + final Iterator it = EntityList.getEntityNameList().iterator(); + + int index = 0; + + while (it.hasNext()) { + final ResourceLocation res = (ResourceLocation) it.next(); + if (res != null) { + msg.appendSibling(new TextComponentString("\247a" + res.getResourceDomain() + ":" + res.getResourcePath() + "\2477" + ((index == size - 1) ? "" : ", "))); + index++; + } + } + + Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(msg); + } + } else if (equals(giveAlias, split[1])) { + if (!this.clamp(input, 3, 3)) { + this.printUsage(); + return; + } + + final ResourceLocation res = this.find(split[2]); + + if (res == null) { + final ResourceLocation similar = this.findSimilar(split[2]); + if (similar != null) { + Seppuku.INSTANCE.errorChat("Unknown entity " + "\247f\"" + split[2] + "\""); + Seppuku.INSTANCE.logChat("Did you mean " + "\247c" + similar.getResourcePath() + "\247f?"); + } + } else { + final ItemStack itemStack = new ItemStack(Item.getItemById(383)); + final NBTTagCompound tagCompound = (itemStack.hasTagCompound()) ? itemStack.getTagCompound() : new NBTTagCompound(); + final NBTTagCompound entityTag = new NBTTagCompound(); + + entityTag.setString("id", res.getResourceDomain() + ":" + res.getResourcePath()); + tagCompound.setTag("EntityTag", entityTag); + itemStack.setTagCompound(tagCompound); + + final int slot = this.findEmptyhotbar(); + + mc.player.connection.sendPacket(new CPacketCreativeInventoryAction(36 + (slot != -1 ? slot : mc.player.inventory.currentItem), itemStack)); + Seppuku.INSTANCE.logChat("Gave you a spawn egg with entity type: " + res.getResourceDomain() + ":" + res.getResourcePath()); + } + } else { + Seppuku.INSTANCE.errorChat("Unknown input " + "\247f\"" + input + "\""); + this.printUsage(); + } + } + + private ResourceLocation findSimilar(String name) { + ResourceLocation ret = null; + double similarity = 0.0f; + + for (ResourceLocation res : EntityList.getEntityNameList()) { + final double currentSimilarity = StringUtil.levenshteinDistance(name, res.getResourcePath()); + + if (currentSimilarity >= similarity) { + similarity = currentSimilarity; + ret = res; + } + } + + return ret; + } + + private ResourceLocation find(String name) { + for (ResourceLocation res : EntityList.getEntityNameList()) { + if (res.getResourcePath().equalsIgnoreCase(name)) { + return res; + } + } + return null; + } + + private int findEmptyhotbar() { + for (int i = 0; i < 9; i++) { + final ItemStack stack = Minecraft.getMinecraft().player.inventory.getStackInSlot(i); + + if (stack.getItem() == Items.AIR) { + return i; + } + } + return -1; + } + +} diff --git a/src/main/java/me/rigamortis/seppuku/impl/command/SpectateCommand.java b/src/main/java/me/rigamortis/seppuku/impl/command/SpectateCommand.java new file mode 100644 index 0000000..de749b1 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/impl/command/SpectateCommand.java @@ -0,0 +1,47 @@ +package me.rigamortis.seppuku.impl.command; + +import me.rigamortis.seppuku.Seppuku; +import me.rigamortis.seppuku.api.command.Command; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; + +/** + * Author Seth + * 4/21/2019 @ 2:18 PM. + */ +public final class SpectateCommand extends Command { + + public SpectateCommand() { + super("Spectate", new String[]{"Spec"}, "Allows you to spectate nearby players", "Spectate "); + } + + @Override + public void exec(String input) { + if (!this.clamp(input, 2, 2)) { + this.printUsage(); + return; + } + + final String[] split = input.split(" "); + + EntityPlayer target = null; + + for (Entity e : Minecraft.getMinecraft().world.loadedEntityList) { + if (e != null) { + if (e instanceof EntityPlayer && e.getName().equalsIgnoreCase(split[1])) { + target = (EntityPlayer) e; + break; + } + } + } + + if (target != null) { + Seppuku.INSTANCE.logChat("Now spectating " + target.getName()); + Minecraft.getMinecraft().setRenderViewEntity(target); + }else{ + Seppuku.INSTANCE.errorChat("\"" + split[1] + "\" is not within range"); + } + } + +} diff --git a/src/main/java/me/rigamortis/seppuku/impl/command/StackSizeCommand.java b/src/main/java/me/rigamortis/seppuku/impl/command/StackSizeCommand.java new file mode 100644 index 0000000..8a82e4e --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/impl/command/StackSizeCommand.java @@ -0,0 +1,51 @@ +package me.rigamortis.seppuku.impl.command; + +import me.rigamortis.seppuku.Seppuku; +import me.rigamortis.seppuku.api.command.Command; +import me.rigamortis.seppuku.api.util.StringUtil; +import net.minecraft.client.Minecraft; +import net.minecraft.item.ItemStack; + +/** + * Author Seth + * 8/16/2019 @ 4:27 AM. + */ +public final class StackSizeCommand extends Command { + + public StackSizeCommand() { + super("StackSize", new String[]{"SS"}, "Allows you to change your held item stack size while in creative mode", "StackSize "); + } + + @Override + public void exec(String input) { + if (!this.clamp(input, 2, 2)) { + this.printUsage(); + return; + } + + final Minecraft mc = Minecraft.getMinecraft(); + + if (!mc.player.isCreative()) { + Seppuku.INSTANCE.errorChat("Creative mode is required to use this command."); + return; + } + + final ItemStack itemStack = mc.player.getHeldItemMainhand(); + + if (itemStack.isEmpty()) { + Seppuku.INSTANCE.errorChat("Please hold an item in your main hand to enchant."); + return; + } + + final String[] split = input.split(" "); + + if (StringUtil.isInt(split[1])) { + final int num = Integer.parseInt(split[1]); + itemStack.setCount(num); + itemStack.getItem().updateItemStackNBT(itemStack.getTagCompound()); + Seppuku.INSTANCE.logChat("Set your stack size to " + num); + } else { + Seppuku.INSTANCE.errorChat("Unknown number " + "\247f\"" + split[1] + "\""); + } + } +} diff --git a/src/main/java/me/rigamortis/seppuku/impl/command/TeleportCommand.java b/src/main/java/me/rigamortis/seppuku/impl/command/TeleportCommand.java new file mode 100644 index 0000000..ce9b8cc --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/impl/command/TeleportCommand.java @@ -0,0 +1,52 @@ +package me.rigamortis.seppuku.impl.command; + +import me.rigamortis.seppuku.Seppuku; +import me.rigamortis.seppuku.api.command.Command; +import me.rigamortis.seppuku.api.util.StringUtil; +import net.minecraft.client.Minecraft; + +import java.text.DecimalFormat; + +/** + * Author Seth + * 6/18/2019 @ 9:24 AM. + */ +public final class TeleportCommand extends Command { + + public TeleportCommand() { + super("Teleport", new String[] {"Tp"}, "Allows you to teleport to coordinates", "Teleport "); + } + + @Override + public void exec(String input) { + if (!this.clamp(input, 4, 4)) { + this.printUsage(); + return; + } + + final String[] split = input.split(" "); + + if (StringUtil.isDouble(split[1])) { + if (StringUtil.isDouble(split[2])) { + if (StringUtil.isDouble(split[3])) { + final double x = Double.parseDouble(split[1]); + final double y = Double.parseDouble(split[2]); + final double z = Double.parseDouble(split[3]); + if (Minecraft.getMinecraft().player.getRidingEntity() != null) { + Minecraft.getMinecraft().player.getRidingEntity().setPosition(x, y, z); + } else { + Minecraft.getMinecraft().player.setPosition(x, y, z); + } + final DecimalFormat format = new DecimalFormat("##.##"); + Seppuku.INSTANCE.logChat("Teleported you to X: " + format.format(x) + " Y: " + format.format(y) + " Z: " + format.format(z)); + }else{ + Seppuku.INSTANCE.errorChat("Unknown number " + "\247f\"" + split[3] + "\""); + } + }else{ + Seppuku.INSTANCE.errorChat("Unknown number " + "\247f\"" + split[2] + "\""); + } + }else{ + Seppuku.INSTANCE.errorChat("Unknown number " + "\247f\"" + split[1] + "\""); + } + } +} diff --git a/src/main/java/me/rigamortis/seppuku/impl/command/ToggleCommand.java b/src/main/java/me/rigamortis/seppuku/impl/command/ToggleCommand.java new file mode 100644 index 0000000..dadc491 --- /dev/null +++ b/src/main/java/me/rigamortis/seppuku/impl/command/ToggleCommand.java @@ -0,0 +1,87 @@ +package me.rigamortis.seppuku.impl.command; + +import me.rigamortis.seppuku.Seppuku; +import me.rigamortis.seppuku.api.command.Command; +import me.rigamortis.seppuku.api.module.Module; +import me.rigamortis.seppuku.api.value.OptionalValue; + +/** + * Author Seth + * 4/16/2019 @ 9:01 PM. + */ +public final class ToggleCommand extends Command { + + public ToggleCommand() { + super("Toggle", new String[] {"T", "Tog"}, "Allows you to toggle modules or between two mode options", "Toggle \nToggle