diff --git a/README.md b/README.md index c11131357..24d06f898 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ [![Purpur Forks](https://img.shields.io/github/forks/pl3xgaming/Purpur?label=forks&logo=github)](https://github.com/pl3xgaming/Purpur/network/members) [![Purpur Watchers](https://img.shields.io/github/watchers/pl3xgaming/Purpur?label=watchers&logo=github)](https://github.com/pl3xgaming/Purpur/watchers) -Purpur is a fork of Paper and Tuinity with the goal of providing new and interesting configuration options, which allow for creating a unique gameplay experience not seen anywhere else +Purpur is a fork of [Paper](https://github.com/PaperMC/Paper), [Tuinity](https://github.com/Spottedleaf/Tuinity), [Airplane](https://github.com/TECHNOVE/Airplane) with the goal of providing new and interesting configuration options, which allow for creating a unique gameplay experience not seen anywhere else @@ -50,7 +50,7 @@ Downloads API endpoints: All patches are licensed under the MIT license, unless otherwise noted in the patch headers. -See [PaperMC/Paper](https://github.com/PaperMC/Paper), [Spottedleaf/Tuinity](https://github.com/Spottedleaf/Tuinity), and [jpenilla/Toothpick](https://github.com/jpenilla/Toothpick) for the license of material used by this project. +See [PaperMC/Paper](https://github.com/PaperMC/Paper), [Spottedleaf/Tuinity](https://github.com/Spottedleaf/Tuinity), [TECHNOVE/Airplane](https://github.com/TECHNOVE/Airplane), and [jpenilla/Toothpick](https://github.com/jpenilla/Toothpick) for the license of material used by this project. ## bStats diff --git a/patches/api/0002-Airplane-API-Changes.patch b/patches/api/0002-Airplane-API-Changes.patch new file mode 100644 index 000000000..d91ba77c5 --- /dev/null +++ b/patches/api/0002-Airplane-API-Changes.patch @@ -0,0 +1,639 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Paul Sauve +Date: Sat, 19 Dec 2020 19:06:37 -0600 +Subject: [PATCH] Airplane API Changes + + 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 + +diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java +index 7760be3e34fa20825faf145d9fb5b2855c1a4602..79d839034d38c941745c6b91f973f908d6cdb8ee 100644 +--- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java ++++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java +@@ -111,6 +111,7 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot + return findClass(name, true); + } + ++ public Class _airplane_findClass(@NotNull String name) throws ClassNotFoundException { return this.classes.get(name); } // Airplane + Class findClass(@NotNull String name, boolean checkGlobal) throws ClassNotFoundException { + if (name.startsWith("org.bukkit.") || name.startsWith("net.minecraft.")) { + throw new ClassNotFoundException(name); diff --git a/patches/api/0002-Purpur-config-files.patch b/patches/api/0003-Purpur-config-files.patch similarity index 100% rename from patches/api/0002-Purpur-config-files.patch rename to patches/api/0003-Purpur-config-files.patch diff --git a/patches/api/0003-Default-permissions.patch b/patches/api/0004-Default-permissions.patch similarity index 100% rename from patches/api/0003-Default-permissions.patch rename to patches/api/0004-Default-permissions.patch diff --git a/patches/api/0004-Allow-inventory-resizing.patch b/patches/api/0005-Allow-inventory-resizing.patch similarity index 100% rename from patches/api/0004-Allow-inventory-resizing.patch rename to patches/api/0005-Allow-inventory-resizing.patch diff --git a/patches/api/0005-Advancement-API.patch b/patches/api/0006-Advancement-API.patch similarity index 100% rename from patches/api/0005-Advancement-API.patch rename to patches/api/0006-Advancement-API.patch diff --git a/patches/api/0006-Llama-API.patch b/patches/api/0007-Llama-API.patch similarity index 100% rename from patches/api/0006-Llama-API.patch rename to patches/api/0007-Llama-API.patch diff --git a/patches/api/0007-AFK-API.patch b/patches/api/0008-AFK-API.patch similarity index 100% rename from patches/api/0007-AFK-API.patch rename to patches/api/0008-AFK-API.patch diff --git a/patches/api/0008-Bring-back-server-name.patch b/patches/api/0009-Bring-back-server-name.patch similarity index 100% rename from patches/api/0008-Bring-back-server-name.patch rename to patches/api/0009-Bring-back-server-name.patch diff --git a/patches/api/0009-ExecuteCommandEvent.patch b/patches/api/0010-ExecuteCommandEvent.patch similarity index 100% rename from patches/api/0009-ExecuteCommandEvent.patch rename to patches/api/0010-ExecuteCommandEvent.patch diff --git a/patches/api/0010-LivingEntity-safeFallDistance.patch b/patches/api/0011-LivingEntity-safeFallDistance.patch similarity index 100% rename from patches/api/0010-LivingEntity-safeFallDistance.patch rename to patches/api/0011-LivingEntity-safeFallDistance.patch diff --git a/patches/api/0011-Lagging-threshold.patch b/patches/api/0012-Lagging-threshold.patch similarity index 100% rename from patches/api/0011-Lagging-threshold.patch rename to patches/api/0012-Lagging-threshold.patch diff --git a/patches/api/0012-ItemFactory-getMonsterEgg.patch b/patches/api/0013-ItemFactory-getMonsterEgg.patch similarity index 100% rename from patches/api/0012-ItemFactory-getMonsterEgg.patch rename to patches/api/0013-ItemFactory-getMonsterEgg.patch diff --git a/patches/api/0013-PlayerSetSpawnerTypeWithEggEvent.patch b/patches/api/0014-PlayerSetSpawnerTypeWithEggEvent.patch similarity index 100% rename from patches/api/0013-PlayerSetSpawnerTypeWithEggEvent.patch rename to patches/api/0014-PlayerSetSpawnerTypeWithEggEvent.patch diff --git a/patches/api/0014-EMC-MonsterEggSpawnEvent.patch b/patches/api/0015-EMC-MonsterEggSpawnEvent.patch similarity index 100% rename from patches/api/0014-EMC-MonsterEggSpawnEvent.patch rename to patches/api/0015-EMC-MonsterEggSpawnEvent.patch diff --git a/patches/api/0015-Villager-resetOffers.patch b/patches/api/0016-Villager-resetOffers.patch similarity index 100% rename from patches/api/0015-Villager-resetOffers.patch rename to patches/api/0016-Villager-resetOffers.patch diff --git a/patches/api/0016-Player-invulnerabilities.patch b/patches/api/0017-Player-invulnerabilities.patch similarity index 100% rename from patches/api/0016-Player-invulnerabilities.patch rename to patches/api/0017-Player-invulnerabilities.patch diff --git a/patches/api/0017-Anvil-API.patch b/patches/api/0018-Anvil-API.patch similarity index 100% rename from patches/api/0017-Anvil-API.patch rename to patches/api/0018-Anvil-API.patch diff --git a/patches/api/0018-ItemStack-convenience-methods.patch b/patches/api/0019-ItemStack-convenience-methods.patch similarity index 100% rename from patches/api/0018-ItemStack-convenience-methods.patch rename to patches/api/0019-ItemStack-convenience-methods.patch diff --git a/patches/api/0019-Phantoms-attracted-to-crystals-and-crystals-shoot-ph.patch b/patches/api/0020-Phantoms-attracted-to-crystals-and-crystals-shoot-ph.patch similarity index 100% rename from patches/api/0019-Phantoms-attracted-to-crystals-and-crystals-shoot-ph.patch rename to patches/api/0020-Phantoms-attracted-to-crystals-and-crystals-shoot-ph.patch diff --git a/patches/api/0020-ChatColor-conveniences.patch b/patches/api/0021-ChatColor-conveniences.patch similarity index 100% rename from patches/api/0020-ChatColor-conveniences.patch rename to patches/api/0021-ChatColor-conveniences.patch diff --git a/patches/api/0021-Ridables.patch b/patches/api/0022-Ridables.patch similarity index 100% rename from patches/api/0021-Ridables.patch rename to patches/api/0022-Ridables.patch diff --git a/patches/api/0022-Configurable-permission-message-upgrades.patch b/patches/api/0023-Configurable-permission-message-upgrades.patch similarity index 100% rename from patches/api/0022-Configurable-permission-message-upgrades.patch rename to patches/api/0023-Configurable-permission-message-upgrades.patch diff --git a/patches/api/0023-LivingEntity-broadcastItemBreak.patch b/patches/api/0024-LivingEntity-broadcastItemBreak.patch similarity index 100% rename from patches/api/0023-LivingEntity-broadcastItemBreak.patch rename to patches/api/0024-LivingEntity-broadcastItemBreak.patch diff --git a/patches/api/0024-Item-entity-immunities.patch b/patches/api/0025-Item-entity-immunities.patch similarity index 100% rename from patches/api/0024-Item-entity-immunities.patch rename to patches/api/0025-Item-entity-immunities.patch diff --git a/patches/api/0025-Spigot-Improve-output-of-plugins-command.patch b/patches/api/0026-Spigot-Improve-output-of-plugins-command.patch similarity index 100% rename from patches/api/0025-Spigot-Improve-output-of-plugins-command.patch rename to patches/api/0026-Spigot-Improve-output-of-plugins-command.patch diff --git a/patches/api/0026-Add-option-to-disable-zombie-aggressiveness-towards-.patch b/patches/api/0027-Add-option-to-disable-zombie-aggressiveness-towards-.patch similarity index 100% rename from patches/api/0026-Add-option-to-disable-zombie-aggressiveness-towards-.patch rename to patches/api/0027-Add-option-to-disable-zombie-aggressiveness-towards-.patch diff --git a/patches/api/0027-Add-predicate-to-recipe-s-ExactChoice-ingredient.patch b/patches/api/0028-Add-predicate-to-recipe-s-ExactChoice-ingredient.patch similarity index 100% rename from patches/api/0027-Add-predicate-to-recipe-s-ExactChoice-ingredient.patch rename to patches/api/0028-Add-predicate-to-recipe-s-ExactChoice-ingredient.patch diff --git a/patches/api/0028-Add-critical-hit-check-to-EntityDamagedByEntityEvent.patch b/patches/api/0029-Add-critical-hit-check-to-EntityDamagedByEntityEvent.patch similarity index 100% rename from patches/api/0028-Add-critical-hit-check-to-EntityDamagedByEntityEvent.patch rename to patches/api/0029-Add-critical-hit-check-to-EntityDamagedByEntityEvent.patch diff --git a/patches/api/0029-Left-handed-API.patch b/patches/api/0030-Left-handed-API.patch similarity index 100% rename from patches/api/0029-Left-handed-API.patch rename to patches/api/0030-Left-handed-API.patch diff --git a/patches/api/0030-Alphabetize-in-game-plugins-list.patch b/patches/api/0031-Alphabetize-in-game-plugins-list.patch similarity index 100% rename from patches/api/0030-Alphabetize-in-game-plugins-list.patch rename to patches/api/0031-Alphabetize-in-game-plugins-list.patch diff --git a/patches/api/0031-Rabid-Wolf-API.patch b/patches/api/0032-Rabid-Wolf-API.patch similarity index 100% rename from patches/api/0031-Rabid-Wolf-API.patch rename to patches/api/0032-Rabid-Wolf-API.patch diff --git a/patches/api/0032-Fix-javadoc-warnings-missing-param-and-return.patch b/patches/api/0033-Fix-javadoc-warnings-missing-param-and-return.patch similarity index 100% rename from patches/api/0032-Fix-javadoc-warnings-missing-param-and-return.patch rename to patches/api/0033-Fix-javadoc-warnings-missing-param-and-return.patch diff --git a/patches/api/0033-PlayerBookTooLargeEvent.patch b/patches/api/0034-PlayerBookTooLargeEvent.patch similarity index 100% rename from patches/api/0033-PlayerBookTooLargeEvent.patch rename to patches/api/0034-PlayerBookTooLargeEvent.patch diff --git a/patches/api/0034-Full-netherite-armor-grants-fire-resistance.patch b/patches/api/0035-Full-netherite-armor-grants-fire-resistance.patch similarity index 100% rename from patches/api/0034-Full-netherite-armor-grants-fire-resistance.patch rename to patches/api/0035-Full-netherite-armor-grants-fire-resistance.patch diff --git a/patches/api/0035-Add-EntityTeleportHinderedEvent.patch b/patches/api/0036-Add-EntityTeleportHinderedEvent.patch similarity index 100% rename from patches/api/0035-Add-EntityTeleportHinderedEvent.patch rename to patches/api/0036-Add-EntityTeleportHinderedEvent.patch diff --git a/patches/api/0036-Add-StructureGenerateEvent.patch b/patches/api/0037-Add-StructureGenerateEvent.patch similarity index 100% rename from patches/api/0036-Add-StructureGenerateEvent.patch rename to patches/api/0037-Add-StructureGenerateEvent.patch diff --git a/patches/api/0037-Add-unsafe-Entity-serialization-API.patch b/patches/api/0038-Add-unsafe-Entity-serialization-API.patch similarity index 100% rename from patches/api/0037-Add-unsafe-Entity-serialization-API.patch rename to patches/api/0038-Add-unsafe-Entity-serialization-API.patch diff --git a/patches/server/0002-Airplane-Server-Changes.patch b/patches/server/0002-Airplane-Server-Changes.patch new file mode 100644 index 000000000..922c140ea --- /dev/null +++ b/patches/server/0002-Airplane-Server-Changes.patch @@ -0,0 +1,3106 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Paul Sauve +Date: Sat, 31 Oct 2020 19:21:42 -0500 +Subject: [PATCH] Airplane Server Changes + + 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 + +diff --git a/pom.xml b/pom.xml +index e83e4241a56fe131a75fe21cc1518992c089da2c..fa4ff553ae58285201d773a538eeda2b40c89c4a 100644 +--- a/pom.xml ++++ b/pom.xml +@@ -27,8 +27,8 @@ + + + +- com.tuinity +- tuinity-api ++ gg.airplane ++ airplane-api + ${project.version} + compile + +@@ -159,6 +159,13 @@ + 1.1.0-SNAPSHOT + compile + ++ ++ ++ com.github.technove ++ Flare ++ master-SNAPSHOT ++ compile ++ + + + +@@ -172,6 +179,11 @@ + spigotmc-public + https://hub.spigotmc.org/nexus/content/groups/public/ + ++ ++ ++ jitpack.io ++ https://jitpack.io ++ + + + +diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java +index 52c0ab1ce46e1f3233ef746d9bc699356fa9fae4..b480bd3044370b8eb733166f0c4b737344475993 100644 +--- a/src/main/java/com/destroystokyo/paper/Metrics.java ++++ b/src/main/java/com/destroystokyo/paper/Metrics.java +@@ -593,7 +593,7 @@ public class Metrics { + boolean logFailedRequests = config.getBoolean("logFailedRequests", false); + // Only start Metrics, if it's enabled in the config + if (config.getBoolean("enabled", true)) { +- Metrics metrics = new Metrics("Tuinity", serverUUID, logFailedRequests, Bukkit.getLogger()); // Tuinity - we have our own bstats page ++ Metrics metrics = new Metrics("Airplane", serverUUID, logFailedRequests, Bukkit.getLogger()); // Tuinity - we have our own bstats page // Airplane + + metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> { + String minecraftVersion = Bukkit.getVersion(); +@@ -603,7 +603,7 @@ public class Metrics { + + metrics.addCustomChart(new Metrics.SingleLineChart("players", () -> Bukkit.getOnlinePlayers().size())); + metrics.addCustomChart(new Metrics.SimplePie("online_mode", () -> Bukkit.getOnlineMode() || PaperConfig.isProxyOnlineMode() ? "online" : "offline")); +- metrics.addCustomChart(new Metrics.SimplePie("tuinity_version", () -> (Metrics.class.getPackage().getImplementationVersion() != null) ? Metrics.class.getPackage().getImplementationVersion() : "unknown")); // Tuinity - we have our own bstats page ++ metrics.addCustomChart(new Metrics.SimplePie("airplane_version", () -> (Metrics.class.getPackage().getImplementationVersion() != null) ? Metrics.class.getPackage().getImplementationVersion() : "unknown")); // Tuinity - we have our own bstats page // Airplane + + metrics.addCustomChart(new Metrics.DrilldownPie("java_version", () -> { + Map> map = new HashMap<>(); +diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java +index c56e7fb18f9a56c8025eb70a524f028b5942da37..f39452535b2807a226ada095f5c21b19ea238e5c 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java ++++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java +@@ -202,6 +202,15 @@ public class PaperConfig { + public static String timingsServerName; + private static void timings() { + boolean timings = getBoolean("timings.enabled", true); ++ // Airplane start ++ boolean reallyEnableTimings = getBoolean("timings.really-enabled", false); ++ if (timings && !reallyEnableTimings) { ++ Bukkit.getLogger().log(Level.WARNING, "[Airplane] To improve performance, timings have been disabled by default"); ++ Bukkit.getLogger().log(Level.WARNING, "[Airplane] You can still use timings by using /timings on, but they will not start on server startup unless you set timings.really-enabled to true in paper.yml"); ++ Bukkit.getLogger().log(Level.WARNING, "[Airplane] If you would like to disable this message, either set timings.really-enabled to true or timings.enabled to false."); ++ } ++ timings = reallyEnableTimings; ++ // Airplane end + boolean verboseTimings = getBoolean("timings.verbose", true); + TimingsManager.privacy = getBoolean("timings.server-name-privacy", false); + TimingsManager.hiddenConfigs = getList("timings.hidden-config-entries", Lists.newArrayList("database", "settings.bungeecord-addresses", "settings.velocity-support.secret")); +diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java +index 7063f1da3654b382e26b0093ad5d0ff04a2b38c2..dd2a1b1c72426c4172cfbd20f0c84ffd073df484 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java ++++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java +@@ -28,8 +28,8 @@ public class PaperVersionFetcher implements VersionFetcher { + @Nonnull + @Override + public Component getVersionMessage(@Nonnull String serverVersion) { +- String[] parts = serverVersion.substring("git-Tuinity-".length()).split("[-\\s]"); // Tuinity +- final Component updateMessage = getUpdateStatusMessage("Spottedleaf/Tuinity", GITHUB_BRANCH_NAME, parts[0]); // Tuinity ++ String[] parts = serverVersion.substring("git-Airplane-".length()).split("[-\\s]"); // Airplane // Tuinity ++ final Component updateMessage = getUpdateStatusMessage("TECHNOVE/Airplane", GITHUB_BRANCH_NAME, parts[0]); // Airplane // Tuinity + final Component history = getHistory(); + + return history != null ? TextComponent.ofChildren(updateMessage, Component.newline(), history) : updateMessage; +diff --git a/src/main/java/com/tuinity/tuinity/util/maplist/IteratorSafeOrderedReferenceSet.java b/src/main/java/com/tuinity/tuinity/util/maplist/IteratorSafeOrderedReferenceSet.java +index be408aebbccbda46e8aa82ef337574137cfa0096..b9bdce7c7ca8b7b107b0dca165d722321c16229d 100644 +--- a/src/main/java/com/tuinity/tuinity/util/maplist/IteratorSafeOrderedReferenceSet.java ++++ b/src/main/java/com/tuinity/tuinity/util/maplist/IteratorSafeOrderedReferenceSet.java +@@ -16,7 +16,7 @@ public final class IteratorSafeOrderedReferenceSet { + + /* list impl */ + protected E[] listElements; +- protected int listSize; ++ protected int listSize; public int getListSize() { return this.listSize; } // Airplane - getter + + protected final double maxFragFactor; + +diff --git a/src/main/java/gg/airplane/AirplaneCommand.java b/src/main/java/gg/airplane/AirplaneCommand.java +new file mode 100644 +index 0000000000000000000000000000000000000000..1fa9b40e2f89272fa8bc9d927a9a852b5eb0db22 +--- /dev/null ++++ b/src/main/java/gg/airplane/AirplaneCommand.java +@@ -0,0 +1,56 @@ ++package gg.airplane; ++ ++import net.md_5.bungee.api.ChatColor; ++import net.minecraft.server.MinecraftServer; ++import org.bukkit.Bukkit; ++import org.bukkit.Location; ++import org.bukkit.command.Command; ++import org.bukkit.command.CommandSender; ++ ++import java.util.Collections; ++import java.util.List; ++import java.util.stream.Collectors; ++import java.util.stream.Stream; ++ ++public class AirplaneCommand extends Command { ++ ++ public AirplaneCommand() { ++ super("airplane"); ++ this.description = "Airplane related commands"; ++ this.usageMessage = "/airplane [reload | version]"; ++ this.setPermission("bukkit.command.airplane"); ++ } ++ ++ @Override ++ public List tabComplete(CommandSender sender, String alias, String[] args, Location location) throws IllegalArgumentException { ++ if (args.length == 1) { ++ return Stream.of("reload", "version") ++ .filter(arg -> arg.startsWith(args[0].toLowerCase())) ++ .collect(Collectors.toList()); ++ } ++ return Collections.emptyList(); ++ } ++ ++ @Override ++ public boolean execute(CommandSender sender, String commandLabel, String[] args) { ++ if (!testPermission(sender)) return true; ++ String prefix = ChatColor.of("#6a7eda") + "" + ChatColor.BOLD + "Airplane ✈ " + ChatColor.of("#e8ebf9"); ++ ++ if (args.length != 1) { ++ sender.sendMessage(prefix + "Usage: " + usageMessage); ++ args = new String[]{"version"}; ++ } ++ ++ if (args[0].equalsIgnoreCase("reload")) { ++ MinecraftServer console = MinecraftServer.getServer(); ++ AirplaneConfig.load(); ++ console.server.reloadCount++; ++ ++ Command.broadcastCommandMessage(sender, prefix + "Airplane configuration has been reloaded."); ++ } else if (args[0].equalsIgnoreCase("version")) { ++ Command.broadcastCommandMessage(sender, prefix + "This server is running " + Bukkit.getName() + " version " + Bukkit.getVersion() + " (Implementing API version " + Bukkit.getBukkitVersion() + ")"); ++ } ++ ++ return true; ++ } ++} +diff --git a/src/main/java/gg/airplane/AirplaneConfig.java b/src/main/java/gg/airplane/AirplaneConfig.java +new file mode 100644 +index 0000000000000000000000000000000000000000..e183b6cae23935823fa9e0f767e499a8102b0ad1 +--- /dev/null ++++ b/src/main/java/gg/airplane/AirplaneConfig.java +@@ -0,0 +1,104 @@ ++package gg.airplane; ++ ++import gg.airplane.manual.ManualParser; ++import net.minecraft.server.MinecraftServer; ++import org.apache.logging.log4j.Level; ++ ++import java.io.File; ++import java.io.IOException; ++import java.lang.reflect.Method; ++import java.lang.reflect.Modifier; ++ ++public class AirplaneConfig { ++ ++ private static ManualParser manual; ++ ++ public static void load() { ++ try { ++ manual = new ManualParser(new File("airplane.air")); ++ } catch (IOException e) { ++ e.printStackTrace(); ++ } ++ ++ manual.get("info.version", "1.0"); ++ manual.setComment("info", ++ " Airplane Configuration", ++ " Please see https://airplane.gg/config for help."); ++ ++ for (Method method : AirplaneConfig.class.getDeclaredMethods()) { ++ if (Modifier.isStatic(method.getModifiers()) && Modifier.isPrivate(method.getModifiers())) { ++ method.setAccessible(true); ++ try { ++ method.invoke(null); ++ } catch (Throwable t) { ++ MinecraftServer.LOGGER.log(Level.WARN, "Failed to load configuration option from " + method.getName(), t); ++ } ++ } ++ } ++ ++ try { ++ manual.save(); ++ } catch (IOException e) { ++ e.printStackTrace(); ++ } ++ } ++ ++ ++ public static int maximumActivationPrio = 20; ++ public static int activationDistanceMod = 9; ++ public static boolean dynamicVillagerBehavior = true; ++ public static boolean dynamicPiglinBehavior = true; ++ public static boolean dynamicHoglinBehavior = true; ++ ++ private static void dynamicActivationRange() { ++ manual.setComment("activation-range", "Optimizes how entities act when", "they're far away from the player"); ++ ++ maximumActivationPrio = manual.get("activation-range.max-tick-freq", maximumActivationPrio, ++ "This value defines how often in ticks, the furthest entity", ++ "will get their pathfinders and behaviors ticked. 20 = 1s"); ++ activationDistanceMod = manual.get("activation-range.activation-dist-mod", activationDistanceMod, ++ "This value defines how much distance modifies an entity's", ++ "tick frequency. freq = (distanceToPlayer^2) / (2^value)", ++ "If you want further away entities to tick less often, use 8.", ++ "If you want further away entities to tick more often, try 10."); ++ ++ manual.setComment("behavior-activation", "A list of entities to use the dynamic activation range", "to modify how often their behaviors are ticked"); ++ dynamicVillagerBehavior = manual.get("behavior-activation.villager", dynamicVillagerBehavior); ++ dynamicPiglinBehavior = manual.get("behavior-activation.piglin", dynamicPiglinBehavior); ++ dynamicHoglinBehavior = manual.get("behavior-activation.hoglin", dynamicHoglinBehavior); ++ } ++ ++ ++ public static String profileWebUrl = "https://flare.airplane.gg"; ++ ++ private static void profilerOptions() { ++ manual.setComment("flare", "Configures Flare, the built-in profiler"); ++ ++ profileWebUrl = manual.get("flare.url", profileWebUrl, "Sets the server to use for profiles."); ++ } ++ ++ ++ public static String accessToken = ""; ++ ++ private static void airplaneWebServices() { ++ manual.setComment("web-services", "Options for connecting to Airplane's online utilities"); ++ ++ accessToken = manual.get("web-services.token", ""); ++ // todo lookup token (off-thread) and let users know if their token is valid ++ } ++ ++ ++ public static boolean multithreadedEntityTracker = true; ++ public static boolean entityTrackerAsyncPackets = false; ++ ++ private static void entityTracker() { ++ manual.setComment("tracker", "Options to improve the performance of the entity tracker"); ++ ++ multithreadedEntityTracker = manual.get("tracker.multithreaded", multithreadedEntityTracker, ++ "This enables the multithreading of the tracker."); ++ entityTrackerAsyncPackets = manual.get("tracker.unsafe-async-packets", entityTrackerAsyncPackets, ++ "This option can break plugins that assume packets from the", ++ "entity tracker will be sent sync."); ++ } ++ ++} +diff --git a/src/main/java/gg/airplane/AirplaneLogger.java b/src/main/java/gg/airplane/AirplaneLogger.java +new file mode 100644 +index 0000000000000000000000000000000000000000..1a9d71739019d12772bec6076b195552ff6299f9 +--- /dev/null ++++ b/src/main/java/gg/airplane/AirplaneLogger.java +@@ -0,0 +1,17 @@ ++package gg.airplane; ++ ++import org.bukkit.Bukkit; ++ ++import java.util.logging.Level; ++import java.util.logging.Logger; ++ ++public class AirplaneLogger extends Logger { ++ public static final AirplaneLogger LOGGER = new AirplaneLogger(); ++ ++ private AirplaneLogger() { ++ super("Airplane", null); ++ ++ setParent(Bukkit.getLogger()); ++ setLevel(Level.ALL); ++ } ++} +diff --git a/src/main/java/gg/airplane/commands/AirplaneCommands.java b/src/main/java/gg/airplane/commands/AirplaneCommands.java +new file mode 100644 +index 0000000000000000000000000000000000000000..66b20250a26d005427601b1cdee43bdd9eba70cc +--- /dev/null ++++ b/src/main/java/gg/airplane/commands/AirplaneCommands.java +@@ -0,0 +1,12 @@ ++package gg.airplane.commands; ++ ++import gg.airplane.AirplaneCommand; ++import gg.airplane.flare.FlareCommand; ++import net.minecraft.server.MinecraftServer; ++ ++public class AirplaneCommands { ++ public static void init() { ++ MinecraftServer.getServer().server.getCommandMap().register("airplane", "Airplane", new AirplaneCommand()); ++ MinecraftServer.getServer().server.getCommandMap().register("flare", "Airplane", new FlareCommand()); ++ } ++} +diff --git a/src/main/java/gg/airplane/compat/ServerConfigurations.java b/src/main/java/gg/airplane/compat/ServerConfigurations.java +new file mode 100644 +index 0000000000000000000000000000000000000000..f4976428bc721319d2926e97cbe0f64c6e9e503c +--- /dev/null ++++ b/src/main/java/gg/airplane/compat/ServerConfigurations.java +@@ -0,0 +1,77 @@ ++package gg.airplane.compat; ++ ++import co.aikar.timings.TimingsManager; ++import com.google.common.io.Files; ++import org.bukkit.configuration.InvalidConfigurationException; ++import org.bukkit.configuration.file.YamlConfiguration; ++ ++import java.io.ByteArrayOutputStream; ++import java.io.File; ++import java.io.FileInputStream; ++import java.io.IOException; ++import java.nio.charset.StandardCharsets; ++import java.util.Arrays; ++import java.util.List; ++import java.util.Properties; ++import java.util.stream.Collectors; ++ ++public class ServerConfigurations { ++ ++ public static final String[] configurationFiles = new String[]{ ++ "server.properties", ++ "bukkit.yml", ++ "spigot.yml", ++ "paper.yml", ++ "tuinity.yml", ++ "airplane.air" ++ }; ++ ++ public static String getCleanCopy(String configName) throws IOException { ++ File file = new File(configName); ++ List hiddenConfigs = TimingsManager.hiddenConfigs; ++ ++ if (configName.equals("airplane.air")) { ++ return Files.readLines(file, StandardCharsets.UTF_8) ++ .stream() ++ .filter(line -> !line.trim().startsWith("#")) ++ .map(line -> line.contains("token") ? " token = **" : line) ++ .collect(Collectors.joining("\n")); ++ } ++ ++ switch (Files.getFileExtension(configName)) { ++ case "properties": { ++ Properties properties = new Properties(); ++ try (FileInputStream inputStream = new FileInputStream(file)) { ++ properties.load(inputStream); ++ } ++ for (String hiddenConfig : hiddenConfigs) { ++ properties.remove(hiddenConfig); ++ } ++ ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); ++ properties.store(outputStream, ""); ++ return Arrays.stream(outputStream.toString() ++ .split("\n")) ++ .filter(line -> !line.startsWith("#")) ++ .collect(Collectors.joining("\n")); ++ } ++ case "yml": { ++ YamlConfiguration configuration = new YamlConfiguration(); ++ try { ++ configuration.load(file); ++ } catch (InvalidConfigurationException e) { ++ throw new IOException(e); ++ } ++ configuration.options().header(null); ++ for (String key : configuration.getKeys(true)) { ++ if (hiddenConfigs.contains(key)) { ++ configuration.set(key, null); ++ } ++ } ++ return configuration.saveToString(); ++ } ++ default: ++ throw new IllegalArgumentException("Bad file type " + configName); ++ } ++ } ++ ++} +diff --git a/src/main/java/gg/airplane/flare/FlareCommand.java b/src/main/java/gg/airplane/flare/FlareCommand.java +new file mode 100644 +index 0000000000000000000000000000000000000000..81f5267d287138f6b47aa0a1f1d59d2d91a7e34a +--- /dev/null ++++ b/src/main/java/gg/airplane/flare/FlareCommand.java +@@ -0,0 +1,158 @@ ++package gg.airplane.flare; ++ ++import com.google.common.collect.ImmutableList; ++import gg.airplane.AirplaneConfig; ++import gg.airplane.flare.exceptions.UserReportableException; ++import gg.airplane.flare.profiling.AsyncProfilerIntegration; ++import net.md_5.bungee.api.ChatColor; ++import net.md_5.bungee.api.chat.BaseComponent; ++import net.md_5.bungee.api.chat.ClickEvent; ++import net.md_5.bungee.api.chat.ComponentBuilder; ++import net.md_5.bungee.api.chat.TextComponent; ++import org.bukkit.Bukkit; ++import org.bukkit.command.Command; ++import org.bukkit.command.CommandSender; ++import org.bukkit.command.ConsoleCommandSender; ++import org.bukkit.craftbukkit.scheduler.MinecraftInternalPlugin; ++import org.bukkit.util.StringUtil; ++ ++import java.util.ArrayList; ++import java.util.Collections; ++import java.util.List; ++ ++public class FlareCommand extends Command { ++ ++ private static final ChatColor HEX = ChatColor.of("#6a7eda"); ++ private static final BaseComponent[] PREFIX = new ComponentBuilder("Flare ✈ ") ++ .color(HEX) ++ .bold(true) ++ .create(); ++ ++ private static ComponentBuilder create(ComponentBuilder newBuilder) { ++ newBuilder.color(HEX); ++ newBuilder.bold(false); ++ ++ ComponentBuilder builder = new ComponentBuilder(); ++ builder.append(PREFIX); ++ builder.append(newBuilder.create()); ++ return builder; ++ } ++ ++ public FlareCommand() { ++ super("flare", "Profile your server with Flare", "/flare", Collections.singletonList("profile")); ++ this.setPermission("airplane.flare"); ++ } ++ ++ @Override ++ public boolean execute(CommandSender sender, String commandLabel, String[] args) { ++ if (!testPermission(sender)) return true; ++ if (AirplaneConfig.accessToken.length() == 0) { ++ BaseComponent clickable = new TextComponent("https://blog.airplane.gg/flare"); ++ clickable.setUnderlined(true); ++ clickable.setColor(HEX); ++ clickable.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://blog.airplane.gg/flare")); ++ ++ sender.sendMessage(create(new ComponentBuilder("Flare currently requires an access token to use. To learn more, visit ") ++ .color(HEX) ++ .append(clickable) ++ ) ++ .create()); ++ return true; ++ } ++ ++ if (AsyncProfilerIntegration.doesNotSupportProfiling()) { ++ sender.sendMessage(create(new ComponentBuilder("Profiling is not supported in this environment, reason: " + AsyncProfilerIntegration.getDisabledReason()) ++ .color(ChatColor.RED) ++ ).create()); ++ return true; ++ } ++ if (ProfilingManager.isProfiling()) { ++ if (args.length == 1 && args[0].equalsIgnoreCase("status")) { ++ sender.sendMessage(create(new ComponentBuilder("Status: " + AsyncProfilerIntegration.status())).create()); ++ return true; ++ } ++ if (ProfilingManager.stop()) { ++ if (!(sender instanceof ConsoleCommandSender)) { ++ sender.sendMessage(create(new ComponentBuilder("Profiling has been stopped.")).create()); ++ } ++ } else { ++ sender.sendMessage(create(new ComponentBuilder("Profiling has already been stopped.")).create()); ++ } ++ } else { ++ ProfileType profileType = null; ++ if (args.length > 0) { ++ try { ++ profileType = ProfileType.valueOf(args[0].toUpperCase()); ++ } catch (Exception e) { ++ sender.sendMessage(create(new ComponentBuilder("Invalid profile type ") ++ .append(args[0]).color(ChatColor.BOLD) ++ .append("!").color(HEX)).create()); ++ return false; ++ } ++ } ++ int interval = 5; ++ if (args.length > 1) { ++ try { ++ interval = Integer.parseInt(args[1]); ++ } catch (Exception e) { ++ sender.sendMessage(create(new ComponentBuilder("Invalid time in milliseconds ") ++ .append(args[1]).color(HEX).bold(true) ++ .append("!").color(HEX)).create()); ++ return false; ++ } ++ } ++ int finalInterval = interval; ++ ProfileType finalProfileType = profileType; ++ Bukkit.getScheduler().runTaskAsynchronously(new MinecraftInternalPlugin(), () -> { ++ try { ++ if (ProfilingManager.start(finalProfileType, finalInterval)) { ++ if (!(sender instanceof ConsoleCommandSender)) { ++ sender.sendMessage(create(new ComponentBuilder("Profiling has been started: " + ProfilingManager.getProfilingUrl().get()) ++ .event(new ClickEvent(ClickEvent.Action.OPEN_URL, ProfilingManager.getProfilingUrl().get()))) ++ .create()); ++ sender.sendMessage(create(new ComponentBuilder(" Run /" + commandLabel + " to stop profiling.")).create()); ++ } ++ } else { ++ sender.sendMessage(create(new ComponentBuilder("Profiling has already been started: " + ProfilingManager.getProfilingUrl().get()) ++ .event(new ClickEvent(ClickEvent.Action.OPEN_URL, ProfilingManager.getProfilingUrl().get()))) ++ .create()); ++ } ++ } catch (UserReportableException e) { ++ sender.sendMessage(create(new ComponentBuilder("Profiling failed to start: " + e.getUserError())).create()); ++ e.printStackTrace(); ++ } ++ }); ++ } ++ return true; ++ } ++ ++ @Override ++ public List tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { ++ if (AsyncProfilerIntegration.doesNotSupportProfiling()) { ++ return ImmutableList.of(); ++ } ++ ++ List list = new ArrayList<>(); ++ if (AsyncProfilerIntegration.isProfiling()) { ++ if (args.length == 1) { ++ String lastWord = args[0]; ++ if (StringUtil.startsWithIgnoreCase("status", lastWord)) { ++ list.add("status"); ++ } ++ if (StringUtil.startsWithIgnoreCase("stop", lastWord)) { ++ list.add("stop"); ++ } ++ } ++ } else { ++ if (args.length <= 1) { ++ String lastWord = args.length == 0 ? "" : args[0]; ++ for (ProfileType value : ProfileType.values()) { ++ if (StringUtil.startsWithIgnoreCase(value.getInternalName(), lastWord)) { ++ list.add(value.name().toLowerCase()); ++ } ++ } ++ } ++ } ++ return list; ++ } ++} +diff --git a/src/main/java/gg/airplane/flare/FlareSetup.java b/src/main/java/gg/airplane/flare/FlareSetup.java +new file mode 100644 +index 0000000000000000000000000000000000000000..27ac32779e700494aeca8b425edb2871d3ec29cc +--- /dev/null ++++ b/src/main/java/gg/airplane/flare/FlareSetup.java +@@ -0,0 +1,146 @@ ++package gg.airplane.flare; ++ ++import com.google.common.cache.Cache; ++import com.google.common.cache.CacheBuilder; ++import gg.airplane.AirplaneConfig; ++import gg.airplane.AirplaneLogger; ++import gg.airplane.compat.ServerConfigurations; ++import gg.airplane.flare.profiling.AsyncProfilerIntegration; ++import net.minecraft.server.MinecraftServer; ++import org.bukkit.Bukkit; ++import org.bukkit.craftbukkit.scheduler.MinecraftInternalPlugin; ++import org.bukkit.plugin.Plugin; ++import org.bukkit.plugin.java.PluginClassLoader; ++import org.bukkit.scheduler.BukkitTask; ++ ++import java.io.IOException; ++import java.util.HashMap; ++import java.util.LinkedHashMap; ++import java.util.Map; ++import java.util.concurrent.TimeUnit; ++import java.util.logging.Level; ++ ++public class FlareSetup { ++ ++ public static void init() { ++ ServerConnector.connector = new ServerConnector() { ++ ++ private final Cache pluginNameCache = CacheBuilder.newBuilder() ++ .expireAfterAccess(1, TimeUnit.MINUTES) ++ .maximumSize(1024) ++ .build(); ++ ++ @Override ++ public String getPluginForClass(String name) { ++ if (name.contains(".") && name.charAt(0) != '/') { ++ if (name.startsWith("net.minecraft") || name.startsWith("java.") || name.startsWith("com.mojang") || name.startsWith("com.google") || name.startsWith("it.unimi") || name.startsWith("sun")) { ++ return null; ++ } ++ ++ String className = name.substring(0, name.lastIndexOf(".")); ++ String existing = pluginNameCache.getIfPresent(name); ++ if (existing != null) { ++ return existing.isEmpty() ? null : existing; ++ } ++ ++ String newValue = ""; ++ ++ for (Plugin plugin : Bukkit.getPluginManager().getPlugins()) { ++ ClassLoader classLoader = plugin.getClass().getClassLoader(); ++ if (classLoader instanceof PluginClassLoader) { ++ try { ++ Class aClass = ((PluginClassLoader) classLoader)._airplane_findClass(className); ++ if (aClass != null) { ++ newValue = plugin.getName(); ++ } ++ } catch (ClassNotFoundException | IllegalAccessError e) { ++ } ++ } ++ } ++ ++ pluginNameCache.put(name, newValue); ++ } ++ return null; ++ } ++ ++ @Override ++ public Thread getMainThread() { ++ return MinecraftServer.getServer().serverThread; ++ } ++ ++ @Override ++ public Map getConfigurations() { ++ Map map = new LinkedHashMap<>(); ++ for (String configurationFile : ServerConfigurations.configurationFiles) { ++ try { ++ map.put(configurationFile, ServerConfigurations.getCleanCopy(configurationFile)); ++ } catch (IOException e) { ++ this.log(Level.WARNING, "Failed to load config file " + configurationFile, e); ++ } ++ } ++ return map; ++ } ++ ++ @Override ++ public void log(Level level, String s) { ++ AirplaneLogger.LOGGER.log(level, s); ++ } ++ ++ @Override ++ public void log(Level level, String s, Throwable throwable) { ++ AirplaneLogger.LOGGER.log(level, s, throwable); ++ } ++ ++ @Override ++ public String getPrimaryVersion() { ++ return Bukkit.getVersion(); ++ } ++ ++ @Override ++ public String getApiVersion() { ++ return "bukkit:" + Bukkit.getBukkitVersion(); ++ } ++ ++ @Override ++ public String getMcVersion() { ++ return Bukkit.getMinecraftVersion(); ++ } ++ ++ private final Map scheduledRunnables = new HashMap<>(); ++ ++ @Override ++ public void schedule(Runnable runnable, long l, long l1) { ++ BukkitTask task = Bukkit.getScheduler().runTaskTimer(new MinecraftInternalPlugin(), runnable, l, l1); ++ this.scheduledRunnables.put(runnable, task); ++ } ++ ++ @Override ++ public void scheduleAsync(Runnable runnable, long l, long l1) { ++ BukkitTask task = Bukkit.getScheduler().runTaskTimerAsynchronously(new MinecraftInternalPlugin(), runnable, l, l1); ++ this.scheduledRunnables.put(runnable, task); ++ } ++ ++ @Override ++ public void cancel(Runnable runnable) { ++ this.scheduledRunnables.get(runnable).cancel(); ++ } ++ ++ @Override ++ public void runAsync(Runnable runnable) { ++ Bukkit.getScheduler().runTaskAsynchronously(new MinecraftInternalPlugin(), runnable); ++ } ++ ++ @Override ++ public String getWebUrl() { ++ return AirplaneConfig.profileWebUrl; ++ } ++ ++ @Override ++ public String getToken() { ++ return AirplaneConfig.accessToken; ++ } ++ }; ++ AsyncProfilerIntegration.init(); ++ } ++ ++} +diff --git a/src/main/java/gg/airplane/flare/ProfilingManager.java b/src/main/java/gg/airplane/flare/ProfilingManager.java +new file mode 100644 +index 0000000000000000000000000000000000000000..86d6650d174a7794a7ebe793cad033b42215c321 +--- /dev/null ++++ b/src/main/java/gg/airplane/flare/ProfilingManager.java +@@ -0,0 +1,65 @@ ++package gg.airplane.flare; ++ ++import gg.airplane.AirplaneConfig; ++import gg.airplane.AirplaneLogger; ++import gg.airplane.flare.exceptions.UserReportableException; ++import gg.airplane.flare.profiling.ProfileController; ++import org.bukkit.Bukkit; ++import org.bukkit.craftbukkit.scheduler.MinecraftInternalPlugin; ++import org.bukkit.scheduler.BukkitTask; ++ ++import javax.annotation.Nullable; ++import java.util.Optional; ++import java.util.logging.Level; ++ ++public class ProfilingManager { ++ ++ private static ProfileController currentController; ++ private static BukkitTask currentTask = null; ++ ++ public static synchronized boolean isProfiling() { ++ return currentController != null; ++ } ++ ++ public static synchronized Optional getProfilingUrl() { ++ if (!isProfiling()) { ++ return Optional.empty(); ++ } ++ return Optional.of(AirplaneConfig.profileWebUrl + "/" + currentController.getId()); ++ } ++ ++ public static synchronized boolean start(@Nullable ProfileType type, int interval) throws UserReportableException { ++ if (isProfiling()) { ++ return false; ++ } ++ if (Bukkit.isPrimaryThread()) { ++ throw new UserReportableException("Profiles should be started off-thread"); ++ } ++ currentController = new ProfileController(type, Math.max(interval, 1)); // don't allow lower than 20ms: https://bugzilla.redhat.com/show_bug.cgi?id=645528 ++ currentTask = Bukkit.getScheduler().runTaskLater(new MinecraftInternalPlugin(), ProfilingManager::stop, 20 * 60 * 15); ++ AirplaneLogger.LOGGER.log(Level.INFO, "Flare has been started: " + getProfilingUrl().orElse("An error occurred retrieving the Flare URL.")); ++ return true; ++ } ++ ++ public static synchronized boolean stop() { ++ if (!isProfiling()) { ++ return false; ++ } ++ AirplaneLogger.LOGGER.log(Level.INFO, "Flare has been stopped: " + getProfilingUrl().orElse("An error occurred retrieving the Flare URL.")); ++ try { ++ currentController.cancel(); ++ } catch (Throwable t) { ++ AirplaneLogger.LOGGER.log(Level.WARNING, "Error occurred stopping Flare", t); ++ } ++ currentController = null; ++ ++ try { ++ currentTask.cancel(); ++ } catch (Throwable t) { ++ AirplaneLogger.LOGGER.log(Level.WARNING, "Error occurred stopping Flare", t); ++ } ++ currentTask = null; ++ return true; ++ } ++ ++} +diff --git a/src/main/java/gg/airplane/manual/ManualParser.java b/src/main/java/gg/airplane/manual/ManualParser.java +new file mode 100644 +index 0000000000000000000000000000000000000000..ace29adb0f140d99a8d85ac824654beded4bf5b8 +--- /dev/null ++++ b/src/main/java/gg/airplane/manual/ManualParser.java +@@ -0,0 +1,210 @@ ++package gg.airplane.manual; ++ ++import java.io.BufferedReader; ++import java.io.BufferedWriter; ++import java.io.File; ++import java.io.FileReader; ++import java.io.FileWriter; ++import java.io.IOException; ++import java.util.ArrayList; ++import java.util.Arrays; ++import java.util.LinkedHashMap; ++import java.util.List; ++import java.util.Map; ++import java.util.TreeMap; ++ ++// todo make this cleaner and more ergonomic to use ++// also probably needs lists eventually ++public class ManualParser { ++ ++ private final File file; ++ private final Map sections = new LinkedHashMap<>(); ++ ++ private static class ManualObject { ++ public final String key; ++ public final List comments; ++ ++ private ManualObject(String key, List comments) { ++ this.key = key; ++ this.comments = comments == null ? new ArrayList<>() : comments; ++ } ++ } ++ ++ private static class Section extends ManualObject { ++ public final Map values; ++ ++ private Section(String key, List comments) { ++ super(key, comments); ++ this.values = new LinkedHashMap<>(); ++ } ++ ++ public void add(String key, Value value) { ++ this.values.put(key, value); ++ value.parent = this; ++ } ++ ++ public Value get(String key) { ++ return this.values.computeIfAbsent(key, k -> { ++ Value value = new Value(k, null, null); ++ value.parent = this; ++ return value; ++ }); ++ } ++ } ++ ++ private static class Value extends ManualObject { ++ public Object value; ++ public Section parent; ++ ++ private Value(String key, Object value, List comments) { ++ super(key, comments); ++ this.value = value; ++ } ++ } ++ ++ public ManualParser(File file) throws IOException { ++ this.file = file; ++ ++ if (!file.exists()) { ++ return; ++ } ++ ++ try (BufferedReader reader = new BufferedReader(new FileReader(file))) { ++ Section currentSection = null; ++ List currentComment = new ArrayList<>(); ++ ++ String line; ++ while ((line = reader.readLine()) != null) { ++ line = line.trim(); ++ ++ if (line.length() == 0) { ++ continue; // empty line ++ } ++ ++ if (line.startsWith("#")) { ++ currentComment.add(line.substring(1).trim()); ++ } else if (line.startsWith("[")) { ++ if (!line.endsWith("]")) { ++ throw new IllegalArgumentException("Invalid configuration, section '" + line + "' does not end with ]"); ++ } ++ if (line.length() < 3) { ++ throw new IllegalArgumentException("Invalid configuration, section '" + line + "' does not have a name"); ++ } ++ String sectionName = line.substring(1, line.length() - 1); ++ Section newSection = new Section(sectionName, currentComment); ++ currentComment = new ArrayList<>(); ++ currentSection = newSection; ++ this.sections.put(sectionName, newSection); ++ } else { ++ if (currentSection == null) { ++ throw new IllegalArgumentException("Invalid configuration, found value outside of section " + line); ++ } ++ int equals = line.indexOf("="); ++ if (equals <= 1 || equals == line.length() - 1) { ++ throw new IllegalArgumentException("Invalid configuration, assignment invalid " + line); ++ } ++ ++ String key = line.substring(0, equals).trim(); ++ ++ String value = line.substring(equals + 1).trim(); ++ if (value.length() == 0) { ++ throw new IllegalArgumentException("Invalid configuration, value does not exist " + line); ++ } ++ if (value.startsWith("\"")) { ++ if (!value.endsWith("\"")) { ++ throw new IllegalArgumentException("Invalid configuration, value has no ending quote " + line); ++ } ++ String stringValue = value.substring(1, value.length() - 1); ++ currentSection.add(key, new Value(key, stringValue, currentComment)); ++ } else if (Character.isDigit(value.charAt(0))) { ++ if (value.contains(".")) { ++ double doubleValue = Double.parseDouble(value); ++ currentSection.add(key, new Value(key, doubleValue, currentComment)); ++ } else { ++ int intValue = Integer.parseInt(value); ++ currentSection.add(key, new Value(key, intValue, currentComment)); ++ } ++ } else if (value.equals("true") || value.equals("false")) { ++ boolean boolValue = Boolean.parseBoolean(value); ++ currentSection.add(key, new Value(key, boolValue, currentComment)); ++ } else { ++ throw new IllegalArgumentException("Invalid configuration, unknown type for " + line); ++ } ++ currentComment = new ArrayList<>(); ++ } ++ } ++ } ++ } ++ ++ public void save() throws IOException { ++ try (BufferedWriter writer = new BufferedWriter(new FileWriter(this.file))) { ++ for (Map.Entry entry : this.sections.entrySet()) { ++ Section section = entry.getValue(); ++ if (section.comments != null) { ++ for (String comment : section.comments) { ++ writer.write("# " + comment + "\n"); ++ } ++ } ++ writer.write("[" + section.key + "]" + "\n"); ++ for (Value value : section.values.values()) { ++ if (value.comments != null) { ++ for (String comment : value.comments) { ++ writer.write(" # " + comment + "\n"); ++ } ++ } ++ writer.write(" " + value.key + " = " + serialize(value.value) + "\n"); ++ } ++ writer.write("\n"); ++ } ++ } ++ } ++ ++ private ManualObject getObject(String key) { ++ String[] split = key.split("\\.", 2); ++ if (split.length == 1) { ++ return this.sections.computeIfAbsent(key, k -> new Section(k, null)); ++ } ++ return this.sections.computeIfAbsent(split[0], k -> new Section(k, null)).get(split[1]); ++ } ++ ++ public void setComment(String key, String... comment) { ++ ManualObject object = this.getObject(key); ++ object.comments.clear(); ++ object.comments.addAll(Arrays.asList(comment)); ++ } ++ ++ public T get(String key, T defaultValue, String... comment) { ++ String[] split = key.split("\\.", 2); ++ if (split.length == 1) { ++ throw new IllegalArgumentException("Key " + key + " does not include section"); ++ } ++ Section section = this.sections.computeIfAbsent(split[0], k -> new Section(k, null)); ++ if (!section.values.containsKey(split[1])) { ++ Value value = section.get(split[1]); ++ value.value = defaultValue; ++ value.comments.addAll(Arrays.asList(comment)); ++ return defaultValue; ++ } ++ Value value = section.get(split[1]); ++ if (value.comments.isEmpty()) { ++ value.comments.addAll(Arrays.asList(comment)); ++ } ++ return (T) value.value; ++ } ++ ++ public void set(String key, Object value) { ++ ManualObject object = getObject(key); ++ if (!(object instanceof Value)) { ++ throw new IllegalArgumentException("Invalid key for value " + key); ++ } ++ ((Value) object).value = value; ++ } ++ ++ private String serialize(Object object) { ++ if (object instanceof String) { ++ return "\"" + object + "\""; ++ } ++ return String.valueOf(object); ++ } ++ ++} +diff --git a/src/main/java/gg/airplane/structs/TrackQueue.java b/src/main/java/gg/airplane/structs/TrackQueue.java +new file mode 100644 +index 0000000000000000000000000000000000000000..601694aa6d36ce230d84cc6b55231d2fc3af30e9 +--- /dev/null ++++ b/src/main/java/gg/airplane/structs/TrackQueue.java +@@ -0,0 +1,84 @@ ++package gg.airplane.structs; ++ ++import com.tuinity.tuinity.util.maplist.IteratorSafeOrderedReferenceSet; ++import net.minecraft.server.Chunk; ++import net.minecraft.server.MinecraftServer; ++import org.apache.logging.log4j.Level; ++ ++import java.util.concurrent.ConcurrentLinkedQueue; ++import java.util.concurrent.ForkJoinPool; ++import java.util.concurrent.atomic.AtomicInteger; ++ ++/** ++ * Helper class to handle processing a track queue. ++ */ ++public class TrackQueue { ++ ++ private final IteratorSafeOrderedReferenceSet chunks; ++ private final ForkJoinPool pool = ForkJoinPool.commonPool(); ++ private final AtomicInteger taskIndex = new AtomicInteger(); ++ ++ private final ConcurrentLinkedQueue mainThreadTasks; ++ ++ public TrackQueue(IteratorSafeOrderedReferenceSet chunks, ConcurrentLinkedQueue mainThreadTasks) { ++ this.chunks = chunks; ++ this.mainThreadTasks = mainThreadTasks; ++ } ++ ++ public void start() { ++ int iterator = this.chunks.createRawIterator(); ++ if (iterator == -1) { ++ return; ++ } ++ try { ++ this.taskIndex.set(iterator); ++ ++ for (int i = 0; i < this.pool.getParallelism(); i++) { ++ this.pool.execute(this::run); ++ } ++ ++ while (this.taskIndex.get() < this.chunks.getListSize()) { ++ this.runMainThreadTasks(); ++ this.handleTask(); // assist ++ } ++ this.runMainThreadTasks(); // finish tasks ++ } finally { ++ this.chunks.finishRawIterator(); ++ } ++ } ++ ++ private void runMainThreadTasks() { ++ Runnable task; ++ while ((task = this.mainThreadTasks.poll()) != null) { ++ try { ++ task.run(); ++ } catch (Throwable t) { ++ MinecraftServer.LOGGER.log(Level.WARN, "Tasks failed while ticking track queue", t); ++ } ++ } ++ ++ } ++ ++ private void run() { ++ while (handleTask()); ++ } ++ ++ private boolean handleTask() { ++ int index; ++ while ((index = this.taskIndex.getAndIncrement()) < this.chunks.getListSize()) { ++ Chunk chunk = this.chunks.rawGet(index); ++ if (chunk != null) { ++ try { ++ chunk.entityTracker.run(); ++ } catch (Throwable t) { ++ MinecraftServer.LOGGER.log(Level.WARN, "Ticking tracker failed", t); ++ } ++ ++ return true; ++ } ++ } ++ ++ return false; ++ } ++ ++} +diff --git a/src/main/java/net/minecraft/server/BehaviorBetterJob.java b/src/main/java/net/minecraft/server/BehaviorBetterJob.java +index 19f8cf4384ff7a1515ad33a5f573ea0061bab93d..e6507a9bef705e1496497ad6b58a546348a0779e 100644 +--- a/src/main/java/net/minecraft/server/BehaviorBetterJob.java ++++ b/src/main/java/net/minecraft/server/BehaviorBetterJob.java +@@ -14,11 +14,31 @@ public class BehaviorBetterJob extends Behavior { + protected void a(WorldServer worldserver, EntityVillager entityvillager, long i) { + GlobalPos globalpos = (GlobalPos) entityvillager.getBehaviorController().getMemory(MemoryModuleType.JOB_SITE).get(); + ++ // Airplane start - remove stream ++ /* + worldserver.y().c(globalpos.getBlockPosition()).ifPresent((villageplacetype) -> { + BehaviorUtil.a(entityvillager, (entityvillager1) -> { + return this.a(globalpos, villageplacetype, entityvillager1); + }).reduce(entityvillager, BehaviorBetterJob::a); + }); ++ */ ++ java.util.Optional optVillagePlaceType = worldserver.y().c(globalpos.getBlockPosition()); ++ if (optVillagePlaceType.isPresent()) { ++ VillagePlaceType villageplacetype = optVillagePlaceType.get(); ++ java.util.Optional> optList = entityvillager.getBehaviorController().getMemory(MemoryModuleType.MOBS); ++ if (optList.isPresent()) { ++ EntityVillager previous = entityvillager; ++ for (EntityLiving entityliving : optList.get()) { ++ if (entityliving instanceof EntityVillager && entityliving != entityvillager && entityliving.isAlive()) { ++ EntityVillager entityvillager1 = (EntityVillager) entityliving; ++ if (this.a(globalpos, villageplacetype, entityvillager1)) { ++ previous = a(previous, entityvillager1); ++ } ++ } ++ } ++ } ++ } ++ // Airplane end + } + + private static EntityVillager a(EntityVillager entityvillager, EntityVillager entityvillager1) { +diff --git a/src/main/java/net/minecraft/server/BehaviorFindPosition.java b/src/main/java/net/minecraft/server/BehaviorFindPosition.java +index 8d445e9c0875db6cf45e4d8bcfce7cd3d5094d94..0594b0bb12c553edbb6284b48328a3dcf5a64ba4 100644 +--- a/src/main/java/net/minecraft/server/BehaviorFindPosition.java ++++ b/src/main/java/net/minecraft/server/BehaviorFindPosition.java +@@ -278,6 +278,7 @@ public class BehaviorFindPosition extends Behavior { + + protected void a(WorldServer worldserver, EntityCreature entitycreature, long i) { + this.f = i + 20L + (long) worldserver.getRandom().nextInt(20); ++ if (entitycreature.getNavigation().isStuck()) this.f += 200L; // Airplane - wait an additional 10s to check again if they're stuck + VillagePlace villageplace = worldserver.y(); + + this.g.long2ObjectEntrySet().removeIf((entry) -> { +diff --git a/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java b/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java +index 7b29d47dfdef7611db58068af285f76d92a9f12a..6c5d96853d47850b81ce85e56a516c554819ef25 100644 +--- a/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java ++++ b/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java +@@ -43,8 +43,14 @@ public abstract class BlockDirtSnowSpreadable extends BlockDirtSnow { + if (worldserver.getLightLevel(blockposition.up()) >= 9) { + IBlockData iblockdata1 = this.getBlockData(); + ++ // Airplane start - use mutable position ++ BlockPosition.MutableBlockPosition blockposition1 = new BlockPosition.MutableBlockPosition(); + for (int i = 0; i < 4; ++i) { ++ blockposition1.setValues(blockposition).addValues(random.nextInt(3) - 1, random.nextInt(5) - 3, random.nextInt(3) - 1); ++ /* + BlockPosition blockposition1 = blockposition.b(random.nextInt(3) - 1, random.nextInt(5) - 3, random.nextInt(3) - 1); ++ */ ++ // Airplane end + + if (worldserver.getType(blockposition1).a(Blocks.DIRT) && c(iblockdata1, (IWorldReader) worldserver, blockposition1)) { + org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(worldserver, blockposition, blockposition1, (IBlockData) iblockdata1.set(BlockDirtSnowSpreadable.a, worldserver.getType(blockposition1.up()).a(Blocks.SNOW))); // CraftBukkit +diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java +index 2291135eaef64c403183724cb6e413cd7e472672..72ee5fe0ca25844cbcd8f1bbbbd6a7f8ced24bc4 100644 +--- a/src/main/java/net/minecraft/server/BlockPosition.java ++++ b/src/main/java/net/minecraft/server/BlockPosition.java +@@ -432,6 +432,14 @@ public class BlockPosition extends BaseBlockPosition { + public BlockPosition b(int i, int j, int k) { + return super.b(i, j, k).immutableCopy(); + } ++ // Airplane start - version of b that doesn't copy ++ public BlockPosition addValues(int x, int y, int z) { ++ ((BaseBlockPosition)this).a += x; ++ ((BaseBlockPosition)this).b += y; ++ ((BaseBlockPosition)this).e += z; ++ return this; ++ } ++ // Airplane end + + @Override + public BlockPosition shift(EnumDirection enumdirection, int i) { +diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java +index 8fda4702764e80dae93ef9c0eb53abc198642ab1..1d65d884d1f31a73333e4cf6a9ce30d7863dab9f 100644 +--- a/src/main/java/net/minecraft/server/Chunk.java ++++ b/src/main/java/net/minecraft/server/Chunk.java +@@ -53,6 +53,38 @@ public class Chunk implements IChunkAccess { + private final ChunkCoordIntPair loc; public final long coordinateKey; public final int locX; public final int locZ; // Paper - cache coordinate key + private volatile boolean x; + ++ // Airplane start - instead of using a random every time the chunk is ticked, define when lightning strikes preemptively ++ private int lightningTick; ++ // shouldDoLightning compiles down to 29 bytes, which with the default of 35 byte inlining should guarantee an inline ++ public final boolean shouldDoLightning(java.util.Random random) { ++ if (this.lightningTick-- <= 0) { ++ this.lightningTick = random.nextInt(100000) << 1; ++ return true; ++ } ++ return false; ++ } ++ // Airplane end ++ ++ // Airplane start - entity tracker runnable ++ // prevents needing to allocate new lambda in processTrackQueue ++ public final Runnable entityTracker = new Runnable() { ++ @Override ++ public void run() { ++ Entity[] entities = Chunk.this.entities.getRawData(); ++ for (int i = 0, len = Chunk.this.entities.size(); i < len; ++i) { ++ Entity entity = entities[i]; ++ if (entity != null) { ++ PlayerChunkMap.EntityTracker tracker = ((WorldServer) Chunk.this.getWorld()).getChunkProvider().playerChunkMap.trackedEntities.get(entity.getId()); ++ if (tracker != null) { ++ tracker.updatePlayers(tracker.tracker.getPlayersInTrackRange()); ++ tracker.tickEntry(); ++ } ++ } ++ } ++ } ++ }; ++ // Airplane end ++ + public Chunk(World world, ChunkCoordIntPair chunkcoordintpair, BiomeStorage biomestorage) { + this(world, chunkcoordintpair, biomestorage, ChunkConverter.a, TickListEmpty.b(), TickListEmpty.b(), 0L, (ChunkSection[]) null, (Consumer) null); + } +@@ -287,6 +319,7 @@ public class Chunk implements IChunkAccess { + // CraftBukkit start + this.bukkitChunk = new org.bukkit.craftbukkit.CraftChunk(this); + this.entitySlicesManager = new com.tuinity.tuinity.world.ChunkEntitySlices(this.world, this.loc.x, this.loc.z, 0, 15); // TODO update for 1.17 // Tuinity ++ this.lightningTick = this.world.random.nextInt(100000) << 1; // Airplane - initialize lightning tick + } + + public org.bukkit.Chunk bukkitChunk; +diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java +index e26389d8d9ee4fedb32767fce3aed071af412304..9cf3cd69661a140d34d17195c2cd6dc299c95ddf 100644 +--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java ++++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java +@@ -974,6 +974,7 @@ public class ChunkProviderServer extends IChunkProvider { + } + // Paper end - optimize isOutisdeRange + this.world.getMethodProfiler().enter("pollingChunks"); ++ this.world.resetIceAndSnowTick(); // Airplane - reset ice & snow tick random + int k = this.world.getGameRules().getInt(GameRules.RANDOM_TICK_SPEED); + boolean flag2 = world.ticksPerAnimalSpawns != 0L && worlddata.getTime() % world.ticksPerAnimalSpawns == 0L; // CraftBukkit + +diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java +index 076d6c1e1cc049dd312ecb30518e7b25fc2d7371..68538ae94806d5980cd531e61fa52a01a5cc8997 100644 +--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java ++++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java +@@ -424,6 +424,7 @@ public class ChunkRegionLoader { + public static NBTTagCompound saveChunk(WorldServer worldserver, IChunkAccess ichunkaccess) { + return saveChunk(worldserver, ichunkaccess, null); + } ++ private static final ThreadLocal paletteArray = ThreadLocal.withInitial(() -> new int[4096]); // Airplane + public static NBTTagCompound saveChunk(WorldServer worldserver, IChunkAccess ichunkaccess, AsyncSaveData asyncsavedata) { + // Paper end + // Tuinity start - rewrite light impl +@@ -454,6 +455,7 @@ public class ChunkRegionLoader { + + NBTTagCompound nbttagcompound2; + ++ int[] aint = paletteArray.get(); // Airplane - use cached + for (int i = -1; i < 17; ++i) { // Paper - conflict on loop parameter change + int finalI = i; // CraftBukkit - decompile errors + ChunkSection chunksection = (ChunkSection) Arrays.stream(achunksection).filter((chunksection1) -> { +@@ -474,7 +476,7 @@ public class ChunkRegionLoader { + nbttagcompound2 = new NBTTagCompound(); + nbttagcompound2.setByte("Y", (byte) (i & 255)); + if (chunksection != Chunk.a) { +- chunksection.getBlocks().a(nbttagcompound2, "Palette", "BlockStates"); ++ chunksection.getBlocks().a(nbttagcompound2, "Palette", "BlockStates", aint); // Airplane + } + + if (nibblearray != null && !nibblearray.c()) { +diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java +index 73163b417af7e522a4509bf9c1ab56d6499be622..2855a2757c35afc5751a7ca6f3a12cc27c24bf96 100644 +--- a/src/main/java/net/minecraft/server/DataPaletteBlock.java ++++ b/src/main/java/net/minecraft/server/DataPaletteBlock.java +@@ -226,12 +226,16 @@ public class DataPaletteBlock implements DataPaletteExpandable { + this.b(); + } + ++ // Airplane start - add parameter for reusing aint + public synchronized void a(NBTTagCompound nbttagcompound, String s, String s1) { // Paper - synchronize ++ a(nbttagcompound, s, s1, new int[4096]); ++ } ++ public synchronized void a(NBTTagCompound nbttagcompound, String s, String s1, int[] aint) { // Paper - synchronize // Airplane end + this.a(); + DataPaletteHash datapalettehash = new DataPaletteHash<>(this.d, this.i, this.c, this.e, this.f); + T t0 = this.g; + int i = datapalettehash.a(this.g); +- int[] aint = new int[4096]; ++ //int[] aint = new int[4096]; // Airplane - use parameter + + for (int j = 0; j < 4096; ++j) { + T t1 = this.a(j); +diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java +index 2644b190813cc934914aeab78fbd6515d1a37c4a..2ee781604868a508d81585a68da811ea366a21b2 100644 +--- a/src/main/java/net/minecraft/server/DedicatedServer.java ++++ b/src/main/java/net/minecraft/server/DedicatedServer.java +@@ -176,6 +176,9 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer + com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // load version history now + // Paper end + com.tuinity.tuinity.config.TuinityConfig.init((java.io.File) options.valueOf("tuinity-settings")); // Tuinity - Server Config ++ gg.airplane.AirplaneConfig.load(); // Airplane - config ++ gg.airplane.commands.AirplaneCommands.init(); // Airplane - command ++ gg.airplane.flare.FlareSetup.init(); // Airplane + + this.setPVP(dedicatedserverproperties.pvp); + this.setAllowFlight(dedicatedserverproperties.allowFlight); +diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java +index 2ec48858be8eb2c522c9685b43bd36b3b581cf8b..1d718095cf29ee70dd031b0c374e772774b8e11b 100644 +--- a/src/main/java/net/minecraft/server/Entity.java ++++ b/src/main/java/net/minecraft/server/Entity.java +@@ -197,6 +197,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + public void inactiveTick() { } + // Spigot end + public boolean shouldBeRemoved; // Paper ++ // Airplane start ++ public int activatedPriority = gg.airplane.AirplaneConfig.maximumActivationPrio; // golf score ++ // Airplane end + + public float getBukkitYaw() { + return this.yaw; +diff --git a/src/main/java/net/minecraft/server/EntityBat.java b/src/main/java/net/minecraft/server/EntityBat.java +index 451ffcfd1fc9fa3091dc2bd697e5d829dcf6443f..f06ffdca027e5477332c6bc0c381264b47633f78 100644 +--- a/src/main/java/net/minecraft/server/EntityBat.java ++++ b/src/main/java/net/minecraft/server/EntityBat.java +@@ -222,13 +222,22 @@ public class EntityBat extends EntityAmbient { + } + } + ++ // Airplane start - only check for spooky season once an hour ++ private static boolean isSpookySeason = false; ++ private static final int ONE_HOUR = 20 * 60 * 60; ++ private static int lastSpookyCheck = -ONE_HOUR; + private static boolean eJ() { ++ if (MinecraftServer.currentTick - lastSpookyCheck > ONE_HOUR) { + LocalDate localdate = LocalDate.now(); + int i = localdate.get(ChronoField.DAY_OF_MONTH); + int j = localdate.get(ChronoField.MONTH_OF_YEAR); ++ isSpookySeason = j == 10 && i >= 20 || j == 11 && i <= 3; ++ lastSpookyCheck = MinecraftServer.currentTick; ++ } + +- return j == 10 && i >= 20 || j == 11 && i <= 3; ++ return isSpookySeason; + } ++ // Airplane end + + @Override + protected float b(EntityPose entitypose, EntitySize entitysize) { +diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java +index f53525eb32a6096ae24fd23756b2169d5d39e9d4..a192400f0ea4517c56c473d39e4bd04396b4eb72 100644 +--- a/src/main/java/net/minecraft/server/EntityEnderman.java ++++ b/src/main/java/net/minecraft/server/EntityEnderman.java +@@ -260,11 +260,18 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { + private boolean p(double d0, double d1, double d2) { + BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(d0, d1, d2); + +- while (blockposition_mutableblockposition.getY() > 0 && !this.world.getType(blockposition_mutableblockposition).getMaterial().isSolid()) { ++ // Airplane start - single chunk lookup ++ Chunk chunk = this.world.getChunkIfLoaded(blockposition_mutableblockposition); ++ if (chunk == null) { ++ return false; ++ } ++ ++ while (blockposition_mutableblockposition.getY() > 0 && !chunk.getType(blockposition_mutableblockposition).getMaterial().isSolid()) { // use chunk lookup + blockposition_mutableblockposition.c(EnumDirection.DOWN); + } + +- IBlockData iblockdata = this.world.getType(blockposition_mutableblockposition); ++ IBlockData iblockdata = chunk.getType(blockposition_mutableblockposition); // use chunk lookup ++ // Airplane end + boolean flag = iblockdata.getMaterial().isSolid(); + boolean flag1 = iblockdata.getFluid().a((Tag) TagsFluid.WATER); + +diff --git a/src/main/java/net/minecraft/server/EntityHoglin.java b/src/main/java/net/minecraft/server/EntityHoglin.java +index f6797925365836b6c2d3d2c48c746a4d58e28bf3..7bd22c81d75368697113915a97c7fbe55ed2a268 100644 +--- a/src/main/java/net/minecraft/server/EntityHoglin.java ++++ b/src/main/java/net/minecraft/server/EntityHoglin.java +@@ -13,7 +13,7 @@ public class EntityHoglin extends EntityAnimal implements IMonster, IOglin { + public int conversionTicks = 0; + public boolean cannotBeHunted = false; + protected static final ImmutableList>> bo = ImmutableList.of(SensorType.c, SensorType.d, SensorType.n, SensorType.m); +- protected static final ImmutableList> bp = ImmutableList.of(MemoryModuleType.BREED_TARGET, MemoryModuleType.MOBS, MemoryModuleType.VISIBLE_MOBS, MemoryModuleType.NEAREST_VISIBLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_TARGETABLE_PLAYER, MemoryModuleType.LOOK_TARGET, MemoryModuleType.WALK_TARGET, MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE, MemoryModuleType.PATH, MemoryModuleType.ATTACK_TARGET, MemoryModuleType.ATTACK_COOLING_DOWN, MemoryModuleType.NEAREST_VISIBLE_ADULT_PIGLIN, new MemoryModuleType[]{MemoryModuleType.AVOID_TARGET, MemoryModuleType.VISIBLE_ADULT_PIGLIN_COUNT, MemoryModuleType.VISIBLE_ADULT_HOGLIN_COUNT, MemoryModuleType.NEAREST_VISIBLE_ADULT_HOGLINS, MemoryModuleType.NEAREST_VISIBLE_ADULY, MemoryModuleType.NEAREST_REPELLENT, MemoryModuleType.PACIFIED}); ++ protected static final ImmutableList> bp = ImmutableList.of(MemoryModuleType.BREED_TARGET, MemoryModuleType.MOBS, MemoryModuleType.VISIBLE_MOBS, MemoryModuleType.NEAREST_VISIBLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_TARGETABLE_PLAYER, MemoryModuleType.LOOK_TARGET, MemoryModuleType.WALK_TARGET, MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE, MemoryModuleType.PATH, MemoryModuleType.ATTACK_TARGET, MemoryModuleType.ATTACK_COOLING_DOWN, MemoryModuleType.NEAREST_VISIBLE_ADULT_PIGLIN, new MemoryModuleType[]{MemoryModuleType.AVOID_TARGET, MemoryModuleType.VISIBLE_ADULT_PIGLIN_COUNT, MemoryModuleType.VISIBLE_ADULT_HOGLIN_COUNT, MemoryModuleType.NEAREST_VISIBLE_ADULT_HOGLINS, MemoryModuleType.NEAREST_VISIBLE_ADULY, MemoryModuleType.NEAREST_REPELLENT, MemoryModuleType.PACIFIED}); // Airplane - decompile error + + public EntityHoglin(EntityTypes entitytypes, World world) { + super(entitytypes, world); +@@ -77,15 +77,20 @@ public class EntityHoglin extends EntityAnimal implements IMonster, IOglin { + + @Override + public BehaviorController getBehaviorController() { +- return super.getBehaviorController(); ++ return (BehaviorController) super.getBehaviorController(); // Airplane - decompile error + } + ++ private int behaviorTick; // Airplane + @Override + protected void mobTick() { ++ // Airplane - dynamic tick ++ if (!gg.airplane.AirplaneConfig.dynamicHoglinBehavior || this.behaviorTick++ % this.activatedPriority == 0) { + this.world.getMethodProfiler().enter("hoglinBrain"); +- this.getBehaviorController().a((WorldServer) this.world, (EntityLiving) this); ++ this.getBehaviorController().a((WorldServer) this.world, (EntityHoglin) this); // Airplane - decompile error + this.world.getMethodProfiler().exit(); + HoglinAI.a(this); ++ } ++ // Airplane end + if (this.isConverting()) { + ++this.conversionTicks; + if (this.conversionTicks > 300) { +@@ -259,7 +264,7 @@ public class EntityHoglin extends EntityAnimal implements IMonster, IOglin { + + @Override + protected SoundEffect getSoundAmbient() { +- return this.world.isClientSide ? null : (SoundEffect) HoglinAI.b(this).orElse((Object) null); ++ return this.world.isClientSide ? null : (SoundEffect) HoglinAI.b(this).orElse(null); // Airplane - decompile error + } + + @Override +diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java +index a47217c020d2c2a3caddafa0549dc827373798dd..81a91d63dd26a940c381b5a4f18eb60d42bbd61e 100644 +--- a/src/main/java/net/minecraft/server/EntityInsentient.java ++++ b/src/main/java/net/minecraft/server/EntityInsentient.java +@@ -133,10 +133,10 @@ public abstract class EntityInsentient extends EntityLiving { + @Override + public void inactiveTick() { + super.inactiveTick(); +- if (this.goalSelector.inactiveTick()) { ++ if (this.goalSelector.inactiveTick(this.activatedPriority)) { // Airplane - pass activated priroity + this.goalSelector.doTick(); + } +- if (this.targetSelector.inactiveTick()) { ++ if (this.targetSelector.inactiveTick(this.activatedPriority)) { // Airplane - pass activated priority + this.targetSelector.doTick(); + } + } +@@ -761,9 +761,11 @@ public abstract class EntityInsentient extends EntityLiving { + this.bo.a(); + this.world.getMethodProfiler().exit(); + this.world.getMethodProfiler().enter("targetSelector"); ++ if (this.targetSelector.inactiveTick(this.activatedPriority)) // Airplane - use this to alternate ticking + this.targetSelector.doTick(); + this.world.getMethodProfiler().exit(); + this.world.getMethodProfiler().enter("goalSelector"); ++ if (this.goalSelector.inactiveTick(this.activatedPriority)) // Airplane - use this to alternate ticking + this.goalSelector.doTick(); + this.world.getMethodProfiler().exit(); + this.world.getMethodProfiler().enter("navigation"); +diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java +index d568db532de83a85d5c387121cec151c160f36bf..58af082b95a7eff44e2c71c3609a288a31d28d01 100644 +--- a/src/main/java/net/minecraft/server/EntityLiving.java ++++ b/src/main/java/net/minecraft/server/EntityLiving.java +@@ -815,11 +815,13 @@ public abstract class EntityLiving extends Entity { + } + + if (entity != null) { +- ItemStack itemstack = this.getEquipment(EnumItemSlot.HEAD); +- Item item = itemstack.getItem(); ++ // Airplane start - don't get equipment if not needed ++ //ItemStack itemstack = this.getEquipment(EnumItemSlot.HEAD); ++ //Item item = itemstack.getItem(); + EntityTypes entitytypes = entity.getEntityType(); + +- if (entitytypes == EntityTypes.SKELETON && item == Items.SKELETON_SKULL || entitytypes == EntityTypes.ZOMBIE && item == Items.ZOMBIE_HEAD || entitytypes == EntityTypes.CREEPER && item == Items.CREEPER_HEAD) { ++ if (entitytypes == EntityTypes.SKELETON && this.getEquipment(EnumItemSlot.HEAD).getItem() == Items.SKELETON_SKULL || entitytypes == EntityTypes.ZOMBIE && this.getEquipment(EnumItemSlot.HEAD).getItem() == Items.ZOMBIE_HEAD || entitytypes == EntityTypes.CREEPER && this.getEquipment(EnumItemSlot.HEAD).getItem() == Items.CREEPER_HEAD) { ++ // Airplane end + d0 *= 0.5D; + } + } +@@ -3007,7 +3009,7 @@ public abstract class EntityLiving extends Entity { + Vec3D vec3d = new Vec3D(this.locX(), this.getHeadY(), this.locZ()); + Vec3D vec3d1 = new Vec3D(entity.locX(), entity.getHeadY(), entity.locZ()); + +- return this.world.rayTrace(new RayTrace(vec3d, vec3d1, RayTrace.BlockCollisionOption.COLLIDER, RayTrace.FluidCollisionOption.NONE, this)).getType() == MovingObjectPosition.EnumMovingObjectType.MISS; ++ return this.world.rayTraceDirect(vec3d, vec3d1, VoxelShapeCollision.a(this)) == MovingObjectPosition.EnumMovingObjectType.MISS; // Airplane - use direct method + } + + @Override +diff --git a/src/main/java/net/minecraft/server/EntityPiglin.java b/src/main/java/net/minecraft/server/EntityPiglin.java +index ca7f9dc54ed2e58f521613b5d8027494bd20edd2..682b241ae0e2859aa57faea8a4521c1c07192b7d 100644 +--- a/src/main/java/net/minecraft/server/EntityPiglin.java ++++ b/src/main/java/net/minecraft/server/EntityPiglin.java +@@ -143,7 +143,7 @@ public class EntityPiglin extends EntityPiglinAbstract implements ICrossbow { + + @Override + public BehaviorController getBehaviorController() { +- return super.getBehaviorController(); ++ return (BehaviorController) super.getBehaviorController(); // Airplane - compile error + } + + @Override +@@ -199,12 +199,17 @@ public class EntityPiglin extends EntityPiglinAbstract implements ICrossbow { + return !this.cannotHunt; + } + ++ private int behaviorTick; // Airplane + @Override + protected void mobTick() { ++ // Airplane - dynamic tick ++ if (!gg.airplane.AirplaneConfig.dynamicPiglinBehavior || this.behaviorTick++ % this.activatedPriority == 0) { + this.world.getMethodProfiler().enter("piglinBrain"); +- this.getBehaviorController().a((WorldServer) this.world, (EntityLiving) this); ++ this.getBehaviorController().a((WorldServer) this.world, (EntityPiglin) this); // Airplane - compile error + this.world.getMethodProfiler().exit(); + PiglinAI.b(this); ++ } ++ // Airplane end + super.mobTick(); + } + +@@ -341,7 +346,7 @@ public class EntityPiglin extends EntityPiglinAbstract implements ICrossbow { + + @Override + protected SoundEffect getSoundAmbient() { +- return this.world.isClientSide ? null : (SoundEffect) PiglinAI.d(this).orElse((Object) null); ++ return this.world.isClientSide ? null : (SoundEffect) PiglinAI.d(this).orElse(null); // Airplane - compile error + } + + @Override +diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java +index f40c24b6e2f7bea21d1cb2b58ed3da45ffcfc866..9851b7cf8f60be12cfba9787eabe210661344414 100644 +--- a/src/main/java/net/minecraft/server/EntityPlayer.java ++++ b/src/main/java/net/minecraft/server/EntityPlayer.java +@@ -52,7 +52,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + public NetworkManager networkManager; // Paper + public final MinecraftServer server; + public final PlayerInteractManager playerInteractManager; +- public final Deque removeQueue = new ArrayDeque<>(); // Paper ++ public final Deque removeQueue = new java.util.concurrent.ConcurrentLinkedDeque<>(); // Paper // Airplane concurrent deque + private final AdvancementDataPlayer advancementDataPlayer; + private final ServerStatisticManager serverStatisticManager; + private float lastHealthScored = Float.MIN_VALUE; +diff --git a/src/main/java/net/minecraft/server/EntityProjectile.java b/src/main/java/net/minecraft/server/EntityProjectile.java +index d85a19905efab7189e461a61becb6ca2b8c50803..4b3d5731a18177c74f02eef91820720104145d1c 100644 +--- a/src/main/java/net/minecraft/server/EntityProjectile.java ++++ b/src/main/java/net/minecraft/server/EntityProjectile.java +@@ -85,6 +85,37 @@ public abstract class EntityProjectile extends IProjectile { + this.setPosition(d0, d1, d2); + } + ++ private static int loadedThisTick = 0; ++ private static int loadedTick; ++ ++ private int buffered = 0; ++ ++ // Airplane start ++ @Override ++ public void setPosition(double d0, double d1, double d2) { ++ if (loadedTick != MinecraftServer.currentTick) { ++ loadedTick = MinecraftServer.currentTick; ++ loadedThisTick = 0; ++ } ++ int previousX = MathHelper.floor(this.locX()) >> 4, previousZ = MathHelper.floor(this.locZ()) >> 4; ++ int newX = MathHelper.floor(d0) >> 4, newZ = MathHelper.floor(d2) >> 4; ++ if (previousX != newX || previousZ != newZ) { ++ boolean isLoaded = this.world.isChunkLoaded(newX, newZ); ++ if (!isLoaded) { ++ if (loadedThisTick > 10) { // Airplane 10 = max chunks to load from projectiles in a tick todo config ++ if (++buffered > 20) { // Airplane 20 = max chunks a single projectile loads overall todo config ++ this.die(); ++ } ++ return; ++ } ++ loadedThisTick++; ++ } ++ buffered = 0; ++ } ++ super.setPosition(d0, d1, d2); ++ } ++ // Airplane end ++ + protected float k() { + return 0.03F; + } +diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java +index 2402c18e6a18221a43bea9fc68278da9d19eede4..4b7e83e4f64a8bc4bf5b4ca569c32efefb0b3149 100644 +--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java ++++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java +@@ -46,6 +46,10 @@ public class EntityTrackerEntry { + * Requested in https://github.com/PaperMC/Paper/issues/1537 to allow intercepting packets + */ + public void sendPlayerPacket(EntityPlayer player, Packet packet) { ++ if (!gg.airplane.AirplaneConfig.entityTrackerAsyncPackets && !org.bukkit.Bukkit.isPrimaryThread()) { ++ this.b.chunkProvider.playerChunkMap.trackerEnsureMain(() -> sendPlayerPacket(player, packet)); ++ return; ++ } + player.playerConnection.sendPacket(packet); + } + +@@ -74,7 +78,7 @@ public class EntityTrackerEntry { + + public final void tick() { this.a(); } // Paper - OBFHELPER + public void a() { +- com.tuinity.tuinity.util.TickThread.softEnsureTickThread("Tracker update"); // Tuinity ++ //com.tuinity.tuinity.util.TickThread.softEnsureTickThread("Tracker update"); // Tuinity // Airplane - allow multithreaded + List list = this.tracker.passengers; // Paper - do not copy list + + if (!list.equals(this.p)) { +@@ -88,6 +92,8 @@ public class EntityTrackerEntry { + ItemStack itemstack = entityitemframe.getItem(); + + if (this.tickCounter % 10 == 0 && itemstack.getItem() instanceof ItemWorldMap) { // CraftBukkit - Moved this.tickCounter % 10 logic here so item frames do not enter the other blocks ++ // Airplane start - process maps on main ++ this.b.chunkProvider.playerChunkMap.trackerEnsureMain(() -> { + WorldMap worldmap = ItemWorldMap.getSavedMap(itemstack, this.b); + Iterator iterator = this.trackedPlayers.iterator(); // CraftBukkit + +@@ -101,6 +107,8 @@ public class EntityTrackerEntry { + entityplayer.playerConnection.sendPacket(packet); + } + } ++ }); ++ // Airplane end + } + + this.c(); +@@ -235,18 +243,25 @@ public class EntityTrackerEntry { + // CraftBukkit start - Create PlayerVelocity event + boolean cancelled = false; + +- if (this.tracker instanceof EntityPlayer) { ++ if (this.tracker instanceof EntityPlayer && PlayerVelocityEvent.getHandlerList().getRegisteredListeners().length > 0) { // Airplane - ensure there's listeners ++ // Airplane start - run on main thread ++ this.b.chunkProvider.playerChunkMap.trackerEnsureMain(() -> { + Player player = (Player) this.tracker.getBukkitEntity(); + org.bukkit.util.Vector velocity = player.getVelocity(); + + PlayerVelocityEvent event = new PlayerVelocityEvent(player, velocity.clone()); + this.tracker.world.getServer().getPluginManager().callEvent(event); + +- if (event.isCancelled()) { +- cancelled = true; +- } else if (!velocity.equals(event.getVelocity())) { ++ if (!event.isCancelled() && !velocity.equals(event.getVelocity())) { + player.setVelocity(event.getVelocity()); + } ++ if (!event.isCancelled()) { ++ this.broadcastIncludingSelf(new PacketPlayOutEntityVelocity(this.tracker)); // duplicate from !cancelled below ++ } ++ ++ }); ++ cancelled = true; // don't broadcast until the event has finished ++ // Airplane end + } + + if (!cancelled) { +@@ -330,7 +345,9 @@ public class EntityTrackerEntry { + if (!list.isEmpty()) { + consumer.accept(new PacketPlayOutEntityEquipment(this.tracker.getId(), list)); + } ++ this.b.chunkProvider.playerChunkMap.trackerEnsureMain(() -> { // Airplane + ((EntityLiving) this.tracker).updateEquipment(); // CraftBukkit - SPIGOT-3789: sync again immediately after sending ++ }); // Airplane + } + + // CraftBukkit start - Fix for nonsensical head yaw +@@ -408,6 +425,10 @@ public class EntityTrackerEntry { + // Paper end + + private void broadcastIncludingSelf(Packet packet) { ++ if (!gg.airplane.AirplaneConfig.entityTrackerAsyncPackets && !org.bukkit.Bukkit.isPrimaryThread()) { ++ this.b.chunkProvider.playerChunkMap.trackerEnsureMain(() -> broadcastIncludingSelf(packet)); ++ return; ++ } + this.f.accept(packet); + if (this.tracker instanceof EntityPlayer) { + ((EntityPlayer) this.tracker).playerConnection.sendPacket(packet); +diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java +index 93b5a6471cde31739d2bd5f2a9fc0e0d974d0eb0..4410939423a75357cc2d16bc4a3b96a504942320 100644 +--- a/src/main/java/net/minecraft/server/EntityTypes.java ++++ b/src/main/java/net/minecraft/server/EntityTypes.java +@@ -139,6 +139,8 @@ public class EntityTypes { + private MinecraftKey bq; + private final EntitySize br; + ++ public java.util.function.Supplier getEntityName = () -> IRegistry.ENTITY_TYPE.getKey(this).toString(); // Airplane - create lambda ones ++ + private static EntityTypes a(String s, EntityTypes.Builder entitytypes_builder) { // CraftBukkit - decompile error + return (EntityTypes) IRegistry.a((IRegistry) IRegistry.ENTITY_TYPE, s, (Object) entitytypes_builder.a(s)); + } +diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java +index bf9732058c7e55e8f1ed38b3b5e8831e6b21706c..98b26a2f537594facb4ef32f9e3b6a81e41d6545 100644 +--- a/src/main/java/net/minecraft/server/EntityVillager.java ++++ b/src/main/java/net/minecraft/server/EntityVillager.java +@@ -160,11 +160,17 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation + } + // Spigot End + ++ private int behaviorTick = 0; ++ + @Override + protected void mobTick() { mobTick(false); } + protected void mobTick(boolean inactive) { + this.world.getMethodProfiler().enter("villagerBrain"); +- if (!inactive) this.getBehaviorController().a((WorldServer) this.world, this); // CraftBukkit - decompile error // Paper ++ if (!inactive) { ++ if (!gg.airplane.AirplaneConfig.dynamicVillagerBehavior || behaviorTick++ % this.activatedPriority == 0) { ++ this.getBehaviorController().a((WorldServer) this.world, this); // CraftBukkit - decompile error // Paper ++ } ++ } + this.world.getMethodProfiler().exit(); + if (this.bF) { + this.bF = false; +diff --git a/src/main/java/net/minecraft/server/IBlockAccess.java b/src/main/java/net/minecraft/server/IBlockAccess.java +index 5ccf6b483fe15d4ad12ce2d3d11e9440ee9e8ab7..ec82d91804eeed49a6ef67a92fd24a06ae7ee3fb 100644 +--- a/src/main/java/net/minecraft/server/IBlockAccess.java ++++ b/src/main/java/net/minecraft/server/IBlockAccess.java +@@ -44,6 +44,15 @@ public interface IBlockAccess { + return BlockPosition.a(axisalignedbb).map(this::getType); + } + ++ // Airplane start - broken down variant of below rayTraceBlock, used by World#rayTraceDirect ++ default MovingObjectPosition.EnumMovingObjectType rayTraceBlockDirect(Vec3D vec3d, Vec3D vec3d1, BlockPosition blockposition, IBlockData iblockdata, VoxelShapeCollision voxelshapecoll) { ++ VoxelShape voxelshape = RayTrace.BlockCollisionOption.COLLIDER.get(iblockdata, this, blockposition, voxelshapecoll); ++ MovingObjectPositionBlock movingobjectpositionblock = this.rayTrace(vec3d, vec3d1, blockposition, voxelshape, iblockdata); ++ ++ return movingobjectpositionblock == null ? null : movingobjectpositionblock.getType(); ++ } ++ // Airplane end ++ + // CraftBukkit start - moved block handling into separate method for use by Block#rayTrace + default MovingObjectPositionBlock rayTraceBlock(RayTrace raytrace1, BlockPosition blockposition) { + // Paper start - Prevent raytrace from loading chunks +diff --git a/src/main/java/net/minecraft/server/LootTableInfo.java b/src/main/java/net/minecraft/server/LootTableInfo.java +index addeb268d4d487e18ddaadebf96f078fd079246f..25b6e240cf135da0643250b3f498a077dae070da 100644 +--- a/src/main/java/net/minecraft/server/LootTableInfo.java ++++ b/src/main/java/net/minecraft/server/LootTableInfo.java +@@ -34,8 +34,8 @@ public class LootTableInfo { + this.world = worldserver; + this.d = function; + this.f = function1; +- this.h = ImmutableMap.copyOf(map); +- this.i = ImmutableMap.copyOf(map1); ++ this.h = java.util.Collections.unmodifiableMap(map); // Airplane ++ this.i = java.util.Collections.unmodifiableMap(map1); // Airplane + } + + public boolean hasContextParameter(LootContextParameter lootcontextparameter) { +@@ -53,7 +53,7 @@ public class LootTableInfo { + + @Nullable + public T getContextParameter(LootContextParameter lootcontextparameter) { +- return this.h.get(lootcontextparameter); ++ return (T) this.h.get(lootcontextparameter); // Airplane - compile error + } + + public boolean a(LootTable loottable) { +@@ -207,7 +207,7 @@ public class LootTableInfo { + } + + public T a(LootContextParameter lootcontextparameter) { +- T t0 = this.b.get(lootcontextparameter); ++ T t0 = (T) this.b.get(lootcontextparameter); // Airplane - compile error + + if (t0 == null) { + throw new IllegalArgumentException("No parameter " + lootcontextparameter); +@@ -218,7 +218,7 @@ public class LootTableInfo { + + @Nullable + public T b(LootContextParameter lootcontextparameter) { +- return this.b.get(lootcontextparameter); ++ return (T) this.b.get(lootcontextparameter); // Airplane - compile error + } + + public LootTableInfo build(LootContextParameterSet lootcontextparameterset) { +diff --git a/src/main/java/net/minecraft/server/MathHelper.java b/src/main/java/net/minecraft/server/MathHelper.java +index 2e7721a650c5a351b3584665bd236f92ef577761..b3c2b461b2a654a9e37a57f2f62b3ba8b5bb1634 100644 +--- a/src/main/java/net/minecraft/server/MathHelper.java ++++ b/src/main/java/net/minecraft/server/MathHelper.java +@@ -238,6 +238,7 @@ public class MathHelper { + return f - (float) d(f); + } + ++ public static double getDecimals(double num) { return h(num); } // Airplane + public static double h(double d0) { + return d0 - (double) d(d0); + } +@@ -416,6 +417,7 @@ public class MathHelper { + return f1 + f * (f2 - f1); + } + ++ public static double linearInterpolation(double value1, double value2, double amount) { return d(value1, value2, amount); } // Airplane - OBFHELPER + public static double d(double d0, double d1, double d2) { + return d1 + d0 * (d2 - d1); + } +@@ -432,6 +434,7 @@ public class MathHelper { + return d0 * d0 * d0 * (d0 * (d0 * 6.0D - 15.0D) + 10.0D); + } + ++ public static int sign(double num) { return k(num); } // Airplane - OBFHELPER + public static int k(double d0) { + return d0 == 0.0D ? 0 : (d0 > 0.0D ? 1 : -1); + } +diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java +index 7ac34a8959a797bf2af96f3f402fa65cffe3d666..965f186f4efd808cc92b4570e7426ffb25650e29 100644 +--- a/src/main/java/net/minecraft/server/MinecraftServer.java ++++ b/src/main/java/net/minecraft/server/MinecraftServer.java +@@ -1520,7 +1520,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant // Spigot - Spigot > // CraftBukkit - cb > vanilla! ++ return "Airplane"; // Airplane // Tuinity //Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla! + } + + public CrashReport b(CrashReport crashreport) { +diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java +index b92ca4a6de01f3f86367fb8dfe3591b08a3e9218..87172af0b007f93bbb0474bc8f3789ed396258f8 100644 +--- a/src/main/java/net/minecraft/server/NavigationAbstract.java ++++ b/src/main/java/net/minecraft/server/NavigationAbstract.java +@@ -411,6 +411,7 @@ public abstract class NavigationAbstract { + } + } + ++ public boolean isStuck() { return this.t(); } // Airplane - OBFHELPER + public boolean t() { + return this.t; + } +diff --git a/src/main/java/net/minecraft/server/PathfinderGoalSelector.java b/src/main/java/net/minecraft/server/PathfinderGoalSelector.java +index 9cad895c7d008487ce885cbcc2c3966645df4c19..2ce5e07f4dcd0c76073840c35be66b7c65c6e7e8 100644 +--- a/src/main/java/net/minecraft/server/PathfinderGoalSelector.java ++++ b/src/main/java/net/minecraft/server/PathfinderGoalSelector.java +@@ -43,9 +43,14 @@ public class PathfinderGoalSelector { + } + + // Paper start +- public boolean inactiveTick() { +- incRate(); +- return getCurRate() % getTickRate() == 0; ++ public boolean inactiveTick(int tickRate) { // Airplane - take tick rate ++ tickRate = Math.max(tickRate, getTickRate()); // Airplane ++ if (this.curRate++ % tickRate != 0) { // Airplane - use tick rate / increment curRate every tick ++ //incRate(); ++ return false; ++ } else { ++ return true; ++ } + } + public boolean hasTasks() { + for (PathfinderGoalWrapped task : getTasks()) { +diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java +index 285e976d4a655fb61e70883ae89f974812be7152..d7a17689ce44ccb8281906fb6ac7ba2ae53161e5 100644 +--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java ++++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java +@@ -642,7 +642,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + return d2 * d2 + d3 * d3; + } + +- private static int b(ChunkCoordIntPair chunkcoordintpair, EntityPlayer entityplayer, boolean flag) { ++ // Airplane start - create copy that accepts x/z instead of allocating pair ++ private static int b(ChunkCoordIntPair chunkcoordintpair, EntityPlayer entityplayer, boolean flag) { return someDistanceCalculation(chunkcoordintpair.x, chunkcoordintpair.z, entityplayer, flag); } ++ private static int someDistanceCalculation(int x, int z, EntityPlayer entityplayer, boolean flag) { + int i; + int j; + +@@ -656,12 +658,16 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + j = MathHelper.floor(entityplayer.locZ() / 16.0D); + } + +- return a(chunkcoordintpair, i, j); ++ return someOtherDistanceCalculation(x, z, i, j); ++ // Airplane end + } + +- private static int a(ChunkCoordIntPair chunkcoordintpair, int i, int j) { +- int k = chunkcoordintpair.x - i; +- int l = chunkcoordintpair.z - j; ++ // Airplane start - create copy that accepts x/z instead of allocating pair ++ private static int a(ChunkCoordIntPair chunkcoordintpair, int i, int j) { return someOtherDistanceCalculation(chunkcoordintpair.x, chunkcoordintpair.z, i, j); } ++ private static int someOtherDistanceCalculation(int x, int z, int i, int j) { ++ int k = x - i; ++ int l = z - j; ++ // Airplane end + + return Math.max(Math.abs(k), Math.abs(l)); + } +@@ -722,6 +728,11 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + return (PlayerChunk) (this.hasPendingVisibleUpdate ? this.pendingVisibleChunks.get(i) : ((ProtectedVisibleChunksMap)this.visibleChunks).safeGet(i)); + // Paper end + } ++ // Airplane start - since neither map can be updated during tracker tick, it's safe to allow direct retrieval here ++ private PlayerChunk trackerGetVisibleChunk(long i) { ++ return this.hasPendingVisibleUpdate ? this.pendingVisibleChunks.get(i) : ((ProtectedVisibleChunksMap) this.visibleChunks).safeGet(i); ++ } ++ // Airplane end + + protected final IntSupplier getPrioritySupplier(long i) { return c(i); } // Paper - OBFHELPER + protected IntSupplier c(long i) { +@@ -2124,10 +2135,30 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + entity.tracker = null; // Paper - We're no longer tracked + } + ++ // Airplane start - tools to ensure main thread ++ private final java.util.concurrent.ConcurrentLinkedQueue trackerMainQueue = new java.util.concurrent.ConcurrentLinkedQueue<>(); ++ private gg.airplane.structs.TrackQueue trackQueue; ++ ++ void trackerEnsureMain(Runnable runnable) { ++ if (this.world.serverThread == Thread.currentThread()) { ++ runnable.run(); ++ } else { ++ this.trackerMainQueue.add(runnable); ++ } ++ } ++ // Airplane end ++ + // Paper start - optimised tracker + private final void processTrackQueue() { + this.world.timings.tracker1.startTiming(); + try { ++ // Airplane start - multithreaded tracker ++ if (this.trackQueue == null) this.trackQueue = new gg.airplane.structs.TrackQueue(this.world.getChunkProvider().entityTickingChunks, trackerMainQueue); ++ if (gg.airplane.AirplaneConfig.multithreadedEntityTracker) { ++ this.trackQueue.start(); ++ return; ++ } ++ // Airplane end + com.tuinity.tuinity.util.maplist.IteratorSafeOrderedReferenceSet.Iterator iterator = this.world.getChunkProvider().entityTickingChunks.iterator(); + try { + while (iterator.hasNext()) { +@@ -2389,7 +2420,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially + public class EntityTracker { + + final EntityTrackerEntry trackerEntry; // Paper - private -> package private +- private final Entity tracker; ++ protected final Entity tracker; // Airplane - public for chunk + private final int trackingDistance; + private SectionPosition e; + // Paper start +@@ -2408,7 +2439,9 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially + // Paper start - use distance map to optimise tracker + com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet lastTrackerCandidates; + +- final void updatePlayers(com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet newTrackerCandidates) { ++ synchronized final void tickEntry() { this.trackerEntry.tick(); } // Airplane - move entry tick into sync block ++ ++ synchronized final void updatePlayers(com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet newTrackerCandidates) { // Airplane + com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet oldTrackerCandidates = this.lastTrackerCandidates; + this.lastTrackerCandidates = newTrackerCandidates; + +@@ -2449,7 +2482,13 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially + return this.tracker.getId(); + } + +- public void broadcast(Packet packet) { ++ public synchronized void broadcast(Packet packet) { // Airplane - synchronized for tracked player ++ // Airplane start ++ if (!gg.airplane.AirplaneConfig.entityTrackerAsyncPackets && !org.bukkit.Bukkit.isPrimaryThread()) { ++ trackerEnsureMain(() -> broadcast(packet)); ++ return; ++ } ++ // Airplane end + Iterator iterator = this.trackedPlayers.iterator(); + + while (iterator.hasNext()) { +@@ -2461,6 +2500,12 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially + } + + public void broadcastIncludingSelf(Packet packet) { ++ // Airplane start ++ if (!gg.airplane.AirplaneConfig.entityTrackerAsyncPackets && !org.bukkit.Bukkit.isPrimaryThread()) { ++ trackerEnsureMain(() -> broadcastIncludingSelf(packet)); ++ return; ++ } ++ // Airplane end + this.broadcast(packet); + if (this.tracker instanceof EntityPlayer) { + ((EntityPlayer) this.tracker).playerConnection.sendPacket(packet); +@@ -2487,8 +2532,8 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially + + } + +- public void updatePlayer(EntityPlayer entityplayer) { +- org.spigotmc.AsyncCatcher.catchOp("player tracker update"); // Spigot ++ public synchronized void updatePlayer(EntityPlayer entityplayer) { // Airplane - sync for access to map ++ //org.spigotmc.AsyncCatcher.catchOp("player tracker update"); // Spigot // Airplane - allow sync for tracker + if (entityplayer != this.tracker) { + // Paper start - remove allocation of Vec3D here + //Vec3D vec3d = entityplayer.getPositionVector().d(this.tracker.getPositionVector()); // MC-155077, SPIGOT-5113 +@@ -2503,11 +2548,17 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially + boolean flag1 = this.tracker.attachedToPlayer; + + if (!flag1) { ++ // Airplane start - use int/longs instead of ChunkCoordIntPair ++ /* + ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(this.tracker.chunkX, this.tracker.chunkZ); +- PlayerChunk playerchunk = PlayerChunkMap.this.getVisibleChunk(chunkcoordintpair.pair()); ++ */ ++ int x = this.tracker.chunkX, z = this.tracker.chunkZ; ++ long chunkcoordintpair = ChunkCoordIntPair.pair(x, z); ++ PlayerChunk playerchunk = PlayerChunkMap.this.trackerGetVisibleChunk(chunkcoordintpair); // Airplane + + if (playerchunk != null && playerchunk.getSendingChunk() != null) { // Paper - no-tick view distance +- flag1 = PlayerChunkMap.b(chunkcoordintpair, entityplayer, false) <= PlayerChunkMap.this.viewDistance; ++ flag1 = PlayerChunkMap.someDistanceCalculation(x, z, entityplayer, false) <= PlayerChunkMap.this.viewDistance; ++ // Airplane end + } + } + +@@ -2537,8 +2588,10 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially + } + + private int b() { ++ // Airplane start ++ int i = this.trackingDistance; // move out of if statement ++ if (!this.tracker.passengers.isEmpty()) { + Collection collection = this.tracker.getAllPassengers(); +- int i = this.trackingDistance; + Iterator iterator = collection.iterator(); + + while (iterator.hasNext()) { +@@ -2550,6 +2603,8 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially + i = j; + } + } ++ } ++ // Airplane end + + return this.a(i); + } +diff --git a/src/main/java/net/minecraft/server/ShapelessRecipes.java b/src/main/java/net/minecraft/server/ShapelessRecipes.java +index ecd63281912ae0ed93c5eb5ccb4249833cb23ab1..97825ec914709ca037159c46ecee218a6013ff58 100644 +--- a/src/main/java/net/minecraft/server/ShapelessRecipes.java ++++ b/src/main/java/net/minecraft/server/ShapelessRecipes.java +@@ -18,8 +18,16 @@ public class ShapelessRecipes implements RecipeCrafting { + private final String group; + private final ItemStack result; + private final NonNullList ingredients; ++ private final boolean isBukkit; // Airplane + ++ // Airplane start - add isBukkit constructor param + public ShapelessRecipes(MinecraftKey minecraftkey, String s, ItemStack itemstack, NonNullList nonnulllist) { ++ this(minecraftkey, s, itemstack, nonnulllist, false); ++ } ++ ++ public ShapelessRecipes(MinecraftKey minecraftkey, String s, ItemStack itemstack, NonNullList nonnulllist, boolean isBukkit) { ++ this.isBukkit = isBukkit; ++ // Airplane end + this.key = minecraftkey; + this.group = s; + this.result = itemstack; +@@ -61,6 +69,28 @@ public class ShapelessRecipes implements RecipeCrafting { + } + + public boolean a(InventoryCrafting inventorycrafting, World world) { ++ // Airplane start ++ if (!this.isBukkit) { ++ java.util.List ingredients = com.google.common.collect.Lists.newArrayList(this.ingredients.toArray(new RecipeItemStack[0])); ++ ++ inventory: for (int index = 0; index < inventorycrafting.getSize(); index++) { ++ ItemStack itemStack = inventorycrafting.getItem(index); ++ ++ if (!itemStack.isEmpty()) { ++ for (int i = 0; i < ingredients.size(); i++) { ++ if (ingredients.get(i).test(itemStack)) { ++ ingredients.remove(i); ++ continue inventory; ++ } ++ } ++ return false; ++ } ++ } ++ ++ return ingredients.isEmpty(); ++ } ++ // Airplane end ++ + AutoRecipeStackManager autorecipestackmanager = new AutoRecipeStackManager(); + int i = 0; + +diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java +index a77b1d61b9dcb0a2a27d7e50357eaf44c99a661e..3406ffde3c56d9c35ec18a76af8fb258d4131417 100644 +--- a/src/main/java/net/minecraft/server/SpawnerCreature.java ++++ b/src/main/java/net/minecraft/server/SpawnerCreature.java +@@ -372,7 +372,10 @@ public final class SpawnerCreature { + } + + private static List a(WorldServer worldserver, StructureManager structuremanager, ChunkGenerator chunkgenerator, EnumCreatureType enumcreaturetype, BlockPosition blockposition, @Nullable BiomeBase biomebase) { +- return enumcreaturetype == EnumCreatureType.MONSTER && worldserver.getType(blockposition.down()).getBlock() == Blocks.NETHER_BRICKS && structuremanager.a(blockposition, false, StructureGenerator.FORTRESS).e() ? StructureGenerator.FORTRESS.c() : chunkgenerator.getMobsFor(biomebase != null ? biomebase : worldserver.getBiome(blockposition), structuremanager, enumcreaturetype, blockposition); ++ // Airplane start - single chunk lookup ++ Chunk chunk; ++ return enumcreaturetype == EnumCreatureType.MONSTER && (chunk = worldserver.getChunkIfLoaded(blockposition)) != null && chunk.getType(blockposition.down()).getBlock() == Blocks.NETHER_BRICKS && structuremanager.a(blockposition, false, StructureGenerator.FORTRESS).e() ? StructureGenerator.FORTRESS.c() : chunkgenerator.getMobsFor(biomebase != null ? biomebase : worldserver.getBiome(blockposition), structuremanager, enumcreaturetype, blockposition); ++ // Airplane end + } + + private static BlockPosition getRandomPosition(World world, Chunk chunk) { +diff --git a/src/main/java/net/minecraft/server/StructureManager.java b/src/main/java/net/minecraft/server/StructureManager.java +index 2598ae3710d46c2cfd2be5d6be2a56e59ceef6ea..fd1f1e2d7e4be227697f534bdc6d9c52ceeeda4b 100644 +--- a/src/main/java/net/minecraft/server/StructureManager.java ++++ b/src/main/java/net/minecraft/server/StructureManager.java +@@ -5,6 +5,11 @@ import it.unimi.dsi.fastutil.objects.ObjectArrayList; // Paper + import java.util.stream.Stream; + import javax.annotation.Nullable; + ++// Airplane start ++import it.unimi.dsi.fastutil.longs.LongIterator; ++import it.unimi.dsi.fastutil.longs.LongSet; ++// Airplane end ++ + public class StructureManager { + + private final GeneratorAccess a; public GeneratorAccess getLevel() { return a; } // Paper - OBFHELPER +@@ -41,13 +46,15 @@ public class StructureManager { + public java.util.List> getFeatureStarts(SectionPosition sectionPosition, StructureGenerator structureGenerator, IWorldReader world) { + // Tuinity end - add world parameter + java.util.List> list = new ObjectArrayList<>(); +- for (Long curLong: (world == null ? getLevel() : world).getChunkAt(sectionPosition.a(), sectionPosition.c(), ChunkStatus.STRUCTURE_REFERENCES).b(structureGenerator)) { // Tuinity - fix deadlock on world gen - chunk can be unloaded while generating, so we should be using the generator's regionlimitedaccess so we always get the chunk +- SectionPosition sectionPosition1 = SectionPosition.a(new ChunkCoordIntPair(curLong), 0); ++ // Airplane start - skip allocating Longs ++ (world == null ? getLevel() : world).getChunkAt(sectionPosition.a(), sectionPosition.c(), ChunkStatus.STRUCTURE_REFERENCES).b(structureGenerator).forEach((java.util.function.LongConsumer) curLong -> { ++ SectionPosition sectionPosition1 = SectionPosition.a(ChunkCoordIntPair.getX(curLong), 0, ChunkCoordIntPair.getZ(curLong)); // don't allocate ChunkCoordIntPair + StructureStart structurestart = a(sectionPosition1, structureGenerator, getLevel().getChunkAt(sectionPosition1.a(), sectionPosition1.c(), ChunkStatus.STRUCTURE_STARTS)); + if (structurestart != null && structurestart.e()) { + list.add(structurestart); + } +- } ++ }); ++ // Airplane end + return list; + } + // Paper end +@@ -75,7 +82,18 @@ public class StructureManager { + } + public StructureStart getStructureStarts(BlockPosition blockposition, boolean flag, StructureGenerator structuregenerator, IWorldReader world) { + // Paper start - remove structure streams +- for (StructureStart structurestart : getFeatureStarts(SectionPosition.a(blockposition), structuregenerator, world)) { // Tuinity end - add world parameter ++ // Airplane start - inline getFeatureStarts to skip creating the list ++ SectionPosition sectionPosition = SectionPosition.a(blockposition); ++ ++ // use iterator here instead of forEach like in getFeatureStarts so we can return early ++ LongSet longSet = (world == null ? getLevel() : world).getChunkAt(sectionPosition.a(), sectionPosition.c(), ChunkStatus.STRUCTURE_REFERENCES).b(structuregenerator); ++ LongIterator iterator = longSet.iterator(); ++ while (iterator.hasNext()) { ++ long curLong = iterator.nextLong(); ++ SectionPosition sectionPosition1 = SectionPosition.a(ChunkCoordIntPair.getX(curLong), 0, ChunkCoordIntPair.getZ(curLong)); // don't allocate ChunkCoordIntPair ++ StructureStart structurestart = a(sectionPosition1, structuregenerator, getLevel().getChunkAt(sectionPosition1.a(), sectionPosition1.c(), ChunkStatus.STRUCTURE_STARTS)); ++ if (structurestart != null && structurestart.e()) { ++ + if (structurestart.c().b(blockposition)) { + if (!flag) { + return structurestart; +@@ -86,7 +104,10 @@ public class StructureManager { + } + } + } ++ ++ } + } ++ // Airplane end + return StructureStart.a; + // Paper end + } +diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java +index 970c1be5477a01ab9c6d79e84c519e22775564ff..3c968c6133c42c3690fe554d5993d237de82c162 100644 +--- a/src/main/java/net/minecraft/server/World.java ++++ b/src/main/java/net/minecraft/server/World.java +@@ -318,6 +318,91 @@ public abstract class World implements GeneratorAccess, AutoCloseable { + return null; + } + ++ // Airplane start - broken down method of raytracing for EntityLiving#hasLineOfSight, replaces IBlockAccess#rayTrace(RayTrace) ++ protected MovingObjectPosition.EnumMovingObjectType rayTraceDirect(Vec3D vec3d, Vec3D vec3d1, VoxelShapeCollision voxelshapecoll) { ++ // most of this code comes from IBlockAccess#a(RayTrace, BiFunction, Function), but removes the needless functions ++ if (vec3d.equals(vec3d1)) { ++ return MovingObjectPosition.EnumMovingObjectType.MISS; ++ } ++ ++ double endX = MathHelper.linearInterpolation(-1.0E-7D, vec3d1.x, vec3d.x); ++ double endY = MathHelper.linearInterpolation(-1.0E-7D, vec3d1.y, vec3d.y); ++ double endZ = MathHelper.linearInterpolation(-1.0E-7D, vec3d1.z, vec3d.z); ++ ++ double startX = MathHelper.linearInterpolation(-1.0E-7D, vec3d.x, vec3d1.x); ++ double startY = MathHelper.linearInterpolation(-1.0E-7D, vec3d.y, vec3d1.y); ++ double startZ = MathHelper.linearInterpolation(-1.0E-7D, vec3d.z, vec3d1.z); ++ ++ int currentX = MathHelper.floor(startX); ++ int currentY = MathHelper.floor(startY); ++ int currentZ = MathHelper.floor(startZ); ++ ++ BlockPosition.MutableBlockPosition currentBlock = new BlockPosition.MutableBlockPosition(currentX, currentY, currentZ); ++ ++ Chunk chunk = this.getChunkIfLoaded(currentBlock); ++ if (chunk == null) { ++ return MovingObjectPosition.EnumMovingObjectType.MISS; ++ } ++ ++ MovingObjectPosition.EnumMovingObjectType initialCheck = this.rayTraceBlockDirect(vec3d, vec3d1, currentBlock, chunk.getType(currentBlock), voxelshapecoll); ++ ++ if (initialCheck != null) { ++ return initialCheck; ++ } ++ ++ double diffX = endX - startX; ++ double diffY = endY - startY; ++ double diffZ = endZ - startZ; ++ ++ int xDirection = MathHelper.sign(diffX); ++ int yDirection = MathHelper.sign(diffY); ++ int zDirection = MathHelper.sign(diffZ); ++ ++ double normalizedX = xDirection == 0 ? Double.MAX_VALUE : (double) xDirection / diffX; ++ double normalizedY = yDirection == 0 ? Double.MAX_VALUE : (double) yDirection / diffY; ++ double normalizedZ = zDirection == 0 ? Double.MAX_VALUE : (double) zDirection / diffZ; ++ ++ double normalizedXDirection = normalizedX * (xDirection > 0 ? 1.0D - MathHelper.getDecimals(startX) : MathHelper.getDecimals(startX)); ++ double normalizedYDirection = normalizedY * (yDirection > 0 ? 1.0D - MathHelper.getDecimals(startY) : MathHelper.getDecimals(startY)); ++ double normalizedZDirection = normalizedZ * (zDirection > 0 ? 1.0D - MathHelper.getDecimals(startZ) : MathHelper.getDecimals(startZ)); ++ ++ MovingObjectPosition.EnumMovingObjectType result; ++ ++ do { ++ if (normalizedXDirection > 1.0D && normalizedYDirection > 1.0D && normalizedZDirection > 1.0D) { ++ return MovingObjectPosition.EnumMovingObjectType.MISS; ++ } ++ ++ if (normalizedXDirection < normalizedYDirection) { ++ if (normalizedXDirection < normalizedZDirection) { ++ currentX += xDirection; ++ normalizedXDirection += normalizedX; ++ } else { ++ currentZ += zDirection; ++ normalizedZDirection += normalizedZ; ++ } ++ } else if (normalizedYDirection < normalizedZDirection) { ++ currentY += yDirection; ++ normalizedYDirection += normalizedY; ++ } else { ++ currentZ += zDirection; ++ normalizedZDirection += normalizedZ; ++ } ++ ++ currentBlock.setValues(currentX, currentY, currentZ); ++ if (chunk.getPos().x != currentBlock.getX() >> 4 || chunk.getPos().z != currentBlock.getZ() >> 4) { ++ chunk = this.getChunkIfLoaded(currentBlock); ++ if (chunk == null) { ++ return MovingObjectPosition.EnumMovingObjectType.MISS; ++ } ++ } ++ result = this.rayTraceBlockDirect(vec3d, vec3d1, currentBlock, chunk.getType(currentBlock), voxelshapecoll); ++ } while (result == null); ++ ++ return result; ++ } ++ // Airplane end ++ + public static boolean isValidLocation(BlockPosition blockposition) { + return blockposition.isValidLocation(); // Paper - use better/optimized check + } +@@ -956,19 +1041,19 @@ public abstract class World implements GeneratorAccess, AutoCloseable { + + public void a(Consumer consumer, Entity entity) { + try { +- consumer.accept(entity); ++ consumer.accept(entity); // Airplane - error on change + } catch (Throwable throwable) { + if (throwable instanceof ThreadDeath) throw throwable; // Paper + // Paper start - Prevent tile entity and entity crashes + String msg = "Entity threw exception at " + entity.world.getWorld().getName() + ":" + entity.locX() + "," + entity.locY() + "," + entity.locZ(); + System.err.println(msg); + throwable.printStackTrace(); +- getServer().getPluginManager().callEvent(new ServerExceptionEvent(new ServerInternalException(msg, throwable))); ++ getServer().getPluginManager().callEvent(new ServerExceptionEvent(new ServerInternalException(msg, throwable))); // Airplane - error on change + entity.dead = true; + return; + // Paper end + } +- MinecraftServer.getServer().executeMidTickTasks(); // Tuinity - execute chunk tasks mid tick ++ MinecraftServer.getServer().executeMidTickTasks(); // Tuinity - execute chunk tasks mid tick // Airplane - error on change + } + // Paper start - Prevent armor stands from doing entity lookups + @Override +diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java +index 9c77be805eb71c409a5d41c2730338583527e447..0dc8399d419067403e786b604ca52d0752533419 100644 +--- a/src/main/java/net/minecraft/server/WorldServer.java ++++ b/src/main/java/net/minecraft/server/WorldServer.java +@@ -992,7 +992,28 @@ public class WorldServer extends World implements GeneratorAccessSeed { + + gameprofilerfiller.enter("tick"); + if (!entity.dead && !(entity instanceof EntityComplexPart)) { ++ // Airplane start - inline this.a to prevent creation of lambda ++ /* + this.a(this::entityJoinedWorld, entity); ++ */ ++ boolean doMidTick = false; // usually there's a returns in the catch, so treat it like that ++ try { ++ this.entityJoinedWorld(entity); ++ doMidTick = true; ++ } catch (Throwable throwable) { ++ if (throwable instanceof ThreadDeath) throw throwable; // Paper ++ // Paper start - Prevent tile entity and entity crashes ++ String msg = "Entity threw exception at " + entity.world.getWorld().getName() + ":" + entity.locX() + "," + entity.locY() + "," + entity.locZ(); ++ System.err.println(msg); ++ throwable.printStackTrace(); ++ getServer().getPluginManager().callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerInternalException(msg, throwable))); ++ entity.dead = true; ++ // Paper end ++ } ++ if (doMidTick) { ++ MinecraftServer.getServer().executeMidTickTasks(); // Tuinity - execute chunk tasks mid tick ++ } ++ // Airplane end + } + + gameprofilerfiller.exit(); +@@ -1084,6 +1105,8 @@ public class WorldServer extends World implements GeneratorAccessSeed { + private final com.destroystokyo.paper.util.math.ThreadUnsafeRandom randomTickRandom = new com.destroystokyo.paper.util.math.ThreadUnsafeRandom(); + // Paper end + ++ private int currentIceAndSnowTick = 0; protected void resetIceAndSnowTick() { this.currentIceAndSnowTick = this.randomTickRandom.nextInt(16); } // Airplane ++ + public void a(Chunk chunk, int i) { final int randomTickSpeed = i; // Paper + ChunkCoordIntPair chunkcoordintpair = chunk.getPos(); + boolean flag = this.isRaining(); +@@ -1094,7 +1117,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { + gameprofilerfiller.enter("thunder"); + final BlockPosition.MutableBlockPosition blockposition = this.chunkTickMutablePosition; // Paper - use mutable to reduce allocation rate, final to force compile fail on change + +- if (!this.paperConfig.disableThunder && flag && this.W() && this.random.nextInt(100000) == 0) { // Paper - Disable thunder ++ if (!this.paperConfig.disableThunder && flag && chunk.shouldDoLightning(this.random) && this.W()) { // Paper - Disable thunder // Airplane - check this.W last // Airplane - replace random with shouldDoLighting + blockposition.setValues(this.a(this.a(j, 0, k, 15))); // Paper + if (this.isRainingAt(blockposition)) { + DifficultyDamageScaler difficultydamagescaler = this.getDamageScaler(blockposition); +@@ -1118,7 +1141,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { + } + + gameprofilerfiller.exitEnter("iceandsnow"); +- if (!this.paperConfig.disableIceAndSnow && this.randomTickRandom.nextInt(16) == 0) { // Paper - Disable ice and snow // Paper - optimise random ticking ++ if (!this.paperConfig.disableIceAndSnow && (this.currentIceAndSnowTick++ & 15) == 0) { // Paper - Disable ice and snow // Paper - optimise random ticking // Airplane - optimize further random ticking + // Paper start - optimise chunk ticking + this.getRandomBlockPosition(j, 0, k, 15, blockposition); + int normalY = chunk.getHighestBlockY(HeightMap.Type.MOTION_BLOCKING, blockposition.getX() & 15, blockposition.getZ() & 15); +@@ -1328,9 +1351,14 @@ public class WorldServer extends World implements GeneratorAccessSeed { + ++entity.ticksLived; + GameProfilerFiller gameprofilerfiller = this.getMethodProfiler(); + ++ // Airplane start - create debug lambda once, todo do we even WANT the method profiler? ++ /* + gameprofilerfiller.a(() -> { + return IRegistry.ENTITY_TYPE.getKey(entity.getEntityType()).toString(); + }); ++ */ ++ gameprofilerfiller.a(entity.getEntityType().getEntityName); ++ // Airplane end + gameprofilerfiller.c("tickNonPassenger"); + if (isActive) { // Paper - EAR 2 + TimingHistory.activatedEntityTicks++; // Paper +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +index f994e99ebc8fe22e6f6b45f6379ec410a598789f..ec8ad7a51f62c699588b5804331a5d33ab1fa5a7 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +@@ -232,7 +232,7 @@ import javax.annotation.Nullable; // Paper + import javax.annotation.Nonnull; // Paper + + public final class CraftServer implements Server { +- private final String serverName = "Tuinity"; // Paper // Tuinity ++ private final String serverName = "Airplane"; // Paper // Tuinity // Airplane + private final String serverVersion; + private final String bukkitVersion = Versioning.getBukkitVersion(); + private final Logger logger = Logger.getLogger("Minecraft"); +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapelessRecipe.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapelessRecipe.java +index 4aba511fe8078164bf1467b39645dd9bf6a931e7..56b781e438f0cf1c12dd55eb37356601e47de47f 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapelessRecipe.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftShapelessRecipe.java +@@ -44,6 +44,6 @@ public class CraftShapelessRecipe extends ShapelessRecipe implements CraftRecipe + data.set(i, toNMS(ingred.get(i), true)); + } + +- MinecraftServer.getServer().getCraftingManager().addRecipe(new ShapelessRecipes(CraftNamespacedKey.toMinecraft(this.getKey()), this.getGroup(), CraftItemStack.asNMSCopy(this.getResult()), data)); ++ MinecraftServer.getServer().getCraftingManager().addRecipe(new ShapelessRecipes(CraftNamespacedKey.toMinecraft(this.getKey()), this.getGroup(), CraftItemStack.asNMSCopy(this.getResult()), data, true)); // Airplane + } + } +diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/MinecraftInternalPlugin.java b/src/main/java/org/bukkit/craftbukkit/scheduler/MinecraftInternalPlugin.java +index 49dc0c441b9dd7e7745cf15ced67f383ebee1f99..b343d8ee7435312929558efdaf127334d8e2fff6 100644 +--- a/src/main/java/org/bukkit/craftbukkit/scheduler/MinecraftInternalPlugin.java ++++ b/src/main/java/org/bukkit/craftbukkit/scheduler/MinecraftInternalPlugin.java +@@ -19,7 +19,8 @@ public class MinecraftInternalPlugin extends PluginBase { + private boolean enabled = true; + + private final String pluginName; +- private PluginDescriptionFile pdf; ++ private org.bukkit.plugin.PluginLogger logger; ++ private PluginDescriptionFile pdf; // Airplane + + public MinecraftInternalPlugin() { + this.pluginName = "Minecraft"; +@@ -72,7 +73,12 @@ public class MinecraftInternalPlugin extends PluginBase { + + @Override + public PluginLogger getLogger() { +- throw new UnsupportedOperationException("Not supported."); ++ // Airplane start ++ if (this.logger == null) { ++ this.logger = new org.bukkit.plugin.PluginLogger(this); // Airplane ++ } ++ return this.logger; ++ // Airplane end + } + + @Override +@@ -82,7 +88,7 @@ public class MinecraftInternalPlugin extends PluginBase { + + @Override + public Server getServer() { +- throw new UnsupportedOperationException("Not supported."); ++ return org.bukkit.Bukkit.getServer(); // Airplane - impl + } + + @Override +diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java +index 001b1e5197eaa51bfff9031aa6c69876c9a47960..1788d79ea489e446d3d9f541693d4ba3dfc26015 100644 +--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java ++++ b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java +@@ -11,7 +11,7 @@ public final class Versioning { + public static String getBukkitVersion() { + String result = "Unknown-Version"; + +- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/com.tuinity/tuinity-api/pom.properties"); // Tuinity ++ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/gg.airplane/airplane-api/pom.properties"); // Tuinity // Airplane + Properties properties = new Properties(); + + if (stream != null) { +diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java +index 18295dceeacefd2586f3e3fe8bd58790740ba14d..b72f55c4b34ec7a91cdfdfa1c7efe4225bb2d791 100644 +--- a/src/main/java/org/spigotmc/ActivationRange.java ++++ b/src/main/java/org/spigotmc/ActivationRange.java +@@ -49,6 +49,9 @@ import net.minecraft.server.EntityInsentient; + import net.minecraft.server.EntityLlama; + import net.minecraft.server.EntityWaterAnimal; + // Paper end ++// Airplane start ++import net.minecraft.server.Vec3D; ++// Airplane end + + public class ActivationRange + { +@@ -229,7 +232,7 @@ public class ActivationRange + Chunk chunk = chunkProvider.getChunkAtIfLoadedMainThreadNoCache( i1, j1 ); // Paper + if ( chunk != null ) + { +- activateChunkEntities( chunk ); ++ activateChunkEntities( chunk, player.getPositionVector() ); // Airplane + } + } + } +@@ -242,7 +245,7 @@ public class ActivationRange + * + * @param chunk + */ +- private static void activateChunkEntities(Chunk chunk) ++ private static void activateChunkEntities(Chunk chunk, Vec3D playerVec) // Airplane - add player location + { + // Paper start + Entity[] rawData = chunk.entities.getRawData(); +@@ -251,11 +254,19 @@ public class ActivationRange + //for ( Entity entity : (Collection) slice ) + // Paper end + { ++ // Airplane start ++ Vec3D entityVec = entity.getPositionVector(); ++ double diffX = playerVec.x - entityVec.x, diffY = playerVec.y - entityVec.y, diffZ = playerVec.z - entityVec.z; ++ int priority = Math.max(1, (int) (diffX * diffX + diffY * diffY + diffZ * diffZ) >> gg.airplane.AirplaneConfig.activationDistanceMod); + if (MinecraftServer.currentTick > entity.activatedTick) { + if (entity.defaultActivationState || entity.activationType.boundingBox.c(entity.getBoundingBox())) { // Paper + entity.activatedTick = MinecraftServer.currentTick; + } ++ entity.activatedPriority = Math.min(gg.airplane.AirplaneConfig.maximumActivationPrio, priority); ++ } else { ++ entity.activatedPriority = Math.min(gg.airplane.AirplaneConfig.maximumActivationPrio, Math.min(priority, entity.activatedPriority)); + } ++ // Airplane end + } + } + } diff --git a/patches/server/0002-Rebrand.patch b/patches/server/0003-Rebrand.patch similarity index 91% rename from patches/server/0002-Rebrand.patch rename to patches/server/0003-Rebrand.patch index ed2eaebc9..0f0b42843 100644 --- a/patches/server/0002-Rebrand.patch +++ b/patches/server/0003-Rebrand.patch @@ -5,15 +5,15 @@ Subject: [PATCH] Rebrand diff --git a/pom.xml b/pom.xml -index e83e4241a56fe131a75fe21cc1518992c089da2c..752d62eb3b87ab24260ec2c029bae0d2b0e3b908 100644 +index fa4ff553ae58285201d773a538eeda2b40c89c4a..02bbe784d0a062dd643e37f3ad04b77a78144828 100644 --- a/pom.xml +++ b/pom.xml @@ -27,8 +27,10 @@ -- com.tuinity -- tuinity-api +- gg.airplane +- airplane-api + + net.pl3x.purpur + purpur-api @@ -48,15 +48,15 @@ index 229c3b0f0c650b501f31147adaa17194af57fedd..f88cf526d272fe47b5a474c0b344b748 throwable = throwable1; throw throwable1; diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 7ac34a8959a797bf2af96f3f402fa65cffe3d666..80b7ef7c02c8f99b81a6c33d6d969690b933eb36 100644 +index 965f186f4efd808cc92b4570e7426ffb25650e29..2f2b8a0412195f4060b97ef23449102a18411c74 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -1520,7 +1520,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant // Spigot - Spigot > // CraftBukkit - cb > vanilla! -+ return "Purpur"; // Purpur // Tuinity // Paper // Spigot // CraftBukkit +- return "Airplane"; // Airplane // Tuinity //Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla! ++ return "Purpur"; // Purpur // Airplane // Tuinity // Paper // Spigot // CraftBukkit } public CrashReport b(CrashReport crashreport) { @@ -186,15 +186,15 @@ index 0000000000000000000000000000000000000000..cabfcebf9f944f7a2a2a1cffc7401435 + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index f994e99ebc8fe22e6f6b45f6379ec410a598789f..eeae4862898f093ca4b9819d0d08fdaf219213a0 100644 +index ec8ad7a51f62c699588b5804331a5d33ab1fa5a7..a3cea65ab086fac48c68578c6be70b0f0c5e70a1 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -232,7 +232,7 @@ import javax.annotation.Nullable; // Paper import javax.annotation.Nonnull; // Paper public final class CraftServer implements Server { -- private final String serverName = "Tuinity"; // Paper // Tuinity -+ private final String serverName = "Purpur"; // Paper // Tuinity // Purpur +- private final String serverName = "Airplane"; // Paper // Tuinity // Airplane ++ private final String serverName = "Purpur"; // Paper // Tuinity // Airplane // Purpur private final String serverVersion; private final String bukkitVersion = Versioning.getBukkitVersion(); private final Logger logger = Logger.getLogger("Minecraft"); @@ -212,15 +212,15 @@ index 00e53d577b1dcaccb409e62d35165ee015de9330..7de7afae711800154735411947ff140c @Override diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java -index 001b1e5197eaa51bfff9031aa6c69876c9a47960..13b98439320ac1401a920c01d7cf5a4b3a23deff 100644 +index 1788d79ea489e446d3d9f541693d4ba3dfc26015..191f5331f0c7871f80f0da9cc38345ce33353577 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java @@ -11,7 +11,7 @@ public final class Versioning { public static String getBukkitVersion() { String result = "Unknown-Version"; -- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/com.tuinity/tuinity-api/pom.properties"); // Tuinity -+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/net.pl3x.purpur/purpur-api/pom.properties"); // Tuinity // Purpur +- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/gg.airplane/airplane-api/pom.properties"); // Tuinity // Airplane ++ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/net.pl3x.purpur/purpur-api/pom.properties"); // Tuinity // Airplane // Purpur Properties properties = new Properties(); if (stream != null) { diff --git a/patches/server/0003-Purpur-config-files.patch b/patches/server/0004-Purpur-config-files.patch similarity index 91% rename from patches/server/0003-Purpur-config-files.patch rename to patches/server/0004-Purpur-config-files.patch index 2ffb711e8..ab57ba4de 100644 --- a/patches/server/0003-Purpur-config-files.patch +++ b/patches/server/0004-Purpur-config-files.patch @@ -5,14 +5,14 @@ Subject: [PATCH] Purpur config files diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java -index 52c0ab1ce46e1f3233ef746d9bc699356fa9fae4..4d8740678049aa749b42618470e9cc838555528d 100644 +index b480bd3044370b8eb733166f0c4b737344475993..4d8740678049aa749b42618470e9cc838555528d 100644 --- a/src/main/java/com/destroystokyo/paper/Metrics.java +++ b/src/main/java/com/destroystokyo/paper/Metrics.java @@ -593,7 +593,7 @@ public class Metrics { boolean logFailedRequests = config.getBoolean("logFailedRequests", false); // Only start Metrics, if it's enabled in the config if (config.getBoolean("enabled", true)) { -- Metrics metrics = new Metrics("Tuinity", serverUUID, logFailedRequests, Bukkit.getLogger()); // Tuinity - we have our own bstats page +- Metrics metrics = new Metrics("Airplane", serverUUID, logFailedRequests, Bukkit.getLogger()); // Tuinity - we have our own bstats page // Airplane + Metrics metrics = new Metrics("Purpur", serverUUID, logFailedRequests, Bukkit.getLogger()); // Purpur metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> { @@ -22,14 +22,14 @@ index 52c0ab1ce46e1f3233ef746d9bc699356fa9fae4..4d8740678049aa749b42618470e9cc83 metrics.addCustomChart(new Metrics.SingleLineChart("players", () -> Bukkit.getOnlinePlayers().size())); - metrics.addCustomChart(new Metrics.SimplePie("online_mode", () -> Bukkit.getOnlineMode() || PaperConfig.isProxyOnlineMode() ? "online" : "offline")); -- metrics.addCustomChart(new Metrics.SimplePie("tuinity_version", () -> (Metrics.class.getPackage().getImplementationVersion() != null) ? Metrics.class.getPackage().getImplementationVersion() : "unknown")); // Tuinity - we have our own bstats page +- metrics.addCustomChart(new Metrics.SimplePie("airplane_version", () -> (Metrics.class.getPackage().getImplementationVersion() != null) ? Metrics.class.getPackage().getImplementationVersion() : "unknown")); // Tuinity - we have our own bstats page // Airplane + metrics.addCustomChart(new Metrics.SimplePie("online_mode", () -> Bukkit.getOnlineMode() ? "online" : (PaperConfig.isProxyOnlineMode() ? "bungee" : "offline"))); // Purpur + metrics.addCustomChart(new Metrics.SimplePie("purpur_version", () -> (Metrics.class.getPackage().getImplementationVersion() != null) ? Metrics.class.getPackage().getImplementationVersion() : "unknown")); // Purpur metrics.addCustomChart(new Metrics.DrilldownPie("java_version", () -> { Map> map = new HashMap<>(); diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index c56e7fb18f9a56c8025eb70a524f028b5942da37..4b9fdb4f04b333ce32f7fca8f279bf989e6fd728 100644 +index f39452535b2807a226ada095f5c21b19ea238e5c..ad7df9e8a2cfc6fe65b193adfb65c7b32d6c92b3 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -118,6 +118,11 @@ public class PaperConfig { @@ -45,7 +45,7 @@ index c56e7fb18f9a56c8025eb70a524f028b5942da37..4b9fdb4f04b333ce32f7fca8f279bf98 config.save(CONFIG_FILE); } catch (IOException ex) { diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 2644b190813cc934914aeab78fbd6515d1a37c4a..e3721b53db68171665ba05201155d088ae3cb89f 100644 +index 2ee781604868a508d81585a68da811ea366a21b2..a85a844a4766cde16eea9e814abfec29d8935c0f 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -173,6 +173,15 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer @@ -64,21 +64,8 @@ index 2644b190813cc934914aeab78fbd6515d1a37c4a..e3721b53db68171665ba05201155d088 com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // load version history now // Paper end com.tuinity.tuinity.config.TuinityConfig.init((java.io.File) options.valueOf("tuinity-settings")); // Tuinity - Server Config -diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index bf9732058c7e55e8f1ed38b3b5e8831e6b21706c..90154d2180ebb6a54536884bf89187ca17d11da5 100644 ---- a/src/main/java/net/minecraft/server/EntityVillager.java -+++ b/src/main/java/net/minecraft/server/EntityVillager.java -@@ -164,7 +164,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation - protected void mobTick() { mobTick(false); } - protected void mobTick(boolean inactive) { - this.world.getMethodProfiler().enter("villagerBrain"); -- if (!inactive) this.getBehaviorController().a((WorldServer) this.world, this); // CraftBukkit - decompile error // Paper -+ if (!inactive) this.getBehaviorController().Wa((WorldServer) this.world, this); // CraftBukkit - decompile error // Paper - this.world.getMethodProfiler().exit(); - if (this.bF) { - this.bF = false; diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 970c1be5477a01ab9c6d79e84c519e22775564ff..ee1d5e2dc9fb21190a73e0f333e962a19264dd56 100644 +index 3c968c6133c42c3690fe554d5993d237de82c162..50548761bc94b06af7aaf9b2f91da54eb070df01 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -95,6 +95,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { @@ -373,7 +360,7 @@ index 0000000000000000000000000000000000000000..4904be939c7a4b1d1583fd7b6232c930 + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index eeae4862898f093ca4b9819d0d08fdaf219213a0..a64d375e16f033b875ca80e6678c3a3e198d0220 100644 +index a3cea65ab086fac48c68578c6be70b0f0c5e70a1..a4669fe6e21c38c10979f0e25b41e296e6c08738 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -865,6 +865,7 @@ public final class CraftServer implements Server { diff --git a/patches/server/0004-Timings-stuff.patch b/patches/server/0005-Timings-stuff.patch similarity index 100% rename from patches/server/0004-Timings-stuff.patch rename to patches/server/0005-Timings-stuff.patch diff --git a/patches/server/0005-Barrels-and-enderchests-6-rows.patch b/patches/server/0006-Barrels-and-enderchests-6-rows.patch similarity index 100% rename from patches/server/0005-Barrels-and-enderchests-6-rows.patch rename to patches/server/0006-Barrels-and-enderchests-6-rows.patch diff --git a/patches/server/0006-Advancement-API.patch b/patches/server/0007-Advancement-API.patch similarity index 100% rename from patches/server/0006-Advancement-API.patch rename to patches/server/0007-Advancement-API.patch diff --git a/patches/server/0007-Llama-API.patch b/patches/server/0008-Llama-API.patch similarity index 100% rename from patches/server/0007-Llama-API.patch rename to patches/server/0008-Llama-API.patch diff --git a/patches/server/0008-AFK-API.patch b/patches/server/0009-AFK-API.patch similarity index 97% rename from patches/server/0008-AFK-API.patch rename to patches/server/0009-AFK-API.patch index 296c39313..e4aaf8caa 100644 --- a/patches/server/0008-AFK-API.patch +++ b/patches/server/0009-AFK-API.patch @@ -25,7 +25,7 @@ index f034977f4666385d6e7c7288e453d058c270be01..390aae2733e397ac5c6c457c76bf75f9 super(EntityTypes.PLAYER, world); this.bL = ItemStack.b; diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index f40c24b6e2f7bea21d1cb2b58ed3da45ffcfc866..a4964dab01999f9fd63ba12d56892299b95ad4db 100644 +index 9851b7cf8f60be12cfba9787eabe210661344414..90024417dcb66716590de523dcbfb5034cf0ac20 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -1940,8 +1940,54 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -193,7 +193,7 @@ index 9146b60cff0aa06e2f6b6003bfe9e2be9d2f0d56..bba8dc8fd10dc34179ca3c8cf471fbb3 if (from.getX() != Double.MAX_VALUE) { Location oldTo = to.clone(); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 9c77be805eb71c409a5d41c2730338583527e447..d8e39d29a792bf8a65884f18743befe29a86791e 100644 +index 0dc8399d419067403e786b604ca52d0752533419..c8b20f6789d8f2403a00a8c2d3b0869f0ba8718d 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -887,7 +887,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { @@ -205,7 +205,7 @@ index 9c77be805eb71c409a5d41c2730338583527e447..d8e39d29a792bf8a65884f18743befe2 })) { // CraftBukkit start long l = this.worldData.getDayTime() + 24000L; -@@ -1224,7 +1224,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1247,7 +1247,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { while (iterator.hasNext()) { EntityPlayer entityplayer = (EntityPlayer) iterator.next(); @@ -289,10 +289,10 @@ index f965b071cd2f6a70a216679e4f19956115edee4f..8e69ad39102b8a91e664b31a7f07c521 + // Purpur end } diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index 18295dceeacefd2586f3e3fe8bd58790740ba14d..f2e978107ef1163ceadb3ea7594eba6e900a8a28 100644 +index b72f55c4b34ec7a91cdfdfa1c7efe4225bb2d791..c8ef3856d398fc7a966385c04cadeb1e8e8504f7 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java -@@ -206,6 +206,7 @@ public class ActivationRange +@@ -209,6 +209,7 @@ public class ActivationRange { player.activatedTick = MinecraftServer.currentTick; diff --git a/patches/server/0009-Bring-back-server-name.patch b/patches/server/0010-Bring-back-server-name.patch similarity index 94% rename from patches/server/0009-Bring-back-server-name.patch rename to patches/server/0010-Bring-back-server-name.patch index a78c486d6..5f6598e1c 100644 --- a/patches/server/0009-Bring-back-server-name.patch +++ b/patches/server/0010-Bring-back-server-name.patch @@ -17,7 +17,7 @@ index 15a4f921b1ae2bbc66b7d58238b60151123a7eb3..fe5937d890762ab37a90f189c4992af3 public final boolean spawnNpcs = this.getBoolean("spawn-npcs", true); public final boolean pvp = this.getBoolean("pvp", true); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index a64d375e16f033b875ca80e6678c3a3e198d0220..011d0152ca629ea2e0986338e5f55c5d484cc36e 100644 +index a4669fe6e21c38c10979f0e25b41e296e6c08738..a33f22fb3ae807dc0c4cde537a2ca6c8250419a8 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -2520,4 +2520,11 @@ public final class CraftServer implements Server { diff --git a/patches/server/0010-Configurable-server-mod-name.patch b/patches/server/0011-Configurable-server-mod-name.patch similarity index 86% rename from patches/server/0010-Configurable-server-mod-name.patch rename to patches/server/0011-Configurable-server-mod-name.patch index f70753e07..abe4179a7 100644 --- a/patches/server/0010-Configurable-server-mod-name.patch +++ b/patches/server/0011-Configurable-server-mod-name.patch @@ -5,15 +5,15 @@ Subject: [PATCH] Configurable server mod name diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 80b7ef7c02c8f99b81a6c33d6d969690b933eb36..5d64157b394b49d638e0295438f235c9492e1128 100644 +index 2f2b8a0412195f4060b97ef23449102a18411c74..fc88aa4982711a7fcd027cd684443b2c1a2829b7 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -1520,7 +1520,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant { +@@ -145,6 +145,16 @@ public class EntityTypes { return (EntityTypes) IRegistry.a((IRegistry) IRegistry.ENTITY_TYPE, s, (Object) entitytypes_builder.a(s)); } @@ -25,7 +25,7 @@ index 93b5a6471cde31739d2bd5f2a9fc0e0d974d0eb0..36f572990a0c08f21df6f4dc40c5878b public static MinecraftKey getName(EntityTypes entitytypes) { return IRegistry.ENTITY_TYPE.getKey(entitytypes); } -@@ -301,6 +311,16 @@ public class EntityTypes { +@@ -303,6 +313,16 @@ public class EntityTypes { return this.bg; } @@ -42,7 +42,7 @@ index 93b5a6471cde31739d2bd5f2a9fc0e0d974d0eb0..36f572990a0c08f21df6f4dc40c5878b public String getDescriptionId() { return f(); } // Paper - OBFHELPER public String f() { if (this.bo == null) { -@@ -310,6 +330,7 @@ public class EntityTypes { +@@ -312,6 +332,7 @@ public class EntityTypes { return this.bo; } diff --git a/patches/server/0015-EMC-MonsterEggSpawnEvent.patch b/patches/server/0016-EMC-MonsterEggSpawnEvent.patch similarity index 94% rename from patches/server/0015-EMC-MonsterEggSpawnEvent.patch rename to patches/server/0016-EMC-MonsterEggSpawnEvent.patch index 70f375649..19d322c9d 100644 --- a/patches/server/0015-EMC-MonsterEggSpawnEvent.patch +++ b/patches/server/0016-EMC-MonsterEggSpawnEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] EMC - MonsterEggSpawnEvent diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java -index 36f572990a0c08f21df6f4dc40c5878b669ca00c..9024af41ef5828e1c7c746498a033435e1bddc28 100644 +index 9575d5a8a9cf0beddc6d10da86a089b5425f2320..eea7cf2121f447e0eb172224ae6a7d5c8fa4b10b 100644 --- a/src/main/java/net/minecraft/server/EntityTypes.java +++ b/src/main/java/net/minecraft/server/EntityTypes.java -@@ -187,13 +187,20 @@ public class EntityTypes { +@@ -189,13 +189,20 @@ public class EntityTypes { @Nullable public Entity spawnCreature(WorldServer worldserver, @Nullable ItemStack itemstack, @Nullable EntityHuman entityhuman, BlockPosition blockposition, EnumMobSpawn enummobspawn, boolean flag, boolean flag1) { @@ -31,7 +31,7 @@ index 36f572990a0c08f21df6f4dc40c5878b669ca00c..9024af41ef5828e1c7c746498a033435 } @Nullable -@@ -212,8 +219,28 @@ public class EntityTypes { +@@ -214,8 +221,28 @@ public class EntityTypes { } } // Paper end diff --git a/patches/server/0016-Player-invulnerabilities.patch b/patches/server/0017-Player-invulnerabilities.patch similarity index 98% rename from patches/server/0016-Player-invulnerabilities.patch rename to patches/server/0017-Player-invulnerabilities.patch index 2d9c2c187..2aec1316f 100644 --- a/patches/server/0016-Player-invulnerabilities.patch +++ b/patches/server/0017-Player-invulnerabilities.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Player invulnerabilities diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index a4964dab01999f9fd63ba12d56892299b95ad4db..20aaf52d500d208857f87b1a99e77489607018b2 100644 +index 90024417dcb66716590de523dcbfb5034cf0ac20..876c728a460860ee1881c2cce2220157bd66a4e5 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -154,6 +154,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting { diff --git a/patches/server/0017-Anvil-API.patch b/patches/server/0018-Anvil-API.patch similarity index 100% rename from patches/server/0017-Anvil-API.patch rename to patches/server/0018-Anvil-API.patch diff --git a/patches/server/0018-Configurable-villager-brain-ticks.patch b/patches/server/0019-Configurable-villager-brain-ticks.patch similarity index 84% rename from patches/server/0018-Configurable-villager-brain-ticks.patch rename to patches/server/0019-Configurable-villager-brain-ticks.patch index 4babe548e..1313ce40e 100644 --- a/patches/server/0018-Configurable-villager-brain-ticks.patch +++ b/patches/server/0019-Configurable-villager-brain-ticks.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Configurable villager brain ticks diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index 90154d2180ebb6a54536884bf89187ca17d11da5..1c87bc91515490e2f8579a5321058845c7d30a56 100644 +index 98b26a2f537594facb4ef32f9e3b6a81e41d6545..4491b2199acd4ba9706d82c7e69d80fbc6083344 100644 --- a/src/main/java/net/minecraft/server/EntityVillager.java +++ b/src/main/java/net/minecraft/server/EntityVillager.java @@ -56,6 +56,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation @@ -24,19 +24,17 @@ index 90154d2180ebb6a54536884bf89187ca17d11da5..1c87bc91515490e2f8579a5321058845 } @Override -@@ -164,7 +166,11 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation +@@ -166,6 +168,10 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation protected void mobTick() { mobTick(false); } protected void mobTick(boolean inactive) { this.world.getMethodProfiler().enter("villagerBrain"); -- if (!inactive) this.getBehaviorController().Wa((WorldServer) this.world, this); // CraftBukkit - decompile error // Paper + // Purpur start + boolean tick = (world.getTime() + brainTickOffset) % world.purpurConfig.villagerBrainTicks == 0; + if (((WorldServer) world).getMinecraftServer().lagging ? tick : world.purpurConfig.villagerUseBrainTicksOnlyWhenLagging || tick) + // Purpur end -+ if (!inactive) this.getBehaviorController().a((WorldServer) this.world, this); // CraftBukkit - decompile error // Paper - this.world.getMethodProfiler().exit(); - if (this.bF) { - this.bF = false; + if (!inactive) { + if (!gg.airplane.AirplaneConfig.dynamicVillagerBehavior || behaviorTick++ % this.activatedPriority == 0) { + this.getBehaviorController().a((WorldServer) this.world, this); // CraftBukkit - decompile error // Paper diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java index c441fcea9b2b5a77b801c8a69541cf42050927dc..c7fb5a737cab0083c39732247acb8f4e87562894 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java diff --git a/patches/server/0019-Alternative-Keepalive-Handling.patch b/patches/server/0020-Alternative-Keepalive-Handling.patch similarity index 100% rename from patches/server/0019-Alternative-Keepalive-Handling.patch rename to patches/server/0020-Alternative-Keepalive-Handling.patch diff --git a/patches/server/0020-Silk-touch-spawners.patch b/patches/server/0021-Silk-touch-spawners.patch similarity index 100% rename from patches/server/0020-Silk-touch-spawners.patch rename to patches/server/0021-Silk-touch-spawners.patch diff --git a/patches/server/0021-MC-168772-Fix-Add-turtle-egg-block-options.patch b/patches/server/0022-MC-168772-Fix-Add-turtle-egg-block-options.patch similarity index 100% rename from patches/server/0021-MC-168772-Fix-Add-turtle-egg-block-options.patch rename to patches/server/0022-MC-168772-Fix-Add-turtle-egg-block-options.patch diff --git a/patches/server/0022-Fix-vanilla-command-permission-handler.patch b/patches/server/0023-Fix-vanilla-command-permission-handler.patch similarity index 100% rename from patches/server/0022-Fix-vanilla-command-permission-handler.patch rename to patches/server/0023-Fix-vanilla-command-permission-handler.patch diff --git a/patches/server/0023-Logger-settings-suppressing-pointless-logs.patch b/patches/server/0024-Logger-settings-suppressing-pointless-logs.patch similarity index 100% rename from patches/server/0023-Logger-settings-suppressing-pointless-logs.patch rename to patches/server/0024-Logger-settings-suppressing-pointless-logs.patch diff --git a/patches/server/0024-Disable-outdated-build-check.patch b/patches/server/0025-Disable-outdated-build-check.patch similarity index 100% rename from patches/server/0024-Disable-outdated-build-check.patch rename to patches/server/0025-Disable-outdated-build-check.patch diff --git a/patches/server/0025-Giants-AI-settings.patch b/patches/server/0026-Giants-AI-settings.patch similarity index 95% rename from patches/server/0025-Giants-AI-settings.patch rename to patches/server/0026-Giants-AI-settings.patch index 663201291..0c6dfa2ed 100644 --- a/patches/server/0025-Giants-AI-settings.patch +++ b/patches/server/0026-Giants-AI-settings.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Giants AI settings diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 2ec48858be8eb2c522c9685b43bd36b3b581cf8b..7cafc89e048e43f339f5289f38674b18d052e70d 100644 +index 1d718095cf29ee70dd031b0c374e772774b8e11b..bc80d583104528a9cb3ffd1ea87e7b4dfc14c168 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -136,7 +136,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -98,10 +98,10 @@ index 9f4f56c47ecd4b35ebf33ca0bf9a040074ababf2..565c938d879940d8e12fe320ea8524d2 } } diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index a47217c020d2c2a3caddafa0549dc827373798dd..07908edcaffb5ee1be8a71f3f0affb91c7e6e51b 100644 +index 81a91d63dd26a940c381b5a4f18eb60d42bbd61e..257f349217c55f6c02b42676bcd708c14e4a5fb8 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java -@@ -950,6 +950,7 @@ public abstract class EntityInsentient extends EntityLiving { +@@ -952,6 +952,7 @@ public abstract class EntityInsentient extends EntityLiving { return f; } @@ -109,7 +109,7 @@ index a47217c020d2c2a3caddafa0549dc827373798dd..07908edcaffb5ee1be8a71f3f0affb91 protected void a(DifficultyDamageScaler difficultydamagescaler) { if (this.random.nextFloat() < 0.15F * difficultydamagescaler.d()) { int i = this.random.nextInt(2); -@@ -1057,6 +1058,7 @@ public abstract class EntityInsentient extends EntityLiving { +@@ -1059,6 +1060,7 @@ public abstract class EntityInsentient extends EntityLiving { } } @@ -118,7 +118,7 @@ index a47217c020d2c2a3caddafa0549dc827373798dd..07908edcaffb5ee1be8a71f3f0affb91 float f = difficultydamagescaler.d(); diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index ebe18e5926bb9e7d2dacdb09c213c0ad6fb847c4..996242d7c62984b67b9443356c509d0c7c85e33a 100644 +index c3f36275943c1cd03b65a1c7c6fbb22d1af3a6e3..57f2db9a975216408e4d7e646b0f907c11310502 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -166,6 +166,7 @@ public abstract class EntityLiving extends Entity { @@ -138,7 +138,7 @@ index ebe18e5926bb9e7d2dacdb09c213c0ad6fb847c4..996242d7c62984b67b9443356c509d0c public BehaviorController getBehaviorController() { return this.bg; } -@@ -2179,7 +2182,7 @@ public abstract class EntityLiving extends Entity { +@@ -2181,7 +2184,7 @@ public abstract class EntityLiving extends Entity { this.enderTeleportTo(vec3d.x, vec3d.y, vec3d.z); } diff --git a/patches/server/0026-Illusioners-AI-settings.patch b/patches/server/0027-Illusioners-AI-settings.patch similarity index 100% rename from patches/server/0026-Illusioners-AI-settings.patch rename to patches/server/0027-Illusioners-AI-settings.patch diff --git a/patches/server/0027-Zombie-horse-naturally-spawn.patch b/patches/server/0028-Zombie-horse-naturally-spawn.patch similarity index 94% rename from patches/server/0027-Zombie-horse-naturally-spawn.patch rename to patches/server/0028-Zombie-horse-naturally-spawn.patch index 44ac199e2..6aea87669 100644 --- a/patches/server/0027-Zombie-horse-naturally-spawn.patch +++ b/patches/server/0028-Zombie-horse-naturally-spawn.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Zombie horse naturally spawn diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index d8e39d29a792bf8a65884f18743befe29a86791e..428f43a37d5aa6e0bf363baeef02b0fa01951590 100644 +index c8b20f6789d8f2403a00a8c2d3b0869f0ba8718d..96d0735649476bac0581145c255c702941a17c0e 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1101,12 +1101,18 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1124,12 +1124,18 @@ public class WorldServer extends World implements GeneratorAccessSeed { boolean flag1 = this.getGameRules().getBoolean(GameRules.DO_MOB_SPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.b() * paperConfig.skeleHorseSpawnChance; // Paper if (flag1) { diff --git a/patches/server/0028-Charged-creeper-naturally-spawn.patch b/patches/server/0029-Charged-creeper-naturally-spawn.patch similarity index 100% rename from patches/server/0028-Charged-creeper-naturally-spawn.patch rename to patches/server/0029-Charged-creeper-naturally-spawn.patch diff --git a/patches/server/0029-Rabbit-naturally-spawn-toast-and-killer.patch b/patches/server/0030-Rabbit-naturally-spawn-toast-and-killer.patch similarity index 100% rename from patches/server/0029-Rabbit-naturally-spawn-toast-and-killer.patch rename to patches/server/0030-Rabbit-naturally-spawn-toast-and-killer.patch diff --git a/patches/server/0030-Fix-outdated-server-showing-in-ping-before-server-fu.patch b/patches/server/0031-Fix-outdated-server-showing-in-ping-before-server-fu.patch similarity index 100% rename from patches/server/0030-Fix-outdated-server-showing-in-ping-before-server-fu.patch rename to patches/server/0031-Fix-outdated-server-showing-in-ping-before-server-fu.patch diff --git a/patches/server/0031-Make-Iron-Golems-Swim.patch b/patches/server/0032-Make-Iron-Golems-Swim.patch similarity index 100% rename from patches/server/0031-Make-Iron-Golems-Swim.patch rename to patches/server/0032-Make-Iron-Golems-Swim.patch diff --git a/patches/server/0032-Dont-send-useless-entity-packets.patch b/patches/server/0033-Dont-send-useless-entity-packets.patch similarity index 95% rename from patches/server/0032-Dont-send-useless-entity-packets.patch rename to patches/server/0033-Dont-send-useless-entity-packets.patch index 7ce1309a6..9b48e9bf5 100644 --- a/patches/server/0032-Dont-send-useless-entity-packets.patch +++ b/patches/server/0033-Dont-send-useless-entity-packets.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Dont send useless entity packets diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java -index 2402c18e6a18221a43bea9fc68278da9d19eede4..e51b6bd0698593867e6821326d223770766d717f 100644 +index 4b7e83e4f64a8bc4bf5b4ca569c32efefb0b3149..9f6d767ce8139999032d4c51221da743c694cb09 100644 --- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java +++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java -@@ -172,6 +172,7 @@ public class EntityTrackerEntry { +@@ -180,6 +180,7 @@ public class EntityTrackerEntry { this.o = 0; packet1 = new PacketPlayOutEntityTeleport(this.tracker); } @@ -16,7 +16,7 @@ index 2402c18e6a18221a43bea9fc68278da9d19eede4..e51b6bd0698593867e6821326d223770 } if ((this.e || this.tracker.impulse || this.tracker instanceof EntityLiving && ((EntityLiving) this.tracker).isGliding()) && this.tickCounter > 0) { -@@ -258,6 +259,22 @@ public class EntityTrackerEntry { +@@ -273,6 +274,22 @@ public class EntityTrackerEntry { } diff --git a/patches/server/0033-Tulips-change-fox-type.patch b/patches/server/0034-Tulips-change-fox-type.patch similarity index 100% rename from patches/server/0033-Tulips-change-fox-type.patch rename to patches/server/0034-Tulips-change-fox-type.patch diff --git a/patches/server/0034-Breedable-Polar-Bears.patch b/patches/server/0035-Breedable-Polar-Bears.patch similarity index 100% rename from patches/server/0034-Breedable-Polar-Bears.patch rename to patches/server/0035-Breedable-Polar-Bears.patch diff --git a/patches/server/0035-Chickens-can-retaliate.patch b/patches/server/0036-Chickens-can-retaliate.patch similarity index 100% rename from patches/server/0035-Chickens-can-retaliate.patch rename to patches/server/0036-Chickens-can-retaliate.patch diff --git a/patches/server/0036-Add-option-to-set-armorstand-step-height.patch b/patches/server/0037-Add-option-to-set-armorstand-step-height.patch similarity index 100% rename from patches/server/0036-Add-option-to-set-armorstand-step-height.patch rename to patches/server/0037-Add-option-to-set-armorstand-step-height.patch diff --git a/patches/server/0037-Cat-spawning-options.patch b/patches/server/0038-Cat-spawning-options.patch similarity index 100% rename from patches/server/0037-Cat-spawning-options.patch rename to patches/server/0038-Cat-spawning-options.patch diff --git a/patches/server/0038-MC-147659-Fix-non-black-cats-spawning-in-swamp-huts.patch b/patches/server/0039-MC-147659-Fix-non-black-cats-spawning-in-swamp-huts.patch similarity index 100% rename from patches/server/0038-MC-147659-Fix-non-black-cats-spawning-in-swamp-huts.patch rename to patches/server/0039-MC-147659-Fix-non-black-cats-spawning-in-swamp-huts.patch diff --git a/patches/server/0039-Cows-eat-mushrooms.patch b/patches/server/0040-Cows-eat-mushrooms.patch similarity index 96% rename from patches/server/0039-Cows-eat-mushrooms.patch rename to patches/server/0040-Cows-eat-mushrooms.patch index f145d2aa2..28dace9cd 100644 --- a/patches/server/0039-Cows-eat-mushrooms.patch +++ b/patches/server/0040-Cows-eat-mushrooms.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Cows eat mushrooms diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 7cafc89e048e43f339f5289f38674b18d052e70d..4edb489012ddc9454e412f06acc4587a3572c8d3 100644 +index bc80d583104528a9cb3ffd1ea87e7b4dfc14c168..983ed53eed9e15a14d83c68d72f004417cee2657 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2791,6 +2791,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2794,6 +2794,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke this.invulnerable = flag; } @@ -110,7 +110,7 @@ index 42e6761c8b18b79ffd3f4d5e853ea87a2c153c23..cfb009c811bd2908d38da1b0007cb7aa public EntityCow createChild(WorldServer worldserver, EntityAgeable entityageable) { return (EntityCow) EntityTypes.COW.a((World) worldserver); diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 996242d7c62984b67b9443356c509d0c7c85e33a..8cc440e0e7108e2c7ca29b2f8a2fc5a723dcef0d 100644 +index 57f2db9a975216408e4d7e646b0f907c11310502..0eae140eb55526e5eb88dab0e267b45fdef43ff6 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -81,7 +81,7 @@ public abstract class EntityLiving extends Entity { diff --git a/patches/server/0040-Fix-cow-rotation-when-shearing-mooshroom.patch b/patches/server/0041-Fix-cow-rotation-when-shearing-mooshroom.patch similarity index 100% rename from patches/server/0040-Fix-cow-rotation-when-shearing-mooshroom.patch rename to patches/server/0041-Fix-cow-rotation-when-shearing-mooshroom.patch diff --git a/patches/server/0041-Pigs-give-saddle-back.patch b/patches/server/0042-Pigs-give-saddle-back.patch similarity index 100% rename from patches/server/0041-Pigs-give-saddle-back.patch rename to patches/server/0042-Pigs-give-saddle-back.patch diff --git a/patches/server/0042-Snowman-drop-and-put-back-pumpkin.patch b/patches/server/0043-Snowman-drop-and-put-back-pumpkin.patch similarity index 100% rename from patches/server/0042-Snowman-drop-and-put-back-pumpkin.patch rename to patches/server/0043-Snowman-drop-and-put-back-pumpkin.patch diff --git a/patches/server/0043-Ender-dragon-always-drop-full-exp.patch b/patches/server/0044-Ender-dragon-always-drop-full-exp.patch similarity index 100% rename from patches/server/0043-Ender-dragon-always-drop-full-exp.patch rename to patches/server/0044-Ender-dragon-always-drop-full-exp.patch diff --git a/patches/server/0044-Signs-editable-on-right-click.patch b/patches/server/0045-Signs-editable-on-right-click.patch similarity index 100% rename from patches/server/0044-Signs-editable-on-right-click.patch rename to patches/server/0045-Signs-editable-on-right-click.patch diff --git a/patches/server/0045-Signs-allow-color-codes.patch b/patches/server/0046-Signs-allow-color-codes.patch similarity index 98% rename from patches/server/0045-Signs-allow-color-codes.patch rename to patches/server/0046-Signs-allow-color-codes.patch index f99df06dd..e27769675 100644 --- a/patches/server/0045-Signs-allow-color-codes.patch +++ b/patches/server/0046-Signs-allow-color-codes.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Signs allow color codes diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 20aaf52d500d208857f87b1a99e77489607018b2..0cfe1a620fdd1d4e1240413fb8340b9118bbaa5e 100644 +index 876c728a460860ee1881c2cce2220157bd66a4e5..82268359f340eac0c0dd171c1ef9fe950fc0afb5 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -1449,6 +1449,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { diff --git a/patches/server/0046-Allow-soil-to-moisten-from-water-directly-under-it.patch b/patches/server/0047-Allow-soil-to-moisten-from-water-directly-under-it.patch similarity index 100% rename from patches/server/0046-Allow-soil-to-moisten-from-water-directly-under-it.patch rename to patches/server/0047-Allow-soil-to-moisten-from-water-directly-under-it.patch diff --git a/patches/server/0047-Controllable-Minecarts.patch b/patches/server/0048-Controllable-Minecarts.patch similarity index 97% rename from patches/server/0047-Controllable-Minecarts.patch rename to patches/server/0048-Controllable-Minecarts.patch index 3e1a9e0ae..b55ff410d 100644 --- a/patches/server/0047-Controllable-Minecarts.patch +++ b/patches/server/0048-Controllable-Minecarts.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Controllable Minecarts diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index 2291135eaef64c403183724cb6e413cd7e472672..bc61aaff65a7dc1e7534452b285953b83adb7000 100644 +index 72ee5fe0ca25844cbcd8f1bbbbd6a7f8ced24bc4..f38382cc681f03d9a6a0efa85f045e3770398739 100644 --- a/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java @@ -36,6 +36,12 @@ public class BlockPosition extends BaseBlockPosition { @@ -22,7 +22,7 @@ index 2291135eaef64c403183724cb6e413cd7e472672..bc61aaff65a7dc1e7534452b285953b8 super(i, j, k); } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 8cc440e0e7108e2c7ca29b2f8a2fc5a723dcef0d..46b1bc644c0584fe7006ea9f111d7f4837299dc9 100644 +index 0eae140eb55526e5eb88dab0e267b45fdef43ff6..65dfe107566244b96a9eb1520336caa8cc79361d 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -99,9 +99,9 @@ public abstract class EntityLiving extends Entity { @@ -106,7 +106,7 @@ index be859a1b41254b299a507d03e453dc8efee6f3dd..4de2877f30a9b231a5c8bbd173941699 this.move(EnumMoveType.SELF, this.getMot()); if (!this.onGround) { diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 0cfe1a620fdd1d4e1240413fb8340b9118bbaa5e..05a2494a085dc60ccb0eeb5ae3f6d40ed6f59e98 100644 +index 82268359f340eac0c0dd171c1ef9fe950fc0afb5..75612f2e5489694e11c12bb232b5701e83375d1d 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -1002,6 +1002,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { diff --git a/patches/server/0048-Disable-loot-drops-on-death-by-cramming.patch b/patches/server/0049-Disable-loot-drops-on-death-by-cramming.patch similarity index 92% rename from patches/server/0048-Disable-loot-drops-on-death-by-cramming.patch rename to patches/server/0049-Disable-loot-drops-on-death-by-cramming.patch index 2280fd22e..8e0f238d2 100644 --- a/patches/server/0048-Disable-loot-drops-on-death-by-cramming.patch +++ b/patches/server/0049-Disable-loot-drops-on-death-by-cramming.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Disable loot drops on death by cramming diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 46b1bc644c0584fe7006ea9f111d7f4837299dc9..1dddf80e11db54a666de8c3b0d7a5c8a5f1f93ab 100644 +index 65dfe107566244b96a9eb1520336caa8cc79361d..3745bf3de3fc4e8096feb247b64b53c66a93d7d4 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -1501,8 +1501,10 @@ public abstract class EntityLiving extends Entity { +@@ -1503,8 +1503,10 @@ public abstract class EntityLiving extends Entity { this.dropInventory(); // CraftBukkit - from below if (this.cW() && this.world.getGameRules().getBoolean(GameRules.DO_MOB_LOOT)) { diff --git a/patches/server/0049-Players-should-not-cram-to-death.patch b/patches/server/0050-Players-should-not-cram-to-death.patch similarity index 91% rename from patches/server/0049-Players-should-not-cram-to-death.patch rename to patches/server/0050-Players-should-not-cram-to-death.patch index 62fb264eb..a12661d53 100644 --- a/patches/server/0049-Players-should-not-cram-to-death.patch +++ b/patches/server/0050-Players-should-not-cram-to-death.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Players should not cram to death diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 05a2494a085dc60ccb0eeb5ae3f6d40ed6f59e98..9028ef7f64f2fdd2e11961b9ddb8e6e3cc4de248 100644 +index 75612f2e5489694e11c12bb232b5701e83375d1d..c7b42907a522c81904f4f297daa5ac564f6180b1 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -1426,7 +1426,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { diff --git a/patches/server/0050-Option-to-toggle-milk-curing-bad-omen.patch b/patches/server/0051-Option-to-toggle-milk-curing-bad-omen.patch similarity index 100% rename from patches/server/0050-Option-to-toggle-milk-curing-bad-omen.patch rename to patches/server/0051-Option-to-toggle-milk-curing-bad-omen.patch diff --git a/patches/server/0051-End-gateway-should-check-if-entity-can-use-portal.patch b/patches/server/0052-End-gateway-should-check-if-entity-can-use-portal.patch similarity index 100% rename from patches/server/0051-End-gateway-should-check-if-entity-can-use-portal.patch rename to patches/server/0052-End-gateway-should-check-if-entity-can-use-portal.patch diff --git a/patches/server/0052-Fix-the-dead-lagging-the-server.patch b/patches/server/0053-Fix-the-dead-lagging-the-server.patch similarity index 80% rename from patches/server/0052-Fix-the-dead-lagging-the-server.patch rename to patches/server/0053-Fix-the-dead-lagging-the-server.patch index 7a83a5ccb..7c1182e38 100644 --- a/patches/server/0052-Fix-the-dead-lagging-the-server.patch +++ b/patches/server/0053-Fix-the-dead-lagging-the-server.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix the dead lagging the server diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 4edb489012ddc9454e412f06acc4587a3572c8d3..05902a6e9b1dd326776cac3bd70c438f9e83da26 100644 +index 983ed53eed9e15a14d83c68d72f004417cee2657..88598f55da691ce880d7fb8044c87c10f372aefd 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1536,6 +1536,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1539,6 +1539,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke this.pitch = MathHelper.a(f1, -90.0F, 90.0F) % 360.0F; this.lastYaw = this.yaw; this.lastPitch = this.pitch; @@ -17,10 +17,10 @@ index 4edb489012ddc9454e412f06acc4587a3572c8d3..05902a6e9b1dd326776cac3bd70c438f public void f(double d0, double d1, double d2) { diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 1dddf80e11db54a666de8c3b0d7a5c8a5f1f93ab..b273b021b0e3484a3189c3d6d55284b3c45a41ad 100644 +index 3745bf3de3fc4e8096feb247b64b53c66a93d7d4..d0c73d296a3ab5f65835de0cf226d72174f6902d 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -2500,7 +2500,7 @@ public abstract class EntityLiving extends Entity { +@@ -2502,7 +2502,7 @@ public abstract class EntityLiving extends Entity { } } diff --git a/patches/server/0053-Skip-events-if-there-s-no-listeners.patch b/patches/server/0054-Skip-events-if-there-s-no-listeners.patch similarity index 100% rename from patches/server/0053-Skip-events-if-there-s-no-listeners.patch rename to patches/server/0054-Skip-events-if-there-s-no-listeners.patch diff --git a/patches/server/0054-Add-permission-for-F3-N-debug.patch b/patches/server/0055-Add-permission-for-F3-N-debug.patch similarity index 100% rename from patches/server/0054-Add-permission-for-F3-N-debug.patch rename to patches/server/0055-Add-permission-for-F3-N-debug.patch diff --git a/patches/server/0055-Add-wither-skeleton-takes-wither-damage-option.patch b/patches/server/0056-Add-wither-skeleton-takes-wither-damage-option.patch similarity index 100% rename from patches/server/0055-Add-wither-skeleton-takes-wither-damage-option.patch rename to patches/server/0056-Add-wither-skeleton-takes-wither-damage-option.patch diff --git a/patches/server/0056-Configurable-TPS-Catchup.patch b/patches/server/0057-Configurable-TPS-Catchup.patch similarity index 95% rename from patches/server/0056-Configurable-TPS-Catchup.patch rename to patches/server/0057-Configurable-TPS-Catchup.patch index 7421825d4..55d8cf6e5 100644 --- a/patches/server/0056-Configurable-TPS-Catchup.patch +++ b/patches/server/0057-Configurable-TPS-Catchup.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Configurable TPS Catchup diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index d9513addae86bd5d2f0c50173318cf4d23ef2128..50f1841e3d5e92d6186db49ac4962c0bac943a8c 100644 +index ce829ab8f5ae0f2d231ab7b0aaabdf2392b4f108..c16ca6108f196bfaba887eb46479b225ed5abc39 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -1010,7 +1010,13 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant -1) { diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 05902a6e9b1dd326776cac3bd70c438f9e83da26..a1776d7fad2aad6bd323c6c97472fdca0b4618db 100644 +index 88598f55da691ce880d7fb8044c87c10f372aefd..a9020ef4ebccc4d5497dae5ad1b2ecad20ed4075 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -321,6 +321,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -324,6 +324,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke this.headHeight = this.getHeadHeight(EntityPose.STANDING, this.size); } diff --git a/patches/server/0068-Configurable-void-damage-height.patch b/patches/server/0069-Configurable-void-damage-height.patch similarity index 93% rename from patches/server/0068-Configurable-void-damage-height.patch rename to patches/server/0069-Configurable-void-damage-height.patch index a094150b2..1eaf586d3 100644 --- a/patches/server/0068-Configurable-void-damage-height.patch +++ b/patches/server/0069-Configurable-void-damage-height.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Configurable void damage height diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index a1776d7fad2aad6bd323c6c97472fdca0b4618db..b60eee0d86d55224c9fc8caf3a3a13089c0150e9 100644 +index a9020ef4ebccc4d5497dae5ad1b2ecad20ed4075..e93d028a3908aa4d0c1daf7929acc2a426bbb0df 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -624,7 +624,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -627,7 +627,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke // Paper start protected void performVoidDamage() { diff --git a/patches/server/0069-Dispenser-curse-of-binding-protection.patch b/patches/server/0070-Dispenser-curse-of-binding-protection.patch similarity index 95% rename from patches/server/0069-Dispenser-curse-of-binding-protection.patch rename to patches/server/0070-Dispenser-curse-of-binding-protection.patch index 267c455f1..252aab350 100644 --- a/patches/server/0069-Dispenser-curse-of-binding-protection.patch +++ b/patches/server/0070-Dispenser-curse-of-binding-protection.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Dispenser curse of binding protection diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index 566d6a2551ffbcf4366596cab87a7239a75156c6..9807441d53fcf4ef7aaffe3801542f5a371eb7af 100644 +index 82d2c2ced979ebe6c683e8b3c18ea34defcfe7db..4e3af139712323a12066728426615e0faa274e4b 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java -@@ -996,6 +996,13 @@ public abstract class EntityInsentient extends EntityLiving { +@@ -998,6 +998,13 @@ public abstract class EntityInsentient extends EntityLiving { } diff --git a/patches/server/0070-Add-option-for-boats-to-eject-players-on-land.patch b/patches/server/0071-Add-option-for-boats-to-eject-players-on-land.patch similarity index 100% rename from patches/server/0070-Add-option-for-boats-to-eject-players-on-land.patch rename to patches/server/0071-Add-option-for-boats-to-eject-players-on-land.patch diff --git a/patches/server/0071-Add-obfhelpers-for-plugin-use.patch b/patches/server/0072-Add-obfhelpers-for-plugin-use.patch similarity index 100% rename from patches/server/0071-Add-obfhelpers-for-plugin-use.patch rename to patches/server/0072-Add-obfhelpers-for-plugin-use.patch diff --git a/patches/server/0072-Mending-mends-most-damages-equipment-first.patch b/patches/server/0073-Mending-mends-most-damages-equipment-first.patch similarity index 100% rename from patches/server/0072-Mending-mends-most-damages-equipment-first.patch rename to patches/server/0073-Mending-mends-most-damages-equipment-first.patch diff --git a/patches/server/0073-Add-5-second-tps-average-in-tps.patch b/patches/server/0074-Add-5-second-tps-average-in-tps.patch similarity index 96% rename from patches/server/0073-Add-5-second-tps-average-in-tps.patch rename to patches/server/0074-Add-5-second-tps-average-in-tps.patch index b93a09e7a..66428619c 100644 --- a/patches/server/0073-Add-5-second-tps-average-in-tps.patch +++ b/patches/server/0074-Add-5-second-tps-average-in-tps.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add 5 second tps average in /tps diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 50f1841e3d5e92d6186db49ac4962c0bac943a8c..a3ddf2839738e089a02d841f5b6fd759c3047305 100644 +index c16ca6108f196bfaba887eb46479b225ed5abc39..1a721e28c757971b1a5c2521ad55f0845dbafd20 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -166,7 +166,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant { @@ -28,8 +28,8 @@ index 9024af41ef5828e1c7c746498a033435e1bddc28..73cf30786d2b4d6f87be5f9aad87c3ed + public void setEntitySize(EntitySize entitySize) { this.br = entitySize; } // Purpur - OBFHELPER + private EntitySize br; // Purpur - remove final - private static EntityTypes a(String s, EntityTypes.Builder entitytypes_builder) { // CraftBukkit - decompile error - return (EntityTypes) IRegistry.a((IRegistry) IRegistry.ENTITY_TYPE, s, (Object) entitytypes_builder.a(s)); + public java.util.function.Supplier getEntityName = () -> IRegistry.ENTITY_TYPE.getKey(this).toString(); // Airplane - create lambda ones + diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java index 17a8b43892fdab87a80cbf076c7814bfab087142..c314a8c9a921a95cea43b748e2037521d948e1e7 100644 --- a/src/main/java/net/pl3x/purpur/PurpurConfig.java diff --git a/patches/server/0101-Stop-squids-floating-on-top-of-water.patch b/patches/server/0102-Stop-squids-floating-on-top-of-water.patch similarity index 94% rename from patches/server/0101-Stop-squids-floating-on-top-of-water.patch rename to patches/server/0102-Stop-squids-floating-on-top-of-water.patch index 788f66df2..38982135a 100644 --- a/patches/server/0101-Stop-squids-floating-on-top-of-water.patch +++ b/patches/server/0102-Stop-squids-floating-on-top-of-water.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Stop squids floating on top of water diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 4b9e44aad705247c075e435ebc6eb9b1393f7b17..30408e9e8b4acec56a95852558ead6a581b8565c 100644 +index 13217b14834f4aaf3eddba8da3c3bc4a97cb27c6..e50a3182dad6f2108f31ffc40274643607ce27d5 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -3461,8 +3461,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -3464,8 +3464,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke this.lastYaw = this.yaw; } diff --git a/patches/server/0102-Ridables.patch b/patches/server/0103-Ridables.patch similarity index 97% rename from patches/server/0102-Ridables.patch rename to patches/server/0103-Ridables.patch index 4e3995d78..1c0b9a995 100644 --- a/patches/server/0102-Ridables.patch +++ b/patches/server/0103-Ridables.patch @@ -161,7 +161,7 @@ index bd0267ee4b3782f6d1ec39cba7966ba4f62f1adf..8b36ac2b0950a827763aa2357700f37e this.B = true; return this; diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 30408e9e8b4acec56a95852558ead6a581b8565c..8be2b1ed66c3a72d2b752881b16b8a402cce2768 100644 +index e50a3182dad6f2108f31ffc40274643607ce27d5..bcae44f59b3f90b3f2c3f0680b13ce58688ed77b 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -105,7 +105,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -191,7 +191,7 @@ index 30408e9e8b4acec56a95852558ead6a581b8565c..8be2b1ed66c3a72d2b752881b16b8a40 private float headHeight; // CraftBukkit start public boolean persist = true; -@@ -1495,6 +1495,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1498,6 +1498,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return !this.justCreated && this.M.getDouble(TagsFluid.LAVA) > 0.0D; } @@ -199,7 +199,7 @@ index 30408e9e8b4acec56a95852558ead6a581b8565c..8be2b1ed66c3a72d2b752881b16b8a40 public void a(float f, Vec3D vec3d) { Vec3D vec3d1 = a(vec3d, f, this.yaw); -@@ -2251,6 +2252,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2254,6 +2255,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return this.a(entity, false); } @@ -207,7 +207,7 @@ index 30408e9e8b4acec56a95852558ead6a581b8565c..8be2b1ed66c3a72d2b752881b16b8a40 public boolean a(Entity entity, boolean flag) { for (Entity entity1 = entity; entity1.vehicle != null; entity1 = entity1.vehicle) { if (entity1.vehicle == this) { -@@ -2346,6 +2348,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2349,6 +2351,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke this.passengers.add(entity); } @@ -221,7 +221,7 @@ index 30408e9e8b4acec56a95852558ead6a581b8565c..8be2b1ed66c3a72d2b752881b16b8a40 } return true; // CraftBukkit } -@@ -2386,6 +2395,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2389,6 +2398,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return false; } // Spigot end @@ -234,7 +234,7 @@ index 30408e9e8b4acec56a95852558ead6a581b8565c..8be2b1ed66c3a72d2b752881b16b8a40 this.passengers.remove(entity); entity.j = 60; } -@@ -2551,6 +2566,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2554,6 +2569,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke this.setFlag(4, flag); } @@ -242,7 +242,7 @@ index 30408e9e8b4acec56a95852558ead6a581b8565c..8be2b1ed66c3a72d2b752881b16b8a40 public boolean bE() { return this.glowing || this.world.isClientSide && this.getFlag(6); } -@@ -2773,6 +2789,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2776,6 +2792,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke public void setHeadRotation(float f) {} @@ -250,7 +250,7 @@ index 30408e9e8b4acec56a95852558ead6a581b8565c..8be2b1ed66c3a72d2b752881b16b8a40 public void n(float f) {} public boolean bL() { -@@ -3214,6 +3231,18 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -3217,6 +3234,18 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return false; } @@ -269,7 +269,7 @@ index 30408e9e8b4acec56a95852558ead6a581b8565c..8be2b1ed66c3a72d2b752881b16b8a40 @Override public void sendMessage(IChatBaseComponent ichatbasecomponent, UUID uuid) {} -@@ -3666,4 +3695,47 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -3669,4 +3698,47 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return ((ChunkProviderServer) world.getChunkProvider()).isInEntityTickingChunk(this); } // Paper end @@ -318,7 +318,7 @@ index 30408e9e8b4acec56a95852558ead6a581b8565c..8be2b1ed66c3a72d2b752881b16b8a40 + // Purpur end } diff --git a/src/main/java/net/minecraft/server/EntityBat.java b/src/main/java/net/minecraft/server/EntityBat.java -index 451ffcfd1fc9fa3091dc2bd697e5d829dcf6443f..7677f4a2ec8bacadcbc6e68e13f56256f1963552 100644 +index f06ffdca027e5477332c6bc0c381264b47633f78..7a18c59689b84fa277709ad11c39a72d77df4afb 100644 --- a/src/main/java/net/minecraft/server/EntityBat.java +++ b/src/main/java/net/minecraft/server/EntityBat.java @@ -15,9 +15,48 @@ public class EntityBat extends EntityAmbient { @@ -1317,7 +1317,7 @@ index f777aea69dc9949aae3251e9a530b8cffb251bad..497d05996ab84f599aa0a02f853149f0 this.bF.b(this); } diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java -index e3364032669b473c799b759f5f89468b7584d9f5..995849212c25568d3aa28ada78babf8b8e669960 100644 +index 9728f5eb59d31535dd9cda6083172cb2ddd20a8e..a930cfe4ec08ee5414f03e420ad79ab110d84129 100644 --- a/src/main/java/net/minecraft/server/EntityEnderman.java +++ b/src/main/java/net/minecraft/server/EntityEnderman.java @@ -30,9 +30,22 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { @@ -1360,7 +1360,7 @@ index e3364032669b473c799b759f5f89468b7584d9f5..995849212c25568d3aa28ada78babf8b float f = this.aR(); if (f > 0.5F && this.world.e(this.getChunkCoordinates()) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.tryEscape(EndermanEscapeEvent.Reason.RUNAWAY)) { // Paper -@@ -322,6 +336,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { +@@ -329,6 +343,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { if (this.isInvulnerable(damagesource)) { return false; } else if (net.pl3x.purpur.PurpurConfig.endermanShortHeight && damagesource == DamageSource.STUCK) { return false; // Purpur - no suffocation damage if short height @@ -1368,7 +1368,7 @@ index e3364032669b473c799b759f5f89468b7584d9f5..995849212c25568d3aa28ada78babf8b } else if (damagesource instanceof EntityDamageSourceIndirect) { if (this.tryEscape(EndermanEscapeEvent.Reason.INDIRECT)) { // Paper start for (int i = 0; i < 64; ++i) { -@@ -366,6 +381,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { +@@ -373,6 +388,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { public PathfinderGoalEndermanPickupBlock(EntityEnderman entityenderman) { this.enderman = entityenderman; @@ -1376,7 +1376,7 @@ index e3364032669b473c799b759f5f89468b7584d9f5..995849212c25568d3aa28ada78babf8b } @Override -@@ -408,6 +424,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { +@@ -415,6 +431,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { public PathfinderGoalEndermanPlaceBlock(EntityEnderman entityenderman) { this.a = entityenderman; @@ -1904,18 +1904,10 @@ index b691e844953bcc2853a806a3bbf9cb7338e98266..f6f882746940c9e049106aa9b41591ba return EntityGuardian.eM().a(GenericAttributes.MOVEMENT_SPEED, 0.30000001192092896D).a(GenericAttributes.ATTACK_DAMAGE, 8.0D).a(GenericAttributes.MAX_HEALTH, 80.0D); } diff --git a/src/main/java/net/minecraft/server/EntityHoglin.java b/src/main/java/net/minecraft/server/EntityHoglin.java -index f6797925365836b6c2d3d2c48c746a4d58e28bf3..548ff4449faca0abdf72487276fe49207bacfe17 100644 +index 7bd22c81d75368697113915a97c7fbe55ed2a268..f98ac9edf3ba3f3bee2e626a76a5e0e4013514ad 100644 --- a/src/main/java/net/minecraft/server/EntityHoglin.java +++ b/src/main/java/net/minecraft/server/EntityHoglin.java -@@ -13,13 +13,25 @@ public class EntityHoglin extends EntityAnimal implements IMonster, IOglin { - public int conversionTicks = 0; - public boolean cannotBeHunted = false; - protected static final ImmutableList>> bo = ImmutableList.of(SensorType.c, SensorType.d, SensorType.n, SensorType.m); -- protected static final ImmutableList> bp = ImmutableList.of(MemoryModuleType.BREED_TARGET, MemoryModuleType.MOBS, MemoryModuleType.VISIBLE_MOBS, MemoryModuleType.NEAREST_VISIBLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_TARGETABLE_PLAYER, MemoryModuleType.LOOK_TARGET, MemoryModuleType.WALK_TARGET, MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE, MemoryModuleType.PATH, MemoryModuleType.ATTACK_TARGET, MemoryModuleType.ATTACK_COOLING_DOWN, MemoryModuleType.NEAREST_VISIBLE_ADULT_PIGLIN, new MemoryModuleType[]{MemoryModuleType.AVOID_TARGET, MemoryModuleType.VISIBLE_ADULT_PIGLIN_COUNT, MemoryModuleType.VISIBLE_ADULT_HOGLIN_COUNT, MemoryModuleType.NEAREST_VISIBLE_ADULT_HOGLINS, MemoryModuleType.NEAREST_VISIBLE_ADULY, MemoryModuleType.NEAREST_REPELLENT, MemoryModuleType.PACIFIED}); -+ protected static final ImmutableList> bp = ImmutableList.of(MemoryModuleType.BREED_TARGET, MemoryModuleType.MOBS, MemoryModuleType.VISIBLE_MOBS, MemoryModuleType.NEAREST_VISIBLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_TARGETABLE_PLAYER, MemoryModuleType.LOOK_TARGET, MemoryModuleType.WALK_TARGET, MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE, MemoryModuleType.PATH, MemoryModuleType.ATTACK_TARGET, MemoryModuleType.ATTACK_COOLING_DOWN, MemoryModuleType.NEAREST_VISIBLE_ADULT_PIGLIN, MemoryModuleType.AVOID_TARGET, MemoryModuleType.VISIBLE_ADULT_PIGLIN_COUNT, MemoryModuleType.VISIBLE_ADULT_HOGLIN_COUNT, MemoryModuleType.NEAREST_VISIBLE_ADULT_HOGLINS, MemoryModuleType.NEAREST_VISIBLE_ADULY, MemoryModuleType.NEAREST_REPELLENT, MemoryModuleType.PACIFIED); // Purpur - decompile error - - public EntityHoglin(EntityTypes entitytypes, World world) { - super(entitytypes, world); +@@ -20,6 +20,18 @@ public class EntityHoglin extends EntityAnimal implements IMonster, IOglin { this.f = 5; } @@ -1934,32 +1926,14 @@ index f6797925365836b6c2d3d2c48c746a4d58e28bf3..548ff4449faca0abdf72487276fe4920 @Override public boolean a(EntityHuman entityhuman) { return !this.isLeashed(); -@@ -77,13 +89,14 @@ public class EntityHoglin extends EntityAnimal implements IMonster, IOglin { - - @Override - public BehaviorController getBehaviorController() { -- return super.getBehaviorController(); -+ return (BehaviorController) super.getBehaviorController(); // Purpur - decompile error - } - - @Override - protected void mobTick() { +@@ -86,6 +98,7 @@ public class EntityHoglin extends EntityAnimal implements IMonster, IOglin { + // Airplane - dynamic tick + if (!gg.airplane.AirplaneConfig.dynamicHoglinBehavior || this.behaviorTick++ % this.activatedPriority == 0) { this.world.getMethodProfiler().enter("hoglinBrain"); -- this.getBehaviorController().a((WorldServer) this.world, (EntityLiving) this); + if (getRider() == null) // Purpur - only use brain if no rider -+ this.getBehaviorController().a((WorldServer) this.world, this); // Purpur - decompile error + this.getBehaviorController().a((WorldServer) this.world, (EntityHoglin) this); // Airplane - decompile error this.world.getMethodProfiler().exit(); HoglinAI.a(this); - if (this.isConverting()) { -@@ -259,7 +272,7 @@ public class EntityHoglin extends EntityAnimal implements IMonster, IOglin { - - @Override - protected SoundEffect getSoundAmbient() { -- return this.world.isClientSide ? null : (SoundEffect) HoglinAI.b(this).orElse((Object) null); -+ return this.world.isClientSide ? null : (SoundEffect) HoglinAI.b(this).orElse(null); // Purpur - decompile error - } - - @Override diff --git a/src/main/java/net/minecraft/server/EntityHorse.java b/src/main/java/net/minecraft/server/EntityHorse.java index f958751b16abcc36910bb0b655ff2360459e2e4c..4ffc61acdff8c51dc9b111e3024c828fb5386118 100644 --- a/src/main/java/net/minecraft/server/EntityHorse.java @@ -2182,7 +2156,7 @@ index c57bf5091430709778dc21d70c8a32819c9d6639..b0a5c36d1132e2558a1fefbd9f8dd264 this.targetSelector.a(2, (new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)).a(300)); this.targetSelector.a(3, (new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, false)).a(300)); diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index 43cdeaae22bf020d0b3c1e1c56e65e73fc8106b0..df337fbdb042d98ac1c41532c358ba3f860b3281 100644 +index 37902ee004a7c5aa18165237e75c77117c2eec81..3b6b388515818139cf4b4815b65915cedda67af7 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java @@ -30,7 +30,7 @@ public abstract class EntityInsentient extends EntityLiving { @@ -2238,7 +2212,7 @@ index 43cdeaae22bf020d0b3c1e1c56e65e73fc8106b0..df337fbdb042d98ac1c41532c358ba3f public void v(float f) { this.aR = f; } -@@ -1253,7 +1256,7 @@ public abstract class EntityInsentient extends EntityLiving { +@@ -1255,7 +1258,7 @@ public abstract class EntityInsentient extends EntityLiving { protected void a(EntityHuman entityhuman, EntityInsentient entityinsentient) {} protected EnumInteractionResult b(EntityHuman entityhuman, EnumHand enumhand) { @@ -2247,7 +2221,7 @@ index 43cdeaae22bf020d0b3c1e1c56e65e73fc8106b0..df337fbdb042d98ac1c41532c358ba3f } public boolean ev() { -@@ -1634,4 +1637,54 @@ public abstract class EntityInsentient extends EntityLiving { +@@ -1636,4 +1639,54 @@ public abstract class EntityInsentient extends EntityLiving { this.unleash(true, event.isDropLeash()); // Paper end } @@ -2354,7 +2328,7 @@ index bdff2368836dca230a6622a205d5772834afc6ee..9ee03b233b71d1b4b85a9a5e1f0ea9fe float f1 = 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.2F; diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 4b7ff69eac4dd5fd5c9b0b26d133daeb128c445d..af2b6bb559d78dd912eee02281f5446f31e55eae 100644 +index bd89fa598b7dda7272cc512862fda33b64e2af99..a84150b22adb090309192c21459967a571e86b0a 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -463,7 +463,7 @@ public abstract class EntityLiving extends Entity { @@ -2366,7 +2340,7 @@ index 4b7ff69eac4dd5fd5c9b0b26d133daeb128c445d..af2b6bb559d78dd912eee02281f5446f } protected void cU() { -@@ -2202,7 +2202,7 @@ public abstract class EntityLiving extends Entity { +@@ -2204,7 +2204,7 @@ public abstract class EntityLiving extends Entity { return 0.42F * this.getBlockJumpFactor(); } @@ -2375,7 +2349,7 @@ index 4b7ff69eac4dd5fd5c9b0b26d133daeb128c445d..af2b6bb559d78dd912eee02281f5446f float f = this.dJ(); if (this.hasEffect(MobEffects.JUMP)) { -@@ -2451,10 +2451,12 @@ public abstract class EntityLiving extends Entity { +@@ -2453,10 +2453,12 @@ public abstract class EntityLiving extends Entity { return this.onGround ? this.dN() * (0.21600002F / (f * f * f)) : this.aE; } @@ -2388,7 +2362,7 @@ index 4b7ff69eac4dd5fd5c9b0b26d133daeb128c445d..af2b6bb559d78dd912eee02281f5446f public void q(float f) { this.bu = f; } -@@ -2853,6 +2855,20 @@ public abstract class EntityLiving extends Entity { +@@ -2855,6 +2857,20 @@ public abstract class EntityLiving extends Entity { } } // Paper end @@ -3067,7 +3041,7 @@ index 32b75f710b12efbcecec2c8d72d4d8cb725870fe..3327dbbf87d8f43cbc7cd728df2f4c6a public boolean jockeyOnlyBaby() { return world.purpurConfig.zombifiedPiglinJockeyOnlyBaby; diff --git a/src/main/java/net/minecraft/server/EntityPiglin.java b/src/main/java/net/minecraft/server/EntityPiglin.java -index ca7f9dc54ed2e58f521613b5d8027494bd20edd2..334e0f73e67ef2db7e680874faf0646995d9de8a 100644 +index 682b241ae0e2859aa57faea8a4521c1c07192b7d..29ecfd09f0bed3dc64b14b90875a111253599958 100644 --- a/src/main/java/net/minecraft/server/EntityPiglin.java +++ b/src/main/java/net/minecraft/server/EntityPiglin.java @@ -25,6 +25,18 @@ public class EntityPiglin extends EntityPiglinAbstract implements ICrossbow { @@ -3089,34 +3063,14 @@ index ca7f9dc54ed2e58f521613b5d8027494bd20edd2..334e0f73e67ef2db7e680874faf06469 @Override public void saveData(NBTTagCompound nbttagcompound) { super.saveData(nbttagcompound); -@@ -143,7 +155,7 @@ public class EntityPiglin extends EntityPiglinAbstract implements ICrossbow { - - @Override - public BehaviorController getBehaviorController() { -- return super.getBehaviorController(); -+ return (BehaviorController) super.getBehaviorController(); // Purpur - decompile error - } - - @Override -@@ -202,7 +214,8 @@ public class EntityPiglin extends EntityPiglinAbstract implements ICrossbow { - @Override - protected void mobTick() { +@@ -205,6 +217,7 @@ public class EntityPiglin extends EntityPiglinAbstract implements ICrossbow { + // Airplane - dynamic tick + if (!gg.airplane.AirplaneConfig.dynamicPiglinBehavior || this.behaviorTick++ % this.activatedPriority == 0) { this.world.getMethodProfiler().enter("piglinBrain"); -- this.getBehaviorController().a((WorldServer) this.world, (EntityLiving) this); + if (getRider() == null) // Purpur - only use brain if no rider -+ this.getBehaviorController().a((WorldServer) this.world, this); // Purpur - decompile error + this.getBehaviorController().a((WorldServer) this.world, (EntityPiglin) this); // Airplane - compile error this.world.getMethodProfiler().exit(); PiglinAI.b(this); - super.mobTick(); -@@ -341,7 +354,7 @@ public class EntityPiglin extends EntityPiglinAbstract implements ICrossbow { - - @Override - protected SoundEffect getSoundAmbient() { -- return this.world.isClientSide ? null : (SoundEffect) PiglinAI.d(this).orElse((Object) null); -+ return this.world.isClientSide ? null : (SoundEffect) PiglinAI.d(this).orElse(null); // Purpur - decompile error - } - - @Override diff --git a/src/main/java/net/minecraft/server/EntityPiglinBrute.java b/src/main/java/net/minecraft/server/EntityPiglinBrute.java index 3e9a4af09d0a4af89584ce26428c38f59ff1ff11..f6b170811159544dc10b91226e4e54b349472c46 100644 --- a/src/main/java/net/minecraft/server/EntityPiglinBrute.java @@ -3194,7 +3148,7 @@ index a3a428da99574c485fcf2b8c7944e0d8354146ee..cf7de0127166f6175a6246062c8664e6 this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)); this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, false)); diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 84b6b908eea3b0f0b05f36576e4b6bbcc6b8bd2e..89867313599f0e1e2a70a813e1d31ab2c1bd4d28 100644 +index ca7ec1f237af347c3c5b2b5250948c072304e33c..565cec043a00bc683bbab5874f5887b0df048170 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -512,6 +512,15 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -4316,7 +4270,7 @@ index 9a33866e7529e1636c228bab01205737bc678b47..9336fbbd46c7c6ac11adf8e4cc2735f8 Vec3D vec3d = new Vec3D(this.b - EntityVex.this.locX(), this.c - EntityVex.this.locY(), this.d - EntityVex.this.locZ()); double d0 = vec3d.f(); diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index 762f1acf435c6e7b6d695fc1b2120de0116f46da..15e052cb844df310c62d8a5695e8da6c633d94b6 100644 +index 40085497e61c55789f3888a8a642c44cabed3466..00e3ed9374f9962ea619a104892a4c32b2638876 100644 --- a/src/main/java/net/minecraft/server/EntityVillager.java +++ b/src/main/java/net/minecraft/server/EntityVillager.java @@ -73,8 +73,19 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation @@ -4339,7 +4293,7 @@ index 762f1acf435c6e7b6d695fc1b2120de0116f46da..15e052cb844df310c62d8a5695e8da6c if (world.purpurConfig.villagerFollowEmeraldBlock) this.goalSelector.a(3, new PathfinderGoalTempt(this, 1.0D, false, TEMPT_ITEMS)); } -@@ -239,7 +250,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation +@@ -245,7 +256,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation if (itemstack.getItem() != Items.VILLAGER_SPAWN_EGG && this.isAlive() && !this.eN() && !this.isSleeping()) { if (this.isBaby()) { this.fk(); @@ -4348,7 +4302,7 @@ index 762f1acf435c6e7b6d695fc1b2120de0116f46da..15e052cb844df310c62d8a5695e8da6c } else { boolean flag = this.getOffers().isEmpty(); -@@ -252,8 +263,9 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation +@@ -258,8 +269,9 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation } if (flag) { @@ -4889,7 +4843,7 @@ index dc9f2a1a132b3a7925bd62aa1da0512afd90b8b1..b7e540dfeeabb13227596ecfc6eddabf Entity entity1 = this.getShooter(); // Paper start - Cancel hit for vanished players diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index a3ddf2839738e089a02d841f5b6fd759c3047305..85c14df768ec844b710bf2b32eb7f85c9e6b47ea 100644 +index 1a721e28c757971b1a5c2521ad55f0845dbafd20..de69589a8e88d9330365decccc9e3bceb337b354 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -1418,6 +1418,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant this.bC + 2400L; } @@ -76,7 +79,7 @@ index 15e052cb844df310c62d8a5695e8da6c633d94b6..a04123b5897a150439846abe5b25a3a1 long i = this.bC + 12000L; long j = this.world.getTime(); diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java -index b92ca4a6de01f3f86367fb8dfe3591b08a3e9218..1208464fba96daf276c9cc0c1c9b18db75b03abc 100644 +index 87172af0b007f93bbb0474bc8f3789ed396258f8..b5ea7997040b5bfd98925a146e446aa3c56574da 100644 --- a/src/main/java/net/minecraft/server/NavigationAbstract.java +++ b/src/main/java/net/minecraft/server/NavigationAbstract.java @@ -101,6 +101,7 @@ public abstract class NavigationAbstract { diff --git a/patches/server/0144-Option-for-Villager-Clerics-to-farm-Nether-Wart.patch b/patches/server/0145-Option-for-Villager-Clerics-to-farm-Nether-Wart.patch similarity index 98% rename from patches/server/0144-Option-for-Villager-Clerics-to-farm-Nether-Wart.patch rename to patches/server/0145-Option-for-Villager-Clerics-to-farm-Nether-Wart.patch index 681a3d142..a1ad3df57 100644 --- a/patches/server/0144-Option-for-Villager-Clerics-to-farm-Nether-Wart.patch +++ b/patches/server/0145-Option-for-Villager-Clerics-to-farm-Nether-Wart.patch @@ -133,7 +133,7 @@ index 2d91869660c36b4cd7bfe887956a26802cce7f8a..e376306bc2555620d1a61af2296f3dd8 } else { object = new BehaviorWork(); diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index a04123b5897a150439846abe5b25a3a13419f00e..9b925bf9b7946eecb16f94d49a9823139c5fd641 100644 +index b4719669d5dcfbc34dd37595be403e18184fea4f..d2112fb2424f19b2fb65ce635aa0fe24807a311e 100644 --- a/src/main/java/net/minecraft/server/EntityVillager.java +++ b/src/main/java/net/minecraft/server/EntityVillager.java @@ -129,7 +129,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation @@ -145,7 +145,7 @@ index a04123b5897a150439846abe5b25a3a13419f00e..9b925bf9b7946eecb16f94d49a982313 } behaviorcontroller.a(Activity.CORE, Behaviors.a(villagerprofession, 0.5F)); -@@ -843,6 +843,11 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation +@@ -849,6 +849,11 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation @Override public boolean i(ItemStack itemstack) { Item item = itemstack.getItem(); @@ -157,7 +157,7 @@ index a04123b5897a150439846abe5b25a3a13419f00e..9b925bf9b7946eecb16f94d49a982313 return (EntityVillager.bs.contains(item) || this.getVillagerData().getProfession().c().contains(item)) && this.getInventory().b(itemstack); } -@@ -864,6 +869,11 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation +@@ -870,6 +875,11 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation } public boolean canPlant() { diff --git a/patches/server/0145-Toggle-for-Zombified-Piglin-death-always-counting-as.patch b/patches/server/0146-Toggle-for-Zombified-Piglin-death-always-counting-as.patch similarity index 100% rename from patches/server/0145-Toggle-for-Zombified-Piglin-death-always-counting-as.patch rename to patches/server/0146-Toggle-for-Zombified-Piglin-death-always-counting-as.patch diff --git a/patches/server/0146-Spread-out-and-optimise-player-list-ticks.patch b/patches/server/0147-Spread-out-and-optimise-player-list-ticks.patch similarity index 100% rename from patches/server/0146-Spread-out-and-optimise-player-list-ticks.patch rename to patches/server/0147-Spread-out-and-optimise-player-list-ticks.patch diff --git a/patches/server/0147-Configurable-chance-for-wolves-to-spawn-rabid.patch b/patches/server/0148-Configurable-chance-for-wolves-to-spawn-rabid.patch similarity index 98% rename from patches/server/0147-Configurable-chance-for-wolves-to-spawn-rabid.patch rename to patches/server/0148-Configurable-chance-for-wolves-to-spawn-rabid.patch index 9097da803..9ca848339 100644 --- a/patches/server/0147-Configurable-chance-for-wolves-to-spawn-rabid.patch +++ b/patches/server/0148-Configurable-chance-for-wolves-to-spawn-rabid.patch @@ -7,10 +7,10 @@ Configurable chance to spawn a wolf that is rabid. Rabid wolves attack all players, mobs, and animals. diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index af2b6bb559d78dd912eee02281f5446f31e55eae..79fde7b4763642dc4941899ab186db9dfab3b574 100644 +index a84150b22adb090309192c21459967a571e86b0a..96e9be81429aa7bf215d2c2cdf865606e3a2707c 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -2102,6 +2102,7 @@ public abstract class EntityLiving extends Entity { +@@ -2104,6 +2104,7 @@ public abstract class EntityLiving extends Entity { } } diff --git a/patches/server/0148-Configurable-default-wolf-collar-color.patch b/patches/server/0149-Configurable-default-wolf-collar-color.patch similarity index 100% rename from patches/server/0148-Configurable-default-wolf-collar-color.patch rename to patches/server/0149-Configurable-default-wolf-collar-color.patch diff --git a/patches/server/0149-Configurable-entity-base-attributes.patch b/patches/server/0150-Configurable-entity-base-attributes.patch similarity index 99% rename from patches/server/0149-Configurable-entity-base-attributes.patch rename to patches/server/0150-Configurable-entity-base-attributes.patch index 141fc3e33..79b76303a 100644 --- a/patches/server/0149-Configurable-entity-base-attributes.patch +++ b/patches/server/0150-Configurable-entity-base-attributes.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Configurable entity base attributes diff --git a/src/main/java/net/minecraft/server/EntityBat.java b/src/main/java/net/minecraft/server/EntityBat.java -index 7677f4a2ec8bacadcbc6e68e13f56256f1963552..5ba96d6073d2f30c22c1fa28fdea30857b6f2d59 100644 +index 7a18c59689b84fa277709ad11c39a72d77df4afb..da4ce323b9a2e0de0d1ed242f102a1601c6891d2 100644 --- a/src/main/java/net/minecraft/server/EntityBat.java +++ b/src/main/java/net/minecraft/server/EntityBat.java @@ -55,6 +55,18 @@ public class EntityBat extends EntityAmbient { @@ -204,7 +204,7 @@ index 497d05996ab84f599aa0a02f853149f074e4d3cb..29c8e1b67396df160cdb7ecf4e1a563f public static AttributeProvider.Builder m() { diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java -index acb2b3ed04ea0bf19335415310ce22cd076dd92a..dfe6175ec8107f684ea1567d932d11de06c46372 100644 +index 0a9bd0dbd2f90aa968db0f8a14cde7e58d18652e..c03232ac1e2b450b64430f8d56bfebd30fa37155 100644 --- a/src/main/java/net/minecraft/server/EntityEnderman.java +++ b/src/main/java/net/minecraft/server/EntityEnderman.java @@ -40,6 +40,11 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { @@ -316,7 +316,7 @@ index f6f882746940c9e049106aa9b41591ba27a608ce..7afba8136f9a809e779d9af8c93cda7c public static AttributeProvider.Builder m() { diff --git a/src/main/java/net/minecraft/server/EntityHoglin.java b/src/main/java/net/minecraft/server/EntityHoglin.java -index a1578aade4a535144b5e40277c902f2e9ab9e940..4a3469aca9f9e47d2ea3f3bae6ce77f5f11d6b50 100644 +index 96cad9471d316e26b5daa9d217e172efcc77e0cc..f669fe47801cf21624ba4be3ad86ebc7ab66cf98 100644 --- a/src/main/java/net/minecraft/server/EntityHoglin.java +++ b/src/main/java/net/minecraft/server/EntityHoglin.java @@ -35,6 +35,11 @@ public class EntityHoglin extends EntityAnimal implements IMonster, IOglin { @@ -758,7 +758,7 @@ index 57f3358b8dfd53f5b1d2e976d64b809f74bc3ce3..4c050c841f9846cc74fef51d5eb69f4c @Override diff --git a/src/main/java/net/minecraft/server/EntityPiglin.java b/src/main/java/net/minecraft/server/EntityPiglin.java -index 334e0f73e67ef2db7e680874faf0646995d9de8a..4849829df1041568a9fcac6d16501fc0606d95da 100644 +index 29ecfd09f0bed3dc64b14b90875a111253599958..20b6a4faae21e6969eb8bb4377c6cbe0b1f80fa0 100644 --- a/src/main/java/net/minecraft/server/EntityPiglin.java +++ b/src/main/java/net/minecraft/server/EntityPiglin.java @@ -35,6 +35,11 @@ public class EntityPiglin extends EntityPiglinAbstract implements ICrossbow { @@ -1149,7 +1149,7 @@ index 9336fbbd46c7c6ac11adf8e4cc2735f81c9ed639..3fcbfc7cdf78f71d23b2e2b2990c21db @Override diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index 9b925bf9b7946eecb16f94d49a9823139c5fd641..850dae5f20649854f013c0e530a3325455b5db4a 100644 +index d2112fb2424f19b2fb65ce635aa0fe24807a311e..4f5ad3836d39ccb88923a38f2fd556cb88ec241a 100644 --- a/src/main/java/net/minecraft/server/EntityVillager.java +++ b/src/main/java/net/minecraft/server/EntityVillager.java @@ -93,6 +93,11 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation diff --git a/patches/server/0150-Phantom-flames-on-swoop.patch b/patches/server/0151-Phantom-flames-on-swoop.patch similarity index 100% rename from patches/server/0150-Phantom-flames-on-swoop.patch rename to patches/server/0151-Phantom-flames-on-swoop.patch diff --git a/patches/server/0151-Option-for-chests-to-open-even-with-a-solid-block-on.patch b/patches/server/0152-Option-for-chests-to-open-even-with-a-solid-block-on.patch similarity index 100% rename from patches/server/0151-Option-for-chests-to-open-even-with-a-solid-block-on.patch rename to patches/server/0152-Option-for-chests-to-open-even-with-a-solid-block-on.patch diff --git a/patches/server/0152-Implement-TPSBar.patch b/patches/server/0153-Implement-TPSBar.patch similarity index 98% rename from patches/server/0152-Implement-TPSBar.patch rename to patches/server/0153-Implement-TPSBar.patch index 9465da1c7..0397e606f 100644 --- a/patches/server/0152-Implement-TPSBar.patch +++ b/patches/server/0153-Implement-TPSBar.patch @@ -17,7 +17,7 @@ index b5cc099746e9f05ea69bc438bda22a5ac3ebc3c5..bbd17231a4f7ad0ddde6eb5e589a6c40 if (commanddispatcher_servertype.d) { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 85c14df768ec844b710bf2b32eb7f85c9e6b47ea..17591457a33e6994cd26bb1487a7879a11411a9c 100644 +index de69589a8e88d9330365decccc9e3bceb337b354..f328fb6d9d7d3c4362c06a4aa06d379263ca087d 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -472,6 +472,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant. diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 1ec8dcfcbacf373682cb46fee354e3cfd6d3f1b5..85ffb2e72dbf08604c004732f17aee9ec7e1ff9d 100644 +index 6fa2e0b2ee62212ab315a16803457efc8001d6d0..4b7ab2405a7d49ae085d64e482d4a851f18263d6 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1373,7 +1373,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1376,7 +1376,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return this.isInWater() || flag; } diff --git a/patches/server/0164-Fix-stuck-in-portals.patch b/patches/server/0165-Fix-stuck-in-portals.patch similarity index 91% rename from patches/server/0164-Fix-stuck-in-portals.patch rename to patches/server/0165-Fix-stuck-in-portals.patch index 77de719af..cc5ddb909 100644 --- a/patches/server/0164-Fix-stuck-in-portals.patch +++ b/patches/server/0165-Fix-stuck-in-portals.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix stuck in portals diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 85ffb2e72dbf08604c004732f17aee9ec7e1ff9d..49a1447bae91294a23ccab27c2809bea0c4c90a3 100644 +index 4b7ab2405a7d49ae085d64e482d4a851f18263d6..c27ce317c7acaf7ddd926c982d08e0539e045e28 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2424,12 +2424,15 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2427,12 +2427,15 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return new Vec2F(this.pitch, this.yaw); } @@ -25,7 +25,7 @@ index 85ffb2e72dbf08604c004732f17aee9ec7e1ff9d..49a1447bae91294a23ccab27c2809bea this.inPortal = true; diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index dae7411e408df0a351c753d6eb3e2319f6499368..c71485943b938cf1de9f1ae05ea5cafd51a58aa2 100644 +index 3f00d66685479f3bec8cccb7a0b0988584122436..5c01d6609403c7aa8fe6e31faae485910db74a03 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -1161,6 +1161,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { diff --git a/patches/server/0165-Fix-PlayerEditBookEvent-not-saving-new-book.patch b/patches/server/0166-Fix-PlayerEditBookEvent-not-saving-new-book.patch similarity index 100% rename from patches/server/0165-Fix-PlayerEditBookEvent-not-saving-new-book.patch rename to patches/server/0166-Fix-PlayerEditBookEvent-not-saving-new-book.patch diff --git a/patches/server/0166-Config-to-use-infinity-bows-without-arrows.patch b/patches/server/0167-Config-to-use-infinity-bows-without-arrows.patch similarity index 100% rename from patches/server/0166-Config-to-use-infinity-bows-without-arrows.patch rename to patches/server/0167-Config-to-use-infinity-bows-without-arrows.patch diff --git a/patches/server/0167-Toggle-for-water-sensitive-mob-damage.patch b/patches/server/0168-Toggle-for-water-sensitive-mob-damage.patch similarity index 95% rename from patches/server/0167-Toggle-for-water-sensitive-mob-damage.patch rename to patches/server/0168-Toggle-for-water-sensitive-mob-damage.patch index 63a14ec03..a1cb16daa 100644 --- a/patches/server/0167-Toggle-for-water-sensitive-mob-damage.patch +++ b/patches/server/0168-Toggle-for-water-sensitive-mob-damage.patch @@ -18,7 +18,7 @@ index 90b90fa33b39020189a1d4a5826fa3ab720488cd..b4db9869d172406f4eff84cfb2648b5c @Override diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java -index beee80c3d8277f2d784fb6b8a4152a871ee020b0..b884addf2ce6f1ef7394658078deb2e75370654f 100644 +index 4d575d29cd446cd65cea7cdeb2541e0c3112d660..e20b91b36587d1191f8f9e8dd501607bf085e76d 100644 --- a/src/main/java/net/minecraft/server/EntityEnderman.java +++ b/src/main/java/net/minecraft/server/EntityEnderman.java @@ -234,7 +234,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { @@ -31,7 +31,7 @@ index beee80c3d8277f2d784fb6b8a4152a871ee020b0..b884addf2ce6f1ef7394658078deb2e7 @Override diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index 70982f55becd9417e0d3d3b827edc63eac232ecf..9040a445433307e4611e815370f481981a7a390c 100644 +index 679b6a4b408f01ae578803dac8bf562fbfdd2600..cbebc150700ec5074244c28388e7d32714510b05 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java @@ -786,7 +786,8 @@ public abstract class EntityInsentient extends EntityLiving { @@ -45,10 +45,10 @@ index 70982f55becd9417e0d3d3b827edc63eac232ecf..9040a445433307e4611e815370f48198 } return; diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 38f94d4983b69e265441a2b8365702df57a881f5..50fa5f8395fea3ba6fa202a5a38519cd55ae00e0 100644 +index 8b8e6b8cfbdc591eb8681bc672975ae6198ef263..c514ba819e5fc69e67bd370469465a926672c2da 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -2876,6 +2876,7 @@ public abstract class EntityLiving extends Entity { +@@ -2878,6 +2878,7 @@ public abstract class EntityLiving extends Entity { } diff --git a/patches/server/0168-Config-to-always-tame-in-Creative.patch b/patches/server/0169-Config-to-always-tame-in-Creative.patch similarity index 100% rename from patches/server/0168-Config-to-always-tame-in-Creative.patch rename to patches/server/0169-Config-to-always-tame-in-Creative.patch diff --git a/patches/server/0169-End-crystal-explosion-options.patch b/patches/server/0170-End-crystal-explosion-options.patch similarity index 100% rename from patches/server/0169-End-crystal-explosion-options.patch rename to patches/server/0170-End-crystal-explosion-options.patch diff --git a/patches/server/0170-Add-unsafe-Entity-serialization-API.patch b/patches/server/0171-Add-unsafe-Entity-serialization-API.patch similarity index 97% rename from patches/server/0170-Add-unsafe-Entity-serialization-API.patch rename to patches/server/0171-Add-unsafe-Entity-serialization-API.patch index b35c3fc7c..5aea2a02e 100644 --- a/patches/server/0170-Add-unsafe-Entity-serialization-API.patch +++ b/patches/server/0171-Add-unsafe-Entity-serialization-API.patch @@ -17,10 +17,10 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java -index 73cf30786d2b4d6f87be5f9aad87c3edb594d18e..f5fb3b3c08a05bede7ed1141c018bd0d16a19244 100644 +index 4de08939f8a5de464e510e47228291fc513b8104..b38e7c40fe9cb56cb37769ce3a8c7969e2ee5372 100644 --- a/src/main/java/net/minecraft/server/EntityTypes.java +++ b/src/main/java/net/minecraft/server/EntityTypes.java -@@ -394,6 +394,7 @@ public class EntityTypes { +@@ -396,6 +396,7 @@ public class EntityTypes { return this.bf.create(this, world); } diff --git a/patches/server/0171-Add-ghast-allow-griefing-option.patch b/patches/server/0172-Add-ghast-allow-griefing-option.patch similarity index 100% rename from patches/server/0171-Add-ghast-allow-griefing-option.patch rename to patches/server/0172-Add-ghast-allow-griefing-option.patch diff --git a/patches/server/0172-Configs-for-if-Wither-Ender-Dragon-can-ride-vehicles.patch b/patches/server/0173-Configs-for-if-Wither-Ender-Dragon-can-ride-vehicles.patch similarity index 96% rename from patches/server/0172-Configs-for-if-Wither-Ender-Dragon-can-ride-vehicles.patch rename to patches/server/0173-Configs-for-if-Wither-Ender-Dragon-can-ride-vehicles.patch index 40b6f9d19..733a9d7bc 100644 --- a/patches/server/0172-Configs-for-if-Wither-Ender-Dragon-can-ride-vehicles.patch +++ b/patches/server/0173-Configs-for-if-Wither-Ender-Dragon-can-ride-vehicles.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Configs for if Wither/Ender Dragon can ride vehicles diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 49a1447bae91294a23ccab27c2809bea0c4c90a3..94af972e115491d0f4394dd290ec2d9d426b8d32 100644 +index c27ce317c7acaf7ddd926c982d08e0539e045e28..426bebc5cd67ffcc72ee56d437cc13f6846e109c 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2274,7 +2274,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2277,7 +2277,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } } diff --git a/patches/server/0173-Dont-run-with-scissors.patch b/patches/server/0174-Dont-run-with-scissors.patch similarity index 100% rename from patches/server/0173-Dont-run-with-scissors.patch rename to patches/server/0174-Dont-run-with-scissors.patch diff --git a/patches/server/0174-One-Punch-Man.patch b/patches/server/0175-One-Punch-Man.patch similarity index 95% rename from patches/server/0174-One-Punch-Man.patch rename to patches/server/0175-One-Punch-Man.patch index 99180ad04..532660777 100644 --- a/patches/server/0174-One-Punch-Man.patch +++ b/patches/server/0175-One-Punch-Man.patch @@ -5,10 +5,10 @@ Subject: [PATCH] One Punch Man! diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 50fa5f8395fea3ba6fa202a5a38519cd55ae00e0..90d41b9e286064f11ce55badfb76574778d933a6 100644 +index c514ba819e5fc69e67bd370469465a926672c2da..c5762aebcdd383ab710d4891308a7b1e815c44fd 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -1921,6 +1921,23 @@ public abstract class EntityLiving extends Entity { +@@ -1923,6 +1923,23 @@ public abstract class EntityLiving extends Entity { ((EntityPlayer) damagesource.getEntity()).a(StatisticList.DAMAGE_DEALT_ABSORBED, Math.round(f2 * 10.0F)); } diff --git a/patches/server/0175-Add-config-for-snow-on-blue-ice.patch b/patches/server/0176-Add-config-for-snow-on-blue-ice.patch similarity index 100% rename from patches/server/0175-Add-config-for-snow-on-blue-ice.patch rename to patches/server/0176-Add-config-for-snow-on-blue-ice.patch diff --git a/patches/server/0176-Configurable-Ender-Pearl-cooldown-damage-and-Endermi.patch b/patches/server/0177-Configurable-Ender-Pearl-cooldown-damage-and-Endermi.patch similarity index 100% rename from patches/server/0176-Configurable-Ender-Pearl-cooldown-damage-and-Endermi.patch rename to patches/server/0177-Configurable-Ender-Pearl-cooldown-damage-and-Endermi.patch diff --git a/patches/server/0177-Config-to-ignore-nearby-mobs-when-sleeping.patch b/patches/server/0178-Config-to-ignore-nearby-mobs-when-sleeping.patch similarity index 96% rename from patches/server/0177-Config-to-ignore-nearby-mobs-when-sleeping.patch rename to patches/server/0178-Config-to-ignore-nearby-mobs-when-sleeping.patch index ee7858f8d..23a129d81 100644 --- a/patches/server/0177-Config-to-ignore-nearby-mobs-when-sleeping.patch +++ b/patches/server/0178-Config-to-ignore-nearby-mobs-when-sleeping.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Config to ignore nearby mobs when sleeping diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index c71485943b938cf1de9f1ae05ea5cafd51a58aa2..6283890eedb5d7efa838777fb3ba3722454571d8 100644 +index 5c01d6609403c7aa8fe6e31faae485910db74a03..453f1b9eb3e8a878f0645d1daa956de7810cbbac 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -1311,7 +1311,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { diff --git a/patches/server/0178-Config-for-Enderman-to-aggro-spawned-Endermites.patch b/patches/server/0179-Config-for-Enderman-to-aggro-spawned-Endermites.patch similarity index 96% rename from patches/server/0178-Config-for-Enderman-to-aggro-spawned-Endermites.patch rename to patches/server/0179-Config-for-Enderman-to-aggro-spawned-Endermites.patch index 2e902a6ed..118ba54cc 100644 --- a/patches/server/0178-Config-for-Enderman-to-aggro-spawned-Endermites.patch +++ b/patches/server/0179-Config-for-Enderman-to-aggro-spawned-Endermites.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Config for Enderman to aggro spawned Endermites By default, Enderman do not attack Endermites unless spawned by an Ender Pearl. diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java -index b884addf2ce6f1ef7394658078deb2e75370654f..6c60253fee2098889292837033396f0dcd75c4b7 100644 +index e20b91b36587d1191f8f9e8dd501607bf085e76d..c9fd8c8e7e36cbab2dcf4b0f5e6d84ede5851a12 100644 --- a/src/main/java/net/minecraft/server/EntityEnderman.java +++ b/src/main/java/net/minecraft/server/EntityEnderman.java @@ -16,7 +16,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { diff --git a/patches/server/0179-Config-to-ignore-Dragon-Head-wearers-and-stare-aggro.patch b/patches/server/0180-Config-to-ignore-Dragon-Head-wearers-and-stare-aggro.patch similarity index 96% rename from patches/server/0179-Config-to-ignore-Dragon-Head-wearers-and-stare-aggro.patch rename to patches/server/0180-Config-to-ignore-Dragon-Head-wearers-and-stare-aggro.patch index b7188141b..001c188a3 100644 --- a/patches/server/0179-Config-to-ignore-Dragon-Head-wearers-and-stare-aggro.patch +++ b/patches/server/0180-Config-to-ignore-Dragon-Head-wearers-and-stare-aggro.patch @@ -7,7 +7,7 @@ Prevents Enderman from becoming aggresive towards players that are wearing a Dra Adds functionality to a useless item! diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java -index 6c60253fee2098889292837033396f0dcd75c4b7..df4d5ed5957658ee9ca083ac79b38a1202fe7015 100644 +index c9fd8c8e7e36cbab2dcf4b0f5e6d84ede5851a12..e7568e3df10bc07e9b3b05caa9d41398925cf4d7 100644 --- a/src/main/java/net/minecraft/server/EntityEnderman.java +++ b/src/main/java/net/minecraft/server/EntityEnderman.java @@ -197,7 +197,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable {